Search in sources :

Example 1 with ParseGSEAEnrichmentResults

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

the class LoadDatasetTaskTest method testLoadDataset1GSEAResult_withexpression.

@Test
public void testLoadDataset1GSEAResult_withexpression() throws Exception {
    //for a dataset we require genesets, an expression file (optional), enrichment results
    String testGMTFileName = "src/test/resources/org/baderlab/csplugins/enrichmentmap/task/LoadDataset/gs_apop_mouse.gmt";
    String testExpressionFileName = "src/test/resources/org/baderlab/csplugins/enrichmentmap/task/LoadDataset/Expressiontestfile.gct";
    String testGSEAResults1FileName = "src/test/resources/org/baderlab/csplugins/enrichmentmap/task/LoadDataset/GSEA_enrichments1.xls";
    String testGSEAResults2FileName = "src/test/resources/org/baderlab/csplugins/enrichmentmap/task/LoadDataset/GSEA_enrichments2.xls";
    DataSetFiles files = new DataSetFiles();
    files.setGMTFileName(testGMTFileName);
    files.setExpressionFileName(testExpressionFileName);
    files.setEnrichmentFileName1(testGSEAResults1FileName);
    files.setEnrichmentFileName2(testGSEAResults2FileName);
    EMCreationParameters params = new EMCreationParameters("EM1_", 0.1, 0.1, NESFilter.ALL, Optional.empty(), SimilarityMetric.JACCARD, 0.1, 0.1);
    //create an new enrichment Map
    EnrichmentMap em = new EnrichmentMap(params, serviceRegistrar);
    //create a dataset
    EMDataSet dataset = em.createDataSet(LegacySupport.DATASET1, Method.Generic, files);
    //load Data
    GMTFileReaderTask task = new GMTFileReaderTask(dataset);
    task.run(taskMonitor);
    ParseGSEAEnrichmentResults enrichmentResultsFilesTask = new ParseGSEAEnrichmentResults(dataset);
    enrichmentResultsFilesTask.run(taskMonitor);
    //load expression file
    ExpressionFileReaderTask exptask = new ExpressionFileReaderTask(dataset);
    exptask.run(taskMonitor);
    //check to see if the dataset loaded
    assertEquals(193, 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) EMDataSet(org.baderlab.csplugins.enrichmentmap.model.EMDataSet) EnrichmentMap(org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap) GMTFileReaderTask(org.baderlab.csplugins.enrichmentmap.parsers.GMTFileReaderTask) ExpressionFileReaderTask(org.baderlab.csplugins.enrichmentmap.parsers.ExpressionFileReaderTask) DataSetFiles(org.baderlab.csplugins.enrichmentmap.model.DataSetFiles) ParseGSEAEnrichmentResults(org.baderlab.csplugins.enrichmentmap.parsers.ParseGSEAEnrichmentResults) 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 ExpressionFileReaderTask (org.baderlab.csplugins.enrichmentmap.parsers.ExpressionFileReaderTask)1 GMTFileReaderTask (org.baderlab.csplugins.enrichmentmap.parsers.GMTFileReaderTask)1 ParseGSEAEnrichmentResults (org.baderlab.csplugins.enrichmentmap.parsers.ParseGSEAEnrichmentResults)1 Test (org.junit.Test)1