Class RESTSampleSequenceFilesController
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.web.controller.api.samples.RESTSampleSequenceFilesController
-
@Controller public class RESTSampleSequenceFilesController extends java.lang.Object
Controller for managing relationships betweenSample
andSequenceFile
.
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.collect.BiMap<java.lang.Class<? extends SequencingObject>,java.lang.String>
objectLabels
Filetype labels for differentSequencingObject
subclasses.static java.lang.String
REL_AUTOMATED_ASSEMBLY
rel for automated analyses associated with sequencing objectstatic java.lang.String
REL_PAIR
Rel to theSequenceFile
pairstatic java.lang.String
REL_PAIR_FORWARD
rel for forward and reverse filesstatic java.lang.String
REL_PAIR_REVERSE
static java.lang.String
REL_PAIR_SAMPLE
static java.lang.String
REL_QC_SEQFILE
static java.lang.String
REL_SAMPLE
Rel to get back to theSample
.static java.lang.String
REL_SAMPLE_SEQUENCE_FILE_FAST5
static java.lang.String
REL_SAMPLE_SEQUENCE_FILE_PAIRS
Rel for paired sequence files for a given samplestatic java.lang.String
REL_SAMPLE_SEQUENCE_FILE_UNPAIRED
rel for the unpaired sequence files for a given samplestatic java.lang.String
REL_SAMPLE_SEQUENCE_FILES
Rel to get to the new location of theSequenceFile
.static java.lang.String
REL_SEQ_OBJECT
Rel to a sequencefile's sequencing objectstatic java.lang.String
REL_SEQ_QC
Rel for a sequencefile's fastqc infostatic java.lang.String
REL_SEQUENCEFILE_SAMPLE
static java.lang.String
REL_SISTR_TYPING
static java.lang.String
SEQUENCE_FILE_ID_KEY
The key used in the request to add an existingSequenceFile
to aSample
.
-
Constructor Summary
Constructors Modifier Constructor Description protected
RESTSampleSequenceFilesController()
RESTSampleSequenceFilesController(SampleService sampleService, SequencingRunService miseqRunService, SequencingObjectService sequencingObjectService, AnalysisService analysisService)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ResponseResource<SequenceFile>
addNewFast5FileToSample(java.lang.Long sampleId, org.springframework.web.multipart.MultipartFile file, SequenceFileResource fileResource, javax.servlet.http.HttpServletResponse response)
REST function to add new Fast5 object to a sampleResponseResource<SequencingObject>
addNewSequenceFilePairToSample(java.lang.Long sampleId, org.springframework.web.multipart.MultipartFile file1, SequenceFileResource fileResource1, org.springframework.web.multipart.MultipartFile file2, SequenceFileResource fileResource2, javax.servlet.http.HttpServletResponse response)
Add a pair ofSequenceFile
s to aSample
ResponseResource<SequenceFile>
addNewSequenceFileToSample(java.lang.Long sampleId, org.springframework.web.multipart.MultipartFile file, SequenceFileResource fileResource, javax.servlet.http.HttpServletResponse response)
Add a newSequenceFile
to aSample
.static <T extends SequencingObject>
TaddSequencingObjectLinks(T sequencingObject, java.lang.Long sampleId)
Add the links for aSequencingObject
to its sample, self, to each individualSequenceFile
ResponseResource<ResourceCollection<SequenceFile>>
getSampleSequenceFiles(java.lang.Long sampleId)
Get theSequenceFile
entities associated with a specificSample
.ResponseResource<ResourceCollection<SequencingObject>>
listSequencingObjectsOfTypeForSample(java.lang.Long sampleId, java.lang.String objectType)
List allSequencingObject
s of a given type for aSample
ResponseResource<AnalysisFastQC>
readQCForSequenceFile(java.lang.Long sampleId, java.lang.String objectType, java.lang.Long objectId, java.lang.Long fileId)
Get the fastqc metrics for aSequenceFile
ResponseResource<SequenceFile>
readSequenceFileForSequencingObject(java.lang.Long sampleId, java.lang.String objectType, java.lang.Long objectId, java.lang.Long fileId)
ResponseResource<SequencingObject>
readSequencingObject(java.lang.Long sampleId, java.lang.String objectType, java.lang.Long objectId)
Read a singleSequencingObject
of the given type from aSample
ResponseResource<RootResource>
removeSequenceFileFromSample(java.lang.Long sampleId, java.lang.String objectType, java.lang.Long objectId)
Remove aSequencingObject
from aSample
.
-
-
-
Field Detail
-
REL_SAMPLE
public static final java.lang.String REL_SAMPLE
Rel to get back to theSample
.- See Also:
- Constant Field Values
-
REL_PAIR
public static final java.lang.String REL_PAIR
Rel to theSequenceFile
pair- See Also:
- Constant Field Values
-
REL_SAMPLE_SEQUENCE_FILES
public static final java.lang.String REL_SAMPLE_SEQUENCE_FILES
Rel to get to the new location of theSequenceFile
.- See Also:
- Constant Field Values
-
REL_SAMPLE_SEQUENCE_FILE_PAIRS
public static final java.lang.String REL_SAMPLE_SEQUENCE_FILE_PAIRS
Rel for paired sequence files for a given sample- See Also:
- Constant Field Values
-
REL_SAMPLE_SEQUENCE_FILE_UNPAIRED
public static final java.lang.String REL_SAMPLE_SEQUENCE_FILE_UNPAIRED
rel for the unpaired sequence files for a given sample- See Also:
- Constant Field Values
-
REL_SAMPLE_SEQUENCE_FILE_FAST5
public static final java.lang.String REL_SAMPLE_SEQUENCE_FILE_FAST5
- See Also:
- Constant Field Values
-
REL_SEQUENCEFILE_SAMPLE
public static final java.lang.String REL_SEQUENCEFILE_SAMPLE
- See Also:
- Constant Field Values
-
REL_PAIR_SAMPLE
public static final java.lang.String REL_PAIR_SAMPLE
- See Also:
- Constant Field Values
-
REL_SEQ_OBJECT
public static final java.lang.String REL_SEQ_OBJECT
Rel to a sequencefile's sequencing object- See Also:
- Constant Field Values
-
REL_SEQ_QC
public static final java.lang.String REL_SEQ_QC
Rel for a sequencefile's fastqc info- See Also:
- Constant Field Values
-
REL_QC_SEQFILE
public static final java.lang.String REL_QC_SEQFILE
- See Also:
- Constant Field Values
-
REL_PAIR_FORWARD
public static final java.lang.String REL_PAIR_FORWARD
rel for forward and reverse files- See Also:
- Constant Field Values
-
REL_PAIR_REVERSE
public static final java.lang.String REL_PAIR_REVERSE
- See Also:
- Constant Field Values
-
REL_AUTOMATED_ASSEMBLY
public static final java.lang.String REL_AUTOMATED_ASSEMBLY
rel for automated analyses associated with sequencing object- See Also:
- Constant Field Values
-
REL_SISTR_TYPING
public static final java.lang.String REL_SISTR_TYPING
- See Also:
- Constant Field Values
-
SEQUENCE_FILE_ID_KEY
public static final java.lang.String SEQUENCE_FILE_ID_KEY
The key used in the request to add an existingSequenceFile
to aSample
.- See Also:
- Constant Field Values
-
objectLabels
public static com.google.common.collect.BiMap<java.lang.Class<? extends SequencingObject>,java.lang.String> objectLabels
Filetype labels for differentSequencingObject
subclasses. These will be used in the hrefs for readingSequencingObject
s
-
-
Constructor Detail
-
RESTSampleSequenceFilesController
protected RESTSampleSequenceFilesController()
-
RESTSampleSequenceFilesController
@Autowired public RESTSampleSequenceFilesController(SampleService sampleService, SequencingRunService miseqRunService, SequencingObjectService sequencingObjectService, AnalysisService analysisService)
-
-
Method Detail
-
getSampleSequenceFiles
@RequestMapping(value="/api/samples/{sampleId}/sequenceFiles", method=GET) public ResponseResource<ResourceCollection<SequenceFile>> getSampleSequenceFiles(@PathVariable java.lang.Long sampleId)
Get theSequenceFile
entities associated with a specificSample
.- Parameters:
sampleId
- the identifier for theSample
.- Returns:
- the
SequenceFile
entities associated with theSample
.
-
listSequencingObjectsOfTypeForSample
@RequestMapping(value="/api/samples/{sampleId}/{objectType}", method=GET) public ResponseResource<ResourceCollection<SequencingObject>> listSequencingObjectsOfTypeForSample(@PathVariable java.lang.Long sampleId, @PathVariable java.lang.String objectType)
List allSequencingObject
s of a given type for aSample
- Parameters:
sampleId
- ID of theSample
to read fromobjectType
-SequencingObject
type- Returns:
- The
SequencingObject
s of the given type for theSample
-
readSequencingObject
@RequestMapping(value="/api/samples/{sampleId}/{objectType}/{objectId}", method=GET) public ResponseResource<SequencingObject> readSequencingObject(@PathVariable java.lang.Long sampleId, @PathVariable java.lang.String objectType, @PathVariable java.lang.Long objectId)
Read a singleSequencingObject
of the given type from aSample
- Parameters:
sampleId
-Sample
identifierobjectType
- type ofSequencingObject
objectId
- ID of theSequencingObject
- Returns:
- A single
SequencingObject
-
readSequenceFileForSequencingObject
@RequestMapping(value="/api/samples/{sampleId}/{objectType}/{objectId}/files/{fileId}", method=GET) public ResponseResource<SequenceFile> readSequenceFileForSequencingObject(@PathVariable java.lang.Long sampleId, @PathVariable java.lang.String objectType, @PathVariable java.lang.Long objectId, @PathVariable java.lang.Long fileId)
- Parameters:
sampleId
- ID of theSample
objectType
- type ofSequencingObject
objectId
- id of theSequencingObject
fileId
- ID of theSequenceFile
to read- Returns:
- a
SequenceFile
-
readQCForSequenceFile
@RequestMapping(value="/api/samples/{sampleId}/{objectType}/{objectId}/files/{fileId}/qc", method=GET) public ResponseResource<AnalysisFastQC> readQCForSequenceFile(@PathVariable java.lang.Long sampleId, @PathVariable java.lang.String objectType, @PathVariable java.lang.Long objectId, @PathVariable java.lang.Long fileId)
Get the fastqc metrics for aSequenceFile
- Parameters:
sampleId
-Sample
id of the fileobjectType
- type ofSequencingObject
objectId
- id of theSequencingObject
fileId
- id of theSequenceFile
- Returns:
- an
AnalysisFastQC
for the file
-
addNewSequenceFileToSample
@RequestMapping(value="/api/samples/{sampleId}/sequenceFiles", method=POST, consumes="multipart/form-data") public ResponseResource<SequenceFile> addNewSequenceFileToSample(@PathVariable java.lang.Long sampleId, @RequestPart("file") org.springframework.web.multipart.MultipartFile file, @RequestPart(value="parameters",required=false) SequenceFileResource fileResource, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
Add a newSequenceFile
to aSample
.- Parameters:
sampleId
- the identifier for theSample
.file
- the content of theSequenceFile
.fileResource
- the parameters for the fileresponse
- the servlet response.- Returns:
- a response indicating the success of the submission.
- Throws:
java.io.IOException
- if we can't write the file to disk.
-
addNewFast5FileToSample
@RequestMapping(value="/api/samples/{sampleId}/fast5", method=POST, consumes="multipart/form-data") public ResponseResource<SequenceFile> addNewFast5FileToSample(@PathVariable java.lang.Long sampleId, @RequestPart("file") org.springframework.web.multipart.MultipartFile file, @RequestPart(value="parameters",required=false) SequenceFileResource fileResource, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
REST function to add new Fast5 object to a sample- Parameters:
sampleId
- the ID of the sample to addfile
- The multipart file uploa to createfileResource
- the parameters for the fileresponse
- the servlet response.- Returns:
- a response indicating the success of the submission.
- Throws:
java.io.IOException
- if we can't write the file to disk.
-
addNewSequenceFilePairToSample
@RequestMapping(value="/api/samples/{sampleId}/pairs", method=POST, consumes="multipart/form-data") public ResponseResource<SequencingObject> addNewSequenceFilePairToSample(@PathVariable java.lang.Long sampleId, @RequestPart("file1") org.springframework.web.multipart.MultipartFile file1, @RequestPart("parameters1") SequenceFileResource fileResource1, @RequestPart("file2") org.springframework.web.multipart.MultipartFile file2, @RequestPart("parameters2") SequenceFileResource fileResource2, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
Add a pair ofSequenceFile
s to aSample
- Parameters:
sampleId
- TheSample
id to add tofile1
- The first multipart filefileResource1
- The metadata for the first filefile2
- The second multipart filefileResource2
- the metadata for the second fileresponse
- a reference to the servlet response.- Returns:
- Response containing the locations for the created files
- Throws:
java.io.IOException
- if we can't write the files to disk
-
removeSequenceFileFromSample
@RequestMapping(value="/api/samples/{sampleId}/{objectType}/{objectId}", method=DELETE) public ResponseResource<RootResource> removeSequenceFileFromSample(@PathVariable java.lang.Long sampleId, @PathVariable java.lang.String objectType, @PathVariable java.lang.Long objectId)
Remove aSequencingObject
from aSample
.- Parameters:
sampleId
- the sourceSample
identifier.objectType
- The type of sequencing object being removedobjectId
- the identifier of theSequencingObject
to move.- Returns:
- a status indicating the success of the move.
-
addSequencingObjectLinks
public static <T extends SequencingObject> T addSequencingObjectLinks(T sequencingObject, java.lang.Long sampleId)
Add the links for aSequencingObject
to its sample, self, to each individualSequenceFile
- Type Parameters:
T
- The subclass ofSequencingObject
being enhanced by this method- Parameters:
sequencingObject
-SequencingObject
to enhancesampleId
- ID of theSample
for the object- Returns:
- the enhanced
SequencingObject
-
-