Search in sources :

Example 1 with FilterSignatureGSTask

use of org.baderlab.csplugins.enrichmentmap.task.postanalysis.FilterSignatureGSTask 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);
    }
}
Also used : ResultTaskObserver(org.baderlab.csplugins.enrichmentmap.util.ResultTaskObserver) TaskObserver(org.cytoscape.work.TaskObserver) ObservableTask(org.cytoscape.work.ObservableTask) ResultTaskObserver(org.baderlab.csplugins.enrichmentmap.util.ResultTaskObserver) FilterSignatureGSTask(org.baderlab.csplugins.enrichmentmap.task.postanalysis.FilterSignatureGSTask) LoadSignatureGMTFilesTask(org.baderlab.csplugins.enrichmentmap.task.postanalysis.LoadSignatureGMTFilesTask) Set(java.util.Set) FinishStatus(org.cytoscape.work.FinishStatus) SetOfGeneSets(org.baderlab.csplugins.enrichmentmap.model.SetOfGeneSets)

Aggregations

Set (java.util.Set)1 SetOfGeneSets (org.baderlab.csplugins.enrichmentmap.model.SetOfGeneSets)1 FilterSignatureGSTask (org.baderlab.csplugins.enrichmentmap.task.postanalysis.FilterSignatureGSTask)1 LoadSignatureGMTFilesTask (org.baderlab.csplugins.enrichmentmap.task.postanalysis.LoadSignatureGMTFilesTask)1 ResultTaskObserver (org.baderlab.csplugins.enrichmentmap.util.ResultTaskObserver)1 FinishStatus (org.cytoscape.work.FinishStatus)1 ObservableTask (org.cytoscape.work.ObservableTask)1 TaskObserver (org.cytoscape.work.TaskObserver)1