This is a test version of Biostars. For the public version, visit https://www.biostars.org.
extract variants from 1000 Genome VCF files

Hi everyone,

I have a gVCF containing genetic information from different individuals, and I would like to extract specific SNPs. The SNPs of interest are listed in a BED file with the following structure (the end position rapresent the real position of the SNP):

chr #start-position #end-position

chr1 0 1

chr1 344 345

chr2 10 11

...

For the extraction process, I used the following command in a folder where I only have the BED file and the VCF file:

bcftools view -Ou -R snp.bed file.vcf.gz > output

I found these instructions here.

However it gives me an empty output with only the header of the original vcf. But I know there are the variants I need in it.

Can someone help me find a solution to this problem?

Thank you so much!

bcftools bed snp vcf

I'm unsure if this could be correlated, but before using bcftools view, I generated the index file for the VCF using the command:

tabix -p vcf file.vcf.gz

I'm unsure if this could be correlated

no, it's not.

1 answer

check the chromosomes use the same notation 'chr1' vs '1'.

Log in to answer this question.