-
Notifications
You must be signed in to change notification settings - Fork 606
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
base: ah_var_store
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.*; |
There was a problem hiding this comment.
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.
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.
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); |
There was a problem hiding this comment.
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.
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.
This PR adds annotations to the sites-only VCF as requested by Conrad
Integration test here