Bcftools extracting list of markers by chr and pos
1
1
Entering edit mode
4 weeks ago
am29 ▴ 60

I want to extract a list of markers from the vcf file. However, many of these markers don't have rsID, and I was wondering if is possible to extract the list of markers with bcftools using just their Chr and Pos as input?

bcftools • 293 views
ADD COMMENT
4
Entering edit mode
4 weeks ago

read the manual for the option --regions-file https://samtools.github.io/bcftools/bcftools.html

The columns of the tab-delimited file can contain either positions (two-column format: CHROM, POS) or intervals (three-column format: CHROM, BEG, END), but not both. Positions are 1-based and inclusive.

ADD COMMENT
0
Entering edit mode

Figured it out! For anyone who might need it:

bcftools view -R CHR_BP_tab.txt file.vcf.gz > file_extracted.vcf.gz

CHR_BP_tab.txt is tab-delimited file with chromosomal and base positions, without header

ADD REPLY
0
Entering edit mode

Figured what out? Pierre showed you the exact option to use as well as how to provide the input file.

ADD REPLY

Login before adding your answer.

Traffic: 1535 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