Dear Users, 

I couldn't find any script that could split my vcf file that has scaffolds (10322) but not chromes number, i would like to split each scaffold into individual vcf file or a text file. 

Thank you
<p>First get a list of uniq scaffolds:</p>

<pre>
bgzip merge-test.vcf
tabix merge-test.vcf.gz
gzcat merge-test.vcf.gz | grep -v &quot;^#&quot; | cut -f1 | sort | uniq &gt; scaff_names​</pre>

<p>Then Split by individual scaffolds:</p>

<pre>
parallel -a scaff_names &quot;bcftools view merge-test.vcf.gz {} &gt; {.}.vcf&quot;​</pre>

<p>or by for loop:</p>

<pre>
for scaff in `cat scaff_names`; do bcftools view merge-test.vcf.gz $scaff &gt; $scaff.vcf; done​
</pre>
