Skip to content

Commit 9c84b5d

Browse files
committed
Removed global GMT. Refactored mastermap dialog.
1 parent b302cd4 commit 9c84b5d

File tree

12 files changed

+372
-378
lines changed

12 files changed

+372
-378
lines changed

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/ApplicationModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
import org.baderlab.csplugins.enrichmentmap.view.heatmap.HeatMapMainPanel;
2121
import org.baderlab.csplugins.enrichmentmap.view.heatmap.HeatMapParentPanel;
2222
import org.baderlab.csplugins.enrichmentmap.view.heatmap.table.ColumnHeaderRankOptionRenderer;
23-
import org.baderlab.csplugins.enrichmentmap.view.mastermap.EditCommonPropertiesPanel;
2423
import org.baderlab.csplugins.enrichmentmap.view.mastermap.EditDataSetPanel;
2524
import org.baderlab.csplugins.enrichmentmap.view.mastermap.ErrorMessageDialog;
25+
import org.baderlab.csplugins.enrichmentmap.view.mastermap.PathTextField;
2626
import org.baderlab.csplugins.enrichmentmap.view.postanalysis.PostAnalysisInputPanel;
2727
import org.baderlab.csplugins.enrichmentmap.view.postanalysis.PostAnalysisKnownSignaturePanel;
2828
import org.baderlab.csplugins.enrichmentmap.view.postanalysis.PostAnalysisSignatureDiscoveryPanel;
@@ -86,9 +86,9 @@ protected void configure() {
8686
installFactory(ExportTXTAction.Factory.class);
8787
installFactory(AddRanksDialog.Factory.class);
8888
installFactory(EditDataSetPanel.Factory.class);
89-
installFactory(EditCommonPropertiesPanel.Factory.class);
9089
installFactory(ErrorMessageDialog.Factory.class);
9190
installFactory(ColumnHeaderRankOptionRenderer.Factory.class);
91+
installFactory(PathTextField.Factory.class);
9292
}
9393

9494
private void installFactory(Class<?> factoryInterface) {

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/EMCreationParameters.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.baderlab.csplugins.enrichmentmap.model;
22

3-
import java.nio.file.Path;
43
import java.util.HashSet;
54
import java.util.Optional;
65
import java.util.Set;
@@ -40,8 +39,6 @@ public static enum GreatFilter {
4039
private boolean createDistinctEdges;
4140
private String enrichmentEdgeType = "Geneset_Overlap";
4241

43-
private Path globalGmtFile;
44-
4542
private final Set<String> pValueColumnNames = new HashSet<>();
4643
private final Set<String> qValueColumnNames = new HashSet<>();
4744
private final Set<String> similarityCutoffColumnNames = new HashSet<>();
@@ -67,14 +64,6 @@ public EMCreationParameters(
6764
this.combinedConstant = combinedConstant;
6865
}
6966

70-
public void setGlobalGmtFile(Path path) {
71-
this.globalGmtFile = path;
72-
}
73-
74-
public Path getGlobalGmtFile() {
75-
return globalGmtFile;
76-
}
77-
7867
public String getAttributePrefix() {
7968
return attributePrefix;
8069
}

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/model/EnrichmentMap.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ public class EnrichmentMap {
4545
/** Post analysis signature genesets associated with this map.*/
4646
private Map<String, EMSignatureDataSet> signatureDataSets = new HashMap<>();
4747

48-
private SetOfGeneSets globalGenesets = new SetOfGeneSets();
49-
5048
private int NumberOfGenes = 0;
5149
private boolean isLegacy = false;
5250
private boolean isDistinctExpressionSets = false;
@@ -222,8 +220,6 @@ public Map<String, GeneSet> getAllGeneSets() {
222220
Map<String, GeneSet> allGeneSets = new HashMap<>();
223221

224222
synchronized (lock) {
225-
allGeneSets.putAll(globalGenesets.getGeneSets());
226-
227223
// If a GeneSet appears in more than one DataSet, then its totally arbitrary which version of it gets picked
228224
// If a GeneSet appears in an enrichment file it will override the one with the same name in the global GMT file
229225
for (EMDataSet ds : dataSets.values()) {
@@ -300,20 +296,14 @@ public Set<String> getAllGeneSetOfInterestNames() {
300296
}
301297

302298
public String findGeneSetDescription(String genesetName) {
303-
GeneSet gs = globalGenesets.getGeneSets().get(genesetName);
304-
if(gs != null)
305-
return gs.getDescription();
306299
for(EMDataSet ds : dataSets.values()) {
307-
gs = ds.getGeneSetsOfInterest().getGeneSets().get(genesetName);
300+
GeneSet gs = ds.getGeneSetsOfInterest().getGeneSets().get(genesetName);
308301
if(gs != null)
309302
return gs.getDescription();
310303
}
311304
return null;
312305
}
313306

314-
public SetOfGeneSets getGlobalGenesets() {
315-
return globalGenesets;
316-
}
317307

318308
public Map<String, EMDataSet> getDataSets() {
319309
return dataSets;

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/parsers/ParseGenericEnrichmentResults.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void parseLines(List<String> lines, EMDataSet dataset, TaskMonitor taskMo
2828

2929
//Get the current genesets so we can check that all the results are in the geneset list
3030
//and put the size of the genesets into the visual style
31-
Map<String, GeneSet> genesets = dataset.getMap().getGlobalGenesets().getGeneSets();
31+
Map<String, GeneSet> genesets = dataset.getSetOfGeneSets().getGeneSets();
3232

3333
int currentProgress = 0;
3434
int maxValue = lines.size();

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/task/CreateEnrichmentMapTaskFactory.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ public TaskIterator createTaskIterator() {
5757

5858
EnrichmentMap map = new EnrichmentMap(params, serviceRegistrar);
5959

60-
// Load global GMT file into each dataset
61-
if(params.getGlobalGmtFile() != null) {
62-
tasks.append(new GMTFileReaderTask(map, params.getGlobalGmtFile().toString(), map.getGlobalGenesets()));
63-
}
64-
6560
for(DataSetParameters dataSetParameters : dataSets) {
6661
String datasetName = dataSetParameters.getName();
6762
Method method = dataSetParameters.getMethod();
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
package org.baderlab.csplugins.enrichmentmap.view.mastermap;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
6+
import javax.swing.GroupLayout;
7+
import javax.swing.GroupLayout.Alignment;
8+
import javax.swing.JPanel;
9+
10+
import org.baderlab.csplugins.enrichmentmap.AfterInjection;
11+
import org.baderlab.csplugins.enrichmentmap.view.util.FileBrowser;
12+
import org.cytoscape.util.swing.IconManager;
13+
import org.cytoscape.util.swing.LookAndFeelUtil;
14+
15+
import com.google.inject.Inject;
16+
17+
@SuppressWarnings("serial")
18+
public class EditCommonPanel extends JPanel implements DetailPanel {
19+
20+
@Inject private PathTextField.Factory pathTextFactory;
21+
22+
private PathTextField gmtText;
23+
private PathTextField expressionsText;
24+
25+
26+
@Override
27+
public String getIcon() {
28+
return IconManager.ICON_FILE_O;
29+
}
30+
31+
@Override
32+
public String getDisplayName() {
33+
return "Common Files";
34+
}
35+
36+
@Override
37+
public JPanel getPanel() {
38+
return this;
39+
}
40+
41+
@AfterInjection
42+
private void createContents() {
43+
gmtText = pathTextFactory.create("GMT File:", FileBrowser.Filter.GMT);
44+
expressionsText = pathTextFactory.create("Expressions:", FileBrowser.Filter.EXPRESSION);
45+
46+
GroupLayout layout = new GroupLayout(this);
47+
setLayout(layout);
48+
layout.setAutoCreateContainerGaps(true);
49+
layout.setAutoCreateGaps(true);
50+
51+
layout.setHorizontalGroup(
52+
layout.createSequentialGroup()
53+
.addGroup(layout.createParallelGroup(Alignment.TRAILING)
54+
.addComponent(gmtText.getLabel())
55+
.addComponent(expressionsText.getLabel())
56+
)
57+
.addGroup(layout.createParallelGroup(Alignment.LEADING, true)
58+
.addComponent(gmtText.getTextField())
59+
.addComponent(expressionsText.getTextField())
60+
)
61+
.addGroup(layout.createParallelGroup()
62+
.addComponent(gmtText.getBrowseButton())
63+
.addComponent(expressionsText.getBrowseButton())
64+
)
65+
);
66+
67+
layout.setVerticalGroup(
68+
layout.createSequentialGroup()
69+
.addGroup(layout.createParallelGroup(Alignment.BASELINE)
70+
.addComponent(gmtText.getLabel())
71+
.addComponent(gmtText.getTextField())
72+
.addComponent(gmtText.getBrowseButton())
73+
)
74+
.addGroup(layout.createParallelGroup(Alignment.BASELINE)
75+
.addComponent(expressionsText.getLabel())
76+
.addComponent(expressionsText.getTextField())
77+
.addComponent(expressionsText.getBrowseButton())
78+
)
79+
);
80+
81+
if(LookAndFeelUtil.isAquaLAF())
82+
setOpaque(false);
83+
}
84+
85+
86+
@Override
87+
public List<String> validateInput() {
88+
gmtText.hideError();
89+
expressionsText.hideError();
90+
91+
List<String> err = new ArrayList<>(2);
92+
if(!gmtText.emptyOrReadable())
93+
err.add(gmtText.showError("Enrichments file path is not valid."));
94+
if(!expressionsText.emptyOrReadable())
95+
err.add(expressionsText.showError("Enrichments 2 file path is not valid."));
96+
return err;
97+
}
98+
99+
100+
public String getGmtFile() {
101+
return gmtText.getText();
102+
}
103+
104+
public String getExpressionFile() {
105+
return expressionsText.getText();
106+
}
107+
108+
}

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/view/mastermap/EditCommonPropertiesPanel.java

Lines changed: 0 additions & 150 deletions
This file was deleted.

0 commit comments

Comments
 (0)