计算质谱的质量干扰和标准同位素比值。
interference-calculator的Python项目详细描述
干扰计算器
干扰计算器计算出在给定目标质量和范围的情况下,由一系列原子(样品成分)组合而成的所有分子(干扰)。这个计算考虑了样本原子的所有同位素,并建立了一个给定大小的分子。结果显示在表格和质谱图中。
该程序还可以显示任何给定元素的同位素标准比值。结果包括天然丰度、标准比值、反比值和测量同位素比值的标准物质。
安装
要使用interference_计算器,首先需要安装python。下载python here。安装python后,打开一个终端窗口(windows上的命令窗口)并键入:
$ pip install interference_calculator
在命令行上安装干涉计算器。
运行
要启动程序,只需运行ui.py脚本。
$ python interference_calculator/ui.py
用于ipython
interference_计算器也可以从交互式解释器或在另一个python脚本中使用。例如,要计算铁周围的质量干扰(fe,质量56),给定一个由si、ca、o和h组成的样品,就这样使用它。
>>> import interference_calculator as ic >>> ic.interference(['Ca', 'O', 'H', 'Si'], 'Fe') molecule charge mass/charge mass/charge diff MRP \ 0 O Ca - 1 55.958054 0.023118 2419.529988 1 Si2 - 1 55.954402 0.019466 2873.520086 2 18O3 D - 1 56.012129 0.077193 724.609657 3 18O3 H2 - 1 56.013677 0.078741 710.361726 4 17O 18O2 H D - 1 56.019926 0.084990 658.132608 5 D4 48Ca - 1 56.009478 0.074542 750.376520 6 O 18O2 D2 - 1 56.021986 0.087050 642.561143 7 17O2 18O D2 - 1 56.026175 0.091239 613.057735 8 Fe - 1 55.934936 0.000000 inf probability target 0 9.671034e-01 False 1 8.506314e-01 False 2 7.556442e-15 False 3 3.999731e-06 False 4 1.103164e-13 False 5 1.100126e-18 False 6 3.721482e-09 False 7 1.103556e-16 False 8 9.175400e-01 True >>> ic.standard_ratio(['Ca', 'O']) isotope mass abundance ratio inverse ratio standard 13 16O 15.994915 0.997621 1.000000 1.000000 VSMOW 14 17O 16.999132 0.000379 0.000380 2632.244327 VSMOW 15 18O 17.999160 0.002000 0.002005 498.710558 VSMOW 41 40Ca 39.962591 0.969410 1.000000 1.000000 NIST SRM 915 42 42Ca 41.958618 0.006470 0.006674 149.831530 NIST SRM 915 43 43Ca 42.958766 0.001350 0.001393 718.081481 NIST SRM 915 44 44Ca 43.955482 0.020860 0.021518 46.472196 NIST SRM 915 45 46Ca 45.953690 0.000040 0.000041 24235.250000 NIST SRM 915 46 48Ca 47.952523 0.001870 0.001929 518.401070 NIST SRM 915
还有一个类Molecule,可以用分子公式解析字符串。经过解析,它保存了分子的信息,如质量、元素、同位素和相对丰度。Molecule.formula()可用于以各种方式排版分子式。:
>>> m = ic.Molecule('C2 15N O3 2+') >>> m.elements ['N', 'C', 'O'] >>> m.isotopes ['15N', '12C', '16O'] >>> m.masses [15.000108899, 12.0, 15.99491462] >>> m.mass 86.985949918818 >>> m.abundances [0.003663, 0.988922, 0.9976206] >>> m.abundance 1.317443808955884e-05 >>> m.formula(style='latex') '$\\mathrm{{}^{15}{N}{C}_{2}{O}_{3}{}^{2-}}$'
有关详细帮助和选项,请参见docstrings。