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

SelectVariants cannot filter variant types for GVCFs (VariantTypesVariantFilter) #7111

Closed
michaelgatzen opened this issue Feb 26, 2021 · 8 comments · Fixed by #7193
Closed
Assignees
Labels
learn GATK Suitable for GATK beginners tools VariantWalker

Comments

@michaelgatzen
Copy link
Contributor

When running gatk SelectVariants -V ... --select-type SNP -O ... on GVCFs the output is empty, since every GVCF VariantContext is assigned the type MIXED in HTSJDK, due to its symbolic alternate allele (e.g. <NON_REF>,A).

@michaelgatzen
Copy link
Contributor Author

Is this expected? If not, how should we address that? I could think of copying the type determination code from HTSJDK into VariantTypesVariantFilter and accounting for this case, which would fix the problem for this filter. However I could also imagine that always assigning MIXED to every GVCF variant isn't very helpful in other situations, but making a change in HTSJDK's VariantContext would probably have massive downstream effects.

Also referenced here: https://gatk.broadinstitute.org/hc/en-us/community/posts/360071943332-SelectVariants-error

@droazen
Copy link
Contributor

droazen commented Feb 26, 2021

@michaelgatzen I agree that this behavior seems non-helpful -- perhaps SelectVariants needs a special GVCF-aware mode. I'd consult with @ldgauthier to see what she thinks would be best here.

@kachulis
Copy link
Contributor

kachulis commented Mar 1, 2021

I think something somewhat similar is happening in #7100, related to the treatment of spanning deletions in htsjdk (discussed a few year ago here: samtools/htsjdk#806). So if there is interest is improving some of the variant typing in htsjdk might be useful to try to resurrect that conversation.

@droazen
Copy link
Contributor

droazen commented Mar 8, 2021

@ldgauthier Would you mind weighing in here on what you think the SelectVariants behavior with GVCFs should be? Should we add in a special mode that is aware of the NON_REF allele?

@droazen
Copy link
Contributor

droazen commented Mar 15, 2021

Another likely related ticket: #7100

@ldgauthier
Copy link
Contributor

GVCF-aware types would be very useful. I've wanted this in the past. My natural inclination is always to add extra args so we don't change the default behavior. How about "--ignore-non-ref-in-types"? And maybe a log info/warning if the input file extension is ".g.vcf" or ".g.vcf.gz" and "-selectType" is specified without the new arg?

I wish that the span del (*) allele was considered symbolic in htsjdk. There a bunch of places I have methods to check for it that really should be pushed down into htsjdk.

@kachulis
Copy link
Contributor

Fixed by #7193

@kachulis kachulis reopened this Feb 13, 2023
@kachulis
Copy link
Contributor

apparently #7193 hasn't been merged yet...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
learn GATK Suitable for GATK beginners tools VariantWalker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants