Search in sources :

Example 1 with ParseEDBEnrichmentResults

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

the class LoadEdbDatasetTest method testEdbLoad.

@Test
public void testEdbLoad() throws Exception {
    //for a dataset we require genesets, an expression file (optional), enrichment results
    String testEdbResultsFileName = "src/test/resources/org/baderlab/csplugins/enrichmentmap/task/LoadDataset/GSEA_example_results/edb/results.edb";
    String testgmtFileName = "src/test/resources/org/baderlab/csplugins/enrichmentmap/task/LoadDataset/GSEA_example_results/edb/gene_sets.gmt";
    String testrnkFileName = "src/test/resources/org/baderlab/csplugins/enrichmentmap/task/LoadDataset/GSEA_example_results/edb/Expressionfile.rnk";
    DataSetFiles files = new DataSetFiles();
    files.setEnrichmentFileName1(testEdbResultsFileName);
    files.setGMTFileName(testgmtFileName);
    files.setRankedFile(testrnkFileName);
    //set the method to gsea
    double similarityCutoff = 0.5;
    double pvalue = 1.0;
    double qvalue = 1.0;
    EMCreationParameters params = new EMCreationParameters("EM1_", pvalue, qvalue, NESFilter.ALL, Optional.empty(), SimilarityMetric.JACCARD, similarityCutoff, 0.5);
    //create an new enrichment Map
    EnrichmentMap em = new EnrichmentMap(params, serviceRegistrar);
    //Load data set
    //create a dataset
    EMDataSet dataset = em.createDataSet(LegacySupport.DATASET1, Method.GSEA, files);
    //create a DatasetTask
    //create a DatasetTask
    //load Data
    GMTFileReaderTask task = new GMTFileReaderTask(dataset);
    task.run(taskMonitor);
    ParseEDBEnrichmentResults enrichmentResultsFilesTask = new ParseEDBEnrichmentResults(dataset);
    enrichmentResultsFilesTask.run(taskMonitor);
    //create dummy expression
    CreateDummyExpressionTask dummyExpressionTask = new CreateDummyExpressionTask(dataset);
    dummyExpressionTask.run(taskMonitor);
    em.filterGenesets();
    InitializeGenesetsOfInterestTask genesets_init = new InitializeGenesetsOfInterestTask(em);
    genesets_init.run(taskMonitor);
    //check to see if the dataset loaded
    //although the original analysis had 193 genesets because this is loaded from
    //edb version it only stores the genesets that overlapped with the dataset analyzed.
    assertEquals(14, dataset.getSetOfGeneSets().getGeneSets().size());
    assertEquals(14, dataset.getEnrichments().getEnrichments().size());
    assertEquals(41, dataset.getDataSetGenes().size());
    assertEquals(41, dataset.getExpressionSets().getNumGenes());
}
Also used : EMCreationParameters(org.baderlab.csplugins.enrichmentmap.model.EMCreationParameters) ParseEDBEnrichmentResults(org.baderlab.csplugins.enrichmentmap.parsers.ParseEDBEnrichmentResults) EMDataSet(org.baderlab.csplugins.enrichmentmap.model.EMDataSet) EnrichmentMap(org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap) GMTFileReaderTask(org.baderlab.csplugins.enrichmentmap.parsers.GMTFileReaderTask) DataSetFiles(org.baderlab.csplugins.enrichmentmap.model.DataSetFiles) Test(org.junit.Test)

Aggregations

DataSetFiles (org.baderlab.csplugins.enrichmentmap.model.DataSetFiles)1 EMCreationParameters (org.baderlab.csplugins.enrichmentmap.model.EMCreationParameters)1 EMDataSet (org.baderlab.csplugins.enrichmentmap.model.EMDataSet)1 EnrichmentMap (org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap)1 GMTFileReaderTask (org.baderlab.csplugins.enrichmentmap.parsers.GMTFileReaderTask)1 ParseEDBEnrichmentResults (org.baderlab.csplugins.enrichmentmap.parsers.ParseEDBEnrichmentResults)1 Test (org.junit.Test)1