def get_reconstructed_alignment(self):
"""
Get the multiple sequence alignment including reconstructed sequences for
the internal nodes.
"""
from Bio.Align import MultipleSeqAlignment
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
self.logger("TreeAnc.get_reconstructed_alignment ...",2)
if not hasattr(self.tree.root, 'sequence'):
self.logger("TreeAnc.reconstructed_alignment... reconstruction not yet done",3)
self.reconstruct_anc('ml')
new_aln = MultipleSeqAlignment([SeqRecord(id=n.name, seq=Seq("".join(n.sequence)), description="")
for n in self.tree.find_clades()])
return new_aln
评论列表
文章目录