3
$\begingroup$

I have a filtered VCF file with indels (no SNPs). Does anyone know of a easy way to use bcftools/vcftools to filter out small or large indels (I'm interested in indels between 50-100bp in size)? Thanks!

$\endgroup$
2
  • $\begingroup$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. $\endgroup$
    – Community Bot
    Commented Mar 25 at 20:09
  • $\begingroup$ What is the output to bcftools view -H <file.vcf> | head -n 5 where <file.vcf> is the actual VCF file? $\endgroup$
    – Ram RS
    Commented Mar 25 at 20:58

1 Answer 1

3
$\begingroup$

Vcftools allows you to filter to include or not include a list of sites.

https://vcftools.github.io/man_latest.html#SITE%20FILTERING%20OPTIONS

If you can first grab the locations of indels of this size (for example you could write a python script that goes through your vcf and grabs the location of anything with ref or alt of a length of at least 50 characters), then you can provide vcftools with a list of variants to filter on.

If you are not comfortable writing your own script to look through the file, you could delete the vcf header lines, change the file extension to tsv, then open it in excel. Then you could use excel to filter for those sites and get their positions.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.