Removing indels +/- a buffer area? How? : bioinformatics

Hey everyone. Hopefully an easy question but my Googling and looking for papers hasn’t really come up with much. I am using a software (IBDMix) to analyze some Neanderthal DNA vs. Modern humans using the new HG38 1000 Genomes data from earlier this year. The method in the IBDMix paper has a lot of filtering, and one of them is to remove non-biallelic SNPS, indels, and a 5bp buffer zone around the indel. I have no idea how to do this. I have the code for the indel removal using bcftools but I have no idea how to add a buffer, and unless I am looking at the wrong tool, it seems like this may not be possible on bcftools.

Any suggestions? Thank you.

Here is my code:

for i in {1..22}; do bcftools view –max-alleles 2 –exclude-types indels CCDG_14151_B01_GRM_WGS_2020-08-05_chr${i}.filtered.shapeit2-duohmm-phased.vcf.gz > Chrom${i}.vcf; done

Read more here: Source link