This is a test version of Biostars. For the public version, visit https://www.biostars.org.
tabix for multiple vcf

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

2 answers

for F in *.vcf.gz ; do   tabix -f -p vcf ${F}  ; done

can't we use parallel some thing like:

parallel  tabix -f -p ::: *.vcf.gz

hello brother what language are you using for the script?

the language is bash

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.

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.

Log in to answer this question.