# Mutations in sequences relative to reference (histogram)

I have a reference sequence of amino acids that I compare other sequences to using Bio.pairwise2.align.globalmx of Biopython package (one to many compare - one by one [is there a better way?])

It's works fine but only returns strings of the alignment with very little metadata.

Now I want to extract the indices of the amino acids that are different than the reference sequence and plot it in some kind of histogram according to protein features:

For example:

• pos 1-36: 3 mutations.
• pos 37-202: 4 mutations.
• pos 203: 1 mutation
• pos 204-660: 0 mutations

Is there any builtin package to do so?

How can I get the data of diff between 2 sequences in python? I mean which AA changed to which AA and at each position. Bio.pairwise2.align.globalmx returns some data structures of strings (see below) that can be printed but does not contain the locations in a convenient way.

LLGHKVNPFKALYNRIDMK-QVEALVEASKEE
||||||||||||||||||||||||||||||||

• Can you post a minimal, working, and complete example of what you have gotten to work so far? Oct 27, 2017 at 14:36
• Lets start with more basic question: How can I get the data of diff between 2 sequences in python? I mean which AA changed to which AA and at each position. Bio.pairwise2.align.globalmx returns some data structures of strings (see below) that can be printed but does not contain the locations in a convenient way. LLGHKVNPFKALYNRIDMK-QVEALVEASKEE |||||||||||||||||||||||||||||||| LLGHKVNPFKALYNRIDM-RQVEALVEASKEE Oct 27, 2017 at 15:31
• The comments section is not a good place to discuss other questions. Probably best to open a new post. Oct 27, 2017 at 21:09
• Do you just want a graphical representation of the diverse regions of a multiple sequence alignment? Oct 27, 2017 at 22:43
• I'm not sure if multiple sequence alignment is what I need because I have one reference sequence that I compare all the others to. I need one-to-many comparison (which now I do by many one-to-one comparisons). Correct me if I'm wrong. Oct 28, 2017 at 7:26

\$: alignbuddy input.gb --generate_alignment mafft | \