import string
seq = 'DHPFWKQTACKHV'
weights = {'A': 71.04, 'C': 103.01, 'D': 115.03, 'E': 129.04, 'F': 147.07,
'G': 57.02, 'H': 137.06, 'I': 113.08, 'K': 128.09, 'L': 113.08,
'M': 131.04, 'N': 114.04, 'P': 97.05, 'Q': 128.06, 'R': 156.10,
'S': 87.03, 'T': 101.05, 'V': 99.07, 'W': 186.08, 'Y': 163.06 }
weight = sum()
print ("The molecular weight of this protein is", weight)
答案 0 :(得分:5)
对于p
中的每种蛋白seq
,将其权重weights[p]
添加到weight
:
weight = sum(weights[p] for p in seq) # => 1577.7599999999998