Logo Search packages:      
Sourcecode: python-biopython version File versions

def Bio::Align::AlignInfo::SummaryInfo::_get_base_replacements (   self,
  skip_items = [] 
) [private]

Get a zeroed dictonary of all possible letter combinations.

This looks at the type of alphabet and gets the letters for it.
It then creates a dictionary with all possible combinations of these
letters as keys (ie. ('A', 'G')) and sets the values as zero.

Returns:
o The base dictionary created
o A list of alphabet items to skip when filling the dictionary.Right
now the only thing I can imagine in this list is gap characters, but
maybe X's or something else might be useful later. This will also
include any characters that are specified to be skipped.

Definition at line 300 of file AlignInfo.py.

00300                                                      :
        """Get a zeroed dictonary of all possible letter combinations.

        This looks at the type of alphabet and gets the letters for it.
        It then creates a dictionary with all possible combinations of these
        letters as keys (ie. ('A', 'G')) and sets the values as zero.

        Returns:
        o The base dictionary created
        o A list of alphabet items to skip when filling the dictionary.Right
        now the only thing I can imagine in this list is gap characters, but
        maybe X's or something else might be useful later. This will also
        include any characters that are specified to be skipped.
        """
        base_dictionary = {}
        all_letters = self.alignment._alphabet.letters

        # if we have a gapped alphabet we need to find the gap character
        # and drop it out
        if isinstance(self.alignment._alphabet, Alphabet.Gapped):
            skip_items.append(self.alignment._alphabet.gap_char)
            all_letters = string.replace(all_letters,
                                         self.alignment._alphabet.gap_char,
                                         '')

        # now create the dictionary
        for first_letter in all_letters:
            for second_letter in all_letters:
                if (first_letter not in skip_items and
                    second_letter not in skip_items):
                    base_dictionary[(first_letter, second_letter)] = 0

        return base_dictionary, skip_items


    def pos_specific_score_matrix(self, axis_seq = None,


Generated by  Doxygen 1.6.0   Back to index