Skip to content

Commit 1215b6f

Browse files
committed
Minor code reformatting.
1 parent 10af931 commit 1215b6f

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/task/postanalysis/CreateDiseaseSignatureTaskFactory.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ public class CreateDiseaseSignatureTaskFactory extends AbstractTaskFactory {
2929
@Inject private Provider<ControlPanelMediator> controlPanelMediatorProvider;
3030
@Inject private ApplyEMStyleTask.Factory applyStyleTaskFactory;
3131

32-
3332
private String errors = null;
3433

3534
private final CyNetworkView netView;
3635
private final PostAnalysisParameters params;
3736

38-
3937
public interface Factory {
4038
CreateDiseaseSignatureTaskFactory create(CyNetworkView netView, PostAnalysisParameters params);
4139
}
@@ -54,16 +52,17 @@ public String getErrors() {
5452
public TaskIterator createTaskIterator() {
5553
// Make sure that the minimum information is set in the current set of parameters
5654
EnrichmentMap map = emManager.getEnrichmentMap(netView.getModel().getSUID());
57-
5855
StringBuilder errorBuilder = new StringBuilder();
5956
checkMinimalRequirements(errorBuilder, params);
57+
6058
if (params.getRankTestParameters().getType().isMannWhitney() && map.getAllRanks().isEmpty())
6159
errorBuilder.append("Mann-Whitney requires ranks. \n");
6260

63-
this.errors = errorBuilder.toString();
61+
errors = errorBuilder.toString();
6462

65-
if(errors.isEmpty()) {
63+
if (errors.isEmpty()) {
6664
ControlPanelMediator controlPanelMediator = controlPanelMediatorProvider.get();
65+
6766
EMStyleOptions options = controlPanelMediator.createStyleOptions(netView);
6867
options.setPostAnalysis(true);
6968

@@ -73,6 +72,7 @@ public TaskIterator createTaskIterator() {
7372
TaskIterator tasks = new TaskIterator();
7473
tasks.append(signatureTaskFactory.create(params, map, dataSetList));
7574
tasks.append(applyStyleTaskFactory.create(options, chart, false));
75+
7676
return tasks;
7777
} else {
7878
// 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 {
8585
}
8686
}
8787

88-
8988
private List<EMDataSet> getDataSets(EnrichmentMap map) {
9089
return params.getDataSetName().map(map::getDataSet).map(Arrays::asList).orElseGet(map::getDataSetList);
9190
}
9291

93-
9492
/**
9593
* Checks all values of the PostAnalysisInputPanel
9694
*
@@ -103,18 +101,19 @@ public void checkMinimalRequirements(StringBuilder errors, PostAnalysisParameter
103101
errors.append("No Signature Genesets selected \n");
104102
}
105103
}
106-
107104

108105
/**
109106
* Checks if SignatureGMTFileName is provided and if the file can be read.
110107
*
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.
113109
*/
114110
public String checkGMTfiles(PostAnalysisParameters params) {
115111
String signatureGMTFileName = params.getSignatureGMTFileName();
116-
if(signatureGMTFileName == null || signatureGMTFileName.isEmpty() || !EnrichmentMapParameters.checkFile(signatureGMTFileName))
112+
113+
if (signatureGMTFileName == null || signatureGMTFileName.isEmpty()
114+
|| !EnrichmentMapParameters.checkFile(signatureGMTFileName))
117115
return "Signature GMT file can not be found \n";
116+
118117
return "";
119118
}
120119
}

0 commit comments

Comments
 (0)