This is a test version of Biostars. For the public version, visit https://www.biostars.org.
split vcf file into multiple files

Hi,

I have tried to split vcf into multiple file with following codes:

for file in *.vcf*; do
 for sample in `bcftools query -l $file`; do
 bcftools view -c1 -Oz -s $sample -o ${file/.vcf*/.$sample.vcf.gz} $file
 done
done

But it gives me error: Could not parse argument: --compression-level $file

What does it mean, how can I get rid of it. Thanks in advance!

wgs vcf bcftools

what is your shell ? what is the output of ${SHELL} ? are you using bash ? replace "bcftools view" with "echo" , what is the output ?

0 answers

No answers yet.

Log in to answer this question.