[BioPython] ambiguous alphabets and alignments

Peter biopython at maubp.freeserve.co.uk
Fri Nov 30 10:14:16 EST 2007


> >>> from Bio import Clustalw
> >>> from Bio.Align import AlignInfo
> >>> from Bio.Alphabet import IUPAC
> >>> alignment = Clustalw.parse_file("align16S/AE000511_16S.aln", alphabet=IUPAC.IUPACAmbiguousDNA)
> >>> summary_aln = AlignInfo.SummaryInfo(alignment)
> >>> pssm = summary_aln.pos_specific_score_matrix()

I think the problem is you are giving Clustalw an alphabet class
rather than an instance of the class.  I am not at a computer with
Biopython installed right now, but I would guess you need to change
one line subtly:

alignment = Clustalw.parse_file("align16S/AE000511_16S.aln",
alphabet=IUPAC.IUPACAmbiguousDNA())

Peter


More information about the BioPython mailing list