Thank you!
• 0 views
•
link
Hello everyone, is there an efficient way to split a given vcf file (lets say for chromosome 1) into several sub-vcf files each of which contain 10mb each pertaining to the same chromosome? Many thanks in advance!
I wrote http://lindenb.github.io/jvarkit/VcfToIntervals.html
(not tested)
bcftools view in.vcf.gz | java -jar dist/vcf2intervals.jar --bed --distance "10mb" --min-distance 0 | awk '{printf("%s:%d-%s\n",$1,int($2)+1,$3);}' | while read R
do
bcftools view -O z -o "${R//[:-]/_}.out.vcf.gz" "in.vcf.gz" "${R}"
done
Thank you!
Log in to answer this question.