treetime/treeanc.py
def get_reconstructed_alignment(self):
        """
        Get the multiple sequence alignment, including reconstructed sequences for
        the internal nodes.

        Returns
        -------
        new_aln : MultipleSeqAlignment
           Alignment including sequences of all 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('probabilistic')

        new_aln = MultipleSeqAlignment([SeqRecord(id=n.name, seq=Seq("".join(n.sequence)), description="")
                                        for n in self.tree.find_clades()])

        return new_aln
def get_reconstructed_alignment(self):
        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('probabilistic')

        new_aln = MultipleSeqAlignment([SeqRecord(id=n.name, seq=Seq("".join(n.sequence)), description="")
                                        for n in self.tree.find_clades()])

        return new_aln
def get_reconstructed_alignment ( self ) : 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 ( 'probabilistic' ) new_aln = MultipleSeqAlignment ( [ SeqRecord ( id = n . name , seq = Seq ( "" . join ( n . sequence ) ) , description = "" ) for n in self . tree . find_clades ( ) ] ) return new_aln
Get the multiple sequence alignment, including reconstructed sequences for
        the internal nodes.

        Returns
        -------
        new_aln : MultipleSeqAlignment
           Alignment including sequences of all internal nodes
Get the multiple sequence alignment including reconstructed sequences for the internal nodes .