use of ca.corefacility.bioinformatics.irida.model.workflow.structure.IridaWorkflowStructure in project irida by phac-nml.
the class IridaWorkflowLoaderServiceIT method testLoadWorkflowStructure.
/**
* Tests loading up the workflow structure from a file.
*
* @throws FileNotFoundException
*/
@Test
public void testLoadWorkflowStructure() throws FileNotFoundException {
IridaWorkflowStructure iridaWorkflowStructure = buildTestStructure();
IridaWorkflowStructure iridaWorkflowStructureFromFile = workflowLoaderService.loadWorkflowStructure(workflowStructurePath);
assertEquals("irida workflow structure invalid", iridaWorkflowStructure, iridaWorkflowStructureFromFile);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.structure.IridaWorkflowStructure in project irida by phac-nml.
the class AnalysisExecutionServiceGalaxyAsync method prepareSubmission.
/**
* Prepares the given {@link AnalysisSubmission} to be executed within an
* execution manager. This will persist the submission within the database.
*
* @param analysisSubmission
* The {@link AnalysisSubmission} to prepare.
* @return A {@link Future} with an {@link AnalysisSubmission} for the
* analysis submitted.
* @throws IridaWorkflowNotFoundException
* If there was an issue getting a workflow.
* @throws IOException
* If there was an issue reading the workflow.
* @throws ExecutionManagerException
* If there was an issue preparing a workspace for the workflow.
*/
@Transactional
public Future<AnalysisSubmission> prepareSubmission(final AnalysisSubmission analysisSubmission) throws IridaWorkflowNotFoundException, IOException, ExecutionManagerException {
checkNotNull(analysisSubmission, "analysisSubmission is null");
checkNotNull(analysisSubmission.getId(), "analysisSubmission id is null");
checkArgument(null == analysisSubmission.getRemoteAnalysisId(), "remote analyis id should be null");
checkArgument(null == analysisSubmission.getRemoteWorkflowId(), "remoteWorkflowId should be null");
IridaWorkflow iridaWorkflow = iridaWorkflowsService.getIridaWorkflow(analysisSubmission.getWorkflowId());
IridaWorkflowStructure workflowStructure = iridaWorkflow.getWorkflowStructure();
logger.debug("Preparing submission for " + analysisSubmission);
String workflowId = galaxyWorkflowService.uploadGalaxyWorkflow(workflowStructure.getWorkflowFile());
analysisSubmission.setRemoteWorkflowId(workflowId);
logger.trace("Uploaded workflow for " + analysisSubmission + " to workflow with id=" + workflowId);
String analysisId = workspaceService.prepareAnalysisWorkspace(analysisSubmission);
logger.trace("Created Galaxy history for analysis " + " id=" + analysisId + ", " + analysisSubmission);
analysisSubmission.setAnalysisState(AnalysisState.PREPARED);
analysisSubmission.setRemoteWorkflowId(workflowId);
analysisSubmission.setRemoteAnalysisId(analysisId);
AnalysisSubmission analysisPrepared = analysisSubmissionService.update(analysisSubmission);
return new AsyncResult<>(analysisPrepared);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.structure.IridaWorkflowStructure in project irida by phac-nml.
the class TestDataFactory method getIridaWorkflow.
public static IridaWorkflow getIridaWorkflow(UUID id) {
IridaWorkflowInput input = new IridaWorkflowInput();
List<IridaWorkflowOutput> outputs = ImmutableList.of(new IridaWorkflowOutput());
List<IridaWorkflowToolRepository> tools = ImmutableList.of();
List<IridaWorkflowParameter> parameters = ImmutableList.of();
IridaWorkflowDescription description = new IridaWorkflowDescription(id, "My Workflow", "V1", AnalysisType.DEFAULT, input, outputs, tools, parameters);
IridaWorkflowStructure structure = new IridaWorkflowStructure(null);
return new IridaWorkflow(description, structure);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.structure.IridaWorkflowStructure in project irida by phac-nml.
the class IridaWorkflowLoaderService method loadIridaWorkflow.
/**
* Loads up an {@link IridaWorkflow} from the given information files.
*
* @param descriptionFile
* The description file for the workflow.
* @param structureFile
* The file describing the structure of a workflow.
* @return An IridaWorkflow object for this workflow.
* @throws IOException
* If there was an issue reading the passed file.
* @throws IridaWorkflowLoadException
* If there was an issue loading up the workflow.
*/
public IridaWorkflow loadIridaWorkflow(Path descriptionFile, Path structureFile) throws IOException, IridaWorkflowLoadException {
checkNotNull(descriptionFile, "descriptionFile is null");
checkNotNull(structureFile, "structureFile is null");
IridaWorkflowDescription worklowDescription = loadWorkflowDescription(descriptionFile);
IridaWorkflowStructure workflowStructure = loadWorkflowStructure(structureFile);
return new IridaWorkflow(worklowDescription, workflowStructure);
}
Aggregations