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

ReblockGVCFs cleanup #8411

Merged
merged 2 commits into from
Jul 14, 2023
Merged

ReblockGVCFs cleanup #8411

merged 2 commits into from
Jul 14, 2023

Conversation

meganshand
Copy link
Contributor

Adds argument to remove FORMAT level annotations from every genotype in the GVCF (for example, for removing the G-length PRI annotation in dragen GVCFs).

Also adds check to make sure the input VCF is a GVCF rather than a single sample VCF.

@meganshand meganshand requested a review from ldgauthier July 11, 2023 15:00
Copy link
Contributor

@ldgauthier ldgauthier left a comment

Choose a reason for hiding this comment

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

Minor comments. You can merge after you've addressed them. Thanks for the fix!

* @param vc variant context to remove format annotations from
* @return variant context with format annotations removed from genotype
*/
private VariantContext vcFormatAnnotationsRemoved(final VariantContext vc) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The grammar of this method name feels weird. Like usually they're verb phrases. I would prefer "removeVCFormatAnnotations"

@@ -317,7 +325,27 @@ protected void createAnnotationEngine() {
// get VariantContexts from input gVCFs and regenotype
@Override
public void apply(VariantContext variant, ReadsContext reads, ReferenceContext ref, FeatureContext features) {
regenotypeVC(variant);
if (!variant.hasAllele(Allele.NON_REF_ALLELE)) {
throw new GATKException("Variant Context at " + variant.getContig() + ":" + variant.getStart() + " does not contain a <NON-REF> allele. This tool is only intended for use with GVCFs.");
Copy link
Contributor

Choose a reason for hiding this comment

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

I would use a UserException instead -- I think it's a subclass

@meganshand meganshand self-assigned this Jul 14, 2023
@meganshand meganshand merged commit 248dd79 into master Jul 14, 2023
@meganshand meganshand deleted the ms_reblock branch July 14, 2023 20:23
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.

2 participants