use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission.Builder in project irida by phac-nml.
the class AssemblyFileProcessor method process.
/**
* {@inheritDoc}
*/
@Override
@Transactional
public void process(SequencingObject sequencingObject) {
logger.debug("Setting up automated assembly for sequence " + sequencingObject.getId());
// assembly run by admin
User admin = userRepository.loadUserByUsername("admin");
// assembled
if (sequencingObject instanceof SequenceFilePair) {
IridaWorkflow defaultWorkflowByType;
// get the workflow
try {
defaultWorkflowByType = workflowsService.getDefaultWorkflowByType(AnalysisType.ASSEMBLY_ANNOTATION);
} catch (IridaWorkflowNotFoundException e) {
throw new FileProcessorException("Cannot find assembly workflow", e);
}
UUID pipelineUUID = defaultWorkflowByType.getWorkflowIdentifier();
// build an AnalysisSubmission
Builder builder = new AnalysisSubmission.Builder(pipelineUUID);
AnalysisSubmission submission = builder.inputFiles(Sets.newHashSet((SequenceFilePair) sequencingObject)).priority(AnalysisSubmission.Priority.LOW).name("Automated Assembly " + sequencingObject.toString()).updateSamples(true).build();
submission.setSubmitter(admin);
submission = submissionRepository.save(submission);
// Associate the submission with the seqobject
sequencingObject.setAutomatedAssembly(submission);
objectRepository.save(sequencingObject);
logger.debug("Automated assembly submission created for sequencing object " + sequencingObject.getId());
} else {
logger.warn("Could not assemble sequencing object " + sequencingObject.getId() + " because it's not paired end");
}
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission.Builder in project irida by phac-nml.
the class SistrTypingFileProcessor method process.
/**
* {@inheritDoc}
*/
@Override
public void process(SequencingObject sequencingObject) {
logger.debug("Setting up SISTR typing for sequence " + sequencingObject.getId());
User admin = userRepository.loadUserByUsername("admin");
Project.AutomatedSISTRSetting automatedSISTRSetting = shouldTypeWithSISTR(sequencingObject);
// assembled/typed.
if (sequencingObject instanceof SequenceFilePair) {
IridaWorkflow defaultWorkflowByType;
// get the workflow
try {
defaultWorkflowByType = workflowsService.getDefaultWorkflowByType(AnalysisType.SISTR_TYPING);
} catch (IridaWorkflowNotFoundException e) {
throw new FileProcessorException("Cannot find assembly workflow", e);
}
UUID pipelineUUID = defaultWorkflowByType.getWorkflowIdentifier();
// build an AnalysisSubmission
Builder builder = new AnalysisSubmission.Builder(pipelineUUID);
if (automatedSISTRSetting.equals(Project.AutomatedSISTRSetting.AUTO_METADATA)) {
builder.updateSamples(true);
} else if (automatedSISTRSetting.equals(Project.AutomatedSISTRSetting.AUTO)) {
builder.updateSamples(false);
}
AnalysisSubmission submission = builder.inputFiles(Sets.newHashSet((SequenceFilePair) sequencingObject)).priority(AnalysisSubmission.Priority.LOW).name("Automated SISTR Typing " + sequencingObject.toString()).build();
submission.setSubmitter(admin);
submission = submissionRepository.save(submission);
// Associate the submission with the seqobject
sequencingObject.setSistrTyping(submission);
objectRepository.save(sequencingObject);
logger.debug("Automated SISTR typing submission created for sequencing object " + sequencingObject.getId());
} else {
logger.warn("Could not run SISTR typing for sequencing object " + sequencingObject.getId() + " because it's not paired end");
}
}
Aggregations