Hi everyone,
I am doing a bioinformatics project and I have this code:
def three2one(prot):
code = {"G" : "6", "A" : "7", "L" : "1", "I" : "4",
"R" : "2", "K" : "3", "M" : "5", "C" : "8",
"Y" : "9", "T" : "10", "P" : "11", "S" : "12",
"W" : "14", "D" : "15", "E" : "16", "N" : "17",
"Q" : "18", "F" : "19", "H" : "20", "V" : "21" , "R" : "22"}
newprot = ""
for aa in prot:
newprot+=code.get(aa)
return newprot
prot ="""FGYYHFRPTKLRQWEI"""
print three2one(prot)
what I am trying to do is take a protein sequence in prot variable and have the values that are assigned to those letters in the dictionary to add them. I would really appreciate anyone's help thank you! Currently it only takes the first letter value...this is not homework this is a separate indepedant project of learning.