diff --git a/.dockstore.yml b/.dockstore.yml index 2c40ec408fb..5f435c441ca 100644 --- a/.dockstore.yml +++ b/.dockstore.yml @@ -288,6 +288,7 @@ workflows: branches: - master - ah_var_store + - gg_VS-1336_ItsNotASiteFilter tags: - /.*/ - name: GvsQuickstartHailIntegration @@ -297,6 +298,7 @@ workflows: branches: - master - ah_var_store + - gg_VS-1336_ItsNotASiteFilter tags: - /.*/ - name: GvsQuickstartIntegration @@ -306,6 +308,7 @@ workflows: branches: - master - ah_var_store + - gg_VS-1336_ItsNotASiteFilter - vs_1334_vcf_max_alt_alleles tags: - /.*/ diff --git a/scripts/variantstore/wdl/GvsQuickstartIntegration.wdl b/scripts/variantstore/wdl/GvsQuickstartIntegration.wdl index f038ae69b5b..8103d01b145 100644 --- a/scripts/variantstore/wdl/GvsQuickstartIntegration.wdl +++ b/scripts/variantstore/wdl/GvsQuickstartIntegration.wdl @@ -34,7 +34,7 @@ workflow GvsQuickstartIntegration { File full_wgs_interval_list = "gs://gcp-public-data--broad-references/hg38/v0/wgs_calling_regions.hg38.noCentromeres.noTelomeres.interval_list" File full_exome_interval_list = "gs://gcp-public-data--broad-references/hg38/v0/bge_exome_calling_regions.v1.1.interval_list" String expected_subdir = if (!chr20_X_Y_only) then "all_chrs/" else "" - File expected_output_prefix = "gs://gvs-internal-quickstart/integration/2024-03-13/" + expected_subdir + File expected_output_prefix = "gs://gvs-internal-quickstart/integration/2024-05-13/" + expected_subdir # WDL 1.0 trick to set a variable ('none') to be undefined. if (false) { diff --git a/scripts/variantstore/wdl/GvsUtils.wdl b/scripts/variantstore/wdl/GvsUtils.wdl index bfb1b47aff7..988be2647b4 100644 --- a/scripts/variantstore/wdl/GvsUtils.wdl +++ b/scripts/variantstore/wdl/GvsUtils.wdl @@ -74,7 +74,7 @@ task GetToolVersions { String cloud_sdk_slim_docker = "gcr.io/google.com/cloudsdktool/cloud-sdk:435.0.0-slim" String variants_docker = "us-central1-docker.pkg.dev/broad-dsde-methods/gvs/variants:2024-04-22-alpine-32804b134a75" String variants_nirvana_docker = "us.gcr.io/broad-dsde-methods/variantstore:nirvana_2022_10_19" - String gatk_docker = "us-central1-docker.pkg.dev/broad-dsde-methods/gvs/gatk:2024-05-01-gatkbase-617d4d1c7f64" + String gatk_docker = "us-central1-docker.pkg.dev/broad-dsde-methods/gvs/gatk:2024_05_10-gatkbase-9bd39afc04ae" String real_time_genomics_docker = "docker.io/realtimegenomics/rtg-tools:latest" String gotc_imputation_docker = "us.gcr.io/broad-gotc-prod/imputation-bcf-vcf:1.0.5-1.10.2-0.1.16-1649948623" String plink_docker = "us-central1-docker.pkg.dev/broad-dsde-methods/gvs/plink2:2024-04-23-slim-a0a65f52cc0e" diff --git a/src/main/java/org/broadinstitute/hellbender/tools/gvs/common/FilterSensitivityTools.java b/src/main/java/org/broadinstitute/hellbender/tools/gvs/common/FilterSensitivityTools.java index b4231fd62b2..33ebcd0f659 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/gvs/common/FilterSensitivityTools.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/gvs/common/FilterSensitivityTools.java @@ -123,11 +123,20 @@ public static VCFHeaderLine getVqsLodHeader(Double vqsLodThreshold, String model "Site failed " + model + " model VQSLOD cutoff of " + vqsLodThreshold.toString()); } - public static VCFHeaderLine getTruthSensitivityHeader(Double truthSensitivityThreshold, Double vqsLodThreshold, String model) { + public static VCFHeaderLine getTruthSensitivityFilterHeader(Double truthSensitivityThreshold, Double vqsLodThreshold, String model) { if (truthSensitivityThreshold == null) { // at this point, we know that all vqsr threshold inputs are null, so use defaults truthSensitivityThreshold = GATKVCFConstants.SNP.contains(model) ? DEFAULT_TRUTH_SENSITIVITY_THRESHOLD_SNPS : DEFAULT_TRUTH_SENSITIVITY_THRESHOLD_INDELS; } return new VCFFilterHeaderLine(GATKVCFConstants.VQSR_FAILURE_PREFIX + model, "Site failed " + model + " model sensitivity cutoff (" + truthSensitivityThreshold + "), corresponding with VQSLOD cutoff of " + vqsLodThreshold.toString()); } + + public static VCFHeaderLine getTruthSensitivityHeader(Double truthSensitivityThreshold, Double vqsLodThreshold, String model) { + if (truthSensitivityThreshold == null) { // at this point, we know that all vqsr threshold inputs are null, so use defaults + truthSensitivityThreshold = GATKVCFConstants.SNP.contains(model) ? DEFAULT_TRUTH_SENSITIVITY_THRESHOLD_SNPS : DEFAULT_TRUTH_SENSITIVITY_THRESHOLD_INDELS; + } + return new VCFHeaderLine(GATKVCFConstants.VQSR_FAILURE_PREFIX + model, + "Sample Genotype FT filter value indicating that the genotyped allele failed " + model + " model sensitivity cutoff (" + truthSensitivityThreshold + "), corresponding with VQSLOD cutoff of " + vqsLodThreshold.toString()); + } + } diff --git a/src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java b/src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java index 3eae6e1d9aa..1d229cac483 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java @@ -130,7 +130,7 @@ public enum VQScoreFilteringType {GENOTYPE, SITES, NONE} @Argument( fullName = "vqs-score-filter-by-site", - doc = "If Variant Quality Score filtering is applied, it should be at a site level. Default is false", + doc = "If Variant Quality Score filtering (either VETS or VQSR) is applied, it should be at a site level. Default is false", optional = true ) // historical note that this parameter was previously named 'vqsr-score-filter-by-site', changed as it's not VQSR-specific @@ -340,8 +340,15 @@ protected void onStartup() { vqsLodSNPThreshold = FilterSensitivityTools.getVqslodThreshold(trancheMaps.get(GATKVCFConstants.SNP), truthSensitivitySNPThreshold, GATKVCFConstants.SNP); vqsLodINDELThreshold = FilterSensitivityTools.getVqslodThreshold(trancheMaps.get(GATKVCFConstants.INDEL), truthSensitivityINDELThreshold, GATKVCFConstants.INDEL); // set headers - extraHeaderLines.add(FilterSensitivityTools.getTruthSensitivityHeader(truthSensitivitySNPThreshold, vqsLodSNPThreshold, GATKVCFConstants.SNP)); - extraHeaderLines.add(FilterSensitivityTools.getTruthSensitivityHeader(truthSensitivityINDELThreshold, vqsLodINDELThreshold, GATKVCFConstants.INDEL)); + + if (vqScoreFilteringType.equals(VQScoreFilteringType.SITES)) { + extraHeaderLines.add(FilterSensitivityTools.getTruthSensitivityFilterHeader(truthSensitivitySNPThreshold, vqsLodSNPThreshold, GATKVCFConstants.SNP)); + extraHeaderLines.add(FilterSensitivityTools.getTruthSensitivityFilterHeader(truthSensitivityINDELThreshold, vqsLodINDELThreshold, GATKVCFConstants.INDEL)); + } + else if (vqScoreFilteringType.equals(VQScoreFilteringType.GENOTYPE)) { + extraHeaderLines.add(FilterSensitivityTools.getTruthSensitivityHeader(truthSensitivitySNPThreshold, vqsLodSNPThreshold, GATKVCFConstants.SNP)); + extraHeaderLines.add(FilterSensitivityTools.getTruthSensitivityHeader(truthSensitivityINDELThreshold, vqsLodINDELThreshold, GATKVCFConstants.INDEL)); + } } } else { extraHeaderLines.add(GATKVCFHeaderLines.getInfoLine(GATKVCFConstants.SCORE_KEY)); @@ -358,15 +365,23 @@ protected void onStartup() { truthSensitivityINDELThreshold /= 100.0; logger.info("Passing all INDEL variants with " + GATKVCFConstants.CALIBRATION_SENSITIVITY_KEY + " < " + truthSensitivityINDELThreshold); - extraHeaderLines.add(new VCFFilterHeaderLine(GATKVCFConstants.CALIBRATION_SENSITIVITY_FAILURE_SNP, - "Site failed SNP model calibration sensitivity cutoff (" + truthSensitivitySNPThreshold.toString() + ")")); - extraHeaderLines.add(new VCFFilterHeaderLine(GATKVCFConstants.CALIBRATION_SENSITIVITY_FAILURE_INDEL, - "Site failed INDEL model calibration sensitivity cutoff (" + truthSensitivityINDELThreshold.toString() + ")")); + if (vqScoreFilteringType.equals(VQScoreFilteringType.SITES)) { + extraHeaderLines.add(new VCFFilterHeaderLine(GATKVCFConstants.CALIBRATION_SENSITIVITY_FAILURE_SNP, + "Site failed SNP model calibration sensitivity cutoff (" + truthSensitivitySNPThreshold.toString() + ")")); + extraHeaderLines.add(new VCFFilterHeaderLine(GATKVCFConstants.CALIBRATION_SENSITIVITY_FAILURE_INDEL, + "Site failed INDEL model calibration sensitivity cutoff (" + truthSensitivityINDELThreshold.toString() + ")")); + } + else if (vqScoreFilteringType.equals(VQScoreFilteringType.GENOTYPE)) { + extraHeaderLines.add(new VCFHeaderLine(GATKVCFConstants.CALIBRATION_SENSITIVITY_FAILURE_SNP, + "Sample Genotype FT filter value indicating that the genotyped allele failed SNP model calibration sensitivity cutoff (" + truthSensitivitySNPThreshold.toString() + ")")); + extraHeaderLines.add(new VCFHeaderLine(GATKVCFConstants.CALIBRATION_SENSITIVITY_FAILURE_INDEL, + "Sample Genotype FT filter value indicating that the genotyped allele failed INDEL model calibration sensitivity cutoff (" + truthSensitivityINDELThreshold.toString() + ")")); + } } } if (vqScoreFilteringType.equals(VQScoreFilteringType.GENOTYPE)) { - extraHeaderLines.add(new VCFFormatHeaderLine("FT", 1, VCFHeaderLineType.String, "Genotype Filter Field")); + extraHeaderLines.add(new VCFFormatHeaderLine("FT", 1, VCFHeaderLineType.String, "Sample Genotype Filter Field")); } if (emitPLs) { diff --git a/src/test/java/org/broadinstitute/hellbender/tools/gvs/common/FilterSensitivityToolsTest.java b/src/test/java/org/broadinstitute/hellbender/tools/gvs/common/FilterSensitivityToolsTest.java index 2aa1952c39d..e022c883970 100644 --- a/src/test/java/org/broadinstitute/hellbender/tools/gvs/common/FilterSensitivityToolsTest.java +++ b/src/test/java/org/broadinstitute/hellbender/tools/gvs/common/FilterSensitivityToolsTest.java @@ -15,12 +15,12 @@ public class FilterSensitivityToolsTest { // for testing inputs - private Double definedDoubleInput = 0.0; - private Double undefinedDoubleInput = null; - private String definedStringInput = "I'm defined!"; - private String undefinedStringInput = null; + private final Double definedDoubleInput = 0.0; + private final Double undefinedDoubleInput = null; + private final String definedStringInput = "I'm defined!"; + private final String undefinedStringInput = null; - private Map testTrancheMap = new TreeMap<>(); + private final Map testTrancheMap = new TreeMap<>(); @BeforeMethod public void setUp() { @@ -211,7 +211,7 @@ public void testGetTruthSensitivityHeaderSNP() { VCFFilterHeaderLine expectedHeader = new VCFFilterHeaderLine(GATKVCFConstants.VQSR_FAILURE_PREFIX + model, "Site failed SNP model sensitivity cutoff (90.0), corresponding with VQSLOD cutoff of 0.0"); - assertEquals(getTruthSensitivityHeader(truthSensitivityThreshold, vqsLodThreshold, GATKVCFConstants.SNP), expectedHeader); + assertEquals(getTruthSensitivityFilterHeader(truthSensitivityThreshold, vqsLodThreshold, GATKVCFConstants.SNP), expectedHeader); } @Test @@ -222,7 +222,7 @@ public void testGetTruthSensitivityHeaderINDEL() { VCFFilterHeaderLine expectedHeader = new VCFFilterHeaderLine(GATKVCFConstants.VQSR_FAILURE_PREFIX + model, "Site failed INDEL model sensitivity cutoff (90.0), corresponding with VQSLOD cutoff of 0.0"); - assertEquals(getTruthSensitivityHeader(truthSensitivityThreshold, vqsLodThreshold, GATKVCFConstants.INDEL), expectedHeader); + assertEquals(getTruthSensitivityFilterHeader(truthSensitivityThreshold, vqsLodThreshold, GATKVCFConstants.INDEL), expectedHeader); } }