Search in sources :

Example 1 with IridaWorkflowOutput

use of ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowOutput in project irida by phac-nml.

the class AnalysisWorkspaceServiceGalaxy method getAnalysisResults.

/**
 * {@inheritDoc}
 */
@Override
public Analysis getAnalysisResults(AnalysisSubmission analysisSubmission) throws ExecutionManagerException, IridaWorkflowNotFoundException, IOException, IridaWorkflowAnalysisTypeException {
    checkNotNull(analysisSubmission, "analysisSubmission is null");
    checkNotNull(analysisSubmission.getWorkflowId(), "workflowId is null");
    checkNotNull(analysisSubmission.getRemoteWorkflowId(), "remoteWorkflowId is null");
    Path outputDirectory = Files.createTempDirectory("analysis-output");
    logger.trace("Created temporary directory " + outputDirectory + " for analysis output files");
    IridaWorkflow iridaWorkflow = iridaWorkflowsService.getIridaWorkflow(analysisSubmission.getWorkflowId());
    String analysisId = analysisSubmission.getRemoteAnalysisId();
    Map<String, IridaWorkflowOutput> outputsMap = iridaWorkflow.getWorkflowDescription().getOutputsMap();
    String labelPrefix = getLabelPrefix(analysisSubmission, iridaWorkflow);
    Map<String, AnalysisOutputFile> analysisOutputFiles = Maps.newHashMap();
    for (String analysisOutputName : outputsMap.keySet()) {
        String outputFileName = outputsMap.get(analysisOutputName).getFileName();
        Dataset outputDataset = galaxyHistoriesService.getDatasetForFileInHistory(outputFileName, analysisId);
        AnalysisOutputFile analysisOutput = buildOutputFile(analysisId, labelPrefix, outputDataset, outputDirectory);
        analysisOutputFiles.put(analysisOutputName, analysisOutput);
    }
    AnalysisType analysisType = iridaWorkflow.getWorkflowDescription().getAnalysisType();
    return new Analysis(analysisId, analysisOutputFiles, analysisType);
}
Also used : Path(java.nio.file.Path) AnalysisType(ca.corefacility.bioinformatics.irida.model.enums.AnalysisType) IridaWorkflowOutput(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowOutput) IridaWorkflow(ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow) Dataset(com.github.jmchilton.blend4j.galaxy.beans.Dataset) Analysis(ca.corefacility.bioinformatics.irida.model.workflow.analysis.Analysis) AnalysisOutputFile(ca.corefacility.bioinformatics.irida.model.workflow.analysis.AnalysisOutputFile)

Example 2 with IridaWorkflowOutput

use of ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowOutput in project irida by phac-nml.

the class IridaWorkflowTestBuilder method buildTestDescription.

/**
 * Builds a {@link IridaWorkflowDescription} with the following information.
 *
 * @param id
 *            The id of the workflow.
 * @param name
 *            The name of the workflow.
 * @param version
 *            The version of the workflow.
 * @param analysisType
 *            The {@link AnalysisType} of the workflow.
 * @param reference
 *            The reference label for the workflow.
 * @param requiresSingleSample
 *            Whether or not this workflow requires a single sample.
 * @return An {@link IridaWorkflowDescription} with the given information.
 * @throws MalformedURLException
 */
public static IridaWorkflowDescription buildTestDescription(UUID id, String name, String version, AnalysisType analysisType, Input input, String reference, boolean requiresSingleSample) throws MalformedURLException {
    List<IridaWorkflowOutput> outputs = new LinkedList<>();
    outputs.add(new IridaWorkflowOutput("output1", "output1.txt"));
    outputs.add(new IridaWorkflowOutput("output2", "output2.txt"));
    List<IridaWorkflowToolRepository> tools = new LinkedList<>();
    IridaWorkflowToolRepository workflowTool = new IridaWorkflowToolRepository("sam_to_bam", "devteam", new URL("http://toolshed.g2.bx.psu.edu/"), "8176b2575aa1");
    tools.add(workflowTool);
    IridaWorkflowInput workflowInput = null;
    switch(input) {
        case SINGLE:
            workflowInput = new IridaWorkflowInput("sequence_reads", null, reference, requiresSingleSample);
            break;
        case PAIRED:
            workflowInput = new IridaWorkflowInput(null, "sequence_reads_paired", reference, requiresSingleSample);
            break;
        case SINGLE_PAIRED:
            workflowInput = new IridaWorkflowInput("sequence_reads", "sequence_reads_paired", reference, requiresSingleSample);
            break;
    }
    List<IridaWorkflowParameter> parameters = new LinkedList<>();
    IridaToolParameter tool1 = new IridaToolParameter("irida.corefacility.ca/galaxy-shed/repos/irida/test-tool/0.1", "a");
    IridaToolParameter tool2 = new IridaToolParameter("irida.corefacility.ca/galaxy-shed/repos/irida/test-tool/0.1", "b");
    IridaWorkflowParameter parameter1 = new IridaWorkflowParameter("test-parameter", "1", Lists.newArrayList(tool1, tool2));
    parameters.add(parameter1);
    IridaWorkflowDescription iridaWorkflow = new IridaWorkflowDescription(id, name, version, analysisType, workflowInput, outputs, tools, parameters);
    return iridaWorkflow;
}
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) IridaToolParameter(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaToolParameter) IridaWorkflowDescription(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowDescription) LinkedList(java.util.LinkedList) IridaWorkflowToolRepository(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowToolRepository) URL(java.net.URL)

Example 3 with IridaWorkflowOutput

use of ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowOutput 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 IridaWorkflowOutput

use of ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowOutput in project irida by phac-nml.

the class IridaWorkflowLoaderServiceIT method buildTestDescription.

private IridaWorkflowDescription buildTestDescription(UUID id, String name, String version, String sequenceReadsSingle, String sequenceReadsPaired, boolean requiresSingleSample) throws MalformedURLException {
    List<IridaWorkflowOutput> outputs = new LinkedList<>();
    outputs.add(new IridaWorkflowOutput("output1", "output1.txt"));
    outputs.add(new IridaWorkflowOutput("output2", "output2.txt"));
    List<IridaWorkflowToolRepository> tools = new LinkedList<>();
    IridaWorkflowToolRepository workflowTool = new IridaWorkflowToolRepository("sam_to_bam", "devteam", new URL("http://toolshed.g2.bx.psu.edu/"), "8176b2575aa1");
    tools.add(workflowTool);
    List<IridaWorkflowParameter> parameters = new LinkedList<>();
    IridaToolParameter tool1 = new IridaToolParameter("irida.corefacility.ca/galaxy-shed/repos/irida/test-tool/0.1", "a");
    IridaToolParameter tool2 = new IridaToolParameter("irida.corefacility.ca/galaxy-shed/repos/irida/test-tool/0.1", "b");
    IridaWorkflowParameter parameter1 = new IridaWorkflowParameter("test-parameter", "1", Lists.newArrayList(tool1, tool2));
    parameters.add(parameter1);
    IridaWorkflowDescription iridaWorkflow = new IridaWorkflowDescription(id, name, version, AnalysisType.DEFAULT, new IridaWorkflowInput(sequenceReadsSingle, sequenceReadsPaired, "reference", requiresSingleSample), outputs, tools, parameters);
    return iridaWorkflow;
}
Also used : IridaWorkflowOutput(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowOutput) IridaWorkflowParameter(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowParameter) IridaWorkflowInput(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowInput) IridaToolParameter(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaToolParameter) IridaWorkflowDescription(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowDescription) LinkedList(java.util.LinkedList) IridaWorkflowToolRepository(ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowToolRepository) URL(java.net.URL)

Aggregations

IridaWorkflowOutput (ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowOutput)4 IridaWorkflowDescription (ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowDescription)3 IridaWorkflowInput (ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowInput)3 IridaWorkflowParameter (ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowParameter)3 IridaWorkflowToolRepository (ca.corefacility.bioinformatics.irida.model.workflow.description.IridaWorkflowToolRepository)3 IridaWorkflow (ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow)2 IridaToolParameter (ca.corefacility.bioinformatics.irida.model.workflow.description.IridaToolParameter)2 URL (java.net.URL)2 LinkedList (java.util.LinkedList)2 AnalysisType (ca.corefacility.bioinformatics.irida.model.enums.AnalysisType)1 Analysis (ca.corefacility.bioinformatics.irida.model.workflow.analysis.Analysis)1 AnalysisOutputFile (ca.corefacility.bioinformatics.irida.model.workflow.analysis.AnalysisOutputFile)1 IridaWorkflowStructure (ca.corefacility.bioinformatics.irida.model.workflow.structure.IridaWorkflowStructure)1 Dataset (com.github.jmchilton.blend4j.galaxy.beans.Dataset)1 Path (java.nio.file.Path)1