Class RESTSampleAssemblyController


  • @Controller
    public class RESTSampleAssemblyController
    extends java.lang.Object
    Controller for viewing and downloading assemblies for samples
    • Method Detail

      • listAssembliesForSample

        @RequestMapping(value="/api/samples/{sampleId}/assemblies",
                        method=GET)
        public ResponseResource<ResourceCollection<GenomeAssembly>> listAssembliesForSample​(@PathVariable
                                                                                            java.lang.Long sampleId)
        List all the GenomeAssemblys for a given Sample
        Parameters:
        sampleId - the id of the sample
        Returns:
        a list of details about the assemblies
      • readAssemblyForSample

        @RequestMapping(value="/api/samples/{sampleId}/assemblies/{assemblyId}",
                        method=GET)
        public ResponseResource<GenomeAssembly> readAssemblyForSample​(@PathVariable
                                                                      java.lang.Long sampleId,
                                                                      @PathVariable
                                                                      java.lang.Long assemblyId)
        Read an individual GenomeAssembly for a given Sample
        Parameters:
        sampleId - the id of the sample
        assemblyId - the id of the assembly
        Returns:
        details about the requested assembly
      • addNewAssemblyToSample

        @RequestMapping(value="/api/samples/{sampleId}/assemblies",
                        method=POST,
                        consumes="multipart/form-data")
        public ResponseResource<GenomeAssembly> addNewAssemblyToSample​(@PathVariable
                                                                       java.lang.Long sampleId,
                                                                       @RequestPart("file")
                                                                       org.springframework.web.multipart.MultipartFile file,
                                                                       javax.servlet.http.HttpServletResponse response)
                                                                throws java.io.IOException
        Upload a new GenomeAssembly and add it to a Sample
        Parameters:
        sampleId - The ID of the sampleto add the assembly to
        file - the file content
        response - A response to send to the user
        Returns:
        a model with links to the created assembly
        Throws:
        java.io.IOException - if the upload fails