use of org.baderlab.csplugins.enrichmentmap.model.EnrichmentMapParameters in project EnrichmentMapApp by BaderLab.
the class FileReaderTest method testExpression1ReaderCommentLines.
@Test
public void testExpression1ReaderCommentLines(Provider<EnrichmentMapParameters> empFactory) throws Exception {
//load the test expression file
String testDataFileName = "src/test/resources/org/baderlab/csplugins/enrichmentmap/Expressiontestfile_comments.gct";
//create a new instance of the parameters
EnrichmentMapParameters params = empFactory.get();
//set gmt file name
params.getFiles().get(LegacySupport.DATASET1).setExpressionFileName(testDataFileName);
//Create a new Enrichment map
EnrichmentMap map = new EnrichmentMap(params.getCreationParameters(), serviceRegistrar);
//get the default dataset
Method method = EnrichmentMapParameters.stringToMethod(params.getMethod());
DataSetFiles files = params.getFiles().get(LegacySupport.DATASET1);
EMDataSet dataset = map.createDataSet(LegacySupport.DATASET1, method, files);
//make sure that the genes are empty
assertEquals(0, map.getNumberOfGenes());
//add the gene to the master list of genes
map.addGene("GLS");
map.addGene("PSMA1");
map.addGene("ZP1");
map.addGene("ZYX");
//make sure all four genes have been associated
assertEquals(4, map.getNumberOfGenes());
//load expression file
ExpressionFileReaderTask task = new ExpressionFileReaderTask(dataset);
task.run(taskMonitor);
//There was one more gene in the expression file that wasn't in the set of genes
//make sure it was was added
assertEquals(4, map.getNumberOfGenes());
assertEquals(5.131481026, map.getDataSet(LegacySupport.DATASET1).getExpressionSets().getMaxExpression(), 0.0);
assertEquals(4, map.getDataSet(LegacySupport.DATASET1).getExpressionSets().getNumGenes());
assertEquals(59, map.getDataSet(LegacySupport.DATASET1).getExpressionSets().getNumConditions());
assertEquals(0.008720342, map.getDataSet(LegacySupport.DATASET1).getExpressionSets().getMinExpression(), 0.0);
}
Aggregations