Skip to content

VS-1657 - Adding new annotations to the sites-only VCF. #9212

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

Open
wants to merge 7 commits into
base: ah_var_store
Choose a base branch
from

Conversation

gbggrant
Copy link
Collaborator

@gbggrant gbggrant commented Jun 18, 2025

This PR adds annotations to the sites-only VCF as requested by Conrad

Integration test here

@gbggrant gbggrant requested a review from Copilot June 19, 2025 20:48
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds new annotations to the sites-only VCF to support additional variant features. Key changes include:

  • Adding new attributes in ExtractFeaturesEngine.java for strand bias, allele-specific variant depth, and mapping-quality combined with depth.
  • Updating header definitions in ExtractFeatures.java for the new annotation keys.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/main/java/org/broadinstitute/hellbender/tools/gvs/filtering/ExtractFeaturesEngine.java Adds new attribute calculations and annotation assignments for strand bias and depth metrics
src/main/java/org/broadinstitute/hellbender/tools/gvs/filtering/ExtractFeatures.java Updates VCF header definitions to include the newly added annotation keys

import org.broadinstitute.hellbender.tools.walkers.annotator.QualByDepth;
import org.broadinstitute.hellbender.tools.walkers.annotator.StrandOddsRatio;
import org.broadinstitute.hellbender.tools.walkers.annotator.VariantAnnotatorEngine;
import org.broadinstitute.hellbender.tools.walkers.annotator.*;
Copy link
Preview

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider replacing the wildcard import with explicit class imports to improve code clarity and prevent potential namespace pollution.

Suggested change
import org.broadinstitute.hellbender.tools.walkers.annotator.*;
import org.broadinstitute.hellbender.tools.walkers.annotator.ExcessHet;
import org.broadinstitute.hellbender.tools.walkers.annotator.VariantAnnotatorEngine;

Copilot uses AI. Check for mistakes.

Comment on lines +286 to 296
final List<Integer> sbValues = Arrays.asList(sb_ref_plus, sb_ref_minus, sb_alt_plus, sb_alt_minus);

// Create the AS_SB_TABLE annotation - allele-specific strand bias information
final String asSbTable = String.format("%d,%d|%d,%d", sb_ref_plus, sb_ref_minus, sb_alt_plus, sb_alt_minus);

// Calculate the simple SB (Strand Bias) value
// This is typically a Phred-scaled value - we'll use the Fisher's Exact Test p-value
double sbValue = QualityUtils.phredScaleErrorRate(FisherStrand.pValueForContingencyTable(refAltTable));

double fs = QualityUtils.phredScaleErrorRate(Math.max(FisherStrand.pValueForContingencyTable(refAltTable), AS_StrandBiasTest.MIN_PVALUE));
double sor = StrandOddsRatio.calculateSOR(refAltTable);
Copy link
Preview

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider encapsulating the annotation attribute assignments (lines 285-331) into dedicated helper methods to reduce duplication and improve readability.

Suggested change
final List<Integer> sbValues = Arrays.asList(sb_ref_plus, sb_ref_minus, sb_alt_plus, sb_alt_minus);
// Create the AS_SB_TABLE annotation - allele-specific strand bias information
final String asSbTable = String.format("%d,%d|%d,%d", sb_ref_plus, sb_ref_minus, sb_alt_plus, sb_alt_minus);
// Calculate the simple SB (Strand Bias) value
// This is typically a Phred-scaled value - we'll use the Fisher's Exact Test p-value
double sbValue = QualityUtils.phredScaleErrorRate(FisherStrand.pValueForContingencyTable(refAltTable));
double fs = QualityUtils.phredScaleErrorRate(Math.max(FisherStrand.pValueForContingencyTable(refAltTable), AS_StrandBiasTest.MIN_PVALUE));
double sor = StrandOddsRatio.calculateSOR(refAltTable);
final List<Integer> sbValues = createSBTable(sb_ref_plus, sb_ref_minus, sb_alt_plus, sb_alt_minus);
// Create the AS_SB_TABLE annotation - allele-specific strand bias information
final String asSbTable = createASSBTable(sb_ref_plus, sb_ref_minus, sb_alt_plus, sb_alt_minus);
// Calculate the simple SB (Strand Bias) value
double sbValue = calculateSBValue(refAltTable);
// Calculate FS and SOR values
double fs = calculateFSValue(refAltTable);
double sor = calculateSORValue(refAltTable);

Copilot uses AI. Check for mistakes.

@gbggrant gbggrant marked this pull request as ready for review June 24, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant