Search in sources :

Example 26 with Dataset

use of com.github.jmchilton.blend4j.galaxy.beans.Dataset in project irida by phac-nml.

the class AnalysisWorkspaceServiceGalaxy method prepareReferenceFile.

/**
 * Prepares a reference file for input to the workflow.
 *
 * @param referenceFile
 *            The {@link ReferenceFile} for the workflow.
 * @param workflowHistory
 *            The {@link History} for the workflow.
 * @param referenceFileLabel
 *            The label for the reference file in the workflow.
 * @param workflowDetails
 *            The {@link WorkflowDetails} for the workflow.
 * @param inputs
 *            The {@link WorkflowInputs} object used to setup inputs for the
 *            workflow.
 * @throws UploadException
 *             If there's an exception when uploading files to the workflow
 *             engine.
 * @throws GalaxyDatasetException
 *             If there's an exception with Galaxy datasets.
 * @throws WorkflowException
 *             If there's an exception with workflow methods.
 */
private void prepareReferenceFile(ReferenceFile referenceFile, History workflowHistory, String referenceFileLabel, WorkflowDetails workflowDetails, WorkflowInputs inputs) throws UploadException, GalaxyDatasetException, WorkflowException {
    Dataset referenceDataset = galaxyHistoriesService.fileToHistory(referenceFile.getFile(), InputFileType.FASTA, workflowHistory);
    String workflowReferenceFileInputId = galaxyWorkflowService.getWorkflowInputId(workflowDetails, referenceFileLabel);
    inputs.setInput(workflowReferenceFileInputId, new WorkflowInputs.WorkflowInput(referenceDataset.getId(), WorkflowInputs.InputSourceType.HDA));
}
Also used : Dataset(com.github.jmchilton.blend4j.galaxy.beans.Dataset) WorkflowInputs(com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputs)

Aggregations

Dataset (com.github.jmchilton.blend4j.galaxy.beans.Dataset)26 History (com.github.jmchilton.blend4j.galaxy.beans.History)17 Test (org.junit.Test)17 Path (java.nio.file.Path)10 WorkflowOutputs (com.github.jmchilton.blend4j.galaxy.beans.WorkflowOutputs)6 GalaxyWorkflowStatus (ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus)4 HistoryDataset (com.github.jmchilton.blend4j.galaxy.beans.HistoryDataset)4 HistoryDetails (com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails)4 Library (com.github.jmchilton.blend4j.galaxy.beans.Library)4 WorkflowInputs (com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputs)4 CollectionDescription (com.github.jmchilton.blend4j.galaxy.beans.collection.request.CollectionDescription)4 CollectionResponse (com.github.jmchilton.blend4j.galaxy.beans.collection.response.CollectionResponse)4 HistoryContents (com.github.jmchilton.blend4j.galaxy.beans.HistoryContents)3 WorkflowDetails (com.github.jmchilton.blend4j.galaxy.beans.WorkflowDetails)3 HistoryDatasetElement (com.github.jmchilton.blend4j.galaxy.beans.collection.request.HistoryDatasetElement)3 ExecutionManagerException (ca.corefacility.bioinformatics.irida.exceptions.ExecutionManagerException)2 HistoriesClient (com.github.jmchilton.blend4j.galaxy.HistoriesClient)2 FileUploadRequest (com.github.jmchilton.blend4j.galaxy.ToolsClient.FileUploadRequest)2 HistoryContentsProvenance (com.github.jmchilton.blend4j.galaxy.beans.HistoryContentsProvenance)2 ToolParameter (com.github.jmchilton.blend4j.galaxy.beans.ToolParameter)2