This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filtering VCF variants based on txt file with variants CHROM, POS and ID

Hello everyone!

Let's say I have a vcf file (version 4.2). Then, I have a list of variants that I want to exclude from my VCF file. This list is a TXT file containing 3 columns: chromosome, position and ID (dbsnp) where available.

For example, lets say I have the data from this database:

http://srv00.recas.ba.infn.it/atlas/download.html

Then I select the three columns of chromosome name, position and ID for dbsnp.

Is there anyway to remove these variants from my VCF files?

vcf

1 answer

You only need CHR and POS from the file. Use bcftools view -T ^file.txt. See: https://samtools.github.io/bcftools/bcftools.html#view

Log in to answer this question.