use of com.hartwig.patient.Sample in project pipeline5 by hartwigmedical.
the class SbpSampleReaderTest method getsFlowcellFromFileName.
@Test
public void getsFlowcellFromFileName() {
returnJson(FASTQ_JSON);
Sample sample = victim.read(EXISTS);
assertThat(sample.lanes().get(0).flowCellId()).isEqualTo("HJKLMALXX");
}
use of com.hartwig.patient.Sample 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);
}
}
use of com.hartwig.patient.Sample in project pipeline5 by hartwigmedical.
the class SbpSampleReaderTest method addsAllLanesToSample.
@Test
public void addsAllLanesToSample() {
returnJson(FASTQ_JSON);
Sample sample = victim.read(EXISTS);
assertThat(sample).isNotNull();
assertThat(sample.lanes()).hasSize(2);
}
use of com.hartwig.patient.Sample in project pipeline5 by hartwigmedical.
the class SbpSampleReaderTest method filtersLanesWhichHaveNotPassedQC.
@Test
public void filtersLanesWhichHaveNotPassedQC() {
returnJson(FASTQ_JSON_SINGLE_QC_FAILED);
Sample sample = victim.read(EXISTS);
assertThat(sample.lanes()).hasSize(1);
assertThat(sample.lanes().get(0).firstOfPairPath()).contains("L001");
}
use of com.hartwig.patient.Sample in project pipeline5 by hartwigmedical.
the class SbpSampleReaderTest method getsBarcodeFromAPi.
@Test
public void getsBarcodeFromAPi() {
returnJson(FASTQ_JSON);
Sample sample = victim.read(EXISTS);
assertThat(sample.barcode()).isEqualTo("FR13257296");
}
Aggregations