I am unable to view my data which I was able to view and manipulate with similar commands prior to this. Running on a Linux server. This is what I run and the errors I get:
tabix the index file already exists. please use '-f- to overwrite
I saw that I had the tbi file so thought I could just run this to see some of the file
tabix chr37.vcf.gz chr37:1-20000
[ti_index_load] wrong magic number
[ti_index_load] fail to load the index: chr.37.vcf.gz.tbi
[tabix] failed to load the index file
I removed the index file and remade it didn't fix the problem. I tried
I tried moving the -f in front of the -p, removing the -p, and the vcf still get same error. I even reloaded the sequence.snp file and remade the files. I have no idea what the issue is. Any help would be greatly appreciated.
I believe the command you want for that last part is just:
tabix -p -f vcf chr37.vcf.gz
It automatically creates the appropriate file. When you add the redirect after it, it immediately creates an empty file and prepares to write stdout to that file. Then, when tabix checks, it sees that a file by that name exists.
Maybe the > was causing an error. I also just deleted the current tbi file and re created it and now it appears to work. I also don't know if having two of the vcf.gz files caused an error at some point, but thanks.
ADD REPLY
• link
updated 2.4 years ago by
Ram
44k
•
written 8.8 years ago by
bjlemmer
▴
20
Several of the commands that you are using here are unnecessarily using redirects. Basically you can just use
bgzip myfile.vcf
tabix -p vcf myfile.vcf.gz
You don't have to add the redirect when creating the tabix index (e.g. you said tabix -p chr37.vcf.gz > chr37.vcf.gz.tbi) and it is likely that that causes the error too
The other answer by Chris mentions this too, but I would not even use the -f flag, that is probably unneeded, and I believe it is just -p vcf and not -p -f vcf
The reason I was attempting to use the -f option is because it told me to use that to overwrite the current tbi file. I have been using the > to store into a file because I have been using the cut function to keep only columns I need.
ADD REPLY
• link
updated 2.4 years ago by
Ram
44k
•
written 8.8 years ago by
bjlemmer
▴
20
Maybe the
>
was causing an error. I also just deleted the current tbi file and re created it and now it appears to work. I also don't know if having two of the vcf.gz files caused an error at some point, but thanks.