尿布数据的分析、转换和可视化。

diapysef的Python项目详细描述


作者:Max Frank,Hannes Roest日期:2018-04-26

使用dia-pasef数据时,diabysef是一个方便的包。它 具有将Bruker原始文件转换为 openms可以理解。因此openswath可以用来分析数据 而toppview可以用于可视化。尿布本身也有一些 基本的可视化功能,允许显示窗口设置 在前驱图的上下文中运行的dia-pasef。

安装

由于包包含 一些小的示例数据和少量的bruker代码。你可以 通过提供的轮子安装软件包。确保你有 安装了python和pip。然后,在终端命令提示符下,运行:

## Optional: if conversion with compression is required install the newest pyopenms nightly build
## Otherwhise, from the folder containing the .whl file run
pip install diapysef-0.1-py2.py3-none-any.whl

在windows上,确保添加了python的脚本/文件夹 安装到您的路径,以便能够从 任何地方。

转换原始文件

假设您已将python scripts文件夹添加到路径中,则可以 只需运行:

convertTDFtoMzML.py

如果您看到这样的输出:

Bruker sdk not found. Some functionalities that need access to raw data will not be available. To activate that functionality place libtimsdata.so (Linux) or timsdata.dll in the src folder.

This functionality can only be carried out if the bruker sdk is present. Please install it first. The sdk can be installed by installing proteowizard(version >=3, http://proteowizard.sourceforge.net), or by placing the a library file in your path (For windows this will be timsdata.dll and for Linux libtimsdata.so).

你必须安装一个可以处理tdf3.0的bruker sdk。你可以 将sdk文件放在工作目录中(最安全的选项)或 在你路上的某个地方。另一个选择是安装最新版本 支持访问bruker sdk的proteowizard。

现在您可以不带参数运行该工具以获取用法信息:
bash convertTDFtoMzML.py
Found Bruker sdk. Access to the raw data is possible.

usage: convertTDFtoMzML.py [-h] -a ANALYSIS_DIR -o OUTPUT_FNAME
                           [-m MERGE_SCANS] [-r FRAME_LIMIT FRAME_LIMIT]
convertTDFtoMzML.py: error: the following arguments are required: -a/--analysis_dir, -o/--output_name

数据访问和便利功能

其他工具作为脚本提供,但也可以在 更模块化的方式直接从wihtin python。它可以访问raw 来自pasef和dia-pasef的文件运行并读取一些maxquant txt 文件夹。由于这些函数不需要访问原始数据, 它们也可以在没有sdk的情况下运行。

获取窗口布局文件

这可以通过命令行工具完成:

get_dia_windows.py 20180320_AnBr_SA_diaPASEF_200ng_HeLa_Rost_Method_4_a_01_A1_01_2143.d/ windows.csv

或者在python中:

importdiapysefasdp# Open connection to a DIA-PASEF rundia=dp.TimsData("/media/max/D6E01AF3E01ADA17/code/dia-pasef/bruker/20180320_AnBr_SA_diaPASEF_200ng_HeLa_Rost_Method_4_a_01_A1_01_2143.d/")# Obtain the window layout from the first frameswin=dia.get_windows()# Save as csvwin.to_csv("window_layout.csv")print("File Written")
File Written

注释离子迁移率

这对于转换与 不同的离子迁移率取决于运行到1/k0 标准化措施。

例如,要为openswath生成一个库 目标提取。我们可以在 使用原始文件中的校准信息的maxquant输出。

annotate_mq_ionmobility.py 20180309_HeLa_MQ_combined/ 20180309_TIMS1_Metab_AnBr_SA_200ng_HELA_Bremen13_14_A1_01_2129.d/ annotated1K0

或者在python中:

importdiapysefasdp#Open connection to the pasef data filepas=dp.PasefData("/media/max/D6E01AF3E01ADA17/code/dia-pasef/bruker/20180309_TIMS1_Metab_AnBr_SA_200ng_HELA_Bremen13_14_A1_01_2129.d/")# Open connection to the Maxquant output from the same runmq=dp.PasefMQData("/media/max/D6E01AF3E01ADA17/code/dia-pasef/bruker/20180309_HeLa_MQ_combined/")## Annotate all peptides# Read in the allPeptides table from the output and annotate with 1/K0 using the calibration obtained from pasmq.get_all_peptides()mq.annotate_ion_mobility(pas)#Or more directlymq.get_all_peptides(pas)# Save the tableall_pep=mq.all_peptidesall_pep.to_csv("all_peptides_1K0.csv")## Annotate evidence# Read in the allPeptides table from the output and annotate with 1/K0 using the calibration obtained from pasmq.get_evidence()mq.annotate_ion_mobility(pas)#Or more directlymq.get_evidence(pas)# Save the tableev=mq.evidenceev.to_csv("evidence_1K0.csv")

绘制窗口布局

通过以上操作,您可以获得一个前兆图(所有ms1 特征或与肽证据)和窗口布局。它是 提供信息,将这些信息组合在一起,以深入了解 窗户覆盖了前驱空间。

我们提供以下绘图功能,作为命令行脚本

plot_dia_windows.py window_layout.csv all_peptides_1K0.csv

或者在python中:

importdiapysefasdpimportpandasaspddia=dp.TimsData("/media/max/D6E01AF3E01ADA17/code/dia-pasef/bruker/20180320_AnBr_SA_diaPASEF_200ng_HeLa_Rost_Method_4_a_01_A1_01_2143.d/")win=dia.get_windows()# Diapysef saves a precursor layout from a Pasef run internally so it is possible to quickly plot windows without# specifying a precursor mapdp.plot_window_layout(windows=win)# If the windows should be plotted against a certain precursor map (e.g. all_peptides obtained above) you can specify# an additional dataframeprecursors=pd.read_csv("all_peptides_1K0.csv")dp.plot_window_layout(windows=win,precursor_map=precursors)
output_7_0.pngoutput_7_1.png

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
使用jaxrpc的Java eclipse WebService客户端   java编程方式在对象上写入名称   java Spring批处理:重试后跳过   java Android错误:错误:任务执行失败:应用程序:transformClassesWithDexForDebug'   带有清单文件nullPointerException的java Android元数据   spring Java Quartz调度作业停止运行   JavaMockito:如何在不调用实际方法的情况下,模拟带有参数和无效返回类型的静态方法?   java Tomcat连接池问题无法在关闭的连接上调用方法   java如何交换列表中的项目?   java如何停止线程并通过Toast在线程中正确显示文本?   java为什么连续写入OutputStream时偏移量0不会导致重复字节?   java我无法生成头文件   不兼容的返回类型错误java   修改值后键值对的java Jolt转换规范   java有自动更新Javadoc的工具吗?   java线程如何在ints自身实例类中共享变量   java继承一个非gwt模块   java Hibernate xml配置   使用netty4异步调用的java链接HTTP请求响应