use of org.baderlab.csplugins.enrichmentmap.task.postanalysis.LoadSignatureGMTFilesTask in project EnrichmentMapApp by BaderLab.
the class LoadSignatureSetsActionListener method actionPerformed.
@Override
public void actionPerformed(ActionEvent event) {
// make sure that the minimum information is set in the current set of parameters
if (file.canRead()) {
// MKTODO warning LoadSignatureGMTFilesTask is side-effecting, it pulls the loaded genes into the EnrichmentMap object
LoadSignatureGMTFilesTask loadGMTs = new LoadSignatureGMTFilesTask(file, map, filterMetric);
TaskObserver taskObserver = new ResultTaskObserver() {
private SetOfGeneSets resultGeneSets;
private Set<String> filteredSignatureSets;
@Override
public void taskFinished(ObservableTask task) {
if (task instanceof FilterSignatureGSTask) {
resultGeneSets = task.getResults(SetOfGeneSets.class);
filteredSignatureSets = task.getResults(Set.class);
}
}
@Override
public void allFinished(FinishStatus finishStatus) {
geneSetCallback.accept(resultGeneSets);
filteredSignatureSetsCallback.accept(filteredSignatureSets);
}
};
taskManager.execute(loadGMTs.createTaskIterator(), taskObserver);
} else {
JOptionPane.showMessageDialog(application.getJFrame(), "Signature GMT file name not valid.\n", "Invalid File", JOptionPane.WARNING_MESSAGE);
}
}
Aggregations