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());
}
Aggregations