Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS-1336 - It's not a site FILTER #8773

Merged
merged 7 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ workflows:
branches:
- master
- ah_var_store
- gg_VS-1336_ItsNotASiteFilter
tags:
- /.*/
- name: GvsQuickstartHailIntegration
Expand All @@ -297,6 +298,7 @@ workflows:
branches:
- master
- ah_var_store
- gg_VS-1336_ItsNotASiteFilter
tags:
- /.*/
- name: GvsQuickstartIntegration
Expand All @@ -306,6 +308,7 @@ workflows:
branches:
- master
- ah_var_store
- gg_VS-1336_ItsNotASiteFilter
- vs_1334_vcf_max_alt_alleles
tags:
- /.*/
Expand Down
2 changes: 1 addition & 1 deletion scripts/variantstore/wdl/GvsQuickstartIntegration.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/variantstore/wdl/GvsUtils.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,20 @@
"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());

Check warning on line 139 in src/main/java/org/broadinstitute/hellbender/tools/gvs/common/FilterSensitivityTools.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/broadinstitute/hellbender/tools/gvs/common/FilterSensitivityTools.java#L138-L139

Added lines #L138 - L139 were not covered by tests
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@

@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
Expand Down Expand Up @@ -340,8 +340,15 @@
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));

Check warning on line 346 in src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java#L345-L346

Added lines #L345 - L346 were not covered by tests
}
else if (vqScoreFilteringType.equals(VQScoreFilteringType.GENOTYPE)) {
extraHeaderLines.add(FilterSensitivityTools.getTruthSensitivityHeader(truthSensitivitySNPThreshold, vqsLodSNPThreshold, GATKVCFConstants.SNP));
extraHeaderLines.add(FilterSensitivityTools.getTruthSensitivityHeader(truthSensitivityINDELThreshold, vqsLodINDELThreshold, GATKVCFConstants.INDEL));

Check warning on line 350 in src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java#L349-L350

Added lines #L349 - L350 were not covered by tests
}
}
} else {
extraHeaderLines.add(GATKVCFHeaderLines.getInfoLine(GATKVCFConstants.SCORE_KEY));
Expand All @@ -358,15 +365,23 @@
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() + ")"));

Check warning on line 372 in src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java#L369-L372

Added lines #L369 - L372 were not covered by tests
}
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() + ")"));

Check warning on line 378 in src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java#L375-L378

Added lines #L375 - L378 were not covered by tests
}
}
}

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"));

Check warning on line 384 in src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/broadinstitute/hellbender/tools/gvs/extract/ExtractCohort.java#L384

Added line #L384 was not covered by tests
}

if (emitPLs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Double, Double> testTrancheMap = new TreeMap<>();
private final Map<Double, Double> testTrancheMap = new TreeMap<>();

@BeforeMethod
public void setUp() {
Expand Down Expand Up @@ -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
Expand All @@ -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);
}

}
Loading