use of com.hartwig.pipeline.sbpapi.SbpFastQ in project pipeline5 by hartwigmedical.
the class SbpSampleReader method read.
public Sample read(final long sampleId) {
String rawFastQJson = sbpRestApi.getFastQ(sampleId);
try {
List<SbpFastQ> fastqJson = parseFastqJson(rawFastQJson);
String sampleName = extract(sampleId, fastqJson, name());
String barcode = parseSampleJson(sbpRestApi.getSample(sampleId)).barcode();
Sample sample = sample(sampleName, barcode, fastqJson);
LOGGER.info("Found sample [{}] in SBP", sample);
if (sample.lanes().isEmpty()) {
throw new IllegalArgumentException(String.format("No lanes (fastq) were found for sample [%s]. Either no fastq files in the api or none pass qc", sample.name()));
}
return sample;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Aggregations