Thanks for your suggestion. I can see that 'bedtools closest' will do the job, but looking at the bcftools manual, I don't see a direct way to go from VCF to bed. Am I missing something?
How to calculate distribution of SNP-Indel/complex events distances from a vcf
Hi All,
Hope you are safe and well!
I'm currently filtering vcf (non-human) and want to remove SNPs that are very near to indels and complex events, as these are usually considered spurious.
Rather than using an arbitrary cutoff, id like to choose one based on the empirical distribution of SNP-indel distances. Does anyone have an efficient way to calculate the distance to the nearest Indel or complex event (in bp) for each SNP in a VCF?
Thanks in advance!
Sean
• 1,450 views
•
link
1 answer
convert the INDEL vcf to bed using bcftools
convert the SNP vcf to bed using bcftools
use "bedtools closest" to select the coordinates of the SNPS close to an INDEL .
remove the resulting bed from the original vcf using bcftools.
• 0 views
•
link
Log in to answer this question.