Class RESTSampleSequenceFilesController


  • @Controller
    public class RESTSampleSequenceFilesController
    extends java.lang.Object
    Controller for managing relationships between Sample and SequenceFile.
    • Field Detail

      • REL_SAMPLE_SEQUENCE_FILES

        public static final java.lang.String REL_SAMPLE_SEQUENCE_FILES
        Rel to get to the new location of the SequenceFile.
        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_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_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
      • objectLabels

        public static com.google.common.collect.BiMap<java.lang.Class<? extends SequencingObject>,​java.lang.String> objectLabels
        Filetype labels for different SequencingObject subclasses. These will be used in the hrefs for reading SequencingObjects
    • Method Detail

      • 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)
        Read a single SequenceFile for a given Sample and SequencingObject
        Parameters:
        sampleId - ID of the Sample
        objectType - type of SequencingObject
        objectId - id of the SequencingObject
        fileId - ID of the SequenceFile 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 a SequenceFile
        Parameters:
        sampleId - Sample id of the file
        objectType - type of SequencingObject
        objectId - id of the SequencingObject
        fileId - id of the SequenceFile
        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 new SequenceFile to a Sample.
        Parameters:
        sampleId - the identifier for the Sample.
        file - the content of the SequenceFile.
        fileResource - the parameters for the file
        response - 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 add
        file - The multipart file uploa to create
        fileResource - the parameters for the file
        response - 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 of SequenceFiles to a Sample
        Parameters:
        sampleId - The Sample id to add to
        file1 - The first multipart file
        fileResource1 - The metadata for the first file
        file2 - The second multipart file
        fileResource2 - the metadata for the second file
        response - 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 a SequencingObject from a Sample.
        Parameters:
        sampleId - the source Sample identifier.
        objectType - The type of sequencing object being removed
        objectId - the identifier of the SequencingObject to move.
        Returns:
        a status indicating the success of the move.