BCFtools: filtering variants by position
1
0
Entering edit mode
2.3 years ago
Timotheus ▴ 40

Hello,

I'm trying to remove variants that are within 1000 bp of contig ends from by bcf file using BCFtools. I know how to remove those from the beggining:

bcftools filter -i 'POS>1000' my.bcf -o my_filtered.bcf

...but not ends. I thought about adding a column of contig lengths to my vcf when calling with BCFtools mpileup/call, and doing something like:

bcftools filter -i 'POS>1000 && POS<END-1000' my.bcf -o my_filtered.bcf

but I'm unable to produce the 'END' field. I'd appreciate any help.

bcftools snps • 1.2k views
ADD COMMENT
3
Entering edit mode
2.3 years ago
bcftools view --regions-file keep-intervals.bed -O b -o my_filtered.bcf  my.bcf
ADD COMMENT
0
Entering edit mode

Thank you, it works well!

ADD REPLY

Login before adding your answer.

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