Search in sources :

Example 1 with CreateGMTEnrichmentMapTask

use of org.baderlab.csplugins.enrichmentmap.task.CreateGMTEnrichmentMapTask in project EnrichmentMapApp by BaderLab.

the class DetermineEnrichmentResultFileReader method getParsers.

/**
	 * Parse Enrichment results file
	 */
public TaskIterator getParsers() {
    String enrichmentsFileName1 = dataset.getEnrichments().getFilename1();
    String enrichmentsFileName2 = dataset.getEnrichments().getFilename2();
    TaskIterator parserTasks = new TaskIterator();
    try {
        if (!Strings.isNullOrEmpty(enrichmentsFileName1)) {
            AbstractTask current = readFile(enrichmentsFileName1);
            if (current instanceof ParseGREATEnrichmentResults)
                parserTasks.append(new GREATWhichPvalueQuestionTask(dataset.getMap()));
            parserTasks.append(current);
        }
        if (!Strings.isNullOrEmpty(enrichmentsFileName2)) {
            parserTasks.append(readFile(enrichmentsFileName2));
        }
        //If both of the enrichment files are null then we want to default to building a gmt file only build
        if (Strings.isNullOrEmpty(enrichmentsFileName1) && Strings.isNullOrEmpty(enrichmentsFileName2)) {
            parserTasks.append(new CreateGMTEnrichmentMapTask(dataset));
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    return parserTasks;
}
Also used : TaskIterator(org.cytoscape.work.TaskIterator) AbstractTask(org.cytoscape.work.AbstractTask) CreateGMTEnrichmentMapTask(org.baderlab.csplugins.enrichmentmap.task.CreateGMTEnrichmentMapTask) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 CreateGMTEnrichmentMapTask (org.baderlab.csplugins.enrichmentmap.task.CreateGMTEnrichmentMapTask)1 AbstractTask (org.cytoscape.work.AbstractTask)1 TaskIterator (org.cytoscape.work.TaskIterator)1