treetime/treeanc.py
def dict_sequence(self, node, keep_var_ambigs=False):
        """
        For VCF-based TreeAnc objects, we do not want to store the entire
        sequence on every node, as they could be large. Instead, this returns the dict
        of variants & their positions for this sequence. This is used in place of
        :py:meth:`treetime.TreeAnc.expanded_sequence` for VCF-based objects throughout TreeAnc. However, users can still
        call :py:meth:`expanded_sequence` if they require the full sequence.

        Parameters
        ----------
         node  : PhyloTree.Clade
            Tree node

        Returns
        -------
         seq : dict
            dict where keys are the basepair position (numbering from 0) and value is the variant call

        """
        seq = {}

        node_seq = node.cseq
        if keep_var_ambigs and hasattr(node, "original_cseq") and node.is_terminal():
            node_seq = node.original_cseq

        for pos in self.nonref_positions:
            cseqLoc = self.full_to_reduced_sequence_map[pos]
            base = node_seq[cseqLoc]
            if self.ref[pos] != base:
                seq[pos] = base

        return seq
def dict_sequence(self, node, keep_var_ambigs=False):
        """
        For VCF-based TreeAnc objects, we do not want to store the entire
        sequence on every node, as they could be large. Instead, this returns the dict
        of variants & their positions for this sequence. This is used in place of
        :py:meth:`treetime.TreeAnc.expanded_sequence` for VCF-based objects throughout TreeAnc. However, users can still
        call :py:meth:`expanded_sequence` if they require the full sequence.

        Parameters
        ----------
         node  : PhyloTree.Clade
            Tree node

        Returns
        -------
         seq : dict
            dict where keys are the basepair position (numbering from 0) and value is the variant call

        """
        seq = {}

        node_seq = node.cseq
        if keep_var_ambigs and hasattr(node, "original_cseq") and node.is_terminal():
            node_seq = node.original_cseq

        for pos in self.nonref_positions:
            cseqLoc = self.full_to_reduced_sequence_map[pos]
            base = node_seq[cseqLoc]
            if self.ref[pos] != base:
                seq[pos] = base

        return seq
For VCF-based TreeAnc objects, we do not want to store the entire
        sequence on every node, as they could be large. Instead, this returns the dict
        of variants & their positions for this sequence. This is used in place of
        :py:meth:`treetime.TreeAnc.expanded_sequence` for VCF-based objects throughout TreeAnc. However, users can still
        call :py:meth:`expanded_sequence` if they require the full sequence.

        Parameters
        ----------
         node  : PhyloTree.Clade
            Tree node

        Returns
        -------
         seq : dict
            dict where keys are the basepair position (numbering from 0) and value is the variant call