Skip to content

Commit

Permalink
Fix inverted logic on whether we are running in single sample
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldwolfe committed Dec 5, 2019
1 parent 3b678d3 commit d7f5e93
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions cluster/src/main/java/com/hartwig/pipeline/PipelineMain.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.hartwig.pipeline;

import java.util.concurrent.Executors;

import com.google.auth.oauth2.GoogleCredentials;
import com.google.cloud.storage.Storage;
import com.hartwig.pipeline.alignment.AlignerProvider;
Expand All @@ -19,12 +21,11 @@
import com.hartwig.pipeline.storage.RuntimeBucket;
import com.hartwig.pipeline.storage.StorageProvider;
import com.hartwig.pipeline.tools.Versions;

import org.apache.commons.cli.ParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.Executors;

public class PipelineMain {

private static final Logger LOGGER = LoggerFactory.getLogger(PipelineMain.class);
Expand All @@ -38,9 +39,9 @@ public PipelineState start(Arguments arguments) {
SomaticMetadataApi somaticMetadataApi = SomaticMetadataApiProvider.from(arguments, storage).get();
SingleSampleEventListener referenceEventListener = new SingleSampleEventListener();
SingleSampleEventListener tumorEventListener = new SingleSampleEventListener();
boolean isStandalone = !somaticMetadataApi.get().isSingleSample();
return new FullPipeline(singleSamplePipeline(arguments, credentials, storage, referenceEventListener, isStandalone),
singleSamplePipeline(arguments, credentials, storage, tumorEventListener, isStandalone),
boolean isSingleSample = somaticMetadataApi.get().isSingleSample();
return new FullPipeline(singleSamplePipeline(arguments, credentials, storage, referenceEventListener, isSingleSample),
singleSamplePipeline(arguments, credentials, storage, tumorEventListener, isSingleSample),
somaticPipeline(arguments, credentials, storage, somaticMetadataApi),
Executors.newCachedThreadPool(),
referenceEventListener,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public SomaticRunMetadata get() {
SingleSampleRunMetadata tumor = find(TUMOR, samplesBySet).map(referenceSample -> toMetadata(referenceSample,
SingleSampleRunMetadata.SampleType.TUMOR))
.orElseThrow((() -> new IllegalStateException(String.format(
"No tumor sample found in SBP for set [%s] and this run " + "was not marked as single sample",
"No tumor sample found in SBP for set [%s] and this run was not marked as single sample",
sbpSet.name()))));
return SomaticRunMetadata.builder().runName(sbpSet.name()).reference(reference).maybeTumor(tumor).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public void compose(SomaticRunMetadata metadata) {
writeComplete(name);
}

public void compose(SingleSampleRunMetadata metadata, Boolean isStandalone, PipelineState state) {
public void compose(SingleSampleRunMetadata metadata, Boolean isSingleSample, PipelineState state) {
String name = RunTag.apply(arguments, metadata.sampleId());
if (state.shouldProceed()) {
Folder folder = isStandalone ? Folder.from() : Folder.from(metadata);
Folder folder = isSingleSample ? Folder.from() : Folder.from(metadata);
writeMetadata(metadata, name, folder);
compose(name, folder);
}
Expand Down

0 comments on commit d7f5e93

Please sign in to comment.