研究化学物质,特别是ETD产品的质谱。
masstodon的Python项目详细描述
masstodon
你的python3模块用于研究质谱中的电子转移离解,更普遍的是在质谱中发现物质。
先决条件
Python3
安装
可以直接从python包索引安装包:
pip install masstodon
否则,请下载此github repo,使用默认分支,并使用以下命令安装软件:
pip install .
从包含setup.py的文件夹中。 这将允许您通过
简单地导入masstodon
import masstodon
运行
命令行界面
从pip安装后,可以从命令行运行masstodon
。
考虑到从末端输入具有可能的修饰和电荷的多个化合物是不舒服的,我们限制了(目前)在精确研究一种蛋白质及其c/z裂解模式的传统情况下运行masstodon
的可能性。
要查看可能参数的详细描述,请打开终端(或者在windows上打开anaconda提示符,但说真的,windows?你应该感到内疚……)然后写信
masstodon -h
要运行masstodon
,您至少需要提供:
- 具有光谱的文件
- 氨基酸序列(fasta)
- 物质的电荷
所有其他参数都可以跳过,但这可能很愚蠢。
例如,如果你知道在一个特定的氨基酸上有一个特殊的ptm,
您应该提供-m
参数,依此类推。
python脚本
导入数据。您可以使用masstodon
分析单个质谱。
这很可能是对{em1}$orbitrap或普通质谱的单独扫描。
导入质谱最简单的方法是显示一个纯ascii文件,每行有m/z和强度值,用制表符或其他空格符号分隔。
运行masstodon。
要使用单个化合物调用masstodon
,请使用masstodon_single
函数。
例如:
from masstodon.data.substanceP_wh15_wv400 import mz, intensity, fasta, modifications, z # input data from masstodon.masstodon import masstodon_single # masstodon-proper from pprint import pprint # nicer output in the terminal print(mz) # array([ 61.01 , 64.152, 66.515, ..., 1403.9 , 1485.578, 1497.226]) print(intensity) # array([844.4 , 25.35, 190.1 , ..., 15.38, 55.62, 21. ]) print(fasta) # 'RPKPQQFFGLM' print(modifications) # {'11': {'C_carbo': {'H': 1, 'N': 1, 'O': -1}}} # (modify 11th amino-acid [starting from 1 for user-friendliness], # by adding the chemical diff unto the group of atoms that include the C_carbo.) print(z) # 3 m = masstodon_single(mz, intensity, fasta, z, min_mz_diff = 1.1, # this is actually the default modifications = modifications, orbitrap = False, # this ain't an orbitrap profile spectrum threshold = "0.05 Da", # how far away to search for isotopic_coverage = .999, # IsoSpec isotopic envelope coverage min_prob = .8, # minimal acceptance probability of a candidate theoretical envelope. std_cnt = 3 # m/z standard deviation count filter) # for min_prob and std_cnt check out the publication under the filtering procedures. print("Save spectrum to where you started your python from.") m.plotly("spectrum.html", shape='rectangles', show=True) print("Getting stats on inintial and final number of nodes and edges in the deconvolution graph.") pprint(m.ome.G_stats) print("Errors: absolute deviations and relative distance between spectra.") pprint(m.imperator.errors()) print("Estimates of intensities of reactions and fragmentations.") pprint(m.cz_simple.intensities) pprint(m.cz_simple.probabilities) print("Save all things under the given path.") m.write(".")