Search in sources :

Example 1 with IridaWorkflowStructure

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);
}
Also used : IridaWorkflowStructure(ca.corefacility.bioinformatics.irida.model.workflow.structure.IridaWorkflowStructure) Test(org.junit.Test)

Example 2 with IridaWorkflowStructure

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);
}
Also used : IridaWorkflow(ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow) AnalysisSubmission(ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission) IridaWorkflowStructure(ca.corefacility.bioinformatics.irida.model.workflow.structure.IridaWorkflowStructure) AsyncResult(org.springframework.scheduling.annotation.AsyncResult) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with IridaWorkflowStructure

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);
}
Also used : IridaWorkflowOutput(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowOutput) IridaWorkflowInput(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowInput) IridaWorkflowParameter(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowParameter) IridaWorkflow(ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow) IridaWorkflowDescription(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowDescription) IridaWorkflowStructure(ca.corefacility.bioinformatics.irida.model.workflow.structure.IridaWorkflowStructure) IridaWorkflowToolRepository(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowToolRepository)

Example 4 with IridaWorkflowStructure

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);
}
Also used : IridaWorkflow(ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow) IridaWorkflowDescription(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowDescription) IridaWorkflowStructure(ca.corefacility.bioinformatics.irida.model.workflow.structure.IridaWorkflowStructure)

Aggregations

IridaWorkflowStructure (ca.corefacility.bioinformatics.irida.model.workflow.structure.IridaWorkflowStructure)4 IridaWorkflow (ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow)3 IridaWorkflowDescription (ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowDescription)2 IridaWorkflowInput (ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowInput)1 IridaWorkflowOutput (ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowOutput)1 IridaWorkflowParameter (ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowParameter)1 IridaWorkflowToolRepository (ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowToolRepository)1 AnalysisSubmission (ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission)1 Test (org.junit.Test)1 AsyncResult (org.springframework.scheduling.annotation.AsyncResult)1 Transactional (org.springframework.transaction.annotation.Transactional)1