tabix for multiple vcf
2
1
Entering edit mode
6.8 years ago
Motor Genetic ▴ 110

I have about 2000 vcf.gz files and want to merge all together. I first need to index them using tabix -p vcf, but I have to do it one by one. is there a way that all 2000 vcf files be indexed in one command (all are in one directory)

thank you, b

tabix vcf • 8.1k views
ADD COMMENT
4
Entering edit mode
6.8 years ago
for F in *.vcf.gz ; do   tabix -f -p vcf ${F}  ; done
ADD COMMENT
1
Entering edit mode

can't we use parallel some thing like:

parallel  tabix -f -p ::: *.vcf.gz
ADD REPLY
0
Entering edit mode

hello brother what language are you using for the script?

ADD REPLY
0
Entering edit mode

the language is bash

ADD REPLY
0
Entering edit mode
6.8 years ago
Motor Genetic ▴ 110

that was great!!!...so how about vcf-merge? is there a way to merge 2000 vcf files in this command:

vcf-merge A.vcf.gz B.vcf.gz C.vcf.gz | bgzip -c > out.vcf.gz considering the same status above

best, b.

ADD COMMENT
0
Entering edit mode

I'm not familiar with vcf-merge, but you can at least use wildcards to simplify your syntax, because to unix/linux commandline the A.vcf.gz B.vcf.gz C.vcf.gz and *vcf.gz are the same thing. *vcf.gz will expand to your list of files.

ADD REPLY

Login before adding your answer.

Traffic: 2752 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