When using Biopython alignment to align two protein sequences, the output does not show the mismatched amino acids. Would you please have some suggestions to display the mismatched amino acids by Biopython?
The following is the code for alignment by Biopython. I tried different options, the problem could not be resolved.
----------------------------------------------------------
from Bio import pairwise2
from Bio.pairwise2 import format_alignment
proteinSeqQuery='HRTLGLLLHTQVSIQQLLKLPAECFHPKPKVNSVLIKLTRHTTDVPDKYWKLYTYFVSKWVNREYRQLFTKNQFHQAMKHAK'
proteinSeqseqFound='HRTLGLLLHTQVSIKQLLKLPAECFHPKPKVNSALIKLTRHTTDVPDKYWKLYTYFVSKWVNREYRQLFTKNQFHQAMKYAK'
alignments = pairwise2.align.localxx(proteinSeqQuery,proteinSeqseqFound)
print('Score',alignments[0][2])
print(format_alignment(*alignments[0]))
----------------------------------------------------------------
The program output and the output from EMBI-EBI EMBOSS Water (Protein Alignment) are shown as follows:
Biopython:
HRTLGLLLHTQVSI-QQLLKLPAECFHPKPKVNSVLIKLTRHTTDVPDKYWKLYTYFVSKWVNREYRQLFTKNQFHQAMKHAK
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HRTLGLLLHTQVSIKQ-LLKLPAECFHPKPKVNSALIKLTRHTTDVPDKYWKLYTYFVSKWVNREYRQLFTKNQFHQAMKYAK
EMBL-EBI:
EMBOSS_001 1 HRTLGLLLHTQVSIQQLLKLPAECFHPKPKVNSVLIKLTRHTTDVPDKYW 50
||||||||||||||:||||||||||||||||||.||||||||||||||||
EMBOSS_001 1 HRTLGLLLHTQVSIKQLLKLPAECFHPKPKVNSALIKLTRHTTDVPDKYW 50
EMBOSS_001 51 KLYTYFVSKWVNREYRQLFTKNQFHQAMKHAK 82
|||||||||||||||||||||||||||||:||
EMBOSS_001 51 KLYTYFVSKWVNREYRQLFTKNQFHQAMKYAK 82
and in this picture: output
Thank you in advance!
I added (code) markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:
Thanks! I will use this approach for formatting code.
Please say which version of Biopython you are using, since the pairwise code was rewritten in Biopython 1.68