首页 > 解决方案 > 使用 python 从蛋白质序列中提取胰蛋白酶肽

问题描述

我刚开始使用 Python,并从 Stack Overflow 获得了许多有用的建议。我有一个蛋白质序列,可以通过枚举序列中 K 和 R 的位置来确定。例如:

def character_indexes_comprehension ():
    match1 = "R"
    match2 = "K"
    
    return [index for index, character in enumerate(seq1, 0) if character == match1 or character == match2]
print (character_indexes_comprehension())

or

print ([pos for pos, char in enumerate(seq1) if char == "K" or char == "R"])

or

xpos = ([pos for pos, char in enumerate(seq1) if char == "K" or char == "R"])
print ("Liste xpos", xpos)

都给了我序列中 K 和 R 的位置。我还想包括错过的乳沟,这意味着从 K 和 R 的位置到字符串中的第二个和第三个 K 或 R,如何做到这一点。现在我想提取 K 或 R 之后的氨基酸之间的肽,直到包括下一个 K 或 R。对于这些肽,我还想计算分子量,然后计算同位素分布。分子量的计算适用于蛋白质,我需要转移到肽。我有职位,但如何从列表/数组中提取数字?对不起,如果这很容易,我是新手非常感谢曼弗雷德

标签: pythonstringpositionsubstringcharacter

解决方案


推荐阅读