python - 使用 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。对于这些肽,我还想计算分子量,然后计算同位素分布。分子量的计算适用于蛋白质,我需要转移到肽。我有职位,但如何从列表/数组中提取数字?对不起,如果这很容易,我是新手非常感谢曼弗雷德
解决方案
推荐阅读
- excel - VBA Excel - 文本框验证
- reactjs - 使用 APP.JS 的 npm start 找不到模块
- python - 使用图像处理检测皮肤图像中的血管
- python - Python argparse 可选破折号整数参数
- javascript - Vue/Vuex 在创建的钩子中等待异步调度
- python - 复杂字典的深拷贝
- tensorflow - 导出具有多个服务功能的 DNNLinearCombinedClassifier
- r - R中比例或比率响应变量(0,1)的贝叶斯回归
- c# - 我应该在返回 json 对象的获取请求中使用 IActionResult
- python-3.x - 使用先前保存的模型进行预测:(0) 无效参数:indices[0,9] = 14914 is not in [0, 14480)