use of ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow in project irida by phac-nml.
the class IridaWorkflowLoaderServiceIT method testLoadWorkflowNoParameters.
/**
* Test to make sure we can load a workflow with no parameters.
*
* @throws IridaWorkflowLoadException
* @throws IOException
*/
@Test
public void testLoadWorkflowNoParameters() throws IridaWorkflowLoadException, IOException {
IridaWorkflow iridaWorkflowFromFile = workflowLoaderService.loadIridaWorkflowFromDirectory(workflowDirectoryPathNoParameters);
assertFalse("workflow loaded with no parameters", iridaWorkflowFromFile.getWorkflowDescription().acceptsParameters());
assertNull("parameters should be null", iridaWorkflowFromFile.getWorkflowDescription().getParameters());
}
use of ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow 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);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow in project irida by phac-nml.
the class AssemblyFileProcessorTest method setUp.
@Before
public void setUp() throws IridaWorkflowNotFoundException {
MockitoAnnotations.initMocks(this);
processor = new AssemblyFileProcessor(objectRepository, submissionRepository, workflowsService, userRepository, ssoRepository, psjRepository);
UUID workflowUUID = UUID.randomUUID();
IridaWorkflowDescription workflowDescription = new IridaWorkflowDescription(workflowUUID, null, null, null, null, ImmutableList.of(), ImmutableList.of(), ImmutableList.of());
IridaWorkflow workflow = new IridaWorkflow(workflowDescription, null);
when(workflowsService.getDefaultWorkflowByType(AnalysisType.ASSEMBLY_ANNOTATION)).thenReturn(workflow);
when(userRepository.loadUserByUsername("admin")).thenReturn(new User());
}
use of ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow 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);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow in project irida by phac-nml.
the class AnalysisWorkspaceServiceGalaxyIT method testPrepareAnalysisFilesParametersFailInvalidParameter.
/**
* Tests out failing to prepare paired workflow input files for execution
* with parameters due to an invalid parameter passed.
*
* @throws InterruptedException
* @throws ExecutionManagerException
* @throws IOException
* @throws IridaWorkflowException
*/
@Test(expected = IridaWorkflowParameterException.class)
@WithMockUser(username = "aaron", roles = "ADMIN")
public void testPrepareAnalysisFilesParametersFailInvalidParameter() throws InterruptedException, ExecutionManagerException, IOException, IridaWorkflowException {
History history = new History();
history.setName("testPrepareAnalysisFilesParametersFailInvalidParameter");
HistoriesClient historiesClient = localGalaxy.getGalaxyInstanceAdmin().getHistoriesClient();
WorkflowsClient workflowsClient = localGalaxy.getGalaxyInstanceAdmin().getWorkflowsClient();
History createdHistory = historiesClient.create(history);
IridaWorkflow iridaWorkflow = iridaWorkflowsService.getIridaWorkflow(validWorkflowIdPairedWithParameters);
Path workflowPath = iridaWorkflow.getWorkflowStructure().getWorkflowFile();
String workflowString = new String(Files.readAllBytes(workflowPath), StandardCharsets.UTF_8);
Workflow galaxyWorkflow = workflowsClient.importWorkflow(workflowString);
Map<String, String> parameters = ImmutableMap.of("invalid", "20");
AnalysisSubmission analysisSubmission = analysisExecutionGalaxyITService.setupPairSubmissionInDatabase(1L, pairSequenceFiles1A, pairSequenceFiles2A, referenceFilePath, parameters, validWorkflowIdPairedWithParameters);
analysisSubmission.setRemoteAnalysisId(createdHistory.getId());
analysisSubmission.setRemoteWorkflowId(galaxyWorkflow.getId());
analysisWorkspaceService.prepareAnalysisFiles(analysisSubmission);
}
Aggregations