-
Notifications
You must be signed in to change notification settings - Fork 596
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
removing A,R, and G length attributes when ReblockGVCF subsets an allele #8209
Conversation
Github actions tests reported job failures from actions build 4195524107
|
@ldgauthier can you please suggest a reviewer? Thanks! |
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.
Just a couple minor discussion points. I'm glad you addressed my ancient TODO!
@@ -249,6 +251,15 @@ public void onTraversalStart() { | |||
} | |||
} | |||
|
|||
//Allele length and Genotype length annotations need to be subset or removed if alleles are dropped so we need to parse the header for annotation count types | |||
for(final VCFFormatHeaderLine formatHeaderLine : inputHeader.getFormatHeaderLines()) { |
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.
Occasionally the header is wrong, but it's usually A should be R or vice versa, not const should be A. I think this is fine since we're just using this as a list to remove, but it's something to keep in mind.
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.
Hmm, in that case I'll add a warning for the logs that at least lists which annotations have been removed for easier debugging in the future.
final int[] newAnnot = IntStream.range(0, allelesToKeep.size()).map(n -> oldAnnot[allelePermutation.fromIndex(n)]).toArray(); | ||
final int nonRefIndex = allelesToKeep.indexOf(Allele.NON_REF_ALLELE); | ||
if (nonRefIndex != -1 && nonRefIndex < newAnnot.length) { | ||
newAnnot[nonRefIndex] = 0; //we will "lose" coverage here, but otherwise merging NON_REF AD counts with other alleles "creates" reads |
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.
To be honest, I can't follow my own logic here, but you just copied so you're not to blame.
b84c7b3
to
f2631d9
Compare
Previously if an input gVCF had allele length, reference length, or genotype length annotations in the FORMAT field, reblockGVCF would not remove all of them at sites where an allele was dropped. This makes the output gVCF invalid since the annotation length no longer matches the length described in the header at those sites. This PR fixes up F1R2, F2R1, and AF annotations and removes any other annotations that are not already handled that are defined as A, R, or G length in the header.