Search in sources :

Example 6 with GMTFileReaderTask

use of org.baderlab.csplugins.enrichmentmap.parsers.GMTFileReaderTask in project EnrichmentMapApp by BaderLab.

the class GeneSetSimilarityTest method before.

@Before
public void before(Provider<EnrichmentMapParameters> empFactory) throws Exception {
    //load Genesets from the gmt file associated with this test
    String testDataFileName = "src/test/resources/org/baderlab/csplugins/enrichmentmap/model/Genesetstestfile.gmt";
    //create a new instance of the parameters
    EnrichmentMapParameters params = empFactory.get();
    //set gmt file name 
    params.getFiles().get(LegacySupport.DATASET1).setGMTFileName(testDataFileName);
    //Create a new Enrichment map
    map = new EnrichmentMap(params.getCreationParameters(), serviceRegistrar);
    Method method = EnrichmentMapParameters.stringToMethod(params.getMethod());
    DataSetFiles files = params.getFiles().get(LegacySupport.DATASET1);
    dataset = map.createDataSet(LegacySupport.DATASET1, method, files);
    //set up task
    GMTFileReaderTask task = new GMTFileReaderTask(dataset);
    task.run(taskMonitor);
    this.dataset.setGeneSetsOfInterest(this.dataset.getSetOfGeneSets());
}
Also used : Method(org.baderlab.csplugins.enrichmentmap.model.EMDataSet.Method) GMTFileReaderTask(org.baderlab.csplugins.enrichmentmap.parsers.GMTFileReaderTask) Before(org.junit.Before)

Example 7 with GMTFileReaderTask

use of org.baderlab.csplugins.enrichmentmap.parsers.GMTFileReaderTask in project EnrichmentMapApp by BaderLab.

the class LoadSignatureGMTFilesTask method createTaskIterator.

@Override
public TaskIterator createTaskIterator() {
    TaskIterator tasks = new TaskIterator();
    String name = file.getName();
    if (name.toLowerCase().endsWith(FILE_EXT))
        name = name.substring(0, name.length() - FILE_EXT.length()).trim();
    // this is an out-paramter for GMTFileReaderTask and an in-parameter for FilterSignatureGSTask
    // MKTODO: find a better way to pass data from one task to another
    // doesn't this need to be made available to paParams?
    SetOfGeneSets setOfGeneSets = new SetOfGeneSets(name);
    tasks.append(new GMTFileReaderTask(map, file.getAbsolutePath(), setOfGeneSets));
    tasks.append(new FilterSignatureGSTask(map, setOfGeneSets, filterMetric));
    return tasks;
}
Also used : TaskIterator(org.cytoscape.work.TaskIterator) SetOfGeneSets(org.baderlab.csplugins.enrichmentmap.model.SetOfGeneSets) GMTFileReaderTask(org.baderlab.csplugins.enrichmentmap.parsers.GMTFileReaderTask)

Aggregations

GMTFileReaderTask (org.baderlab.csplugins.enrichmentmap.parsers.GMTFileReaderTask)7 DataSetFiles (org.baderlab.csplugins.enrichmentmap.model.DataSetFiles)4 EMDataSet (org.baderlab.csplugins.enrichmentmap.model.EMDataSet)4 EnrichmentMap (org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap)4 EMCreationParameters (org.baderlab.csplugins.enrichmentmap.model.EMCreationParameters)3 Method (org.baderlab.csplugins.enrichmentmap.model.EMDataSet.Method)3 Test (org.junit.Test)3 Map (java.util.Map)2 ExpressionFileReaderTask (org.baderlab.csplugins.enrichmentmap.parsers.ExpressionFileReaderTask)2 Baton (org.baderlab.csplugins.enrichmentmap.util.Baton)2 TaskIterator (org.cytoscape.work.TaskIterator)2 Before (org.junit.Before)2 SetOfGeneSets (org.baderlab.csplugins.enrichmentmap.model.SetOfGeneSets)1 ClassFileReaderTask (org.baderlab.csplugins.enrichmentmap.parsers.ClassFileReaderTask)1 DetermineEnrichmentResultFileReader (org.baderlab.csplugins.enrichmentmap.parsers.DetermineEnrichmentResultFileReader)1 ParseEDBEnrichmentResults (org.baderlab.csplugins.enrichmentmap.parsers.ParseEDBEnrichmentResults)1 ParseGSEAEnrichmentResults (org.baderlab.csplugins.enrichmentmap.parsers.ParseGSEAEnrichmentResults)1 RanksFileReaderTask (org.baderlab.csplugins.enrichmentmap.parsers.RanksFileReaderTask)1 DataSetParameters (org.baderlab.csplugins.enrichmentmap.resolver.DataSetParameters)1