Question: How to filter variants called within n base pairs of each other
1
gravatar for phongphak.06
2.4 years ago by
phongphak.0610
phongphak.0610 wrote:

I've filtered variants based on quality and depth using bcftools, but I also want to filter them that were called within 5 base pairs of each other. Is there any tools that can do this?

Example

Before filter:

1 153489 A T 
1 154895 C T
1 154898 G C
1 157355 C A

After filter:

1 153489 A T 
1 157355 C A
sequencing snp next-gen vcf • 515 views
ADD COMMENTlink modified 2.4 years ago by Pierre Lindenbaum134k • written 2.4 years ago by phongphak.0610
0
gravatar for Pierre Lindenbaum
2.4 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum134k wrote:

using vcffilterjdk: http://lindenb.github.io/jvarkit/VcfFilterJdk.html

$ java -jar dist/vcffilterjdk.jar --body -e 'String prev_contig=null;int prev_end=-1; public Object apply(final VariantContext vc) {boolean ret=!(vc.getContig().equals(prev_contig)  && vc.getStart() - prev_end <=5); prev_contig=vc.getContig();prev_end=vc.getEnd();return ret; }'  in.vcf
ADD COMMENTlink written 2.4 years ago by Pierre Lindenbaum134k

Thank you so much, I'll try this :)

ADD REPLYlink written 2.4 years ago by phongphak.0610
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: 2685 users visited in the last hour
_