1
$\begingroup$

what is the opposite of .translate() function calls ?

I mean let's say I am given an amino acid string CYCLIC, how do I obtain all the possible combinations of DNA strings before the translation process ?

Note: I was told that degeneracy has an important role in this particular aspect, but I am not entirely sure about the degeneracy calculation in the following screenshot highlighted in yellow color.

degeneracy

The degenerate code is as follows:

table = {
        'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M',
        'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T',
        'AAC':'N', 'AAT':'N', 'AAA':'K', 'AAG':'K',
        'AGC':'S', 'AGT':'S', 'AGA':'R', 'AGG':'R',                 
        'CTA':'L', 'CTC':'L', 'CTG':'L', 'CTT':'L',
        'CCA':'P', 'CCC':'P', 'CCG':'P', 'CCT':'P',
        'CAC':'H', 'CAT':'H', 'CAA':'Q', 'CAG':'Q',
        'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGT':'R',
        'GTA':'V', 'GTC':'V', 'GTG':'V', 'GTT':'V',
        'GCA':'A', 'GCC':'A', 'GCG':'A', 'GCT':'A',
        'GAC':'D', 'GAT':'D', 'GAA':'E', 'GAG':'E',
        'GGA':'G', 'GGC':'G', 'GGG':'G', 'GGT':'G',
        'TCA':'S', 'TCC':'S', 'TCG':'S', 'TCT':'S',
        'TTC':'F', 'TTT':'F', 'TTA':'L', 'TTG':'L',
        'TAC':'Y', 'TAT':'Y', 'TAA':'_', 'TAG':'_',
        'TGC':'C', 'TGT':'C', 'TGA':'_', 'TGG':'W',
    }
$\endgroup$
3
  • 1
    $\begingroup$ There isn't a function that will do the reverse translation, so it user code and requires the degenerate amino acid table. Degeneracy is important into primer design agreed. I'm not around for several days. $\endgroup$
    – M__
    Aug 2, 2022 at 14:25
  • $\begingroup$ May I know where exactly did you obtain the degenerate code table ? $\endgroup$
    – kevin
    Aug 2, 2022 at 14:43
  • $\begingroup$ There everywhere, I got it from Geek for Geeks $\endgroup$
    – M__
    Aug 2, 2022 at 15:02

1 Answer 1

3
$\begingroup$

Given the table above the solution for CYCLE is:

from itertools import product

prot = 'CYCLE'
degenDict = dict()
for v,k in table.items():
    if k in degenDict:
        degenDict[k].append(v)
    else:
        degenDict[k]=[]
        degenDict[k].append(v)
nucs = [degenDict[resid] for resid in prot]
for degenNuc in product(*nucs):
    print(''.join(degenNuc))

TGCTACTGCCTAGAA TGCTACTGCCTAGAG TGCTACTGCCTCGAA TGCTACTGCCTCGAG TGCTACTGCCTGGAA TGCTACTGCCTGGAG TGCTACTGCCTTGAA TGCTACTGCCTTGAG TGCTACTGCTTAGAA TGCTACTGCTTAGAG TGCTACTGCTTGGAA TGCTACTGCTTGGAG TGCTACTGTCTAGAA TGCTACTGTCTAGAG TGCTACTGTCTCGAA TGCTACTGTCTCGAG TGCTACTGTCTGGAA TGCTACTGTCTGGAG TGCTACTGTCTTGAA TGCTACTGTCTTGAG TGCTACTGTTTAGAA TGCTACTGTTTAGAG TGCTACTGTTTGGAA TGCTACTGTTTGGAG TGCTATTGCCTAGAA TGCTATTGCCTAGAG TGCTATTGCCTCGAA TGCTATTGCCTCGAG TGCTATTGCCTGGAA TGCTATTGCCTGGAG TGCTATTGCCTTGAA TGCTATTGCCTTGAG TGCTATTGCTTAGAA TGCTATTGCTTAGAG TGCTATTGCTTGGAA TGCTATTGCTTGGAG TGCTATTGTCTAGAA TGCTATTGTCTAGAG TGCTATTGTCTCGAA TGCTATTGTCTCGAG TGCTATTGTCTGGAA TGCTATTGTCTGGAG TGCTATTGTCTTGAA TGCTATTGTCTTGAG TGCTATTGTTTAGAA TGCTATTGTTTAGAG TGCTATTGTTTGGAA TGCTATTGTTTGGAG TGTTACTGCCTAGAA TGTTACTGCCTAGAG TGTTACTGCCTCGAA TGTTACTGCCTCGAG TGTTACTGCCTGGAA TGTTACTGCCTGGAG TGTTACTGCCTTGAA TGTTACTGCCTTGAG TGTTACTGCTTAGAA TGTTACTGCTTAGAG TGTTACTGCTTGGAA TGTTACTGCTTGGAG TGTTACTGTCTAGAA TGTTACTGTCTAGAG TGTTACTGTCTCGAA TGTTACTGTCTCGAG TGTTACTGTCTGGAA TGTTACTGTCTGGAG TGTTACTGTCTTGAA TGTTACTGTCTTGAG TGTTACTGTTTAGAA TGTTACTGTTTAGAG TGTTACTGTTTGGAA TGTTACTGTTTGGAG TGTTATTGCCTAGAA TGTTATTGCCTAGAG TGTTATTGCCTCGAA TGTTATTGCCTCGAG TGTTATTGCCTGGAA TGTTATTGCCTGGAG TGTTATTGCCTTGAA TGTTATTGCCTTGAG TGTTATTGCTTAGAA TGTTATTGCTTAGAG TGTTATTGCTTGGAA TGTTATTGCTTGGAG TGTTATTGTCTAGAA TGTTATTGTCTAGAG TGTTATTGTCTCGAA TGTTATTGTCTCGAG TGTTATTGTCTGGAA TGTTATTGTCTGGAG TGTTATTGTCTTGAA TGTTATTGTCTTGAG TGTTATTGTTTAGAA TGTTATTGTTTAGAG TGTTATTGTTTGGAA TGTTATTGTTTGGAG

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.