This is a test version of Biostars. For the public version, visit https://www.biostars.org.
PopGenome...ReadVCF. Cannot open the file. Why?

I downloaded 1000 Genomes data. I put both the .tbi and the .vcf file in the same folder. However, I get this error message when I try to read the file.

readVCF("C:/Users/Davide/Documents/chr22/Chr22.vcf", 1000,"22",1,100000)
open: No such file or directory
Caught exception inside whop_tabix::open('C:/Users/Davide/Documents/chr22/Chr22.vcf'):
    'whop_tabix::open : Failed to open tabix index file'
return FALSE from whoptabix_open
vcff::open : could not open tabix-index!
VCF_open : Could not open file 'C:/Users/Davide/Documents/chr22/Chr22.vcf' as tabix-indexed!
[1] FALSE
popgenome r

Should it be chr22.vcf perhaps? R cant find a file the the name you passed.

I typed:

readVCF("C:/Users/Davide/Documents/chr22/Chr22.vcf", 1000,"22",1,100000)

Still get the same error message!

I'm pretty sure he meant readVCF("C:/Users/Davide/Documents/Chr22/chr22.vcf", 1000,"22",1,100000)

In any case, ensure that the capitalization is correct.

Try indexing it first. It's looking for the index for that file.

Ok I am a NOOB. How do I index it?

I downloaded chr21 to see if there was something wrong with the file. File extensions seem OK. Attached screenshot of files!

< image not found >

readVCF("C:/Users/Davide/Documents/Chr21/chr21.vcf.gzf", 1000,"21",1,100000)

1 answer

Hi all, see also http://popgenome.weebly.com/

THX, all the best.

Bastian

Log in to answer this question.