Skip to content

Commit

Permalink
purple tumor only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbaber committed Oct 30, 2019
1 parent 449f3ee commit 65aa394
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions purity-ploidy-estimator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ private PurityPloidyEstimateApplication(final String... args)
// Load structural and somatic variants
final PurpleStructuralVariantSupplier structuralVariants = structuralVariants(configSupplier);
final List<SomaticVariant> allSomatics = somaticVariants(configSupplier);
final List<SomaticVariant> snpSomatics = allSomatics.stream().filter(SomaticVariant::isSnp).collect(Collectors.toList());
final List<SomaticVariant> fittingSomatics = config.tumorOnly()
? Collections.emptyList()
: allSomatics.stream().filter(SomaticVariant::isSnp).collect(Collectors.toList());

LOGGER.info("Applying segmentation");
final Segmentation segmentation = new Segmentation(configSupplier, cobaltGender);
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public interface CommonConfig {
@NotNull
String version();

boolean tumorOnly();

default int windowSize() {
return WINDOW_SIZE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.");

Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 65aa394

Please sign in to comment.