View specific chromosome in vcf file
1
0
Entering edit mode
2.6 years ago

I am trying to extract a single chromosome from a vcf file, using this bcftools command

bcftools view inputfile.vcf.gz --regions chr1

and I get this error: 'Failed to read from inputfile.vcf.gz could not load index'

I thought this would be very straightforward, what am I missing? Thanks!

filtering vcf • 1.2k views
ADD COMMENT
0
Entering edit mode
2.6 years ago

inputfile.vcf.gz must be indexed

bcftools index inputfile.vcf.gz
ADD COMMENT
0
Entering edit mode

I did this once before without indexing but I may have used vcftools instead of bcftools, should there be a difference?

Either way, will run this index command and output a new file, then run the command I mentioned above? thanks

ADD REPLY
0
Entering edit mode

I may have used vcftools instead of bcftools

vcftools is deprecated . Use bcftools

will run this index command and output a new file

bcftools will create an associated file 'inputfile.vcf.gz.csi' (the index) next to inputfile.vcf.gz

ADD REPLY
0
Entering edit mode

thank you!

ADD REPLY
0
Entering edit mode

When a suggestion is given, please try it instead of asking "Will your suggestion solve my problem?". Try it, and if it does not solve your problem, come back with what you tried and how you think it failed.

ADD REPLY

Login before adding your answer.

Traffic: 2015 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6