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