Search in sources :

Example 1 with IlluminaExperiment

use of uk.ac.bbsrc.tgac.miso.core.util.IlluminaExperiment in project miso-lims by miso-lims.

the class ConstantsController method addIlluminaExperimentTypes.

private static void addIlluminaExperimentTypes(ObjectNode node) {
    ArrayNode illuminaExperimentTypes = node.putArray("illuminaExperimentTypes");
    for (IlluminaExperiment experiment : IlluminaExperiment.values()) {
        ObjectNode dto = illuminaExperimentTypes.addObject();
        dto.put("name", experiment.name());
        dto.put("description", experiment.getDescription());
    }
}
Also used : IlluminaExperiment(uk.ac.bbsrc.tgac.miso.core.util.IlluminaExperiment) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode)

Example 2 with IlluminaExperiment

use of uk.ac.bbsrc.tgac.miso.core.util.IlluminaExperiment in project miso-lims by miso-lims.

the class PoolRestController method samplesheet.

@PostMapping(value = "/samplesheet")
@ResponseBody
public HttpEntity<byte[]> samplesheet(@RequestBody SampleSheetRequest request, HttpServletRequest httpRequest, HttpServletResponse response, UriComponentsBuilder uriBuilder) throws IOException {
    IlluminaExperiment experiment = IlluminaExperiment.valueOf(request.getExperimentType());
    SequencingParameters parameters = sequencingParametersService.get(request.getSequencingParametersId());
    List<Pool> pools = request.getPoolIds().stream().map(WhineyFunction.rethrow(poolService::get)).collect(Collectors.toList());
    response.setHeader("Content-Disposition", String.format("attachment; filename=%s-%s.csv", experiment.name(), pools.stream().map(Pool::getAlias).collect(Collectors.joining("-"))));
    return new HttpEntity<>(experiment.makeSampleSheet(request.getGenomeFolder(), parameters, request.getCustomRead1Primer(), request.getCustomIndexPrimer(), request.getCustomRead2Primer(), pools).getBytes(StandardCharsets.UTF_8));
}
Also used : IlluminaExperiment(uk.ac.bbsrc.tgac.miso.core.util.IlluminaExperiment) HttpEntity(org.springframework.http.HttpEntity) SequencingParameters(uk.ac.bbsrc.tgac.miso.core.data.SequencingParameters) Pool(uk.ac.bbsrc.tgac.miso.core.data.Pool) PostMapping(org.springframework.web.bind.annotation.PostMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

IlluminaExperiment (uk.ac.bbsrc.tgac.miso.core.util.IlluminaExperiment)2 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 HttpEntity (org.springframework.http.HttpEntity)1 PostMapping (org.springframework.web.bind.annotation.PostMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1 Pool (uk.ac.bbsrc.tgac.miso.core.data.Pool)1 SequencingParameters (uk.ac.bbsrc.tgac.miso.core.data.SequencingParameters)1