use of com.hartwig.api.model.RunSet in project pipeline5 by hartwigmedical.
the class DiagnosticSomaticMetadataApi method get.
@Override
public SomaticRunMetadata get() {
String runBucket = ofNullable(run.getBucket()).orElseThrow();
RunSet set = run.getSet();
List<Sample> samplesBySet = sampleApi.list(null, null, null, set.getId(), null, null);
return SomaticRunMetadata.builder().bucket(runBucket).set(set.getName()).maybeReference(find(SampleType.REF, samplesBySet).map(referenceSample -> toMetadata(referenceSample, run, SingleSampleRunMetadata.SampleType.REFERENCE, anonymizer))).maybeTumor(find(SampleType.TUMOR, samplesBySet).map(referenceSample1 -> toMetadata(referenceSample1, run, SingleSampleRunMetadata.SampleType.TUMOR, anonymizer))).build();
}
Aggregations