Thank you so much, I'll try this :)
• 1 views
•
link
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
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
Thank you so much, I'll try this :)
Log in to answer this question.