@@ -29,13 +29,11 @@ public class CreateDiseaseSignatureTaskFactory extends AbstractTaskFactory {
29
29
@ Inject private Provider <ControlPanelMediator > controlPanelMediatorProvider ;
30
30
@ Inject private ApplyEMStyleTask .Factory applyStyleTaskFactory ;
31
31
32
-
33
32
private String errors = null ;
34
33
35
34
private final CyNetworkView netView ;
36
35
private final PostAnalysisParameters params ;
37
36
38
-
39
37
public interface Factory {
40
38
CreateDiseaseSignatureTaskFactory create (CyNetworkView netView , PostAnalysisParameters params );
41
39
}
@@ -54,16 +52,17 @@ public String getErrors() {
54
52
public TaskIterator createTaskIterator () {
55
53
// Make sure that the minimum information is set in the current set of parameters
56
54
EnrichmentMap map = emManager .getEnrichmentMap (netView .getModel ().getSUID ());
57
-
58
55
StringBuilder errorBuilder = new StringBuilder ();
59
56
checkMinimalRequirements (errorBuilder , params );
57
+
60
58
if (params .getRankTestParameters ().getType ().isMannWhitney () && map .getAllRanks ().isEmpty ())
61
59
errorBuilder .append ("Mann-Whitney requires ranks. \n " );
62
60
63
- this . errors = errorBuilder .toString ();
61
+ errors = errorBuilder .toString ();
64
62
65
- if (errors .isEmpty ()) {
63
+ if (errors .isEmpty ()) {
66
64
ControlPanelMediator controlPanelMediator = controlPanelMediatorProvider .get ();
65
+
67
66
EMStyleOptions options = controlPanelMediator .createStyleOptions (netView );
68
67
options .setPostAnalysis (true );
69
68
@@ -73,6 +72,7 @@ public TaskIterator createTaskIterator() {
73
72
TaskIterator tasks = new TaskIterator ();
74
73
tasks .append (signatureTaskFactory .create (params , map , dataSetList ));
75
74
tasks .append (applyStyleTaskFactory .create (options , chart , false ));
75
+
76
76
return tasks ;
77
77
} else {
78
78
// MKTODO not entirely sure what to do in this case, just return an empty iterator I guess...
@@ -85,12 +85,10 @@ public void run(TaskMonitor taskMonitor) throws Exception {
85
85
}
86
86
}
87
87
88
-
89
88
private List <EMDataSet > getDataSets (EnrichmentMap map ) {
90
89
return params .getDataSetName ().map (map ::getDataSet ).map (Arrays ::asList ).orElseGet (map ::getDataSetList );
91
90
}
92
91
93
-
94
92
/**
95
93
* Checks all values of the PostAnalysisInputPanel
96
94
*
@@ -103,18 +101,19 @@ public void checkMinimalRequirements(StringBuilder errors, PostAnalysisParameter
103
101
errors .append ("No Signature Genesets selected \n " );
104
102
}
105
103
}
106
-
107
104
108
105
/**
109
106
* Checks if SignatureGMTFileName is provided and if the file can be read.
110
107
*
111
- * @return String with error messages (one error per line) or empty String
112
- * if everything is okay.
108
+ * @return String with error messages (one error per line) or empty String if everything is okay.
113
109
*/
114
110
public String checkGMTfiles (PostAnalysisParameters params ) {
115
111
String signatureGMTFileName = params .getSignatureGMTFileName ();
116
- if (signatureGMTFileName == null || signatureGMTFileName .isEmpty () || !EnrichmentMapParameters .checkFile (signatureGMTFileName ))
112
+
113
+ if (signatureGMTFileName == null || signatureGMTFileName .isEmpty ()
114
+ || !EnrichmentMapParameters .checkFile (signatureGMTFileName ))
117
115
return "Signature GMT file can not be found \n " ;
116
+
118
117
return "" ;
119
118
}
120
119
}
0 commit comments