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

Fix reported bug where no-call genotypes with no reads get genotype #5667

Merged
merged 3 commits into from
Feb 14, 2019

Conversation

ldgauthier
Copy link
Contributor

posterior probabilities and calls

Closes #5666

@codecov-io
Copy link

codecov-io commented Feb 12, 2019

Codecov Report

Merging #5667 into master will decrease coverage by 22.63%.
The diff coverage is 87.5%.

@@              Coverage Diff               @@
##             master     #5667       +/-   ##
==============================================
- Coverage     87.05%   64.421%   -22.63%     
+ Complexity    31700     15093    -16607     
==============================================
  Files          1938      1204      -734     
  Lines        146097     70364    -75733     
  Branches      16128     11343     -4785     
==============================================
- Hits         127178     45329    -81849     
- Misses        13033     20294     +7261     
+ Partials       5886      4741     -1145
Impacted Files Coverage Δ Complexity Δ
...org/broadinstitute/hellbender/utils/MathUtils.java 48.406% <100%> (-31.194%) 129 <1> (-91)
...kers/variantutils/PosteriorProbabilitiesUtils.java 68.944% <83.333%> (-12.466%) 48 <6> (-2)
...broadinstitute/hellbender/utils/svd/SimpleSVD.java 0% <0%> (-100%) 0% <0%> (-5%)
...groups/StructuralVariantDiscoveryProgramGroup.java 0% <0%> (-100%) 0% <0%> (-3%)
...ls/variant/writers/GVCFBlockCombiningIterator.java 0% <0%> (-100%) 0% <0%> (-1%)
...ender/utils/svd/ApacheSingularValueDecomposer.java 0% <0%> (-100%) 0% <0%> (-2%)
...otypecaller/RandomLikelihoodCalculationEngine.java 0% <0%> (-100%) 0% <0%> (-6%)
...sformers/MisencodedBaseQualityReadTransformer.java 0% <0%> (-100%) 0% <0%> (-4%)
...er/utils/smithwaterman/SWNativeAlignerWrapper.java 0% <0%> (-100%) 0% <0%> (-6%)
...ne/programgroups/CoverageAnalysisProgramGroup.java 0% <0%> (-100%) 0% <0%> (-3%)
... and 1330 more

return false;
}
if (genotype.hasDP() && genotype.getDP() == 0) {
int[] pls = genotype.getPL();
Copy link
Contributor

Choose a reason for hiding this comment

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

How about return MathUtils.max(genotype.getPL()) > 0?

@Test
public void testGenotypesWithNoDataDoNotChange() {
final GenotypeBuilder gb = new GenotypeBuilder("s1");
gb.alleles(Arrays.asList(Allele.NO_CALL, Allele.NO_CALL)).DP(0).AD(new int[]{0,0}).GQ(0).PL(new int[]{0,0,0});
Copy link
Contributor

Choose a reason for hiding this comment

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

How about chaining .alleles etc with the previous line?

public void testGenotypesWithNoDataDoNotChange() {
final GenotypeBuilder gb = new GenotypeBuilder("s1");
gb.alleles(Arrays.asList(Allele.NO_CALL, Allele.NO_CALL)).DP(0).AD(new int[]{0,0}).GQ(0).PL(new int[]{0,0,0});
final VariantContext vc = makeVC("noCall", Arrays.asList(Allele.create("A",true), Allele.create("T")), gb.make());
Copy link
Contributor

Choose a reason for hiding this comment

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

Allele.create("A", true) can be replaced with the pre-defined Allele.REF_A.

Copy link
Contributor

@davidbenjamin davidbenjamin left a comment

Choose a reason for hiding this comment

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

Just a few comments, no objection to the logic of the bug fix.

@ldgauthier
Copy link
Contributor Author

Back to you @davidbenjamin

@davidbenjamin
Copy link
Contributor

Good to merge! 👍

@ldgauthier ldgauthier merged commit a7ecde4 into master Feb 14, 2019
@ldgauthier ldgauthier deleted the ldg_CGPnoCalls branch March 11, 2019 16:12
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.

3 participants