Search in sources :

Example 1 with IridaWorkflowSet

use of ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowSet in project irida by phac-nml.

the class IridaWorkflowsServiceIT method setup.

@Before
public void setup() throws IOException, URISyntaxException, IridaWorkflowException {
    Path workflowVersion1DirectoryPath = Paths.get(TestAnalysis.class.getResource("workflows/TestAnalysis/1.0").toURI());
    Path workflowVersion2DirectoryPath = Paths.get(TestAnalysis.class.getResource("workflows/TestAnalysis/2.0").toURI());
    Path workflowPhylogenomicsDirectoryPath = Paths.get(TestAnalysis.class.getResource("workflows/AnalysisPhylogenomicsPipeline/0.1").toURI());
    iridaWorkflowsService = new IridaWorkflowsService(new IridaWorkflowSet(Sets.newHashSet()), new IridaWorkflowIdSet(Sets.newHashSet()));
    testWorkflow1v1 = iridaWorkflowLoaderService.loadIridaWorkflowFromDirectory(workflowVersion1DirectoryPath);
    testWorkflow1v2 = iridaWorkflowLoaderService.loadIridaWorkflowFromDirectory(workflowVersion2DirectoryPath);
    testWorkflowPhylogenomics = iridaWorkflowLoaderService.loadIridaWorkflowFromDirectory(workflowPhylogenomicsDirectoryPath);
}
Also used : Path(java.nio.file.Path) IridaWorkflowSet(ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowSet) IridaWorkflowsService(ca.corefacility.bioinformatics.irida.service.workflow.IridaWorkflowsService) IridaWorkflowIdSet(ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowIdSet) Before(org.junit.Before)

Example 2 with IridaWorkflowSet

use of ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowSet in project irida by phac-nml.

the class IridaWorkflowsConfig method iridaWorkflows.

/**
 * Builds a set of workflows to load up into IRIDA.
 *
 * @param iridaWorkflowTypesPath
 *            The parent directory containing sub-directories for all IRIDA
 *            workflow types.
 *
 * @return A set of workflows to load into IRIDA.
 * @throws IOException
 *             If an I/O error occured.
 * @throws IridaWorkflowLoadException
 *             If there was an issue loading a specific workflow.
 */
@Bean
public IridaWorkflowSet iridaWorkflows(Path iridaWorkflowTypesPath) throws IOException, IridaWorkflowLoadException {
    Set<IridaWorkflow> iridaWorkflowsSet = Sets.newHashSet();
    DirectoryStream<Path> workflowTypesStream = Files.newDirectoryStream(iridaWorkflowTypesPath);
    for (Path workflowTypePath : workflowTypesStream) {
        if (!Files.isDirectory(workflowTypePath)) {
            logger.warn("Workflow type directory " + iridaWorkflowTypesPath + " contains a file " + workflowTypePath + " that is not a proper workflow directory.");
        } else {
            iridaWorkflowsSet.addAll(iridaWorkflowLoaderService().loadAllWorkflowImplementations(workflowTypePath));
        }
    }
    return new IridaWorkflowSet(iridaWorkflowsSet);
}
Also used : Path(java.nio.file.Path) IridaWorkflowSet(ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowSet) IridaWorkflow(ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow) Bean(org.springframework.context.annotation.Bean)

Example 3 with IridaWorkflowSet

use of ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowSet in project irida by phac-nml.

the class IridaWorkflowsTestConfig method iridaWorkflows.

@Bean
public IridaWorkflowSet iridaWorkflows() throws IOException, IridaWorkflowLoadException, URISyntaxException {
    Path testAnalysisPath = Paths.get(TestAnalysis.class.getResource("workflows/TestAnalysis").toURI());
    Path phylogenomicsAnalysisPath = Paths.get(Analysis.class.getResource("workflows/AnalysisPhylogenomicsPipeline").toURI());
    Path assemblyAnnotationPath = Paths.get(Analysis.class.getResource("workflows/AnalysisAssemblyAnnotation").toURI());
    Set<IridaWorkflow> workflowsSet = iridaWorkflowLoaderService.loadAllWorkflowImplementations(testAnalysisPath);
    workflowsSet.addAll(iridaWorkflowLoaderService.loadAllWorkflowImplementations(phylogenomicsAnalysisPath));
    workflowsSet.addAll(iridaWorkflowLoaderService.loadAllWorkflowImplementations(assemblyAnnotationPath));
    return new IridaWorkflowSet(workflowsSet);
}
Also used : Path(java.nio.file.Path) IridaWorkflowSet(ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowSet) IridaWorkflow(ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow) Bean(org.springframework.context.annotation.Bean)

Example 4 with IridaWorkflowSet

use of ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowSet in project irida by phac-nml.

the class IridaWorkflowsServiceTest method setup.

@Before
public void setup() throws IridaWorkflowException {
    iridaWorkflow = IridaWorkflowTestBuilder.buildTestWorkflow(iridaWorkflowId, IridaWorkflowTestBuilder.Input.SINGLE, "reference");
    iridaWorkflow2 = IridaWorkflowTestBuilder.buildTestWorkflow(iridaWorkflowId2, IridaWorkflowTestBuilder.Input.SINGLE, "reference");
    iridaWorkflow3 = IridaWorkflowTestBuilder.buildTestWorkflow(iridaWorkflowId3, IridaWorkflowTestBuilder.Input.SINGLE, "reference");
    iridaWorkflowSet = new IridaWorkflowSet(Sets.newHashSet(iridaWorkflow, iridaWorkflow2));
    defaultIridaWorkflowIdSet = new IridaWorkflowIdSet(Sets.newHashSet());
    iridaWorkflowsService = new IridaWorkflowsService(iridaWorkflowSet, defaultIridaWorkflowIdSet);
}
Also used : IridaWorkflowSet(ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowSet) IridaWorkflowsService(ca.corefacility.bioinformatics.irida.service.workflow.IridaWorkflowsService) IridaWorkflowIdSet(ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowIdSet) Before(org.junit.Before)

Aggregations

IridaWorkflowSet (ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowSet)4 Path (java.nio.file.Path)3 IridaWorkflow (ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow)2 IridaWorkflowIdSet (ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowIdSet)2 IridaWorkflowsService (ca.corefacility.bioinformatics.irida.service.workflow.IridaWorkflowsService)2 Before (org.junit.Before)2 Bean (org.springframework.context.annotation.Bean)2