use of ca.corefacility.bioinformatics.irida.model.project.ReferenceFile in project irida by phac-nml.
the class DatabaseSetupGalaxyITService method setupPairSubmissionInDatabase.
/**
* Sets up an {@link AnalysisSubmission} with a set of
* {@link SequenceFilePair}s that have already been setup with samples.
*
* @param sequenceFilePairs
* The set of {@link SequenceFilePair}s to submit.
* @param referenceFilePath
* The path to an input reference file for this test.
* @param iridaWorkflowId
* The id of an irida workflow.
* @return An {@link AnalysisSubmission} which has been saved to the
* database.
*/
public AnalysisSubmission setupPairSubmissionInDatabase(Set<SequencingObject> sequenceFilePairs, Path referenceFilePath, UUID iridaWorkflowId) {
ReferenceFile referenceFile = referenceFileRepository.save(new ReferenceFile(referenceFilePath));
AnalysisSubmission submission = AnalysisSubmission.builder(iridaWorkflowId).name("paired analysis").inputFiles(sequenceFilePairs).referenceFile(referenceFile).build();
analysisSubmissionService.create(submission);
return analysisSubmissionRepository.findOne(submission.getId());
}
use of ca.corefacility.bioinformatics.irida.model.project.ReferenceFile in project irida by phac-nml.
the class DatabaseSetupGalaxyITService method setupSubmissionInDatabase.
/**
* Sets up an AnalysisSubmission and saves all dependencies in database.
* Saves with the given {@link AnalysisState}
*
* @param sampleId The id of the sample to associate with the given sequence
* file.
* @param sequenceFilePath The path to an input sequence file for this test.
* @param referenceFilePath The path to an input reference file for this test.
* @param iridaWorkflowId The id of an irida workflow.
* @param state {@link AnalysisState} of the workflow
* @param updateSamples whether to run the sampleUpdater for this analysis
* @return An {@link AnalysisSubmission} which has been saved to the
* database.
*/
public AnalysisSubmission setupSubmissionInDatabase(long sampleId, Path sequenceFilePath, Path referenceFilePath, UUID iridaWorkflowId, AnalysisState state, boolean updateSamples) {
SingleEndSequenceFile sequencingObject = (SingleEndSequenceFile) setupSequencingObjectInDatabase(sampleId, sequenceFilePath).get(0);
waitForFilesToSettle(sequencingObject);
sequencingObject = (SingleEndSequenceFile) sequencingObjectService.read(sequencingObject.getId());
ReferenceFile referenceFile = referenceFileRepository.save(new ReferenceFile(referenceFilePath));
AnalysisSubmission submission = AnalysisSubmission.builder(iridaWorkflowId).name("my analysis").inputFiles(Sets.newHashSet(sequencingObject)).referenceFile(referenceFile).updateSamples(updateSamples).build();
submission.setAnalysisState(state);
analysisSubmissionService.create(submission);
return analysisSubmissionRepository.findOne(submission.getId());
}
use of ca.corefacility.bioinformatics.irida.model.project.ReferenceFile in project irida by phac-nml.
the class ProjectServiceImplIT method testRemoveReferenceFileFromProject.
@Test
@WithMockUser(username = "admin", roles = "ADMIN")
public void testRemoveReferenceFileFromProject() {
Project p = projectService.read(1L);
ReferenceFile f = referenceFileService.read(1L);
projectService.removeReferenceFileFromProject(p, f);
Collection<Join<Project, ReferenceFile>> files = referenceFileService.getReferenceFilesForProject(p);
assertTrue("No reference files should be assigned to project.", files.isEmpty());
}
use of ca.corefacility.bioinformatics.irida.model.project.ReferenceFile in project irida by phac-nml.
the class ProjectServiceImplIT method testRemoveReferenceFileFromProjectExceptions.
@Test(expected = EntityNotFoundException.class)
@WithMockUser(username = "admin", roles = "ADMIN")
public void testRemoveReferenceFileFromProjectExceptions() {
Project p = projectService.read(1L);
ReferenceFile f = referenceFileService.read(2L);
projectService.removeReferenceFileFromProject(p, f);
}
use of ca.corefacility.bioinformatics.irida.model.project.ReferenceFile in project irida by phac-nml.
the class ReferenceFileServiceImplIT method testDeleteReferenceFile.
@Test
@WithMockUser(username = "fbristow", roles = "USER")
public void testDeleteReferenceFile() {
Project p = projectService.read(1L);
List<Join<Project, ReferenceFile>> prs = referenceFileService.getReferenceFilesForProject(p);
assertEquals("Wrong number of reference files for project.", 1, prs.size());
ReferenceFile rf = prs.iterator().next().getObject();
assertEquals("Wrong reference file attached to project.", Long.valueOf(1), rf.getId());
referenceFileService.delete(rf.getId());
p = projectService.read(1L);
prs = referenceFileService.getReferenceFilesForProject(p);
assertEquals("No more reference files should be in the project.", 0, prs.size());
}
Aggregations