This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Subset VCF by regions, but record which region each kept variant is found in

Hi all. I have ~50,000 short chromosomal regions. I would like to, for around 1,000 samples, have a matrix of 50,000x1,000 0s and 1s in which a 0 represents the sample y not having a SNP in the region x, and a 1 represents the sample y having a SNP in the region x.

The easiest way I can imagine doing this is running "bcftools view -R 50k_regions.txt my_vcf.vcf.gz -Oz -o my_output.vcf.gz". Then, I would take the remaining variants and map them to the 50,000 regions as the output does not do this for me.

However, my pipeline would be much more straight forward (and I imagine faster) if bcftools could keep this mapping information for me and output it in the standard VCF output of "view". Is this possible?

vcf bcftools

0 answers

No answers yet.

Log in to answer this question.