extract variants from 1000 Genome VCF files
1
0
Entering edit mode
12 months ago

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 • 740 views
ADD COMMENT
0
Entering edit mode

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
ADD REPLY
0
Entering edit mode

I'm unsure if this could be correlated

no, it's not.

ADD REPLY
2
Entering edit mode
12 months ago

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

ADD COMMENT
0
Entering edit mode

Thank you! That was the problem!

ADD REPLY

Login before adding your answer.

Traffic: 2057 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6