21
21
import org .cytoscape .work .Tunable ;
22
22
import org .cytoscape .work .util .ListSingleSelection ;
23
23
24
+ import com .google .common .base .Strings ;
24
25
import com .google .inject .Inject ;
25
26
26
27
/**
@@ -43,17 +44,17 @@ public class EMGseaCommandTask extends AbstractTask {
43
44
@ Tunable (description ="overlap" , groups ={"User Input" ,"Parameters" }, gravity = 19.0 , tooltip ="coeffecient between 0 and 1." )
44
45
public Double overlap = 0.25 ;
45
46
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 ." )
47
48
public ListSingleSelection <String > similaritymetric ;
48
49
49
50
@ Tunable (description ="expressionfile" )
50
- public String expressionfile = "expressionfile " ;
51
+ public String expressionfile = "" ;
51
52
52
53
@ Tunable (description ="expressionfile2" )
53
- public String expressionfile2 = "expressionfile2 " ;
54
+ public String expressionfile2 = "" ;
54
55
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 ;
57
58
58
59
59
60
@ Inject private CreateEnrichmentMapTaskFactory .Factory taskFactoryFactory ;
@@ -64,8 +65,8 @@ public EMGseaCommandTask() {
64
65
similaritymetric = new ListSingleSelection <String >(EnrichmentMapParameters .SM_OVERLAP , EnrichmentMapParameters .SM_JACCARD , EnrichmentMapParameters .SM_COMBINED );
65
66
}
66
67
67
-
68
- private void buildEnrichmentMap () {
68
+ @ Override
69
+ public void run ( TaskMonitor taskMonitor ) throws Exception {
69
70
//set all files as extracted from the edb directory
70
71
List <DataSetParameters > dataSets = new ArrayList <>(2 );
71
72
DataSetFiles files1 = initializeFiles (edbdir , expressionfile );
@@ -111,17 +112,15 @@ else if(dir_listing[i].endsWith("rnk") && !testrnkFileName.equals(""))
111
112
DataSetFiles files = new DataSetFiles ();
112
113
files .setEnrichmentFileName1 (testEdbResultsFileName );
113
114
files .setGMTFileName (testgmtFileName );
114
- if (!testrnkFileName .equals ("" ))
115
+
116
+ if (!Strings .isNullOrEmpty (testrnkFileName )) {
115
117
files .setRankedFile (testrnkFileName );
116
- if (!exp .equals ("" )){
118
+ }
119
+ if (!Strings .isNullOrEmpty (exp )){
117
120
files .setExpressionFileName (exp );
118
121
}
122
+
119
123
return files ;
120
124
}
121
125
122
- @ Override
123
- public void run (TaskMonitor taskMonitor ) throws Exception {
124
- buildEnrichmentMap ();
125
- }
126
-
127
126
}
0 commit comments