Question: How to remove regions from a vcf file ?
2
gravatar for d0ct0r
4.5 years ago by
d0ct0r20
Denmark/Aarhus/Aarhus University
d0ct0r20 wrote:

I need to remove  specific regions (in a bed file) from a vcf file.  I am aware of the bcftools view options to filter regions. But It only subsets the regions. I need to do the opposite. I need to drop those regions from the vcf file. My solution is by subtracting the bed regions from vcf file regions using bedtools and then using the resulting bed file to filter the vcf file. But I think there will be some straightforward way to do it.

bed vcftools bcftools genome vcf • 3.4k views
ADD COMMENTlink modified 4.5 years ago by andrew.j.skelton735.9k • written 4.5 years ago by d0ct0r20
5
bedtools intersect -v -a file.vcf -b bed.vcf -wa > out.vcf


Are you looking for something like this? With this command, you'll get all the variants that do not overlap with the regions specified in the bed file.

ADD REPLYlink modified 4.5 years ago • written 4.5 years ago by iraun3.7k

What is -v option? It says unrecognized parameter

ADD REPLYlink modified 6 months ago by RamRS27k • written 4.5 years ago by d0ct0r20
1

Sorry. My mistake. Try now the command. -v is the argument for printing all the vcf variants that DO NOT overlap with the given region, without -v, you'd get the overlapping variants.

ADD REPLYlink written 4.5 years ago by iraun3.7k

intersectBed

ADD REPLYlink written 4.5 years ago by pengchy420
0
gravatar for andrew.j.skelton73
4.5 years ago by
London
andrew.j.skelton735.9k wrote:

Check out this post

ADD COMMENTlink written 4.5 years ago by andrew.j.skelton735.9k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 908 users visited in the last hour