├── .gitignore
├── .project
├── EnrichmentMapIntegrationTest
├── .classpath
├── .gitignore
├── .project
├── .settings
│ ├── org.eclipse.jdt.core.prefs
│ └── org.eclipse.m2e.core.prefs
├── pom.xml
└── src
│ └── test
│ ├── java
│ ├── README.md
│ └── org
│ │ └── baderlab
│ │ └── csplugins
│ │ └── enrichmentmap
│ │ └── integration
│ │ ├── BaseIntegrationTest.java
│ │ ├── EdgeSimilarities.java
│ │ ├── NullTaskMonitor.java
│ │ ├── PaxExamConfiguration.java
│ │ ├── SerialTestTaskManager.java
│ │ ├── SessionFile.java
│ │ ├── SimilarityKey.java
│ │ ├── TestUtils.java
│ │ └── task
│ │ ├── CreateEnrichmentMapTaskTest.java
│ │ ├── LegacySessionLoadTest.java
│ │ └── Protocol1Test.java
│ └── resources
│ ├── EnrichmentMapTaskTest
│ ├── FakeExpression.txt
│ ├── FakeRank.rnk
│ ├── PA_top8_middle8_bottom8.gmt
│ ├── fakeEnrichments.txt
│ └── gene_sets.gmt
│ ├── LegacySessionLoadTest
│ ├── em_session_2.2.cys
│ ├── em_session_2.2_twodataset.cys
│ └── em_session_2.2_twodataset_pa.cys
│ └── Protocol1Test
│ ├── gprofiler_results_mesenonly_ordered_computedinR.txt
│ └── protocol_1_expected.xgmml
├── EnrichmentMapPlugin
├── .classpath
├── .gitignore
├── .project
├── build.xml
├── default.properties
├── doc
│ ├── Doc on Cytoscape-Props relevant for EnrichmentMap.txt
│ ├── EM_wiki_manual.txt
│ ├── LGPL_2.1_Disclaimer_for_src_headers.txt
│ ├── LGPL_2.1_LICENSE.txt
│ └── README.TXT
├── pom.xml
├── resources
│ ├── EM_EBC_TestData
│ │ ├── EnrTable_12h_E2_v2.xls
│ │ ├── EnrTable_12h_NT_v2.xls
│ │ ├── EnrTable_24h_E2_v2.xls
│ │ ├── EnrTable_24h_NT_v2.xls
│ │ ├── GO_Hs_EG_f_hgu133p2_v2.gmt
│ │ └── MCF7_ExprMx_v2.txt
│ ├── Graphics_for_Manual
│ │ ├── Hypergeometric_test.png
│ │ ├── PostAnalysis_InputPanel_SignatureHubs_screenshot.ai
│ │ ├── PostAnalysis_InputPanel_SignatureHubs_screenshot.png
│ │ ├── PostAnalysis_InputPanel_SignatureHubs_screenshot_withLabels.png
│ │ └── PostAnalysis_InputPanel_SignatureHubs_screenshot_withLabels_smaller.png
│ └── scripts
│ │ ├── collapse_ExpressionMatrix.py
│ │ ├── disease_hub.py
│ │ └── disease_hub_2.py
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── baderlab
│ │ │ └── csplugins
│ │ │ └── enrichmentmap
│ │ │ ├── AfterInjection.java
│ │ │ ├── AfterInjectionModule.java
│ │ │ ├── ApplicationModule.java
│ │ │ ├── CommandModule.java
│ │ │ ├── CommandTaskFactory.java
│ │ │ ├── CyActivator.java
│ │ │ ├── CytoscapeServiceModule.java
│ │ │ ├── EMBuildProps.java
│ │ │ ├── Em21Handler.java
│ │ │ ├── PropertyManager.java
│ │ │ ├── PropsReader.java
│ │ │ ├── actions
│ │ │ ├── OpenEnrichmentMapAction.java
│ │ │ ├── OpenEnrichmentMapPanelsAction.java
│ │ │ ├── OpenPathwayCommonsTask.java
│ │ │ ├── OpenPathwayCommonsTaskFactory.java
│ │ │ └── ShowAboutDialogAction.java
│ │ │ ├── commands
│ │ │ ├── AssociateNetworkCommandTask.java
│ │ │ ├── ChartCommandTask.java
│ │ │ ├── DatasetColorCommandTask.java
│ │ │ ├── DatasetShowCommandTask.java
│ │ │ ├── EMBuildCommandTask.java
│ │ │ ├── EMGseaCommandTask.java
│ │ │ ├── ExportModelJsonCommandTask.java
│ │ │ ├── ExportNetworkImageCommandTask.java
│ │ │ ├── ExportPDFCommandTask.java
│ │ │ ├── GetColorsCommandTask.java
│ │ │ ├── GetDataSetNamesCommandTask.java
│ │ │ ├── MastermapCommandTask.java
│ │ │ ├── MastermapListCommandTask.java
│ │ │ ├── PAKnownSignatureCommandTask.java
│ │ │ ├── SignificanceListTask.java
│ │ │ ├── TableCommandTask.java
│ │ │ └── tunables
│ │ │ │ ├── ChartTunables.java
│ │ │ │ ├── DatasetColorTunable.java
│ │ │ │ ├── DatasetListTunable.java
│ │ │ │ ├── FilterTunables.java
│ │ │ │ ├── FilterTunablesLegacy.java
│ │ │ │ ├── MannWhitRanks.java
│ │ │ │ ├── MannWhitRanksTunableHandler.java
│ │ │ │ ├── MannWhitRanksTunableHandlerFactory.java
│ │ │ │ ├── NetworkTunable.java
│ │ │ │ ├── NodeListTunable.java
│ │ │ │ └── TableTunables.java
│ │ │ ├── model
│ │ │ ├── AbstractDataSet.java
│ │ │ ├── AssociatedApp.java
│ │ │ ├── AssociatedAppColumns.java
│ │ │ ├── Compress.java
│ │ │ ├── CompressedClass.java
│ │ │ ├── CompressedDataSet.java
│ │ │ ├── DataSetFiles.java
│ │ │ ├── DataSetParameters.java
│ │ │ ├── EMCreationParameters.java
│ │ │ ├── EMDataSet.java
│ │ │ ├── EMSignatureDataSet.java
│ │ │ ├── EnrichmentMap.java
│ │ │ ├── EnrichmentMapManager.java
│ │ │ ├── EnrichmentMapParameters.java
│ │ │ ├── EnrichmentResult.java
│ │ │ ├── EnrichmentResultFilterParams.java
│ │ │ ├── ExpressionCache.java
│ │ │ ├── ExpressionData.java
│ │ │ ├── GSEAResult.java
│ │ │ ├── GeneExpression.java
│ │ │ ├── GeneExpressionMatrix.java
│ │ │ ├── GeneSet.java
│ │ │ ├── GenemaniaParameters.java
│ │ │ ├── GenericResult.java
│ │ │ ├── GenesetSimilarity.java
│ │ │ ├── LegacySupport.java
│ │ │ ├── PhenotypeHighlight.java
│ │ │ ├── PostAnalysisFilterType.java
│ │ │ ├── PostAnalysisParameters.java
│ │ │ ├── Rank.java
│ │ │ ├── Ranking.java
│ │ │ ├── SetOfEnrichmentResults.java
│ │ │ ├── SetOfGeneSets.java
│ │ │ ├── SignatureGenesetSimilarity.java
│ │ │ ├── SimilarityKey.java
│ │ │ ├── TableExpressionParameters.java
│ │ │ ├── TableParameters.java
│ │ │ ├── Transform.java
│ │ │ ├── Uncompressed.java
│ │ │ ├── UniverseType.java
│ │ │ ├── event
│ │ │ │ ├── AssociatedEnrichmentMapsChangedEvent.java
│ │ │ │ ├── AssociatedEnrichmentMapsChangedListener.java
│ │ │ │ ├── EnrichmentMapAboutToBeRemovedEvent.java
│ │ │ │ ├── EnrichmentMapAboutToBeRemovedListener.java
│ │ │ │ ├── EnrichmentMapAddedEvent.java
│ │ │ │ └── EnrichmentMapAddedListener.java
│ │ │ └── io
│ │ │ │ ├── LegacySessionLoader.java
│ │ │ │ ├── ModelSerializer.java
│ │ │ │ ├── SessionListener.java
│ │ │ │ └── SessionModelIO.java
│ │ │ ├── parsers
│ │ │ ├── ClassFileReaderTask.java
│ │ │ ├── ExpressionFileReaderTask.java
│ │ │ ├── GMTFileReaderTask.java
│ │ │ ├── GREATWhichPvalueQuestionTask.java
│ │ │ ├── LineReader.java
│ │ │ ├── LoadEnrichmentsFromGenemaniaTask.java
│ │ │ ├── LoadEnrichmentsFromTableTask.java
│ │ │ ├── LoadExpressionsFromTableTask.java
│ │ │ ├── ParseBingoEnrichmentResults.java
│ │ │ ├── ParseDavidEnrichmentResults.java
│ │ │ ├── ParseEDBEnrichmentResults.java
│ │ │ ├── ParseEnrichrEnrichmentResults.java
│ │ │ ├── ParseGREATEnrichmentResults.java
│ │ │ ├── ParseGSEAEnrichmentException.java
│ │ │ ├── ParseGSEAEnrichmentResults.java
│ │ │ ├── ParseGenericEnrichmentResults.java
│ │ │ ├── ParseGenericEnrichmentsForDummy.java
│ │ │ ├── RanksFileReaderTask.java
│ │ │ ├── RanksGeneMismatchException.java
│ │ │ └── RanksUnsortedException.java
│ │ │ ├── resolver
│ │ │ ├── CancelStatus.java
│ │ │ ├── DataSetResolver.java
│ │ │ ├── DataSetResolverTask.java
│ │ │ └── GSEAResolver.java
│ │ │ ├── rest
│ │ │ ├── ExpressionsResource.java
│ │ │ ├── ModelResource.java
│ │ │ ├── ResourceUtil.java
│ │ │ ├── UploadFileResource.java
│ │ │ └── response
│ │ │ │ ├── DataSetClassResponse.java
│ │ │ │ ├── DataSetExpressionResponse.java
│ │ │ │ ├── ExpressionDataResponse.java
│ │ │ │ └── GeneExpressionResponse.java
│ │ │ ├── style
│ │ │ ├── AbstractColumnDescriptor.java
│ │ │ ├── AssociatedStyleBuilder.java
│ │ │ ├── AssociatedStyleOptions.java
│ │ │ ├── ChartData.java
│ │ │ ├── ChartFactoryManager.java
│ │ │ ├── ChartOptions.java
│ │ │ ├── ChartType.java
│ │ │ ├── ColorScheme.java
│ │ │ ├── ColumnDescriptor.java
│ │ │ ├── ColumnListDescriptor.java
│ │ │ ├── EMStyleBuilder.java
│ │ │ ├── EMStyleOptions.java
│ │ │ ├── NullCustomGraphics.java
│ │ │ ├── WidthFunction.java
│ │ │ └── charts
│ │ │ │ ├── AbstractChart.java
│ │ │ │ ├── AbstractChartLayer.java
│ │ │ │ ├── CustomPieSectionLabelGenerator.java
│ │ │ │ ├── LabelPosition.java
│ │ │ │ ├── Orientation.java
│ │ │ │ ├── Rotation.java
│ │ │ │ ├── TexturePaintFactory.java
│ │ │ │ ├── json
│ │ │ │ ├── ColorJsonDeserializer.java
│ │ │ │ ├── ColorJsonSerializer.java
│ │ │ │ ├── CyColumnIdentifierJsonDeserializer.java
│ │ │ │ ├── CyColumnIdentifierJsonSerializer.java
│ │ │ │ ├── Point2DJsonDeserializer.java
│ │ │ │ ├── Point2DJsonSerializer.java
│ │ │ │ ├── PropertiesJsonDeserializer.java
│ │ │ │ ├── PropertiesJsonSerializer.java
│ │ │ │ ├── Rectangle2DJsonDeserializer.java
│ │ │ │ └── Rectangle2DJsonSerializer.java
│ │ │ │ └── radialheatmap
│ │ │ │ ├── RadialHeatMapChart.java
│ │ │ │ ├── RadialHeatMapChartFactory.java
│ │ │ │ └── RadialHeatMapLayer.java
│ │ │ ├── task
│ │ │ ├── ApplyEMStyleTask.java
│ │ │ ├── AutoAnnotateInitTask.java
│ │ │ ├── AutoAnnotateOpenTask.java
│ │ │ ├── AutoAnnotateRedrawTask.java
│ │ │ ├── CancellableParallelTask.java
│ │ │ ├── ComputeSimilarityTaskParallel.java
│ │ │ ├── CreateDummyExpressionTask.java
│ │ │ ├── CreateEMNetworkTask.java
│ │ │ ├── CreateEMViewTask.java
│ │ │ ├── CreateEnrichmentMapTaskFactory.java
│ │ │ ├── CreateGMTEnrichmentMapTask.java
│ │ │ ├── FilterGenesetsByDatasetGenes.java
│ │ │ ├── FilterNodesEdgesTask.java
│ │ │ ├── InitializeGenesetsOfInterestTask.java
│ │ │ ├── MissingGenesetsException.java
│ │ │ ├── ModelCleanupTask.java
│ │ │ ├── SelectNodesEdgesTask.java
│ │ │ ├── TaskErrorStrategies.java
│ │ │ ├── TitleTask.java
│ │ │ ├── UpdateAssociatedStyleTask.java
│ │ │ ├── cluster
│ │ │ │ ├── CosineDistance.java
│ │ │ │ ├── EuclideanDistance.java
│ │ │ │ ├── HierarchicalClusterTask.java
│ │ │ │ └── PearsonCorrelation.java
│ │ │ ├── genemania
│ │ │ │ ├── GMGene.java
│ │ │ │ ├── GMOrganism.java
│ │ │ │ ├── GMOrganismsResult.java
│ │ │ │ ├── GMSearchResult.java
│ │ │ │ ├── GMWeightingMethod.java
│ │ │ │ ├── GeneManiaTaskFactory.java
│ │ │ │ ├── QueryGeneManiaNodeViewTaskFactory.java
│ │ │ │ └── QueryGeneManiaTask.java
│ │ │ ├── postanalysis
│ │ │ │ ├── CreatePANetworkTask.java
│ │ │ │ ├── CreatePANetworkTaskResult.java
│ │ │ │ ├── FilterMetric.java
│ │ │ │ ├── FilterMetricSet.java
│ │ │ │ ├── Hypergeometric.java
│ │ │ │ ├── PAMostSimilarTaskParallel.java
│ │ │ │ ├── PASimilarityTaskParallel.java
│ │ │ │ ├── PATaskFactory.java
│ │ │ │ └── RemoveSignatureDataSetsTask.java
│ │ │ ├── string
│ │ │ │ ├── QueryStringNodeViewTaskFactory.java
│ │ │ │ ├── QueryStringTask.java
│ │ │ │ ├── STRSpecies.java
│ │ │ │ └── StringAppTaskFactory.java
│ │ │ └── tunables
│ │ │ │ ├── GeneListGUITunableHandler.java
│ │ │ │ ├── GeneListPanel.java
│ │ │ │ └── GeneListTunable.java
│ │ │ ├── util
│ │ │ ├── Baton.java
│ │ │ ├── CoalesceTimer.java
│ │ │ ├── DelegatingTaskMonitor.java
│ │ │ ├── DiscreteTaskMonitor.java
│ │ │ ├── LinearNumberInterpolator.java
│ │ │ ├── MathUtil.java
│ │ │ ├── NamingUtil.java
│ │ │ ├── NetworkUtil.java
│ │ │ ├── NullTaskMonitor.java
│ │ │ ├── PathUtil.java
│ │ │ ├── SimpleSyncTaskManager.java
│ │ │ └── TaskUtil.java
│ │ │ └── view
│ │ │ ├── AboutDialog.java
│ │ │ ├── EMColumnPresentation.java
│ │ │ ├── EnablementComboBoxRenderer.java
│ │ │ ├── control
│ │ │ ├── ControlPanel.java
│ │ │ ├── ControlPanelMediator.java
│ │ │ ├── DataSetColorSelectorDialog.java
│ │ │ ├── DataSetSelector.java
│ │ │ ├── FilterUtil.java
│ │ │ ├── SortedListModel.java
│ │ │ └── io
│ │ │ │ ├── SessionViewIO.java
│ │ │ │ ├── ViewParams.java
│ │ │ │ └── ViewSerializer.java
│ │ │ ├── creation
│ │ │ ├── CombinedConstantSlider.java
│ │ │ ├── CommandDisplayMediator.java
│ │ │ ├── CreationDialogParameters.java
│ │ │ ├── CreationDialogShowAction.java
│ │ │ ├── CutoffPropertiesPanel.java
│ │ │ ├── DependencyChecker.java
│ │ │ ├── DetailCommonPanel.java
│ │ │ ├── DetailDataSetPanel.java
│ │ │ ├── DetailGettingStartedPanel.java
│ │ │ ├── DetailPanel.java
│ │ │ ├── EMDialogTaskRunner.java
│ │ │ ├── MasterDetailDialogPage.java
│ │ │ ├── NameAndLayoutPanel.java
│ │ │ ├── NamePanel.java
│ │ │ ├── PathTextField.java
│ │ │ ├── ResolverTaskTransferHandler.java
│ │ │ ├── SimilaritySlider.java
│ │ │ └── genemania
│ │ │ │ ├── GenemaniaAnnotation.java
│ │ │ │ ├── GenemaniaDialogPage.java
│ │ │ │ ├── GenemaniaDialogParameters.java
│ │ │ │ ├── GenemaniaDialogShowAction.java
│ │ │ │ ├── NetworkLoadDialogPage.java
│ │ │ │ ├── StringDialogPage.java
│ │ │ │ ├── StringDialogParameters.java
│ │ │ │ └── StringDialogShowAction.java
│ │ │ ├── heatmap
│ │ │ ├── AddRanksDialog.java
│ │ │ ├── BasicRankingOption.java
│ │ │ ├── ClusterRankingOption.java
│ │ │ ├── ExportPDFAction.java
│ │ │ ├── ExportPDFTask.java
│ │ │ ├── ExportTXTAction.java
│ │ │ ├── ExportTXTTask.java
│ │ │ ├── GSEALeadingEdgeRankingOption.java
│ │ │ ├── HeatMapContentPanel.java
│ │ │ ├── HeatMapMediator.java
│ │ │ ├── HeatMapPanel.java
│ │ │ ├── HeatMapParams.java
│ │ │ ├── OptionsPopup.java
│ │ │ ├── RankingOption.java
│ │ │ ├── RankingOptionFactory.java
│ │ │ ├── RankingResult.java
│ │ │ └── table
│ │ │ │ ├── ColumnHeaderRankOptionRenderer.java
│ │ │ │ ├── ColumnHeaderVerticalRenderer.java
│ │ │ │ ├── DataSetColorRange.java
│ │ │ │ ├── GradientLegendPanel.java
│ │ │ │ ├── GradientLegendPopup.java
│ │ │ │ ├── GradientLegendToolTip.java
│ │ │ │ ├── GradientLegendToolbarPanel.java
│ │ │ │ ├── HeatMapCellRenderer.java
│ │ │ │ ├── HeatMapRowSorter.java
│ │ │ │ ├── HeatMapTableModel.java
│ │ │ │ ├── RankOptionErrorHeader.java
│ │ │ │ ├── RankValue.java
│ │ │ │ ├── RankValueRenderer.java
│ │ │ │ └── VerticalTextIcon.java
│ │ │ ├── legend
│ │ │ ├── ColorLegendPanel.java
│ │ │ ├── CreationParametersPanel.java
│ │ │ ├── ExportLegendPDFTask.java
│ │ │ ├── LegendContent.java
│ │ │ ├── LegendPanel.java
│ │ │ └── LegendPanelMediator.java
│ │ │ ├── postanalysis
│ │ │ ├── EdgeWidthDialog.java
│ │ │ ├── PADialogMediator.java
│ │ │ ├── PADialogPage.java
│ │ │ ├── PADialogParameters.java
│ │ │ ├── PAFilterDialog.java
│ │ │ ├── PAWeightPanel.java
│ │ │ ├── SigGeneSetCellRenderer.java
│ │ │ ├── SigGeneSetDescriptor.java
│ │ │ ├── SigGeneSetTableModel.java
│ │ │ └── web
│ │ │ │ ├── BaderlabDialogPage.java
│ │ │ │ ├── BaderlabRequests.java
│ │ │ │ ├── DateDir.java
│ │ │ │ ├── DialogParameters.java
│ │ │ │ ├── DownloadGMTFileTask.java
│ │ │ │ ├── FileChooserPanel.java
│ │ │ │ ├── FileSizeRenderer.java
│ │ │ │ ├── GmtFile.java
│ │ │ │ ├── ListFileChooserPanel.java
│ │ │ │ └── TreeFileChooserPanel.java
│ │ │ └── util
│ │ │ ├── ChartUtil.java
│ │ │ ├── CheckboxData.java
│ │ │ ├── CheckboxList.java
│ │ │ ├── CheckboxListModel.java
│ │ │ ├── ColorKeyword.java
│ │ │ ├── ColorUtil.java
│ │ │ ├── ComboItem.java
│ │ │ ├── FileBrowser.java
│ │ │ ├── GBCFactory.java
│ │ │ ├── HSLColor.java
│ │ │ ├── IconUtil.java
│ │ │ ├── IterableListModel.java
│ │ │ ├── Labels.java
│ │ │ ├── OpenBrowser.java
│ │ │ ├── OpenPDFViewerTask.java
│ │ │ ├── Range.java
│ │ │ ├── SliderBarPanel.java
│ │ │ ├── SwingUtil.java
│ │ │ └── dialog
│ │ │ ├── CardDialog.java
│ │ │ ├── CardDialogCallback.java
│ │ │ ├── CardDialogPage.java
│ │ │ ├── CardDialogParameters.java
│ │ │ ├── CardDialogShowAction.java
│ │ │ ├── ErrorMessageDialog.java
│ │ │ └── Message.java
│ └── resources
│ │ ├── fonts
│ │ └── enrichmentmap.ttf
│ │ ├── images
│ │ ├── enrichmentmap_logo.png
│ │ ├── enrichmentmap_logo.svg
│ │ ├── enrichmentmap_logo_16.png
│ │ ├── folder_button.png
│ │ ├── radialheatmap-chart.png
│ │ ├── spinner_16.gif
│ │ └── spinner_24.gif
│ │ └── org
│ │ └── baderlab
│ │ └── csplugins
│ │ └── enrichmentmap
│ │ ├── app.props
│ │ └── revision.props
│ ├── support
│ └── java
│ │ └── org
│ │ └── baderlab
│ │ └── csplugins
│ │ ├── brainlib
│ │ ├── AvgLinkHierarchicalClustering.java
│ │ ├── DistanceMatrix.java
│ │ ├── DistanceMetric.java
│ │ └── HierarchicalClusteringResultTree.java
│ │ ├── mannwhit
│ │ ├── MannWhitneyMemoized.java
│ │ ├── MannWhitneyTestResult.java
│ │ └── MannWhitneyUTestSided.java
│ │ ├── org
│ │ └── mskcc
│ │ │ └── colorgradient
│ │ │ ├── ColorGradientRange.java
│ │ │ ├── ColorGradientTheme.java
│ │ │ └── ColorGradientWidget.java
│ │ └── prefuse
│ │ ├── data
│ │ └── query
│ │ │ └── NumberRangeModel.java
│ │ └── util
│ │ ├── TypeLib.java
│ │ └── ui
│ │ ├── JRangeSlider.java
│ │ ├── JRangeSliderExtended.java
│ │ └── ValuedRangeModel.java
│ └── test
│ ├── java
│ └── org
│ │ └── baderlab
│ │ └── csplugins
│ │ └── enrichmentmap
│ │ ├── EdgeSimilarities.java
│ │ ├── HypergeometricTest.java
│ │ ├── LogSilenceRule.java
│ │ ├── MannWhitneyRankSumTest.java
│ │ ├── SerialTestTaskManager.java
│ │ ├── StreamUtil.java
│ │ ├── TestUtils.java
│ │ ├── actions
│ │ └── OpenPathwayCommonsTaskTest.java
│ │ ├── heatmap
│ │ └── HeatMapRanksTest.java
│ │ ├── model
│ │ ├── EnrichmentMapTest.java
│ │ ├── EnrichmentResultTest.java
│ │ ├── ExpressionOpsTest.java
│ │ ├── GeneSetSimilarityTest.java
│ │ ├── GeneSetTest.java
│ │ ├── ModelSerializerTest.java
│ │ ├── ModelSharingTest.java
│ │ ├── SetOfGenesetsTest.java
│ │ └── SimilarityKeyTest.java
│ │ ├── parsers
│ │ └── FileReaderTest.java
│ │ ├── rest
│ │ └── ExpressionResourceTest.java
│ │ ├── style
│ │ └── ApplyStyleTest.java
│ │ ├── task
│ │ ├── BaseNetworkTest.java
│ │ ├── GprofilerDummyExpressionTest.java
│ │ ├── LoadBingoResultsTest.java
│ │ ├── LoadDatasetTaskTest.java
│ │ ├── LoadDavidResultTest.java
│ │ ├── LoadEdbDatasetTest.java
│ │ ├── LoadGMTFileOnlyTest.java
│ │ ├── PostAnalysisCutoffTest.java
│ │ ├── PostAnalysisTaskTest.java
│ │ └── TableLoadNetworkTest.java
│ │ └── util
│ │ ├── LinearNumberInterpolatorTest.java
│ │ ├── NamingUtilTest.java
│ │ └── PathUtilTest.java
│ └── resources
│ └── org
│ └── baderlab
│ └── csplugins
│ └── enrichmentmap
│ ├── BingoResults.bgo
│ ├── DavidResults.txt
│ ├── ExpressionTestFile.rnk
│ ├── ExpressionTestFile_edbrnk.rnk
│ ├── Expressiontestfile.gct
│ ├── Expressiontestfile_comments.gct
│ ├── Expressiontestfile_gseagct.gct
│ ├── GSEA_enrichments1.xls
│ ├── GSEA_enrichments2.xls
│ ├── Genesetstestfile.gmt
│ ├── Human_GO_AllPathways_with_GO_iea_symbol.gmt
│ ├── HypergeometricTest_pvalues.csv
│ ├── MannWhitneyTest_pvalues.csv
│ ├── Mouse_GO_AllPathways_with_GO_iea_symbol.gmt
│ ├── generic_enr_5col.txt
│ ├── model
│ └── Genesetstestfile.gmt
│ └── task
│ ├── EMandPA
│ ├── FakeExpression.txt
│ ├── FakeRank.rnk
│ ├── FakeRank2.rnk
│ ├── PA_top8_middle8_bottom8.gmt
│ ├── fakeEnrichments.txt
│ └── gene_sets.gmt
│ ├── Extrogen_Expression_file.txt
│ ├── LoadDataset
│ ├── 8w_r9c_vs_wt_SN.cls
│ ├── Expressiontestfile.gct
│ ├── GSEA_enrichments1.xls
│ ├── GSEA_enrichments2.xls
│ ├── GSEA_example_results
│ │ └── edb
│ │ │ ├── 8w_r9c_vs_wt_SN.cls
│ │ │ ├── Expressiontestfile.rnk
│ │ │ ├── gene_sets.gmt
│ │ │ └── results.edb
│ └── gs_apop_mouse.gmt
│ ├── bingo_output
│ ├── 12Hr_topgenes.bgo
│ ├── 24Hr_topgenes.bgo
│ └── test_cluster.bgo
│ ├── david_output
│ ├── 12hr_David_Output.txt
│ └── 24hr_David_Output.txt
│ ├── genesets_subset.gmt
│ ├── gprofiler
│ ├── Supplementary_Table4_gprofiler_results.txt
│ └── Supplementary_Table5_hsapiens.pathways.NAME.gmt
│ └── tutorial
│ ├── ES_NT.cls
│ ├── Human_GO_AllPathways_no_GO_iea_April_15_2013_symbol.gmt
│ ├── MCF7_ExprMx_v2_names.gct
│ ├── gene_order_leading_edge.txt
│ ├── gsea_report_for_ES12_1473194913081.xls
│ ├── gsea_report_for_NT12_1473194913081.xls
│ └── ranked_gene_list_ES12_versus_NT12_1473194913081.xls
├── LICENSE.md
├── README.md
└── pom.xml
/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 | .DS_Store
3 |
4 | # Package Files #
5 | *.jar
6 | *.war
7 | *.ear
8 | .settings
9 |
10 | #ignore anything in the compiled directory
11 | target/**/*
12 | DataForVictor/
13 | Mockupinterfaces/
14 | /target
15 | _build
16 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | enrichmentmap-parent
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.m2e.core.maven2Builder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.m2e.core.maven2Nature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | /bin/
3 |
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | EnrichmentMapIntegrationTest
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.m2e.core.maven2Builder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.m2e.core.maven2Nature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
3 | org.eclipse.jdt.core.compiler.compliance=11
4 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
5 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
6 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
7 | org.eclipse.jdt.core.compiler.release=disabled
8 | org.eclipse.jdt.core.compiler.source=11
9 |
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/src/test/java/README.md:
--------------------------------------------------------------------------------
1 | Some Notes
2 |
3 | Protocol tests are based on the Enrichment Map Protocols from the EM-tutorial-docker repository.
4 |
5 | Pax Exam
6 |
7 | - Can't figure out how to reuse utility classes from enrichmentmap-app in the integration tests so they had to be copied.
8 | - For some reason using the same package names was causing NoClassDefFoundErrors, so I added 'integration' to the package names.
9 | - Note: These are not unit tests, so the trick of using the same package names is not necessary.
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/src/test/java/org/baderlab/csplugins/enrichmentmap/integration/NullTaskMonitor.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.integration;
2 |
3 | import org.cytoscape.work.TaskMonitor;
4 |
5 | public class NullTaskMonitor implements TaskMonitor {
6 |
7 | @Override
8 | public void setTitle(String title) {
9 | }
10 |
11 | @Override
12 | public void setProgress(double progress) {
13 | }
14 |
15 | @Override
16 | public void setStatusMessage(String statusMessage) {
17 | }
18 |
19 | @Override
20 | public void showMessage(Level level, String message) {
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/src/test/java/org/baderlab/csplugins/enrichmentmap/integration/SessionFile.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.integration;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Retention(RetentionPolicy.RUNTIME)
9 | @Target(ElementType.METHOD) //can use in method only.
10 | public @interface SessionFile {
11 | String value();
12 | }
13 |
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/src/test/java/org/baderlab/csplugins/enrichmentmap/integration/SimilarityKey.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.integration;
2 |
3 | import java.util.Objects;
4 |
5 | public class SimilarityKey {
6 |
7 | private final String geneSet1;
8 | private final String interaction;
9 | private final String geneSet2;
10 |
11 | public SimilarityKey(String geneSet1, String interaction, String geneSet2) {
12 | Objects.requireNonNull(geneSet1);
13 | Objects.requireNonNull(interaction);
14 | Objects.requireNonNull(geneSet2);
15 | this.geneSet1 = geneSet1;
16 | this.interaction = interaction;
17 | this.geneSet2 = geneSet2;
18 | }
19 |
20 | public static SimilarityKey parse(String name) {
21 | int open = name.indexOf("(");
22 | int close = name.indexOf(")", open);
23 | String name1 = name.substring(0, open).trim();
24 | String name2 = name.substring(close+1, name.length()).trim();
25 | String interaction = name.substring(open+1, close);
26 | return new SimilarityKey(name1, interaction, name2);
27 | }
28 |
29 | public String getGeneSet1() {
30 | return geneSet1;
31 | }
32 |
33 | public String getGeneSet2() {
34 | return geneSet2;
35 | }
36 |
37 | public String getInteraction() {
38 | return interaction;
39 | }
40 |
41 | public SimilarityKey swap() {
42 | return new SimilarityKey(geneSet2, interaction, geneSet1);
43 | }
44 |
45 | @Override
46 | public int hashCode() {
47 | return geneSet1.hashCode() + interaction.hashCode() + geneSet2.hashCode();
48 | }
49 |
50 | @Override
51 | public boolean equals(Object o) {
52 | if(!(o instanceof SimilarityKey))
53 | return false;
54 | SimilarityKey other = (SimilarityKey)o;
55 |
56 | if(!interaction.equals(other.interaction))
57 | return false;
58 |
59 | return
60 | (geneSet1.equals(other.geneSet1) && geneSet2.equals(other.geneSet2))
61 | || (geneSet1.equals(other.geneSet2) && geneSet2.equals(other.geneSet1));
62 | }
63 |
64 | @Override
65 | public String toString() {
66 | return geneSet1 + " (" + interaction + ") " + geneSet2;
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/src/test/java/org/baderlab/csplugins/enrichmentmap/integration/TestUtils.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.integration;
2 |
3 | import static org.junit.Assert.assertNotNull;
4 |
5 | import java.io.File;
6 | import java.io.IOException;
7 | import java.io.InputStream;
8 | import java.nio.file.Files;
9 | import java.nio.file.StandardCopyOption;
10 | import java.util.HashMap;
11 | import java.util.Map;
12 |
13 | import org.cytoscape.model.CyEdge;
14 | import org.cytoscape.model.CyNetwork;
15 | import org.cytoscape.model.CyNode;
16 |
17 | public class TestUtils {
18 |
19 | public static Map getNodes(CyNetwork network) {
20 | Map nodes = new HashMap<>();
21 | for(CyNode node : network.getNodeList()) {
22 | nodes.put(network.getRow(node).get("name", String.class), node);
23 | }
24 | return nodes;
25 | }
26 |
27 | public static Map getEdges(CyNetwork network) {
28 | Map edges = new HashMap<>();
29 | for(CyEdge edge : network.getEdgeList()) {
30 | edges.put(network.getRow(edge).get("name", String.class), edge);
31 | }
32 | return edges;
33 | }
34 |
35 | public static EdgeSimilarities getEdgeSimilarities(CyNetwork network) {
36 | EdgeSimilarities edges = new EdgeSimilarities();
37 | for(CyEdge edge : network.getEdgeList()) {
38 | edges.addEdge(network.getRow(edge).get("name", String.class), edge);
39 | }
40 | return edges;
41 | }
42 |
43 | public static File createTempFile(String path, String fileName) throws IOException {
44 | int dot = fileName.indexOf('.');
45 | String prefix = fileName.substring(0, dot);
46 | String suffix = fileName.substring(dot+1);
47 | File tempFile = File.createTempFile(prefix, suffix);
48 | InputStream in = TestUtils.class.getResourceAsStream(path + prefix + "." + suffix);
49 | assertNotNull(in);
50 | Files.copy(in, tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
51 | return tempFile;
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/src/test/resources/EnrichmentMapTaskTest/PA_top8_middle8_bottom8.gmt:
--------------------------------------------------------------------------------
1 | PA_top8_middle8_bottom8 PA_top8_middle8_bottom8 ST3GAL2 ST6GALNAC2 ST3GAL1 ST6GALNAC4 B3GNT5 MUC2 ST6GAL1 GALNT16 GALNT11 GALNT14 GALNT1 MUC21 GALNT2 MUC3A GALNT3 GCNT1 MUCL1 ST3GAL4 GALNT9 B3GNT8 B4GALT5 GCNT3 GALNT6 GCNT4
2 |
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/src/test/resources/EnrichmentMapTaskTest/fakeEnrichments.txt:
--------------------------------------------------------------------------------
1 | Name Description pvalue fdr
2 | Top8_plus100 Top8_plus100 0.005 0.1
3 | Bottom8_plus100 Bottom8_plus100 0.005 0.1
4 | Middle8_plus100 Middle8_plus100 0.005 0.1
5 | top1_plus100 top1_plus100 0.005 0.1
6 |
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/src/test/resources/EnrichmentMapTaskTest/gene_sets.gmt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BaderLab/EnrichmentMapApp/bac424dd749d090fb4462906540ae948f3a18a5b/EnrichmentMapIntegrationTest/src/test/resources/EnrichmentMapTaskTest/gene_sets.gmt
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/src/test/resources/LegacySessionLoadTest/em_session_2.2.cys:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BaderLab/EnrichmentMapApp/bac424dd749d090fb4462906540ae948f3a18a5b/EnrichmentMapIntegrationTest/src/test/resources/LegacySessionLoadTest/em_session_2.2.cys
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/src/test/resources/LegacySessionLoadTest/em_session_2.2_twodataset.cys:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BaderLab/EnrichmentMapApp/bac424dd749d090fb4462906540ae948f3a18a5b/EnrichmentMapIntegrationTest/src/test/resources/LegacySessionLoadTest/em_session_2.2_twodataset.cys
--------------------------------------------------------------------------------
/EnrichmentMapIntegrationTest/src/test/resources/LegacySessionLoadTest/em_session_2.2_twodataset_pa.cys:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BaderLab/EnrichmentMapApp/bac424dd749d090fb4462906540ae948f3a18a5b/EnrichmentMapIntegrationTest/src/test/resources/LegacySessionLoadTest/em_session_2.2_twodataset_pa.cys
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 | .DS_Store
3 |
4 | # Package Files #
5 | *.jar
6 | *.war
7 | *.ear
8 | *.ai
9 | *.zip
10 | *.cys
11 |
12 | #ignore anything in the compiled directory
13 | target/**/*
14 | resources/EM_EBC_TestData/
15 | resources/Graphics_for_Manual/
16 | resources/Graphics_for_wiki/
17 | resources/scripts/
18 | *.Gsea.*/
19 | *.GseaPreRanked.*/
20 | temp_resources/
21 | .settings/
22 |
23 | /target
24 | /bin
25 | /.apt_generated/
26 |
27 | local.properties
28 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | enrichmentmap
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.wst.common.project.facet.core.builder
15 |
16 |
17 |
18 |
19 | org.eclipse.m2e.core.maven2Builder
20 |
21 |
22 |
23 |
24 |
25 | org.eclipse.m2e.core.maven2Nature
26 | org.eclipse.pde.PluginNature
27 | org.eclipse.wst.common.project.facet.core.nature
28 | org.eclipse.jdt.core.javanature
29 |
30 |
31 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | *******************************************************************
27 | * This script installs the Enrichment Map Cytoscape app *
28 | *******************************************************************
29 |
30 |
31 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/default.properties:
--------------------------------------------------------------------------------
1 | # Overwrite it in your local.properties file
2 | cytoscape.home=${user.home}/CytoscapeConfiguration
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/doc/EM_wiki_manual.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BaderLab/EnrichmentMapApp/bac424dd749d090fb4462906540ae948f3a18a5b/EnrichmentMapPlugin/doc/EM_wiki_manual.txt
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/doc/LGPL_2.1_Disclaimer_for_src_headers.txt:
--------------------------------------------------------------------------------
1 | /*
2 | * EnrichmentMap Cytoscape Plugin
3 | *
4 | * Copyright (c) 2008-2009 Bader Lab, Donnelly Centre for Cellular and Biomolecular
5 | * Research, University of Toronto
6 | *
7 | * Contact: http://www.baderlab.org
8 | *
9 | * Code written by: Ruth Isserlin
10 | * Authors: Daniele Merico, Ruth Isserlin, Oliver Stueker, Gary D. Bader
11 | *
12 | * This library is free software; you can redistribute it and/or modify it
13 | * under the terms of the GNU Lesser General Public License as published
14 | * by the Free Software Foundation; either version 2.1 of the License, or
15 | * (at your option) any later version.
16 | *
17 | * This library is distributed in the hope that it will be useful, but
18 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
19 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
20 | * documentation provided hereunder is on an "as is" basis, and
21 | * University of Toronto
22 | * has no obligations to provide maintenance, support, updates,
23 | * enhancements or modifications. In no event shall the
24 | * University of Toronto
25 | * be liable to any party for direct, indirect, special,
26 | * incidental or consequential damages, including lost profits, arising
27 | * out of the use of this software and its documentation, even if
28 | * University of Toronto
29 | * has been advised of the possibility of such damage.
30 | * See the GNU Lesser General Public License for more details.
31 | *
32 | * You should have received a copy of the GNU Lesser General Public License
33 | * along with this library; if not, write to the Free Software Foundation,
34 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
35 | *
36 | */
37 |
38 | // $ID$
39 | // $LastChangedDate$
40 | // $LasrChangedRevision$
41 | // $LastChangedBy$
42 | // $HeadURL$
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/resources/Graphics_for_Manual/Hypergeometric_test.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BaderLab/EnrichmentMapApp/bac424dd749d090fb4462906540ae948f3a18a5b/EnrichmentMapPlugin/resources/Graphics_for_Manual/Hypergeometric_test.png
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/resources/Graphics_for_Manual/PostAnalysis_InputPanel_SignatureHubs_screenshot.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BaderLab/EnrichmentMapApp/bac424dd749d090fb4462906540ae948f3a18a5b/EnrichmentMapPlugin/resources/Graphics_for_Manual/PostAnalysis_InputPanel_SignatureHubs_screenshot.ai
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/resources/Graphics_for_Manual/PostAnalysis_InputPanel_SignatureHubs_screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BaderLab/EnrichmentMapApp/bac424dd749d090fb4462906540ae948f3a18a5b/EnrichmentMapPlugin/resources/Graphics_for_Manual/PostAnalysis_InputPanel_SignatureHubs_screenshot.png
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/resources/Graphics_for_Manual/PostAnalysis_InputPanel_SignatureHubs_screenshot_withLabels.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BaderLab/EnrichmentMapApp/bac424dd749d090fb4462906540ae948f3a18a5b/EnrichmentMapPlugin/resources/Graphics_for_Manual/PostAnalysis_InputPanel_SignatureHubs_screenshot_withLabels.png
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/resources/Graphics_for_Manual/PostAnalysis_InputPanel_SignatureHubs_screenshot_withLabels_smaller.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BaderLab/EnrichmentMapApp/bac424dd749d090fb4462906540ae948f3a18a5b/EnrichmentMapPlugin/resources/Graphics_for_Manual/PostAnalysis_InputPanel_SignatureHubs_screenshot_withLabels_smaller.png
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/AfterInjection.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Retention(RetentionPolicy.RUNTIME)
9 | @Target(ElementType.METHOD)
10 | public @interface AfterInjection {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/CommandTaskFactory.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap;
2 |
3 | import org.cytoscape.work.ObservableTask;
4 | import org.cytoscape.work.Task;
5 | import org.cytoscape.work.TaskFactory;
6 | import org.cytoscape.work.TaskIterator;
7 | import org.cytoscape.work.json.JSONResult;
8 |
9 | import com.google.inject.Provider;
10 |
11 | public interface CommandTaskFactory extends TaskFactory {
12 |
13 |
14 | public String getName();
15 |
16 | public String getDescription();
17 |
18 | public String getLongDescription();
19 |
20 | public boolean supportsJson();
21 |
22 |
23 | public static CommandTaskFactory create(String name, String desc, String longDesc, Provider extends Task> taskProvider, Task... moreTasks) {
24 | Task task = taskProvider.get();
25 | boolean supportsJson = supportsJson(task);
26 |
27 | return new CommandTaskFactory() {
28 | @Override
29 | public TaskIterator createTaskIterator() {
30 | var ti = new TaskIterator(taskProvider.get());
31 | for(Task task : moreTasks) {
32 | ti.append(task);
33 | }
34 | return ti;
35 | }
36 |
37 | @Override public boolean isReady() { return true; }
38 | @Override public String getName() { return name; }
39 | @Override public String getDescription() { return desc; }
40 | @Override public String getLongDescription() { return longDesc == null ? null : desc + " " + longDesc; }
41 | @Override public boolean supportsJson() { return supportsJson; }
42 | };
43 | }
44 |
45 | private static boolean supportsJson(Task task) {
46 | if(task instanceof ObservableTask) {
47 | return ((ObservableTask)task).getResultClasses().contains(JSONResult.class);
48 | }
49 | return false;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/PropsReader.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap;
2 |
3 | import java.util.Properties;
4 |
5 | import org.cytoscape.property.AbstractConfigDirPropsReader;
6 | import org.cytoscape.property.CyProperty;
7 |
8 | public class PropsReader extends AbstractConfigDirPropsReader {
9 |
10 | public static final String PROPS_FILE_NAME = "enrichmentmap.props";
11 | public static final String NAME = "org.baderlab.enrichmentmap";
12 |
13 | public PropsReader() {
14 | super(NAME, PROPS_FILE_NAME, CyProperty.SavePolicy.CONFIG_DIR);
15 | }
16 |
17 | public static Properties getServiceProps() {
18 | Properties props = new Properties();
19 | props.setProperty("cyPropertyName", PROPS_FILE_NAME);
20 | return props;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/actions/OpenEnrichmentMapAction.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.actions;
2 |
3 | import java.awt.event.ActionEvent;
4 |
5 | import org.baderlab.csplugins.enrichmentmap.view.control.ControlPanelMediator;
6 | import org.baderlab.csplugins.enrichmentmap.view.creation.CreationDialogShowAction;
7 | import org.baderlab.csplugins.enrichmentmap.view.heatmap.HeatMapMediator;
8 | import org.cytoscape.application.swing.AbstractCyAction;
9 | import org.cytoscape.work.Task;
10 | import org.cytoscape.work.TaskMonitor;
11 |
12 | import com.google.inject.Inject;
13 | import com.google.inject.Provider;
14 | import com.google.inject.Singleton;
15 |
16 | @SuppressWarnings("serial")
17 | @Singleton
18 | public class OpenEnrichmentMapAction extends AbstractCyAction implements Task {
19 |
20 | public static final String NAME = "EnrichmentMap";
21 |
22 | @Inject private Provider controlPanelMediatorProvider;
23 | @Inject private Provider heatMapMediatorProvider;
24 | @Inject private CreationDialogShowAction masterMapDialogAction;
25 |
26 | public OpenEnrichmentMapAction() {
27 | super(NAME);
28 | setPreferredMenu("Apps");
29 | setMenuGravity(3.1f);
30 | }
31 |
32 | public synchronized void showPanels() {
33 | controlPanelMediatorProvider.get().showControlPanel();
34 | heatMapMediatorProvider.get().showHeatMapPanel();
35 | masterMapDialogAction.showDialog();
36 | }
37 |
38 | @Override
39 | public void actionPerformed(ActionEvent e) {
40 | showPanels();
41 | }
42 |
43 | @Override
44 | public void run(TaskMonitor taskMonitor) {
45 | showPanels();
46 | }
47 |
48 | @Override
49 | public void cancel() {
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/actions/OpenEnrichmentMapPanelsAction.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.actions;
2 |
3 | import java.awt.event.ActionEvent;
4 |
5 | import org.baderlab.csplugins.enrichmentmap.view.control.ControlPanelMediator;
6 | import org.baderlab.csplugins.enrichmentmap.view.heatmap.HeatMapMediator;
7 | import org.cytoscape.application.swing.AbstractCyAction;
8 | import org.cytoscape.work.Task;
9 | import org.cytoscape.work.TaskMonitor;
10 |
11 | import com.google.inject.Inject;
12 | import com.google.inject.Provider;
13 | import com.google.inject.Singleton;
14 |
15 | @SuppressWarnings("serial")
16 | @Singleton
17 | public class OpenEnrichmentMapPanelsAction extends AbstractCyAction implements Task {
18 |
19 | public static final String NAME = "EnrichmentMap";
20 |
21 | @Inject private Provider controlPanelMediatorProvider;
22 | @Inject private Provider heatMapMediatorProvider;
23 |
24 | public OpenEnrichmentMapPanelsAction() {
25 | super(NAME);
26 | setPreferredMenu("Apps");
27 | }
28 |
29 | public synchronized void showPanels() {
30 | controlPanelMediatorProvider.get().showControlPanel();
31 | heatMapMediatorProvider.get().showHeatMapPanel();
32 | }
33 |
34 | @Override
35 | public void actionPerformed(ActionEvent e) {
36 | showPanels();
37 | }
38 |
39 | @Override
40 | public void run(TaskMonitor taskMonitor) {
41 | showPanels();
42 | }
43 |
44 | @Override
45 | public void cancel() {
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/actions/OpenPathwayCommonsTaskFactory.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.actions;
2 |
3 | import org.baderlab.csplugins.enrichmentmap.model.DataSetFiles;
4 | import org.baderlab.csplugins.enrichmentmap.model.EMDataSet;
5 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap;
6 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMapManager;
7 | import org.cytoscape.model.CyNode;
8 | import org.cytoscape.task.NodeViewTaskFactory;
9 | import org.cytoscape.view.model.CyNetworkView;
10 | import org.cytoscape.view.model.View;
11 | import org.cytoscape.work.TaskIterator;
12 |
13 | import com.google.common.base.Strings;
14 | import com.google.inject.Inject;
15 |
16 | public class OpenPathwayCommonsTaskFactory implements NodeViewTaskFactory {
17 |
18 | @Inject private OpenPathwayCommonsTask.Factory taskFactory;
19 | @Inject private EnrichmentMapManager emManager;
20 |
21 | @Override
22 | public TaskIterator createTaskIterator(View nodeView, CyNetworkView networkView) {
23 | return new TaskIterator(taskFactory.create(networkView.getModel(), nodeView.getModel()));
24 | }
25 |
26 | /**
27 | * There has to be class and expression data available for at least one dataset.
28 | */
29 | @Override
30 | public boolean isReady(View nodeView, CyNetworkView networkView) {
31 | // have to call isEnrichmentMap() because getEnrichmentMap() returns a value for associated networks such as genemania networks
32 | if(!emManager.isEnrichmentMap(networkView))
33 | return false;
34 | EnrichmentMap em = emManager.getEnrichmentMap(networkView.getModel().getSUID());
35 | if(em == null)
36 | return false;
37 |
38 | for(EMDataSet dataset : em.getDataSetList()) {
39 | DataSetFiles files = dataset.getDataSetFiles();
40 | if(!Strings.isNullOrEmpty(files.getExpressionFileName()) && !Strings.isNullOrEmpty(files.getClassFile())) {
41 | return true;
42 | }
43 | }
44 | return false;
45 | }
46 |
47 | }
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/ExportModelJsonCommandTask.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.commands;
2 |
3 | import java.io.File;
4 | import java.io.FileWriter;
5 |
6 | import org.baderlab.csplugins.enrichmentmap.commands.tunables.NetworkTunable;
7 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap;
8 | import org.baderlab.csplugins.enrichmentmap.model.io.ModelSerializer;
9 | import org.cytoscape.work.AbstractTask;
10 | import org.cytoscape.work.ContainsTunables;
11 | import org.cytoscape.work.TaskMonitor;
12 | import org.cytoscape.work.Tunable;
13 |
14 | import com.google.inject.Inject;
15 |
16 | public class ExportModelJsonCommandTask extends AbstractTask {
17 |
18 | @Tunable(required=true, description="File used as destination for model JSON. Will be overwritten if it already exists.")
19 | public File file;
20 |
21 | @Inject @ContainsTunables
22 | public NetworkTunable networkTunable;
23 |
24 |
25 | @Override
26 | public void run(TaskMonitor taskMonitor) throws Exception {
27 | if(file == null)
28 | throw new IllegalArgumentException("'file' argument is null");
29 |
30 | file.createNewFile();
31 | if(!file.canWrite())
32 | throw new IllegalArgumentException("Cannot write to file");
33 |
34 | EnrichmentMap map = networkTunable.getEnrichmentMap();
35 | if(map == null)
36 | throw new IllegalArgumentException("Network is not an Enrichment Map.");
37 |
38 | String json = ModelSerializer.serialize(map, true);
39 |
40 | try(FileWriter out = new FileWriter(file)) {
41 | out.write(json);
42 | }
43 | }
44 |
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/ExportNetworkImageCommandTask.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.commands;
2 |
3 | import java.nio.file.Paths;
4 | import java.util.HashMap;
5 | import java.util.Map;
6 | import java.util.UUID;
7 |
8 | import org.cytoscape.command.CommandExecutorTaskFactory;
9 | import org.cytoscape.work.AbstractTask;
10 | import org.cytoscape.work.TaskIterator;
11 | import org.cytoscape.work.TaskMonitor;
12 |
13 | import com.google.inject.Inject;
14 |
15 | /**
16 | * There is already a command in Cytoscape to export a network image. This command
17 | * is different in that it always exports to the user's home directory, and it
18 | * never prompts for overwrite permission.
19 | */
20 | public class ExportNetworkImageCommandTask extends AbstractTask {
21 |
22 | @Inject private CommandExecutorTaskFactory commandTaskFactory;
23 |
24 | @Override
25 | public void run(TaskMonitor taskMonitor) {
26 | String fileName = "em_network_" + UUID.randomUUID() + ".png";
27 | String homeDir = System.getProperty("user.home");
28 | String filePath = Paths.get(homeDir, fileName).toString();
29 |
30 | Map args = new HashMap<>();
31 | args.put("options", "PNG (*.png)");
32 | args.put("outputFile", filePath);
33 | args.put("view", "CURRENT"); // required
34 |
35 | TaskIterator commandTasks = commandTaskFactory.createTaskIterator("view", "export", args, null);
36 | insertTasksAfterCurrentTask(commandTasks);
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/GetDataSetNamesCommandTask.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.commands;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 |
6 | import org.baderlab.csplugins.enrichmentmap.commands.tunables.NetworkTunable;
7 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap;
8 | import org.cytoscape.work.AbstractTask;
9 | import org.cytoscape.work.ContainsTunables;
10 | import org.cytoscape.work.ObservableTask;
11 | import org.cytoscape.work.TaskMonitor;
12 |
13 | import com.google.inject.Inject;
14 |
15 | public class GetDataSetNamesCommandTask extends AbstractTask implements ObservableTask {
16 |
17 | @ContainsTunables @Inject
18 | public NetworkTunable networkTunable;
19 |
20 | private List results;
21 |
22 |
23 | @Override
24 | public void run(TaskMonitor tm) {
25 | EnrichmentMap map = networkTunable.getEnrichmentMap();
26 | if(map == null)
27 | throw new IllegalArgumentException("Network is not an Enrichment Map.");
28 |
29 | results = map.getDataSetNames();
30 | }
31 |
32 |
33 | @Override
34 | public List> getResultClasses() {
35 | return Arrays.asList(String.class, List.class);
36 | }
37 |
38 | @Override
39 | public R getResults(Class extends R> type) {
40 | if(String.class.equals(type)) {
41 | return type.cast(String.join(",", results));
42 | } else if(List.class.equals(type)) {
43 | return type.cast(results);
44 | }
45 | return null;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/tunables/ChartTunables.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.commands.tunables;
2 |
3 | import static org.baderlab.csplugins.enrichmentmap.style.ChartData.DATA_SET;
4 | import static org.baderlab.csplugins.enrichmentmap.style.ChartType.DATASET_PIE;
5 | import static org.baderlab.csplugins.enrichmentmap.style.ChartType.HEAT_MAP;
6 | import static org.baderlab.csplugins.enrichmentmap.style.ChartType.HEAT_STRIPS;
7 | import static org.baderlab.csplugins.enrichmentmap.style.ChartType.RADIAL_HEAT_MAP;
8 |
9 | import org.baderlab.csplugins.enrichmentmap.style.ChartData;
10 | import org.baderlab.csplugins.enrichmentmap.style.ChartType;
11 | import org.baderlab.csplugins.enrichmentmap.style.ColorScheme;
12 | import org.baderlab.csplugins.enrichmentmap.util.TaskUtil;
13 | import org.cytoscape.work.Tunable;
14 | import org.cytoscape.work.util.ListSingleSelection;
15 |
16 | public class ChartTunables {
17 |
18 | @Tunable(description = "Sets the chart data to show.")
19 | public ListSingleSelection data;
20 |
21 | @Tunable(description = "Sets the chart type.")
22 | public ListSingleSelection type;
23 |
24 | @Tunable(description = "Sets the chart colors.")
25 | public ListSingleSelection colors;
26 |
27 | @Tunable
28 | public boolean showChartLabels = true;
29 |
30 |
31 | public ChartTunables() {
32 | data = TaskUtil.lssFromEnumWithDefault(ChartData.values(), ChartData.NES_VALUE);
33 | type = TaskUtil.lssFromEnum(RADIAL_HEAT_MAP, HEAT_STRIPS, HEAT_MAP); // don't include DATASET_PIE
34 | colors = TaskUtil.lssFromEnum(ColorScheme.values());
35 | }
36 |
37 |
38 | public ChartData getChartData() {
39 | return ChartData.valueOf(data.getSelectedValue());
40 | }
41 |
42 | public ChartType getChartType() {
43 | return getChartData() == DATA_SET ? DATASET_PIE : ChartType.valueOf(type.getSelectedValue());
44 | }
45 |
46 | public ColorScheme getColorScheme() {
47 | return ColorScheme.valueOf(colors.getSelectedValue());
48 | }
49 |
50 | public boolean showChartLabels() {
51 | return showChartLabels;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/tunables/DatasetColorTunable.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.commands.tunables;
2 |
3 | import java.awt.Color;
4 | import java.util.Collections;
5 | import java.util.Map;
6 | import java.util.Map.Entry;
7 | import java.util.stream.Collectors;
8 |
9 | import org.cytoscape.work.Tunable;
10 |
11 | import com.google.common.base.Splitter;
12 | import com.google.common.base.Strings;
13 |
14 | public class DatasetColorTunable {
15 |
16 | @Tunable(description="Comma separated list of key=value pairs where the key is the "
17 | + "name or index of a data set, and the value is an HTML hex color code. "
18 | + "Example: \"DataSet1=#224433,DataSet2=#887766\"")
19 | public String colors = null;
20 |
21 | @Tunable(description="Color to use for compound edges, the value is an HTML hex color code. "
22 | + "Note: This parameter has no effect if the EnrichmentMap network uses distinct edges (i.e. separate edges for each data set). "
23 | + "Example: \"#224433\"")
24 | public String compoundEdgeColor = null;
25 |
26 |
27 | public Map getColors() {
28 | if(Strings.isNullOrEmpty(colors))
29 | return Collections.emptyMap();
30 |
31 | return
32 | Splitter.on(',')
33 | .omitEmptyStrings()
34 | .withKeyValueSeparator(
35 | Splitter.on('=')
36 | .limit(2)
37 | .trimResults()
38 | )
39 | .split(colors)
40 | .entrySet()
41 | .stream()
42 | .collect(
43 | Collectors.toMap(
44 | Entry::getKey,
45 | v -> Color.decode(v.getValue())
46 | )
47 | );
48 | }
49 |
50 | public Color getCompoundEdgeColor() {
51 | return compoundEdgeColor == null ? null : Color.decode(compoundEdgeColor);
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/tunables/DatasetListTunable.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.commands.tunables;
2 |
3 | import java.util.Collection;
4 | import java.util.Collections;
5 | import java.util.HashSet;
6 | import java.util.List;
7 | import java.util.Set;
8 | import java.util.stream.Collectors;
9 |
10 | import org.baderlab.csplugins.enrichmentmap.model.EMDataSet;
11 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap;
12 | import org.cytoscape.work.Tunable;
13 |
14 | public class DatasetListTunable {
15 |
16 | @Tunable(description="Comma separated list of dataset names or indexes, or 'ALL' to indicate all datasets.",
17 | longDescription="Comma separated list of dataset names or indexes, for example 'dataset1,dataset2,3'. " +
18 | "The list may also contain positive integers that indicate the index of the dataset in the enrichment map. " +
19 | "Alternately use 'ALL' to indicate all data sets.")
20 | public String datasets = "ALL";
21 |
22 |
23 | public Collection getDataSets(EnrichmentMap map) {
24 | if(datasets == null) {
25 | return Collections.emptyList();
26 | }
27 | if(datasets.trim().equalsIgnoreCase("ALL")) {
28 | return map.getDataSetList();
29 | }
30 |
31 | Set result = new HashSet<>();
32 | List datasetList = map.getDataSetList();
33 |
34 | String[] names = datasets.split(",");
35 | for(String name : names) {
36 | int index = getIndex(name);
37 | if(index >= 0 && index < datasetList.size()) {
38 | result.add(datasetList.get(index));
39 | } else {
40 | EMDataSet ds = map.getDataSet(name);
41 | if(ds != null) {
42 | result.add(ds);
43 | }
44 | }
45 | }
46 |
47 | return result;
48 | }
49 |
50 | public Set getDataSetNames(EnrichmentMap map) {
51 | return getDataSets(map).stream().map(EMDataSet::getName).collect(Collectors.toSet());
52 | }
53 |
54 |
55 | private static int getIndex(String s) {
56 | try {
57 | return Integer.parseInt(s);
58 | } catch(NumberFormatException e) {
59 | return -1;
60 | }
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/tunables/FilterTunablesLegacy.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.commands.tunables;
2 |
3 | import static org.baderlab.csplugins.enrichmentmap.model.EMCreationParameters.SimilarityMetric.COMBINED;
4 | import static org.baderlab.csplugins.enrichmentmap.model.EMCreationParameters.SimilarityMetric.JACCARD;
5 | import static org.baderlab.csplugins.enrichmentmap.model.EMCreationParameters.SimilarityMetric.OVERLAP;
6 |
7 | import org.baderlab.csplugins.enrichmentmap.model.EMCreationParameters.SimilarityMetric;
8 | import org.cytoscape.work.Tunable;
9 | import org.cytoscape.work.util.ListSingleSelection;
10 |
11 |
12 | /**
13 | * This is just for the build command for backwards compatibility with the misspelled 'coeffecients' parameter.
14 | * Use with @ContainsTunables.
15 | */
16 | public class FilterTunablesLegacy extends FilterTunables {
17 |
18 | @Deprecated
19 | @Tunable(description = "Deprecated, use 'coefficients' instead.")
20 | public ListSingleSelection coeffecients; // misspelled, but must keep for backwards compatibility
21 |
22 |
23 | public FilterTunablesLegacy() {
24 | coeffecients = new ListSingleSelection("null", OVERLAP.name(), JACCARD.name(), COMBINED.name());
25 | }
26 |
27 | @Override
28 | public SimilarityMetric getSimilarityMetric() {
29 | String value;
30 | if(!"null".equals(coeffecients.getSelectedValue())) {
31 | // the old field overrides the new field
32 | value = coeffecients.getSelectedValue();
33 | } else {
34 | value = coefficients.getSelectedValue();
35 | }
36 |
37 | return SimilarityMetric.valueOf(value);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/tunables/MannWhitRanks.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.commands.tunables;
2 |
3 | import java.util.Collections;
4 | import java.util.HashMap;
5 | import java.util.Map;
6 |
7 | import com.google.common.collect.ImmutableMap;
8 |
9 | public class MannWhitRanks {
10 |
11 | public static final String DESCRIPTION = "When using Mann-Whitney allows to specify which rank file to use with each dataset."
12 | + " Example usage \"DataSetName1:RankFile1,DataSetName2:RankFile2\"";
13 |
14 |
15 | private Map dataSetToRankFile = new HashMap<>();
16 |
17 | public MannWhitRanks(Map dataSetToRankFile) {
18 | this.dataSetToRankFile = ImmutableMap.copyOf(dataSetToRankFile);
19 | }
20 |
21 | public MannWhitRanks() {
22 | this.dataSetToRankFile = Collections.emptyMap();
23 | }
24 |
25 | public Map getDataSetToRankFile() {
26 | return dataSetToRankFile;
27 | }
28 |
29 | public String getRankFile(String dataSet) {
30 | return dataSetToRankFile.get(dataSet);
31 | }
32 |
33 | @Override
34 | public String toString() {
35 | return "MannWhitRanking [dataSetToRankFile=" + dataSetToRankFile + "]";
36 | }
37 |
38 | public boolean isEmpty() {
39 | return dataSetToRankFile.isEmpty();
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/tunables/MannWhitRanksTunableHandler.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.commands.tunables;
2 |
3 | import java.lang.reflect.Field;
4 | import java.lang.reflect.Method;
5 | import java.util.Arrays;
6 | import java.util.HashMap;
7 | import java.util.Map;
8 |
9 | import org.cytoscape.command.AbstractStringTunableHandler;
10 | import org.cytoscape.work.Tunable;
11 |
12 | public class MannWhitRanksTunableHandler extends AbstractStringTunableHandler {
13 |
14 | public MannWhitRanksTunableHandler(Field f, Object o, Tunable t) {
15 | super(f, o, t);
16 | }
17 |
18 | public MannWhitRanksTunableHandler(Method get, Method set, Object o, Tunable t) {
19 | super(get, set, o, t);
20 | }
21 |
22 | @Override
23 | public MannWhitRanks processArg(String arg) {
24 | return new MannWhitRanks(parseArg(arg));
25 | }
26 |
27 |
28 | private static Map parseArg(String arg) {
29 | Map dataSetToRank = new HashMap<>();
30 |
31 | String[] split = arg.split("(?= 2) {
36 | String attribute = t[0];
37 | String[] slice = Arrays.copyOfRange(t, 1, t.length);
38 | String value = String.join(":", slice);
39 | attribute = attribute.replaceAll("\\\\:", ":");
40 | value = value.replaceAll("\\\\:", ":");
41 |
42 | dataSetToRank.put(attribute, value);
43 | }
44 | }
45 | return dataSetToRank;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/tunables/MannWhitRanksTunableHandlerFactory.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.commands.tunables;
2 |
3 | import org.cytoscape.command.StringTunableHandlerFactory;
4 | import org.cytoscape.work.BasicTunableHandlerFactory;
5 |
6 | public class MannWhitRanksTunableHandlerFactory
7 | extends BasicTunableHandlerFactory
8 | implements StringTunableHandlerFactory {
9 |
10 | public MannWhitRanksTunableHandlerFactory() {
11 | super(MannWhitRanksTunableHandler.class, MannWhitRanks.class);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/tunables/NetworkTunable.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.commands.tunables;
2 |
3 | import java.util.Collection;
4 |
5 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap;
6 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMapManager;
7 | import org.cytoscape.application.CyApplicationManager;
8 | import org.cytoscape.model.CyNetwork;
9 | import org.cytoscape.view.model.CyNetworkView;
10 | import org.cytoscape.view.model.CyNetworkViewManager;
11 | import org.cytoscape.work.Tunable;
12 |
13 | import com.google.inject.Inject;
14 |
15 | public class NetworkTunable {
16 |
17 | @Inject private CyApplicationManager applicationManager;
18 | @Inject private CyNetworkViewManager networkViewManager;
19 | @Inject private EnrichmentMapManager emManager;
20 |
21 | @Tunable
22 | public CyNetwork network;
23 |
24 |
25 | public CyNetwork getNetwork() {
26 | if(network == null)
27 | return applicationManager.getCurrentNetwork();
28 | return network;
29 | }
30 |
31 | public CyNetworkView getNetworkView() {
32 | CyNetwork network = getNetwork();
33 | if(network == null) {
34 | return null;
35 | }
36 |
37 | Collection networkViews = networkViewManager.getNetworkViews(network);
38 | if(networkViews == null || networkViews.isEmpty())
39 | return null;
40 | return networkViews.iterator().next();
41 | }
42 |
43 | public EnrichmentMap getEnrichmentMap() {
44 | CyNetwork network = getNetwork();
45 | if(network == null)
46 | return null;
47 | return emManager.getEnrichmentMap(getNetwork().getSUID());
48 | }
49 |
50 | public boolean isEnrichmentMap() {
51 | return getEnrichmentMap() != null;
52 | }
53 |
54 | public boolean isAssociatedEnrichmenMap() {
55 | CyNetwork network = getNetwork();
56 | if(network == null)
57 | return false;
58 | return emManager.isAssociatedEnrichmentMap(network.getSUID());
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/tunables/NodeListTunable.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.commands.tunables;
2 |
3 | import java.util.List;
4 | import java.util.stream.Collectors;
5 |
6 | import org.cytoscape.work.Tunable;
7 |
8 | import com.google.common.base.Splitter;
9 |
10 | public class NodeListTunable {
11 |
12 | @Tunable(description = "Comma separated list of node SUIDs")
13 | public String nodes;
14 |
15 | public List getNodeSuids() throws NumberFormatException {
16 | return Splitter.on(',')
17 | .trimResults()
18 | .omitEmptyStrings()
19 | .splitToStream(nodes)
20 | .map(Long::parseLong)
21 | .collect(Collectors.toList());
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/AssociatedApp.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model;
2 |
3 | import org.baderlab.csplugins.enrichmentmap.style.ColumnDescriptor;
4 | import org.baderlab.csplugins.enrichmentmap.style.ColumnListDescriptor;
5 | import org.baderlab.csplugins.enrichmentmap.style.EMStyleBuilder;
6 |
7 | public enum AssociatedApp {
8 |
9 | GENEMANIA("GeneMANIA", AssociatedAppColumns.GM_GENE_NAME, AssociatedAppColumns.GM_QUERY_TERM),
10 | STRING("STRING", AssociatedAppColumns.STR_GENE_NAME, AssociatedAppColumns.STR_QUERY_TERM),
11 | AUTOANNOTATE("AUTOANNOTATE", EMStyleBuilder.Columns.NODE_GENES);
12 |
13 |
14 | private final String name;
15 | private final ColumnDescriptor geneNameColumn;
16 | private final ColumnListDescriptor geneNameListColumn;
17 | private final ColumnDescriptor queryTermColumn;
18 |
19 |
20 | private AssociatedApp(String name, ColumnDescriptor geneNameColumn, ColumnDescriptor queryTermColumn) {
21 | this.name = name;
22 | this.geneNameColumn = geneNameColumn;
23 | this.geneNameListColumn = null;
24 | this.queryTermColumn = queryTermColumn;
25 | }
26 |
27 | private AssociatedApp(String name, ColumnListDescriptor geneNameListColumn) {
28 | this.name = name;
29 | this.geneNameColumn = null;
30 | this.geneNameListColumn = geneNameListColumn;
31 | this.queryTermColumn = null;
32 | }
33 |
34 |
35 | public ColumnDescriptor getGeneNameColumn() {
36 | return geneNameColumn;
37 | }
38 |
39 | public ColumnDescriptor getQueryTermColumn() {
40 | return queryTermColumn;
41 | }
42 |
43 | public ColumnListDescriptor getGeneNameListColumn() {
44 | return geneNameListColumn;
45 | }
46 |
47 |
48 | @Override
49 | public String toString() {
50 | return name;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/AssociatedAppColumns.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model;
2 |
3 | import org.baderlab.csplugins.enrichmentmap.style.ColumnDescriptor;
4 | import org.baderlab.csplugins.enrichmentmap.style.EMStyleBuilder;
5 |
6 | public interface AssociatedAppColumns {
7 |
8 | // GeneMANIA Attributes
9 | // NODE
10 | ColumnDescriptor GM_GENE_NAME = new ColumnDescriptor<>("gene name", String.class);
11 | ColumnDescriptor GM_QUERY_TERM = new ColumnDescriptor<>("query term", String.class);
12 |
13 | // STRING Attributes
14 | // NODE
15 | ColumnDescriptor STR_GENE_NAME = new ColumnDescriptor<>("display name", String.class);
16 | ColumnDescriptor STR_QUERY_TERM = new ColumnDescriptor<>("query term", String.class);
17 |
18 | // Hidden network attributes in associated networks
19 | // Hard code the namespace prefix because when we go from the associated network back to the EM network we don't know the EM network's prefix yet
20 | ColumnDescriptor EM_ASSOCIATED_APP = new ColumnDescriptor<>(EMStyleBuilder.Columns.NAMESPACE_PREFIX + "Associated_App", String.class);
21 | ColumnDescriptor EM_NETWORK_SUID = new ColumnDescriptor<>(EMStyleBuilder.Columns.NAMESPACE_PREFIX + "Network.SUID", Long.class);
22 | }
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/Compress.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model;
2 |
3 | public enum Compress {
4 | NONE,
5 | CLASS_MEDIAN,
6 | CLASS_MIN,
7 | CLASS_MAX,
8 | DATASET_MEDIAN,
9 | DATASET_MIN,
10 | DATASET_MAX;
11 |
12 | public boolean isNone() {
13 | return this == NONE;
14 | }
15 |
16 | public boolean isClass() {
17 | return this == CLASS_MEDIAN || this == CLASS_MIN || this == CLASS_MAX;
18 | }
19 |
20 | public boolean isDataSet() {
21 | return this == DATASET_MEDIAN || this == DATASET_MIN || this == DATASET_MAX;
22 | }
23 |
24 | public boolean sameStructure(Compress other) {
25 | return (this.isNone() && other.isNone()) || (this.isClass() && other.isClass())
26 | || (this.isDataSet() && other.isDataSet());
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/CompressedDataSet.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model;
2 |
3 | import java.util.List;
4 | import java.util.Optional;
5 |
6 | import org.baderlab.csplugins.enrichmentmap.model.PhenotypeHighlight.Highlight;
7 |
8 | public class CompressedDataSet implements ExpressionData {
9 |
10 | private final ExpressionCache expressionCache;
11 | private final List datasets;
12 | private final boolean isDistinctExpressionSets;
13 |
14 | public CompressedDataSet(EnrichmentMap map, List datasets, ExpressionCache expressionCache) {
15 | this.datasets = datasets;
16 | this.expressionCache = expressionCache;
17 | this.isDistinctExpressionSets = map != null && map.isDistinctExpressionSets();
18 | }
19 |
20 | @Override
21 | public EMDataSet getDataSet(int idx) {
22 | return datasets.get(idx);
23 | }
24 |
25 | @Override
26 | public double getValue(int geneID, int idx, Compress compress, Transform transform) {
27 | EMDataSet dataset = getDataSet(idx);
28 | Optional expression = expressionCache.getExpressions(geneID, dataset, transform);
29 |
30 | if (compress == null || !expression.isPresent())
31 | return Float.NaN;
32 |
33 | switch (compress) {
34 | case DATASET_MEDIAN: return GeneExpression.median(expression.get());
35 | case DATASET_MAX: return GeneExpression.max(expression.get());
36 | case DATASET_MIN: return GeneExpression.min(expression.get());
37 | default: return Float.NaN;
38 | }
39 | }
40 |
41 | @Override
42 | public String getName(int idx) {
43 | EMDataSet dataset = getDataSet(idx);
44 | return isDistinctExpressionSets ? dataset.getName() : "Expressions";
45 | }
46 |
47 | @Override
48 | public int getSize() {
49 | return datasets.size();
50 | }
51 |
52 | @Override
53 | public PhenotypeHighlight getHighlight(int col) {
54 | var dataSet = getDataSet(col);
55 | var name = getName(col);
56 | return new PhenotypeHighlight(dataSet, name, Highlight.NONE);
57 | }
58 |
59 | @Override
60 | public boolean commonButDiffPheno() {
61 | return false;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/EnrichmentResultFilterParams.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model;
2 |
3 | import java.util.Optional;
4 |
5 | public interface EnrichmentResultFilterParams {
6 |
7 | public static enum NESFilter {
8 | ALL,
9 | POSITIVE,
10 | NEGATIVE
11 | }
12 |
13 | double getPvalue();
14 |
15 | double getQvalue();
16 |
17 | NESFilter getNESFilter();
18 |
19 | Optional getMinExperiments();
20 |
21 | boolean isFDR();
22 | }
23 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/ExpressionCache.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model;
2 |
3 | import java.util.Map;
4 | import java.util.Optional;
5 | import java.util.concurrent.ExecutionException;
6 |
7 | import javax.annotation.Nullable;
8 |
9 | import org.apache.commons.lang3.tuple.Triple;
10 |
11 | import com.google.common.cache.Cache;
12 | import com.google.common.cache.CacheBuilder;
13 |
14 | public class ExpressionCache {
15 |
16 | private final Cache, Optional> cache;
17 |
18 | public ExpressionCache() {
19 | this.cache = CacheBuilder.newBuilder().maximumSize(20).build();
20 | }
21 |
22 | public Optional getExpressions(int geneID, EMDataSet dataset, Transform transform) {
23 | try {
24 | return cache.get(Triple.of(geneID, dataset, transform),
25 | () -> Optional.ofNullable(getExpression(geneID, dataset, transform))
26 | );
27 | } catch (ExecutionException e) {
28 | return Optional.empty();
29 | }
30 | }
31 |
32 | public float getExpression(int geneID, EMDataSet dataset, Transform transform, int expressionIndex) {
33 | Optional vals = getExpressions(geneID, dataset, transform);
34 |
35 | return vals.isPresent() ? vals.get()[expressionIndex] : Float.NaN;
36 | }
37 |
38 | public static GeneExpression getGeneExpression(int geneID, EMDataSet dataset) {
39 | GeneExpressionMatrix matrix = dataset.getExpressionSets();
40 | Map expressions = matrix.getExpressionMatrix();
41 | GeneExpression row = expressions.get(geneID);
42 |
43 | return row;
44 | }
45 |
46 | private static @Nullable float[] getExpression(int geneID, EMDataSet dataset, Transform transform) {
47 | GeneExpression expression = getGeneExpression(geneID, dataset);
48 |
49 | if (expression != null) {
50 | switch (transform) {
51 | case ROW_NORMALIZE: return expression.rowNormalize();
52 | case LOG_TRANSFORM: return expression.rowLogTransform();
53 | case AS_IS: return expression.getExpression();
54 | }
55 | }
56 |
57 | return null;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/GenemaniaParameters.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model;
2 |
3 | import org.cytoscape.model.CyNetwork;
4 |
5 | public class GenemaniaParameters {
6 |
7 | // the SUID of the genemania network
8 | private final CyNetwork network;
9 |
10 | public GenemaniaParameters(CyNetwork network) {
11 | this.network = network;
12 | }
13 |
14 | public CyNetwork getNetwork() {
15 | return network;
16 | }
17 |
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/TableExpressionParameters.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model;
2 |
3 | import java.util.Objects;
4 |
5 | import org.cytoscape.model.CyTable;
6 |
7 | public class TableExpressionParameters {
8 |
9 | // expression table
10 | private final CyTable exprTable;
11 | private final String exprGeneNameColumn;
12 | private final String exprDescriptionColumn;
13 | private final String[] exprValueColumns;
14 |
15 |
16 | public TableExpressionParameters(CyTable exprTable, String exprGeneNameColumn, String exprDescriptionColumn, String[] exprValueColumns) {
17 | this.exprTable = Objects.requireNonNull(exprTable);
18 | this.exprGeneNameColumn = exprGeneNameColumn;
19 | this.exprDescriptionColumn = exprDescriptionColumn;
20 | this.exprValueColumns = exprValueColumns;
21 | }
22 |
23 | public CyTable getExprTable() {
24 | return exprTable;
25 | }
26 |
27 | public String getExprGeneNameColumn() {
28 | return exprGeneNameColumn;
29 | }
30 |
31 | public String getExprDescriptionColumn() {
32 | return exprDescriptionColumn;
33 | }
34 |
35 | public String[] getExprValueColumns() {
36 | return exprValueColumns;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/TableParameters.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model;
2 |
3 | import java.util.Objects;
4 | import java.util.function.Predicate;
5 |
6 | import javax.annotation.Nullable;
7 |
8 | import org.cytoscape.model.CyRow;
9 | import org.cytoscape.model.CyTable;
10 |
11 | public class TableParameters {
12 |
13 | private final CyTable table;
14 | private final String nameColumn;
15 | private final String genesColumn;
16 | private final String pvalueColumn;
17 | private final String qvalueColumn;
18 | private final String nesColumn;
19 | private final String descriptionColumn;
20 |
21 | private final @Nullable Predicate filter;
22 |
23 |
24 | public TableParameters(
25 | CyTable table,
26 | String nameColumn,
27 | String genesColumn,
28 | String pvalueColumn,
29 | String qvalueColumn,
30 | String nesColumn,
31 | String descriptionColumn,
32 | Predicate filter
33 | ) {
34 | this.table = Objects.requireNonNull(table);
35 | this.nameColumn = Objects.requireNonNull(nameColumn);
36 | this.genesColumn = Objects.requireNonNull(genesColumn);
37 | this.pvalueColumn = pvalueColumn;
38 | this.qvalueColumn = qvalueColumn;
39 | this.nesColumn = nesColumn;
40 | this.descriptionColumn = descriptionColumn;
41 | this.filter = filter;
42 | }
43 |
44 | public CyTable getTable() {
45 | return table;
46 | }
47 |
48 | public String getNameColumn() {
49 | return nameColumn;
50 | }
51 |
52 | public String getGenesColumn() {
53 | return genesColumn;
54 | }
55 |
56 | public String getPvalueColumn() {
57 | return pvalueColumn;
58 | }
59 |
60 | public String getQvalueColumn() {
61 | return qvalueColumn;
62 | }
63 |
64 | public String getNesColumn() {
65 | return nesColumn;
66 | }
67 |
68 | public String getDescriptionColumn() {
69 | return descriptionColumn;
70 | }
71 |
72 | public Predicate getFilter() {
73 | return filter;
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/Transform.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model;
2 |
3 | public enum Transform {
4 | AS_IS,
5 | ROW_NORMALIZE,
6 | LOG_TRANSFORM;
7 | }
8 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/UniverseType.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model;
2 |
3 | /**
4 | * The "gene universe", typically used as a parameter to
5 | * the Hypergeometric test when running post-analysis.
6 | */
7 | public enum UniverseType {
8 |
9 | GMT,
10 | EXPRESSION_SET,
11 | INTERSECTION,
12 | USER_DEFINED;
13 |
14 |
15 | public int getGeneUniverse(EnrichmentMap map, String datasetName, int userDefinedUniverseSize) {
16 | EMDataSet dataset = map.getDataSet(datasetName);
17 | switch(this) {
18 | default:
19 | case GMT:
20 | return dataset.getGeneSetGenes().size(); // number of un-filtered genes from the original GMT file (GMT)
21 | case EXPRESSION_SET:
22 | return dataset.getExpressionSets().getExpressionUniverse();
23 | case INTERSECTION:
24 | return dataset.getExpressionSets().getExpressionMatrix().size();
25 | case USER_DEFINED:
26 | return userDefinedUniverseSize;
27 | }
28 | }
29 |
30 | public int getGeneUniverse(EnrichmentMap map, String dataset) {
31 | if(this == UniverseType.USER_DEFINED)
32 | throw new IllegalArgumentException();
33 | return getGeneUniverse(map, dataset, 0);
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/event/AssociatedEnrichmentMapsChangedEvent.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model.event;
2 |
3 | import java.util.Map;
4 |
5 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap;
6 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMapManager;
7 | import org.cytoscape.event.AbstractCyEvent;
8 |
9 | public class AssociatedEnrichmentMapsChangedEvent extends AbstractCyEvent {
10 |
11 | private final EnrichmentMap map;
12 | private final Map associatedMaps;
13 |
14 | public AssociatedEnrichmentMapsChangedEvent(EnrichmentMapManager source, EnrichmentMap map, Map associatedMaps) {
15 | super(source, AssociatedEnrichmentMapsChangedListener.class);
16 | this.map = map;
17 | this.associatedMaps = associatedMaps;
18 | }
19 |
20 | public EnrichmentMap getEnrichmentMap() {
21 | return map;
22 | }
23 |
24 | public Map getAssociatedMaps() {
25 | return associatedMaps;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/event/AssociatedEnrichmentMapsChangedListener.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model.event;
2 |
3 | import org.cytoscape.event.CyListener;
4 |
5 | public interface AssociatedEnrichmentMapsChangedListener extends CyListener {
6 |
7 | public void handleEvent(AssociatedEnrichmentMapsChangedEvent e);
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/event/EnrichmentMapAboutToBeRemovedEvent.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model.event;
2 |
3 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap;
4 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMapManager;
5 | import org.cytoscape.event.AbstractCyEvent;
6 | import org.cytoscape.view.model.CyNetworkView;
7 |
8 | public class EnrichmentMapAboutToBeRemovedEvent extends AbstractCyEvent {
9 |
10 | private final EnrichmentMap map;
11 | private final CyNetworkView networkView;
12 |
13 | public EnrichmentMapAboutToBeRemovedEvent(EnrichmentMapManager source, EnrichmentMap map, CyNetworkView networkView) {
14 | super(source, EnrichmentMapAboutToBeRemovedListener.class);
15 | this.map = map;
16 | this.networkView = networkView;
17 | }
18 |
19 | public EnrichmentMap getEnrichmentMap() {
20 | return map;
21 | }
22 |
23 | public CyNetworkView getNetworkView() {
24 | return networkView;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/event/EnrichmentMapAboutToBeRemovedListener.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model.event;
2 |
3 | import org.cytoscape.event.CyListener;
4 |
5 | public interface EnrichmentMapAboutToBeRemovedListener extends CyListener {
6 |
7 | public void handleEvent(EnrichmentMapAboutToBeRemovedEvent e);
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/event/EnrichmentMapAddedEvent.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model.event;
2 |
3 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap;
4 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMapManager;
5 | import org.cytoscape.event.AbstractCyEvent;
6 |
7 |
8 | public class EnrichmentMapAddedEvent extends AbstractCyEvent {
9 |
10 | private final EnrichmentMap map;
11 |
12 | public EnrichmentMapAddedEvent(EnrichmentMapManager source, EnrichmentMap map) {
13 | super(source, EnrichmentMapAddedListener.class);
14 | this.map = map;
15 | }
16 |
17 | public EnrichmentMap getEnrichmentMap() {
18 | return map;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/event/EnrichmentMapAddedListener.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.model.event;
2 |
3 | import org.cytoscape.event.CyListener;
4 |
5 | public interface EnrichmentMapAddedListener extends CyListener {
6 |
7 | public void handleEvent(EnrichmentMapAddedEvent e);
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/parsers/ClassFileReaderTask.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.parsers;
2 |
3 | import static com.google.common.base.Strings.isNullOrEmpty;
4 |
5 | import java.io.File;
6 | import java.io.IOException;
7 | import java.util.List;
8 |
9 | import org.baderlab.csplugins.enrichmentmap.model.EMDataSet;
10 | import org.cytoscape.work.AbstractTask;
11 | import org.cytoscape.work.TaskMonitor;
12 |
13 | public class ClassFileReaderTask extends AbstractTask {
14 |
15 | private final EMDataSet dataset;
16 |
17 | public ClassFileReaderTask(EMDataSet dataset) {
18 | this.dataset = dataset;
19 | }
20 |
21 | @Override
22 | public void run(TaskMonitor taskMonitor) throws Exception {
23 | taskMonitor.setTitle("Parsing class file");
24 | String classFile = dataset.getDataSetFiles().getClassFile();
25 | String[] classes = parseClasses(classFile);
26 | dataset.getEnrichments().setPhenotypes(classes);
27 | }
28 |
29 |
30 | public static String[] parseClasses(String classFile) {
31 | if (isNullOrEmpty(classFile))
32 | return new String[] {"NA_pos", "NA_neg"};
33 |
34 | File f = new File(classFile);
35 | if(!f.exists())
36 | return null;
37 |
38 | try {
39 | List lines = LineReader.readLines(classFile, 4);
40 |
41 | /*
42 | * GSEA class files will have 3 lines in the following format: 6 2 1
43 | * # R9C_8W WT_8W R9C_8W R9C_8W R9C_8W WT_8W WT_8W WT_8W
44 | *
45 | * If the file has 3 lines assume it is a GSEA and get the
46 | * phenotypes from the third line. If the file only has 1 line
47 | * assume that it is a generic class file and get the phenotypes
48 | * from the single line
49 | * the class file can be split by a space or a tab
50 | */
51 | if(lines.size() >= 3)
52 | return lines.get(2).split("\\s");
53 | else if(lines.size() == 1)
54 | return lines.get(0).split("\\s");
55 | else
56 | return null;
57 |
58 | } catch (IOException ie) {
59 | System.err.println("unable to open class file: " + classFile);
60 | return null;
61 | }
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/parsers/GREATWhichPvalueQuestionTask.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.parsers;
2 |
3 | import org.baderlab.csplugins.enrichmentmap.model.EMCreationParameters;
4 | import org.baderlab.csplugins.enrichmentmap.model.EMCreationParameters.GreatFilter;
5 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap;
6 | import org.cytoscape.work.AbstractTask;
7 | import org.cytoscape.work.ObservableTask;
8 | import org.cytoscape.work.TaskMonitor;
9 | import org.cytoscape.work.Tunable;
10 | import org.cytoscape.work.util.ListSingleSelection;
11 |
12 | public class GREATWhichPvalueQuestionTask extends AbstractTask implements ObservableTask{
13 | //tunable representing the question
14 | @Tunable(description="GREAT results can be filtered by Hypergeometric, <
>Binomial, both[AND] or either[OR] tests.
Which would you like to filter by?")
15 | public ListSingleSelection filterResponse;
16 |
17 | private static final String hyper = "Hypergeometric p-value";
18 | private static final String binom = "Binomial p-value";
19 | private static final String both = "Both";
20 | private static final String either = "Either";
21 |
22 | private final EMCreationParameters params;
23 |
24 | public GREATWhichPvalueQuestionTask(EnrichmentMap map) {
25 | filterResponse = new ListSingleSelection<>(hyper, binom, both, either);
26 | params = map.getParams();
27 | }
28 |
29 | @Override
30 | public void run(TaskMonitor tm) {
31 | var filter = getFilter(filterResponse.getSelectedValue());
32 | params.setGreatFilter(filter);
33 | }
34 |
35 | private static GreatFilter getFilter(String value) {
36 | switch(value) {
37 | case hyper: return GreatFilter.HYPER;
38 | case binom: return GreatFilter.BINOM;
39 | case both: return GreatFilter.BOTH;
40 | case either: return GreatFilter.EITHER;
41 | }
42 | return null;
43 | }
44 |
45 | public R getResults(Class extends R> arg) {
46 | return null;
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/parsers/ParseGSEAEnrichmentException.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.parsers;
2 |
3 | @SuppressWarnings("serial")
4 | public class ParseGSEAEnrichmentException extends RuntimeException {
5 |
6 | private final String nonParsableToken;
7 |
8 | public ParseGSEAEnrichmentException(Throwable cause, String nonParsableToken) {
9 | super(cause);
10 | this.nonParsableToken = nonParsableToken;
11 | }
12 |
13 | public String getNonParseableToken() {
14 | return nonParsableToken;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/parsers/RanksGeneMismatchException.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.parsers;
2 |
3 | @SuppressWarnings("serial")
4 | public class RanksGeneMismatchException extends RuntimeException {
5 |
6 | private final String ranksFileName;
7 |
8 | public RanksGeneMismatchException(String ranksFileName, String message) {
9 | super(message);
10 | this.ranksFileName = ranksFileName;
11 | }
12 |
13 | public String getRanksFileName() {
14 | return ranksFileName;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/parsers/RanksUnsortedException.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.parsers;
2 |
3 | @SuppressWarnings("serial")
4 | public class RanksUnsortedException extends RuntimeException {
5 |
6 | private final String ranksFileName;
7 |
8 | public RanksUnsortedException(String ranksFileName, String message) {
9 | super(message);
10 | this.ranksFileName = ranksFileName;
11 | }
12 |
13 | public String getRanksFileName() {
14 | return ranksFileName;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/resolver/CancelStatus.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.resolver;
2 |
3 | @FunctionalInterface
4 | public interface CancelStatus {
5 |
6 | public boolean isCancelled();
7 |
8 | public static CancelStatus notCancelable() {
9 | return new CancelStatus() {
10 | @Override public boolean isCancelled() { return false; }
11 | };
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/rest/ModelResource.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.rest;
2 |
3 | import javax.ws.rs.GET;
4 | import javax.ws.rs.Path;
5 | import javax.ws.rs.PathParam;
6 | import javax.ws.rs.Produces;
7 | import javax.ws.rs.core.MediaType;
8 | import javax.ws.rs.core.Response;
9 | import javax.ws.rs.core.Response.Status;
10 |
11 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap;
12 | import org.baderlab.csplugins.enrichmentmap.model.io.ModelSerializer;
13 |
14 | import com.google.inject.Inject;
15 |
16 | import io.swagger.annotations.Api;
17 | import io.swagger.annotations.ApiOperation;
18 | import io.swagger.annotations.ApiParam;
19 |
20 | @Api(tags="Apps: EnrichmentMap")
21 | @Path("/enrichmentmap/model")
22 | public class ModelResource {
23 |
24 | @Inject private ResourceUtil resourceUtil;
25 |
26 | @GET
27 | @ApiOperation(value="Get enrichment map model data for a given network.", response=EnrichmentMap.class)
28 | @Path("/{network}")
29 | @Produces(MediaType.APPLICATION_JSON)
30 | public Response getModelData(
31 | @ApiParam(value="Network name or SUID") @PathParam("network") String network
32 | ) {
33 | return
34 | resourceUtil.getEnrichmentMap(network)
35 | .map(this::getEnrichmentMapJSON)
36 | .map(data -> Response.ok(data).build())
37 | .orElse(Response.status(Status.NOT_FOUND).build());
38 | }
39 |
40 |
41 | private String getEnrichmentMapJSON(EnrichmentMap map) {
42 | // Don't rely on the auto json serialization because ModelSerializer needs to customize the GSON serializer.
43 | return ModelSerializer.serialize(map, true);
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/rest/ResourceUtil.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.rest;
2 |
3 | import java.util.Optional;
4 |
5 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap;
6 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMapManager;
7 | import org.cytoscape.model.CyNetwork;
8 | import org.cytoscape.model.CyNetworkManager;
9 |
10 | import com.google.inject.Inject;
11 |
12 | public class ResourceUtil {
13 |
14 | @Inject private EnrichmentMapManager emManager;
15 | @Inject private CyNetworkManager networkManager;
16 |
17 |
18 | public Optional getEnrichmentMap(String network) {
19 | try {
20 | long suid = Long.parseLong(network);
21 | return Optional.ofNullable(emManager.getEnrichmentMap(suid));
22 | } catch(NumberFormatException e) {
23 | Optional suid = getNetworkByName(network);
24 | return suid.map(emManager::getEnrichmentMap);
25 | }
26 | }
27 |
28 | private Optional getNetworkByName(String name) {
29 | for(CyNetwork network : networkManager.getNetworkSet()) {
30 | String netName = network.getRow(network).get(CyNetwork.NAME, String.class);
31 | if(name.equals(netName)) {
32 | return Optional.of(network.getSUID());
33 | }
34 | }
35 | return Optional.empty();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/rest/response/DataSetClassResponse.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.rest.response;
2 |
3 | import java.util.Arrays;
4 | import java.util.List;
5 |
6 | import org.baderlab.csplugins.enrichmentmap.model.EMDataSet;
7 |
8 | public class DataSetClassResponse {
9 |
10 | private final String dataSet;
11 | private final List classes;
12 | private final String phenotype1;
13 | private final String phenotype2;
14 |
15 | public DataSetClassResponse(EMDataSet dataSet) {
16 | this.dataSet = dataSet.getName();
17 | this.classes = Arrays.asList(dataSet.getEnrichments().getPhenotypes());
18 | this.phenotype1 = dataSet.getEnrichments().getPhenotype1();
19 | this.phenotype2 = dataSet.getEnrichments().getPhenotype2();
20 | }
21 |
22 | public String getDataSet() {
23 | return dataSet;
24 | }
25 |
26 | public List getClasses() {
27 | return classes;
28 | }
29 |
30 | public String getPhenotype1() {
31 | return phenotype1;
32 | }
33 |
34 | public String getPhenotype2() {
35 | return phenotype2;
36 | }
37 |
38 |
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/rest/response/DataSetExpressionResponse.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.rest.response;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Arrays;
5 | import java.util.List;
6 | import java.util.Optional;
7 | import java.util.Set;
8 | import java.util.function.Predicate;
9 |
10 | import org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap;
11 | import org.baderlab.csplugins.enrichmentmap.model.GeneExpressionMatrix;
12 |
13 | public class DataSetExpressionResponse {
14 |
15 | private List dataSets;
16 | private int numConditions;
17 | private List columnNames;
18 | private int expressionUniverse;
19 | private List expressions;
20 |
21 | public DataSetExpressionResponse(EnrichmentMap map, List dataSets, GeneExpressionMatrix matrix, Optional> genes) {
22 | this.dataSets = dataSets;
23 |
24 | Predicate geneFilter = genes.isPresent() ? genes.get()::contains : s -> true;
25 |
26 | numConditions = matrix.getNumConditions() - 2;
27 | String[] colsWithName = matrix.getColumnNames();
28 | columnNames = Arrays.asList(colsWithName).subList(2, colsWithName.length);
29 | expressionUniverse = matrix.getExpressionUniverse();
30 |
31 | expressions = new ArrayList<>();
32 |
33 | matrix.getExpressionMatrix().forEach((hash, geneExpression) -> {
34 | String geneName = map.getGeneFromHashKey(hash);
35 | if(geneFilter.test(geneName)) {
36 | float[] values = geneExpression.getExpression();
37 | expressions.add(new GeneExpressionResponse(geneName, values));
38 | }
39 | });
40 | }
41 |
42 | public List getDataSets() {
43 | return dataSets;
44 | }
45 |
46 | public List getExpressions() {
47 | return expressions;
48 | }
49 |
50 | public int getNumConditions() {
51 | return numConditions;
52 | }
53 |
54 | public List getColumnNames() {
55 | return columnNames;
56 | }
57 |
58 | public int getExpressionUniverse() {
59 | return expressionUniverse;
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/rest/response/GeneExpressionResponse.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.rest.response;
2 |
3 | public class GeneExpressionResponse {
4 |
5 | private String geneName;
6 | private float[] values;
7 |
8 | public GeneExpressionResponse(String geneName, float[] values) {
9 | this.geneName = geneName;
10 | this.values = values;
11 | }
12 |
13 | public String getGeneName() {
14 | return geneName;
15 | }
16 |
17 | public float[] getValues() {
18 | return values;
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/style/ChartData.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.style;
2 |
3 | import org.baderlab.csplugins.enrichmentmap.style.EMStyleBuilder.Columns;
4 | import org.baderlab.csplugins.enrichmentmap.view.util.Labels;
5 |
6 | public enum ChartData {
7 |
8 | NONE(Labels.NONE, null),
9 | NES_VALUE("NES Columns", Columns.NODE_NES),
10 | NES_SIG("NES Columns (significant)", Columns.NODE_NES),
11 | P_VALUE("P-value Columns", Columns.NODE_PVALUE),
12 | FDR_VALUE("Q-value (FDR) Columns", Columns.NODE_FDR_QVALUE),
13 | PHENOTYPES("Phenotypes", Columns.NODE_COLOURING),
14 | DATA_SET("Color by Data Set", Columns.DATASET_CHART),
15 | EXPRESSION_DATA("Color by Expression Data", Columns.EXPRESSION_DATA_CHART),
16 | LOG10_PVAL("-log10(pvalue)", Columns.NODE_LOG_PVALUE),
17 | LOG10_PVAL_NES("-log10(pvalue)*sign(NES)", Columns.NODE_LOG_PVALUE_NES);
18 |
19 | private final String label;
20 | private final AbstractColumnDescriptor columnDescriptor;
21 |
22 | private ChartData(String label, AbstractColumnDescriptor columnDescriptor) {
23 | this.label = label;
24 | this.columnDescriptor = columnDescriptor;
25 | }
26 |
27 | public String getLabel() {
28 | return label;
29 | }
30 |
31 | public AbstractColumnDescriptor getColumnDescriptor() {
32 | return columnDescriptor;
33 | }
34 |
35 | public boolean isChartTypeSelectable() {
36 | return this != NONE && this != DATA_SET && this != EXPRESSION_DATA;
37 | }
38 |
39 | /**
40 | * Returns true if the data range goes negative-zero-positive
41 | */
42 | public boolean isDiverging() {
43 | return this == NES_VALUE || this == NES_SIG || this == LOG10_PVAL_NES;
44 | }
45 |
46 | @Override
47 | public String toString() {
48 | return label;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/style/ChartFactoryManager.java:
--------------------------------------------------------------------------------
1 | package org.baderlab.csplugins.enrichmentmap.style;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import org.cytoscape.view.presentation.customgraphics.CyCustomGraphics2Factory;
7 |
8 | import com.google.inject.Singleton;
9 |
10 | @Singleton
11 | public class ChartFactoryManager {
12 |
13 | private Map> factories = new HashMap<>();
14 |
15 | public void addFactory(CyCustomGraphics2Factory> factory, Map