-
Calculating Protein MassBioinformatics/Rosalind 2019. 3. 2. 23:50
단백질의 질량을 구하는 문제이다. 원래 아미노산이 펩타이드 결합을하면서 물이 빠져나가 단백질이되면 그것을 고려해줘야하지만 설명에서 we avoid the complication of having to distinguish between residues and non-residues by only considering peptides excised from the middle of the protein.이라고 되어있으므로 그냥 단순히 더하면 된다.
from functools import reduce
MASS_TABLE = {'A': 71.03711, 'C': 103.00919, 'D': 115.02694, 'E': 129.04259, 'F': 147.06841,
'G': 57.02146, 'H': 137.05891, 'I': 113.08406, 'K': 128.09496, 'L': 113.08406,
'M': 131.04049, 'N': 114.04293, 'P': 97.05276, 'Q': 128.05858, 'R': 156.10111,
'S': 87.03203, 'T': 101.04768, 'V': 99.06841, 'W': 186.07931, 'Y': 163.06333}
with open('rosalind_prtm.txt') as f:
data = f.read().strip()
print(reduce(lambda a,b: a+b, map(lambda prot: MASS_TABLE[prot], data)))'Bioinformatics > Rosalind' 카테고리의 다른 글
Independent Alleles (0) 2019.06.08 Locating Restriction Sites (0) 2019.03.04 RNA Splicing (0) 2019.03.03 Open Reading Frames (0) 2019.03.02 github (0) 2019.01.31 댓글