# Find indels between two short sequences

I have two sequences, say AAAGCTCGAGG and AAAGCGAGG. I need a convenient tool which shows me insertions or deletions between these, i.e. in this case something like

AAAGCTCGAGG
|||||  ||||
AAAGC  GAGG
2bp deletion starting at base pair 5


and also insertions such as

AAAGCTC GAGG
||||||| ||||
AAAGCTCTGAGG
1bp insertion at base pair 7


Does something like that exist? Blastn finds the alignment of course, but only outputs the number of gaps, not their position. I guess I could parse a pileup, but do not want to create a bam file from one of the sequences first, so samtools seems to be out. Any further ideas?

• IMO you need to write custom code. I just done this (again) via pandas, albeit elegant its a lot of code. Its quite easy to do via Perl5.
– M__
Oct 18 '19 at 6:56

Perhaps you could use something like SearchIO to parse the output of BLAST, to get the desired alignment attributes: https://biopython.org/DIST/docs/api/Bio.SearchIO.BlastIO-module.html
blastn should be able to output this format of alignment result, using the --outfmt 0 option
minimap2 -a seq1.fa seq2.fa | samtools view | awk '{print \$6}'