I am trying to read a vcf file with the readVcf command of the package VariantAnnotation with R. Before, I generated a tbi file from my original vcf file using the following commadns in the shell:
extract the markers of the 1st chromosome tabix -h SNPs.vcf.bgz chr1H > chr1.vcf
create tabix index for the vcf file created in step 1 tabix -p vcf chr1.vcf
The next step is executed in R
vcffile = open(VcfFile(file = "chr1.vcf", index = "chr1.vcf.bgz.tbi", yieldSize = 1000)) vcf = readVcf(vcffile)
This returns the following error: Error: scanVcf: scanVcf: scanTabix: [internal] hmm.. this doesn't look like a tabix file, sorry
Can anybody tell the meaning of this error? How can I find out what is wrong with the tabix file?