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

VCFs with tab at the end of line not loading data #1922

Closed
pratham-emedgene opened this issue Dec 11, 2024 · 3 comments
Closed

VCFs with tab at the end of line not loading data #1922

pratham-emedgene opened this issue Dec 11, 2024 · 3 comments

Comments

@pratham-emedgene
Copy link

pratham-emedgene commented Dec 11, 2024

I tried to load a vcf to igv.org/app and it didn't show any variants. On checking the vcf, I noticed there were tabs at the end of each line. So I removed the tabs from some lines and then the corresponding data showed up.
image
image

Attaching the file itself for reference.
tab_test.vcf.gz

Unfortunately, we have lots of such files and hoping something could be fixed at igv.js side.

I am happy to work on it if someone can point me to the relevant code.
Thank you

@jrobinso
Copy link
Contributor

There are other whitespace problems with this file, I tried to validate it with the htsjdk and ran into this right away, although igv.js lets it slide.

The VCF specification does not allow for whitespace in the INFO field. Offending field value was "AN=6;AC=4;Het=0;Hom=2;AF=0.6667;TEN=case2HOM,case3HOM ", for input source: /Users/jrobinso/Downloads/tab_test.vcf.gz

You can probably fix this in the file js/variant/vcfParser around line 142 by trimming the line before splitting. However I suggest you also fix whatever is producing these files as they aren't going to work in other tools, certainly tools that use the htsjdk (such as IGV desktop, and the GATK tools).

@pratham-emedgene
Copy link
Author

@jrobinso Thank you and would also fix the source of files on our side.

@jrobinso
Copy link
Contributor

I added a trim() to the string before parsing, which should take care of it but I haven't tested it.

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

No branches or pull requests

2 participants