Exemple #1
0
    def _get_digested_code(self, window):
        """
        """

        if ProteinSequence.translation_dict is None:
            autoinc = autoincrement(1)
            ProteinSequence.translation_dict = dict( [ ("%s%s%s" %(a,b,c),autoinc.next()) for a in ProteinSequence.dictionary
                                                       for b in ProteinSequence.dictionary
                                                       for c in ProteinSequence.dictionary ] )
                
        
        try:
            return ProteinSequence.translation_dict[window]
        except KeyError:
            return 0        
Exemple #2
0
    def _get_digested_code(self, window):
        """
        """

        if DNASequence.translation_dict is None:
            autoinc = autoincrement(1)
            DNASequence.translation_dict = dict( [ ("%s%s%s%s%s%s%s%s" %(a,b,c,d,e,f,g,h),autoinc.next()) for a in DNASequence.dictionary
                                           for b in DNASequence.dictionary for c in DNASequence.dictionary
                                           for d in DNASequence.dictionary for e in DNASequence.dictionary
                                           for f in DNASequence.dictionary for g in DNASequence.dictionary for h in DNASequence.dictionary ] )
        
        try:
            return DNASequence.translation_dict[window]
        except KeyError:
            return 0        
Exemple #3
0
    def _get_digested_code(self, window):
        """
        """

        if ProteinSequence.translation_dict is None:
            autoinc = autoincrement(1)
            ProteinSequence.translation_dict = dict([
                ("%s%s%s" % (a, b, c), autoinc.next())
                for a in ProteinSequence.dictionary
                for b in ProteinSequence.dictionary
                for c in ProteinSequence.dictionary
            ])

        try:
            return ProteinSequence.translation_dict[window]
        except KeyError:
            return 0
Exemple #4
0
    def _get_digested_code(self, window):
        """
        """

        if DNASequence.translation_dict is None:
            autoinc = autoincrement(1)
            DNASequence.translation_dict = dict([
                ("%s%s%s%s%s%s%s%s" % (a, b, c, d, e, f, g, h), autoinc.next())
                for a in DNASequence.dictionary for b in DNASequence.dictionary
                for c in DNASequence.dictionary for d in DNASequence.dictionary
                for e in DNASequence.dictionary for f in DNASequence.dictionary
                for g in DNASequence.dictionary for h in DNASequence.dictionary
            ])

        try:
            return DNASequence.translation_dict[window]
        except KeyError:
            return 0