1
$\begingroup$

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?

$\endgroup$
1
  • $\begingroup$ 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. $\endgroup$
    – M__
    Oct 18 '19 at 6:56
1
$\begingroup$

Smith-Waterman is guaranteed to give you the best alignment given your choice of substitution matrix. For a few such tiny sequences, it's what I would use. Many implementations exist.

$\endgroup$
0
$\begingroup$

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

$\endgroup$
0
$\begingroup$

blastn should be able to output this format of alignment result, using the --outfmt 0 option

$\endgroup$
0
$\begingroup$

Is there any particular reason why you don't want a BAM output format? If the sequences are sufficiently long, then the CIGAR field from the SAM output of minimap2 could be used:

minimap2 -a seq1.fa seq2.fa | samtools view | awk '{print $6}'
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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