Home > other >  Need to translated into gene sequences, amino acid sequence of random code below but run out, excuse
Need to translated into gene sequences, amino acid sequence of random code below but run out, excuse

Time:12-21

Def translate_protein (sequence) :
CodonTable={
'AUA' : 'I' and 'AUC' : 'I', 'AUU' : 'I', 'AUG' : 'M',
'ACA' : 'T', 'ACC' : 'T', 'ACG' : 'T', 'ACU' : 'T',
'AAC' : 'N', 'AAU' : 'N', 'AAA' : 'K' and 'AAG' : 'K',
'AGC' : 'S' and 'AGU' : 'S', 'AGA' : 'R', 'AGG' : 'R',
'CUA' : 'L', 'CUC' : 'L', 'CUG' : 'L', 'CUU' : 'L',
'CCA' : 'P', 'CCC' : 'P', 'CCG' : 'P', 'CCU' : 'P',
'CAC' : 'H', 'CAU' : 'H', 'CAA' : 'Q', 'the CAG' : 'Q',
'CGA' : 'R', 'CGC' : 'R', 'CGG' : 'R', 'CGU:' R ',
'GUA' : 'V', 'GUC' : 'V', 'GUG' : 'V', 'GUU' : 'V',
'" GCA "' : 'A', 'GCC' : 'A', 'GCG' : 'A', 'GCU' : 'A',
'GAC' : 'D', 'a GAU' : 'D', 'the GAA' : 'E', 'GAG' : 'E',
'GGA' : 'G' and 'GGC' : 'G' and 'GGG' : 'G' and 'GGU' : 'G',
'UCA' : 'S' and 'UCC' : 'S', 'UCG' : 'S', 'UCU' : 'S',
'UUC' : 'F', 'UUU' : 'F', 'UUA' : 'L', 'UUG' : 'L',
'UAC' : 'Y', 'UAU' : 'Y', 'UAA' : ', 'UAG' : ',
'UGC', 'C', 'UGU' : 'C', 'the UGA' : ', 'UGG' : 'W',
}
Dnasequence='
For the key, val codonTable in items () :
For n in the range (len (sequence) :
If val==se [n] :
Dnasequence +=codonTable [sequence [n]]
Return dnasequence
Se="MVSKGEEDNMASLPATHELHIFGSINGVDFDMVGQGTGNPNDGYEELNLKSTKGDLQFSPWILVPHIGYGFHQYLPYPDMSPFQAAMVDGSGYQVHRTMQFEDGASLTVNYRYTYEGSHIKGEAQVKGTGFPADGPVMTNSLTAADWCRSKKTYPNDKTIISTFKWSYTTGNGKRYRSTARTTYTFAKPMAANYLKNQPMYVFRKTELKHSKTELNFKEWQKAFTDVMGMDELYKHHHHHH"
Print (translate_protein (se))

CodePudding user response:

1. If val==se [n] : instead of the if val==sequence [n] :
2. Dnasequence +=codonTable [sequence [n]] : dnasequence +=key
3. Return to the first for alignment
4. Se="XXXX" and print (translate_protein (se)) aligned with def
 
Def translate_protein (sequence) :
CodonTable={
'AUA' : 'I' and 'AUC' : 'I', 'AUU' : 'I', 'AUG' : 'M',
'ACA' : 'T', 'ACC' : 'T', 'ACG' : 'T', 'ACU' : 'T',
'AAC' : 'N', 'AAU' : 'N', 'AAA' : 'K' and 'AAG' : 'K',
'AGC' : 'S' and 'AGU' : 'S', 'AGA' : 'R', 'AGG' : 'R',
'CUA' : 'L', 'CUC' : 'L', 'CUG' : 'L', 'CUU' : 'L',
'CCA' : 'P', 'CCC' : 'P', 'CCG' : 'P', 'CCU' : 'P',
'CAC' : 'H', 'CAU' : 'H', 'CAA' : 'Q', 'the CAG' : 'Q',
'CGA' : 'R', 'CGC' : 'R', 'CGG' : 'R', 'CGU:' R ',
'GUA' : 'V', 'GUC' : 'V', 'GUG' : 'V', 'GUU' : 'V',
'" GCA "' : 'A', 'GCC' : 'A', 'GCG' : 'A', 'GCU' : 'A',
'GAC' : 'D', 'a GAU' : 'D', 'the GAA' : 'E', 'GAG' : 'E',
'GGA' : 'G' and 'GGC' : 'G' and 'GGG' : 'G' and 'GGU' : 'G',
'UCA' : 'S' and 'UCC' : 'S', 'UCG' : 'S', 'UCU' : 'S',
'UUC' : 'F', 'UUU' : 'F', 'UUA' : 'L', 'UUG' : 'L',
'UAC' : 'Y', 'UAU' : 'Y', 'UAA' : ', 'UAG' : ',
'UGC', 'C', 'UGU' : 'C', 'the UGA' : ', 'UGG' : 'W',
}
Dnasequence='
For the key, val codonTable in items () :
For n in the range (len (sequence) :
If val==sequence [n] :
Dnasequence +=# key codonTable [sequence [n]]

Return dnasequence

Se="MVSKGEEDNMASLPATHELHIFGSINGVDFDMVGQGTGNPNDGYEELNLKSTKGDLQFSPWILVPHIGYGFHQYLPYPDMSPFQAAMVDGSGYQVHRTMQFEDGASLTVNYRYTYEGSHIKGEAQVKGTGFPADGPVMTNSLTAADWCRSKKTYPNDKTIISTFKWSYTTGNGKRYRSTARTTYTFAKPMAANYLKNQPMYVFRKTELKHSKTELNFKEWQKAFTDVMGMDELYKHHHHHH"
Print (translate_protein (se))

CodePudding user response:

Thank you, by the way if you want to random output in value corresponding to a few key how to write a

CodePudding user response:

refer to the second floor weixin_42819172 response:
thank you, by the way if you want to random output in value corresponding to a few key to how to write a


 
Import the random
Def translate_protein (sequence) :
CodonTable={
'AUA' : 'I' and 'AUC' : 'I', 'AUU' : 'I', 'AUG' : 'M',
'ACA' : 'T', 'ACC' : 'T', 'ACG' : 'T', 'ACU' : 'T',
'AAC' : 'N', 'AAU' : 'N', 'AAA' : 'K' and 'AAG' : 'K',
'AGC' : 'S' and 'AGU' : 'S', 'AGA' : 'R', 'AGG' : 'R',
'CUA' : 'L', 'CUC' : 'L', 'CUG' : 'L', 'CUU' : 'L',
'CCA' : 'P', 'CCC' : 'P', 'CCG' : 'P', 'CCU' : 'P',
'CAC' : 'H', 'CAU' : 'H', 'CAA' : 'Q', 'the CAG' : 'Q',
'CGA' : 'R', 'CGC' : 'R', 'CGG' : 'R', 'CGU:' R ',
'GUA' : 'V', 'GUC' : 'V', 'GUG' : 'V', 'GUU' : 'V',
'" GCA "' : 'A', 'GCC' : 'A', 'GCG' : 'A', 'GCU' : 'A',
'GAC' : 'D', 'a GAU' : 'D', 'the GAA' : 'E', 'GAG' : 'E',
'GGA' : 'G' and 'GGC' : 'G' and 'GGG' : 'G' and 'GGU' : 'G',
'UCA' : 'S' and 'UCC' : 'S', 'UCG' : 'S', 'UCU' : 'S',
'UUC' : 'F', 'UUU' : 'F', 'UUA' : 'L', 'UUG' : 'L',
'UAC' : 'Y', 'UAU' : 'Y', 'UAA' : ', 'UAG' : ',
'UGC', 'C', 'UGU' : 'C', 'the UGA' : ', 'UGG' : 'W',
}
Dnasequence='
Temp=[]
For n in the range (len (sequence) :
For the key, val codonTable in items () :
If val==sequence [n] :
Temp. Append (key)
# # dnasequence +=key codonTable [sequence [n]]

Dnasequence +=\ [random randint (0, len (temp) - 1)]
Temp. The clear ()

Return dnasequence

Se="MVSKGEEDNMASLPATHELHIFGSINGVDFDMVGQGTGNPNDGYEELNLKSTKGDLQFSPWILVPHIGYGFHQYLPYPDMSPFQAAMVDGSGYQVHRTMQFEDGASLTVNYRYTYEGSHIKGEAQVKGTGFPADGPVMTNSLTAADWCRSKKTYPNDKTIISTFKWSYTTGNGKRYRSTARTTYTFAKPMAANYLKNQPMYVFRKTELKHSKTELNFKEWQKAFTDVMGMDELYKHHHHHH"
Print (translate_protein (se))

CodePudding user response:

Biological engineering this is doing? nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related