diff --git a/purity-ploidy-estimator/README.md b/purity-ploidy-estimator/README.md index dec5292365..6c18cd80df 100644 --- a/purity-ploidy-estimator/README.md +++ b/purity-ploidy-estimator/README.md @@ -973,6 +973,7 @@ Threads | Elapsed Time| CPU Time | Peak Mem ## Version History and Download Links - Upcoming - Driver catalog written to DB + - Tumor only mode (disables somatic fitting) - [2.34](https://github.com/hartwigmedical/hmftools/releases/tag/purple-v2.34) - Added driver catalog to file output - Purity sunrise plot now supports somatic inferred purity diff --git a/purity-ploidy-estimator/src/main/java/com/hartwig/hmftools/purple/PurityPloidyEstimateApplication.java b/purity-ploidy-estimator/src/main/java/com/hartwig/hmftools/purple/PurityPloidyEstimateApplication.java index d06f5c6f4b..f815729b0e 100644 --- a/purity-ploidy-estimator/src/main/java/com/hartwig/hmftools/purple/PurityPloidyEstimateApplication.java +++ b/purity-ploidy-estimator/src/main/java/com/hartwig/hmftools/purple/PurityPloidyEstimateApplication.java @@ -137,7 +137,9 @@ private PurityPloidyEstimateApplication(final String... args) // Load structural and somatic variants final PurpleStructuralVariantSupplier structuralVariants = structuralVariants(configSupplier); final List allSomatics = somaticVariants(configSupplier); - final List snpSomatics = allSomatics.stream().filter(SomaticVariant::isSnp).collect(Collectors.toList()); + final List fittingSomatics = config.tumorOnly() + ? Collections.emptyList() + : allSomatics.stream().filter(SomaticVariant::isSnp).collect(Collectors.toList()); LOGGER.info("Applying segmentation"); final Segmentation segmentation = new Segmentation(configSupplier, cobaltGender); @@ -146,8 +148,7 @@ private PurityPloidyEstimateApplication(final String... args) LOGGER.info("Fitting purity"); final FitScoreConfig fitScoreConfig = configSupplier.fitScoreConfig(); final FittedRegionFactory fittedRegionFactory = createFittedRegionFactory(averageTumorDepth, cobaltGender, fitScoreConfig); - final BestFit bestFit = - fitPurity(executorService, configSupplier, cobaltGender, snpSomatics, observedRegions, fittedRegionFactory); + final BestFit bestFit = fitPurity(executorService, configSupplier, cobaltGender, fittingSomatics, observedRegions, fittedRegionFactory); final FittedPurity fittedPurity = bestFit.fit(); final PurityAdjuster purityAdjuster = new PurityAdjuster(cobaltGender, fittedPurity); diff --git a/purity-ploidy-estimator/src/main/java/com/hartwig/hmftools/purple/config/CommonConfig.java b/purity-ploidy-estimator/src/main/java/com/hartwig/hmftools/purple/config/CommonConfig.java index 77688b8551..09074f699d 100644 --- a/purity-ploidy-estimator/src/main/java/com/hartwig/hmftools/purple/config/CommonConfig.java +++ b/purity-ploidy-estimator/src/main/java/com/hartwig/hmftools/purple/config/CommonConfig.java @@ -31,6 +31,8 @@ public interface CommonConfig { @NotNull String version(); + boolean tumorOnly(); + default int windowSize() { return WINDOW_SIZE; } diff --git a/purity-ploidy-estimator/src/main/java/com/hartwig/hmftools/purple/config/ConfigSupplier.java b/purity-ploidy-estimator/src/main/java/com/hartwig/hmftools/purple/config/ConfigSupplier.java index f95039a540..4511195232 100644 --- a/purity-ploidy-estimator/src/main/java/com/hartwig/hmftools/purple/config/ConfigSupplier.java +++ b/purity-ploidy-estimator/src/main/java/com/hartwig/hmftools/purple/config/ConfigSupplier.java @@ -24,6 +24,7 @@ public class ConfigSupplier { private static final String GC_PROFILE = "gc_profile"; private static final String AMBER = "amber"; private static final String COBALT = "cobalt"; + private static final String TUMOR_ONLY = "tumor_only"; private static final String MIN_DIPLOID_TUMOR_RATIO_COUNT = "min_diploid_tumor_ratio_count"; private static final int MIN_DIPLOID_TUMOR_RATIO_COUNT_DEFAULT = 30; @@ -32,6 +33,7 @@ public class ConfigSupplier { private static final int MIN_DIPLOID_TUMOR_RATIO_COUNT_AT_CENTROMERE_DEFAULT = 50; public static void addOptions(@NotNull Options options) { + options.addOption(TUMOR_ONLY, false, "Tumor only mode. Disables somatic fitting."); options.addOption(REF_SAMPLE, true, "Name of the reference sample. This should correspond to the value used in AMBER and COBALT."); options.addOption(TUMOR_SAMPLE, true, "Name of the tumor sample. This should correspond to the value used in AMBER and COBALT."); @@ -106,6 +108,7 @@ public ConfigSupplier(@NotNull final String version, @NotNull CommandLine cmd, @ .amberDirectory(amberDirectory) .cobaltDirectory(cobaltDirectory) .gcProfile(gcProfile) + .tumorOnly(cmd.hasOption(TUMOR_ONLY)) .build(); LOGGER.info("Reference Sample: {}, Tumor Sample: {}", commonConfig.refSample(), commonConfig.tumorSample());