Search in sources :

Example 1 with RunSet

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();
}
Also used : Run(com.hartwig.api.model.Run) Logger(org.slf4j.Logger) Optional.ofNullable(java.util.Optional.ofNullable) PipelineState(com.hartwig.pipeline.PipelineState) LoggerFactory(org.slf4j.LoggerFactory) RunApi(com.hartwig.api.RunApi) StagedOutputPublisher(com.hartwig.pipeline.transfer.staged.StagedOutputPublisher) SampleType(com.hartwig.api.model.SampleType) List(java.util.List) RunSet(com.hartwig.api.model.RunSet) Optional(java.util.Optional) SampleApi(com.hartwig.api.SampleApi) Sample(com.hartwig.api.model.Sample) PipelineStatus(com.hartwig.pipeline.execution.PipelineStatus) Collections(java.util.Collections) RunSet(com.hartwig.api.model.RunSet) Sample(com.hartwig.api.model.Sample)

Aggregations

RunApi (com.hartwig.api.RunApi)1 SampleApi (com.hartwig.api.SampleApi)1 Run (com.hartwig.api.model.Run)1 RunSet (com.hartwig.api.model.RunSet)1 Sample (com.hartwig.api.model.Sample)1 SampleType (com.hartwig.api.model.SampleType)1 PipelineState (com.hartwig.pipeline.PipelineState)1 PipelineStatus (com.hartwig.pipeline.execution.PipelineStatus)1 StagedOutputPublisher (com.hartwig.pipeline.transfer.staged.StagedOutputPublisher)1 Collections (java.util.Collections)1 List (java.util.List)1 Optional (java.util.Optional)1 Optional.ofNullable (java.util.Optional.ofNullable)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1