Skip to content

Commit a94f8b9

Browse files
committed
Refs #172. Params to gesabuild command should be optional.
1 parent 4a26eeb commit a94f8b9

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/commands/EMGseaCommandTask.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.cytoscape.work.Tunable;
2222
import org.cytoscape.work.util.ListSingleSelection;
2323

24+
import com.google.common.base.Strings;
2425
import com.google.inject.Inject;
2526

2627
/**
@@ -43,17 +44,17 @@ public class EMGseaCommandTask extends AbstractTask {
4344
@Tunable(description="overlap", groups={"User Input","Parameters"}, gravity = 19.0, tooltip="coeffecient between 0 and 1.")
4445
public Double overlap = 0.25;
4546

46-
@Tunable(description="similaritymetric", groups={"User Input","Parameters"}, gravity = 20.0, tooltip="coeffecient between 0 and 1.")
47+
@Tunable(description="similaritymetric", groups={"User Input","Parameters"}, gravity = 20.0, tooltip="JACCARD, OVERLAP or COMBINED. Default is OVERLAP.")
4748
public ListSingleSelection<String> similaritymetric;
4849

4950
@Tunable(description="expressionfile")
50-
public String expressionfile = "expressionfile";
51+
public String expressionfile = "";
5152

5253
@Tunable(description="expressionfile2")
53-
public String expressionfile2 = "expressionfile2";
54+
public String expressionfile2 = "";
5455

55-
@Tunable(description="combinedconstant ", groups={"User Input","Parameters"}, gravity = 19.0, tooltip="coeffecient between 0 and 1.")
56-
public Double combinedconstant ;
56+
@Tunable(description="combinedconstant ", groups={"User Input","Parameters"}, gravity = 19.0, tooltip="Value between 0 and 1, only used when the similaritymetric is OVERLAP, default is 0.5.")
57+
public Double combinedconstant = 0.5;
5758

5859

5960
@Inject private CreateEnrichmentMapTaskFactory.Factory taskFactoryFactory;
@@ -64,8 +65,8 @@ public EMGseaCommandTask() {
6465
similaritymetric = new ListSingleSelection<String>(EnrichmentMapParameters.SM_OVERLAP, EnrichmentMapParameters.SM_JACCARD, EnrichmentMapParameters.SM_COMBINED);
6566
}
6667

67-
68-
private void buildEnrichmentMap(){
68+
@Override
69+
public void run(TaskMonitor taskMonitor) throws Exception {
6970
//set all files as extracted from the edb directory
7071
List<DataSetParameters> dataSets = new ArrayList<>(2);
7172
DataSetFiles files1 = initializeFiles(edbdir, expressionfile);
@@ -111,17 +112,15 @@ else if(dir_listing[i].endsWith("rnk") && !testrnkFileName.equals(""))
111112
DataSetFiles files = new DataSetFiles();
112113
files.setEnrichmentFileName1(testEdbResultsFileName);
113114
files.setGMTFileName(testgmtFileName);
114-
if(!testrnkFileName.equals(""))
115+
116+
if(!Strings.isNullOrEmpty(testrnkFileName)) {
115117
files.setRankedFile(testrnkFileName);
116-
if(!exp.equals("")){
118+
}
119+
if(!Strings.isNullOrEmpty(exp)){
117120
files.setExpressionFileName(exp);
118121
}
122+
119123
return files;
120124
}
121125

122-
@Override
123-
public void run(TaskMonitor taskMonitor) throws Exception {
124-
buildEnrichmentMap();
125-
}
126-
127126
}

0 commit comments

Comments
 (0)