Search in sources :

Example 1 with SerialTestTaskManager

use of org.baderlab.csplugins.enrichmentmap.integration.SerialTestTaskManager in project EnrichmentMapApp by BaderLab.

the class CreateEnrichmentMapTaskTest method buildEnrichmentMap.

protected void buildEnrichmentMap(EMCreationParameters params, DataSetFiles datasetFiles, String datasetName) {
    List<DataSetParameters> dataSets = Arrays.asList(new DataSetParameters(datasetName, Method.Generic, datasetFiles));
    CreateEnrichmentMapTaskFactory.Factory masterMapTaskFactoryFactory = injector.getInstance(CreateEnrichmentMapTaskFactory.Factory.class);
    CreateEnrichmentMapTaskFactory taskFactory = masterMapTaskFactoryFactory.create(params, dataSets);
    TaskIterator taskIterator = taskFactory.createTaskIterator();
    SerialTestTaskManager taskManager = new SerialTestTaskManager();
    taskManager.execute(taskIterator);
}
Also used : SerialTestTaskManager(org.baderlab.csplugins.enrichmentmap.integration.SerialTestTaskManager) CreateEnrichmentMapTaskFactory(org.baderlab.csplugins.enrichmentmap.task.CreateEnrichmentMapTaskFactory) TaskIterator(org.cytoscape.work.TaskIterator) DataSetParameters(org.baderlab.csplugins.enrichmentmap.resolver.DataSetParameters)

Example 2 with SerialTestTaskManager

use of org.baderlab.csplugins.enrichmentmap.integration.SerialTestTaskManager in project EnrichmentMapApp by BaderLab.

the class LegacySessionLoadTest method loadSessionFile.

@Before
public void loadSessionFile() throws Exception {
    java.lang.reflect.Method testMethod = getClass().getMethod(testName.getMethodName());
    SessionFile annotation = testMethod.getAnnotation(SessionFile.class);
    String fileName = annotation.value();
    assertNotNull(fileName);
    assertNotNull(openSessionTF);
    File sessionFile = TestUtils.createTempFile(PATH, fileName);
    TaskIterator tasks = openSessionTF.createTaskIterator(sessionFile);
    SerialTestTaskManager taskManager = new SerialTestTaskManager();
    taskManager.execute(tasks);
}
Also used : SerialTestTaskManager(org.baderlab.csplugins.enrichmentmap.integration.SerialTestTaskManager) TaskIterator(org.cytoscape.work.TaskIterator) SessionFile(org.baderlab.csplugins.enrichmentmap.integration.SessionFile) File(java.io.File) SessionFile(org.baderlab.csplugins.enrichmentmap.integration.SessionFile) Before(org.junit.Before)

Example 3 with SerialTestTaskManager

use of org.baderlab.csplugins.enrichmentmap.integration.SerialTestTaskManager in project EnrichmentMapApp by BaderLab.

the class Protocol1Test method testProtocol1.

@Test
public void testProtocol1() throws Exception {
    EMBuildCommandTask task = injector.getInstance(EMBuildCommandTask.class);
    File enrichmentFile = TestUtils.createTempFile(PATH, "gprofiler_results_mesenonly_ordered_computedinR.txt");
    assertTrue(enrichmentFile.exists());
    task.analysisType.setSelectedValue(EnrichmentMapParameters.method_generic);
    task.coeffecients.setSelectedValue(EnrichmentMapParameters.SM_JACCARD);
    task.enrichmentsDataset1 = enrichmentFile;
    task.pvalue = 1.0;
    task.qvalue = 0.00001;
    task.similaritycutoff = 0.25;
    SerialTestTaskManager taskManager = new SerialTestTaskManager();
    taskManager.execute(new TaskIterator(task));
    // Assert the network was created
    CyNetwork generatedNetwork = assertAndGetOnlyNetwork();
    CyNetwork expectedNetwork = importNetworkFromFile(PATH, "protocol_1_expected.xgmml");
    Set<String> columnsToIgnore = ImmutableSet.of("EM1_ENR_SET", "EM1_ENRICHMENT_SET", "EM1_Data Set");
    assertNetworksEqual(expectedNetwork, generatedNetwork, columnsToIgnore);
}
Also used : SerialTestTaskManager(org.baderlab.csplugins.enrichmentmap.integration.SerialTestTaskManager) TaskIterator(org.cytoscape.work.TaskIterator) CyNetwork(org.cytoscape.model.CyNetwork) EMBuildCommandTask(org.baderlab.csplugins.enrichmentmap.commands.EMBuildCommandTask) File(java.io.File) BaseIntegrationTest(org.baderlab.csplugins.enrichmentmap.integration.BaseIntegrationTest) Test(org.junit.Test)

Aggregations

SerialTestTaskManager (org.baderlab.csplugins.enrichmentmap.integration.SerialTestTaskManager)3 TaskIterator (org.cytoscape.work.TaskIterator)3 File (java.io.File)2 EMBuildCommandTask (org.baderlab.csplugins.enrichmentmap.commands.EMBuildCommandTask)1 BaseIntegrationTest (org.baderlab.csplugins.enrichmentmap.integration.BaseIntegrationTest)1 SessionFile (org.baderlab.csplugins.enrichmentmap.integration.SessionFile)1 DataSetParameters (org.baderlab.csplugins.enrichmentmap.resolver.DataSetParameters)1 CreateEnrichmentMapTaskFactory (org.baderlab.csplugins.enrichmentmap.task.CreateEnrichmentMapTaskFactory)1 CyNetwork (org.cytoscape.model.CyNetwork)1 Before (org.junit.Before)1 Test (org.junit.Test)1