[Biopython] Error with new biopython with pos_specific_score_matrix()

Sebastian Bassi sbassi at gmail.com
Thu May 21 21:57:33 UTC 2020


I have a code that used to work I think in 1.52 or so.
This is the code I am testing now in 1.76:

from Bio import AlignIO
from Bio.Align.AlignInfo import SummaryInfo
from Bio.Alphabet import ProteinAlphabet

align = AlignIO.read('samples/cas9align.fasta', 'fasta')
align._alphabet = ProteinAlphabet()
summary = SummaryInfo(align)
summary.pos_specific_score_matrix()

I get

/usr/local/lib/python3.6/dist-packages/Bio/Align/AlignInfo.py
<https://localhost:8080/#> in _guess_consensus_alphabet(self,
ambiguous)    196             if not isinstance(alt, a.__class__):
197                 raise ValueError("Alignment contains a sequence
with \
--> 198                                 an incompatible alphabet.")
199     200         # Check the ambiguous character we are going to
use in the consensus


ValueError: Alignment contains a sequence wit an incompatible alphabet.



The alignment alphabet is protein, so I don't know what is wrong with it.
This is the alignment file I am using:
https://github.com/Serulab/Py4Bio/blob/master/samples/cas9align.fasta

I will appreciate any help.

Best,
SB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20200521/3f682ada/attachment.htm>


More information about the Biopython mailing list