-
Notifications
You must be signed in to change notification settings - Fork 597
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
Adds AlleleDepthPseudoCounts genotype annotation. #7303
Conversation
@vruano |
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.
@vruano I have a few minor nits. I think we should aim to get this in tomorrow so that it is part of the release. Rob and Richard have asked that we get this in this release if possible.
@@ -0,0 +1,170 @@ | |||
package org.broadinstitute.hellbender.tools.walkers.annotator; | |||
|
|||
import htsjdk.variant.variantcontext.*; |
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.
Should these be explicit imports? I'm not sure.
src/main/java/org/broadinstitute/hellbender/tools/walkers/annotator/AllelePseudoDepth.java
Outdated
Show resolved
Hide resolved
src/main/java/org/broadinstitute/hellbender/tools/walkers/annotator/AllelePseudoDepth.java
Outdated
Show resolved
Hide resolved
src/main/java/org/broadinstitute/hellbender/tools/walkers/annotator/AllelePseudoDepth.java
Outdated
Show resolved
Hide resolved
src/main/java/org/broadinstitute/hellbender/tools/walkers/annotator/AllelePseudoDepth.java
Outdated
Show resolved
Hide resolved
src/main/java/org/broadinstitute/hellbender/tools/walkers/annotator/AllelePseudoDepth.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Override | ||
public void annotate(final ReferenceContext ref, final VariantContext vc, |
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.
Could you add some javadoc for this method?
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.
I would say that the doc is inherited from the parent class. Is that sufficient.
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.
Yep, the @inheritdoc is good.
src/main/java/org/broadinstitute/hellbender/tools/walkers/annotator/AllelePseudoDepth.java
Show resolved
Hide resolved
src/main/java/org/broadinstitute/hellbender/utils/genotyper/LikelihoodMatrix.java
Outdated
Show resolved
Hide resolved
for (int i = 0; i < result.length; i++) { | ||
double best = lkMatrix.getEntry(0, i); | ||
double secondBest = Double.NEGATIVE_INFINITY; | ||
for (int j = 1; j < lkMatrix.getRowDimension(); j++) { |
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.
This makes me really nervous. Why, does i start with 0, and j with 1?
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.
i is standard
j if you look at the other two previous lines in the outer for loop (double best = ...
and double secondBest =
) the work for j == 0 is done, that is why we jump straight to j = 1
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.
I see, ty.
4a9395e
to
8d735de
Compare
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.
This looks good, though, I'm uncomfortable with,
INITIAL_PRIOR_CACHE_MAX_ALLELE = 10.
The reason is that in high depth somatic samples I we sometimes see more than 10 alleles show up due to homopolymer runs. At high depth sometimes you'll see an insertion of 1 A, AA, AAA, etc on out to like 14 As.
This is rare, but it does happen.
Are there any solutions where we can easily deal with a general number of alleles? Sorry, I know it's a pain.
} | ||
|
||
@Override | ||
public void annotate(final ReferenceContext ref, final VariantContext vc, |
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.
Yep, the @inheritdoc is good.
Similar to AD, the new annotation (DD) captures the depth of each allele supporting evidence or reads, however it does so by following a variational Bayes approach looking into the likelihoods rather than applying a fix threshold.
caace67
to
90872de
Compare
Test pass, @fleharty want to merge? |
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.
Thanks Valentin!
Similar to AD, the new annotation (DD) captures the depth of each allele supporting evidence
or reads, however it does so by following a variational Bayes approach looking into the
likelihoods rather than applying a fix threshold.
This turns out to be more robust in some instances.
To get the new non-standard annotation in HC you need to add -A AllelePseudoDepth