翻译 - peakPantheR-2: Real Time Annotation

Real Time Annotation

Arnaud Wolfer

2018-02-21

peakPantheR 被设计用来对MS文件进行检测、积分和报告预定义的特征(detection, integration and reporting of pre-defined features)。

对与上述的 “检测、积分和报告预定义的特征” 的理解,我目前是这样的:

detect:发现原始数据中的峰

integrate:计算峰的面积

features:不同组别之间存在差异的峰,这个差异的计算是通过integrate的结果

Real Time Annotation被设置为一次从一个文件中进行多个化合物的检测和积分(detect and integrate)。

使用一个示例数据集,主要目的如下:

  • 详细说明 Real Time Annotation 的概念
  • 应用 Real Time Annotation到一个案例dataset

1. Real Time Annotation 概念

实时的化合物积分(compound integration)的过程如下:

  • 一次在一个文件中处理多个化合物

  • 加载预期的有兴趣的RT / m/z 区域(regions of interest, ROI)的列表

    ROI 实际上就是指你希望探索的化合物的RT / m/z 信息

  • 在每个ROI中检测特征并保留强度最强的一个(highest intensity one)

    原始数据中,峰是通过采集一个一个具有一定intensity 的点构成的,那么keep the highest intensity one,实际上就是在 ROI 这个区域的峰的检测中,记录峰的顶点

  • 确定每个特性的峰值统计(peak statistics)信息

  • 返回内容:

    • TIC (总离子流图)

      就是我们的峰图,这里是是指整个文件的TIC图。

    • 一个表包含从文件中检测到的所有化合物(行:化合物复合,列:统计数值)

    • 每一个 ROI 的 EIC(extracted ion chromatogram,提取离子色谱图)

      就是满足某个分子量范围(m/z)的 TIC 图,这里就是指 ROI 的 m/z 范围内的 TIC 图

    • 来自mzML元数据的样本获取日期时间

    • 将绘制的 EIC 图把保存到本地

2. Real Time Annotation 案例

我们可以使用peakPantheR_singleFileSearch()faahKO 包的一个MS光谱文件(MS spectra file)从获得两个目标特征:

setRepositories(ind=1:4)
install.packages('faahKO')

2.1. Input Data

输入一个光谱数据:

library(faahKO)
## file paths
input_spectraPath <- c(system.file('cdf/KO/ko15.CDF', package = "faahKO"))
input_spectraPath
#> [1] "C:/R/R-3.5.1/library/faahKO/cdf/KO/ko15.CDF"

定义两个目标特征(targeed features)的信息并存储在一个表中:

  • cpdID (numeric)
  • cpdName (character)
  • rtMin (sec)
  • rtMax (sec)
  • rt (sec, optional / NA)
  • mzMin (m/z)
  • mzMax (m/z)
  • mz (m/z, optional / NA)
# targetFeatTable
input_targetFeatTable <- data.frame(matrix(vector(), 2, 8, dimnames=list(c(), c("cpdID", "cpdName", "rtMin", "rt", "rtMax", "mzMin", "mz", "mzMax"))), stringsAsFactors=F)
input_targetFeatTable[1,] <- c("ID-1", "Cpd 1", 3310., 3344.888, 3390., 522.194778, 522.2, 522.205222)
input_targetFeatTable[2,] <- c("ID-2", "Cpd 2", 3280., 3385.577, 3440., 496.195038, 496.2, 496.204962)
input_targetFeatTable[,c(3:8)] <- sapply(input_targetFeatTable[,c(3:8)], as.numeric)
cpdIDcpdNamertMinrtrtMaxmzMinmzmzMax
ID-1Cpd 133103344.8883390522.194778522.2522.205222
ID-2Cpd 232803385.5773440496.195038496.2496.204962

2.2. Run Single File Annotation

peakPantheR_singleFileSearch()singleSpectraDataPath 参数被用于指向将进行分析的文件(input_spectraPath),并将targetFeatTable参数用于指向已知的化合物的信息(input_targetFeatTable):

library(peakPantheR)
annotation <- peakPantheR_singleFileSearch(singleSpectraDataPath = input_spectraPath,
                                           targetFeatTable = input_targetFeatTable,
                                           peakStatistic = TRUE,
                                           verbose = TRUE)
#> Polarity can not be extracted from netCDF files, please set manually the polarity with the 'polarity' method.
#> Reading data from 2 windows
#> Data read in: 0.7 secs
#> Warning: rtMin/rtMax outside of ROI; datapoints cannot be used for mzMin/mzMax calculation, approximate mz and returning ROI$mzMin and ROI$mzMax for ROI #1
#> Found 2/2 features in 0.05 secs
#> Peak statistics done in: 0 secs
#> Feature search done in: 1.12 secs
annotation$TIC
#> [1] 2410533091
annotation$acquTime
#> [1] NA
annotation$peakTable
foundrtMinrtrtMaxmzMinmzmzMax
TRUE3309.7593346.8283385.41522.1948522.2522.2052
TRUE3345.3773386.5293428.279496.2496.2496.2
peakAreamaxIntMeasuredmaxIntPredictedcpdIDcpdNameis_filled
26133727889280901015.8ID-1Cpd 1FALSE
3547214111289601113577ID-2Cpd 2FALSE
ppm_errorrt_dev_sectailingFactorasymmetryFactor
0.023376161.9397591.0153571.026824
0.024601030.95180721.0053781.009318
annotation$curveFit
#> [[1]]
#> $amplitude
#> [1] 162404.8
#> 
#> $center
#> [1] 3341.888
#> 
#> $sigma
#> [1] 0.07878613
#> 
#> $gamma
#> [1] 0.00183361
#> 
#> $fitStatus
#> [1] 2
#> 
#> $curveModel
#> [1] "skewedGaussian"
#> 
#> attr(,"class")
#> [1] "peakPantheR_curveFit"
#> 
#> [[2]]
#> $amplitude
#> [1] 199249.1
#> 
#> $center
#> [1] 3382.577
#> 
#> $sigma
#> [1] 0.07490442
#> 
#> $gamma
#> [1] 0.00114719
#> 
#> $fitStatus
#> [1] 2
#> 
#> $curveModel
#> [1] "skewedGaussian"
#> 
#> attr(,"class")
#> [1] "peakPantheR_curveFit"
annotation$ROIsDataPoint
#> [[1]]
#> rt mz int
#> 1 3315.154 522.2 2187
#> 2 3316.719 522.2 3534
#> 3 3318.284 522.2 6338
#> 4 3319.849 522.2 11718
#> 5 3321.414 522.2 21744
#> 6 3322.979 522.2 37872
#> 7 3324.544 522.2 62424
#> 8 3326.109 522.2 98408
#> 9 3327.673 522.2 152896
#> 10 3329.238 522.2 225984
#> 11 3330.803 522.2 308672
#> 12 3332.368 522.2 399360
#> 13 3333.933 522.2 504000
#> 14 3335.498 522.2 614656
#> 15 3337.063 522.2 711872
#> 16 3338.628 522.2 784704
#> 17 3340.193 522.2 836608
#> 18 3341.758 522.2 866304
#> 19 3343.323 522.2 882304
#> 20 3344.888 522.2 889280
#> 21 3346.453 522.2 888256
#> 22 3348.018 522.2 866816
#> 23 3349.583 522.2 827392
#> 24 3351.148 522.2 777728
#> 25 3352.713 522.2 727040
#> 26 3354.278 522.2 678464
#> 27 3355.843 522.2 629120
#> 28 3357.408 522.2 578048
#> 29 3358.973 522.2 524288
#> 30 3360.538 522.2 471040
#> 31 3362.102 522.2 416320
#> 32 3363.667 522.2 360064
#> 33 3365.232 522.2 302400
#> 34 3366.797 522.2 249152
#> 35 3368.362 522.2 202560
#> 36 3369.927 522.2 161024
#> 37 3371.492 522.2 123520
#> 38 3373.057 522.2 93160
#> 39 3374.622 522.2 71856
#> 40 3376.187 522.2 58392
#> 41 3377.752 522.2 51072
#> 42 3379.317 522.2 48376
#> 43 3380.882 522.2 49168
#> 44 3382.447 522.2 53120
#> 45 3384.012 522.2 62488
#> 46 3385.577 522.2 78680
#> 47 3387.142 522.2 102840
#> 48 3388.707 522.2 134656
#> 
#> [[2]]
#> rt mz int
#> 1 3280.725 496.2 1349
#> 2 3290.115 496.2 2069
#> 3 3291.680 496.2 3103
#> 4 3293.245 496.2 5570
#> 5 3294.809 496.2 10730
#> 6 3296.374 496.2 20904
#> 7 3297.939 496.2 38712
#> 8 3299.504 496.2 64368
#> 9 3301.069 496.2 97096
#> 10 3302.634 496.2 136320
#> 11 3304.199 496.2 182080
#> 12 3305.764 496.2 233472
#> 13 3307.329 496.2 288064
#> 14 3308.894 496.2 341248
#> 15 3310.459 496.2 386560
#> 16 3312.024 496.2 419648
#> 17 3313.589 496.2 441344
#> 18 3315.154 496.2 454592
#> 19 3316.719 496.2 459776
#> 20 3318.284 496.2 456320
#> 21 3319.849 496.2 444736
#> 22 3321.414 496.2 425408
#> 23 3322.979 496.2 397888
#> 24 3324.544 496.2 365952
#> 25 3326.109 496.2 329856
#> 26 3327.673 496.2 288832
#> 27 3329.238 496.2 244864
#> 28 3330.803 496.2 207616
#> 29 3332.368 496.2 177216
#> 30 3333.933 496.2 148544
#> 31 3335.498 496.2 119240
#> 32 3337.063 496.2 94736
#> 33 3338.628 496.2 76832
#> 34 3340.193 496.2 64048
#> 35 3341.758 496.2 53744
#> 36 3343.323 496.2 45704
#> 37 3344.888 496.2 39576
#> 38 3346.453 496.2 35080
#> 39 3348.018 496.2 31432
#> 40 3349.583 496.2 28904
#> 41 3351.148 496.2 27064
#> 42 3352.713 496.2 25632
#> 43 3354.278 496.2 24480
#> 44 3355.843 496.2 23840
#> 45 3357.408 496.2 23688
#> 46 3358.973 496.2 24680
#> 47 3360.538 496.2 28608
#> 48 3362.102 496.2 39616
#> 49 3363.667 496.2 63344
#> 50 3365.232 496.2 107352
#> 51 3366.797 496.2 182144
#> 52 3368.362 496.2 295232
#> 53 3369.927 496.2 438016
#> 54 3371.492 496.2 592256
#> 55 3373.057 496.2 737408
#> 56 3374.622 496.2 858624
#> 57 3376.187 496.2 938368
#> 58 3377.752 496.2 982976
#> 59 3379.317 496.2 1015232
#> 60 3380.882 496.2 1057280
#> 61 3382.447 496.2 1095680
#> 62 3384.012 496.2 1122304
#> 63 3385.577 496.2 1128960
#> 64 3387.142 496.2 1111040
#> 65 3388.707 496.2 1058816
#> 66 3390.272 496.2 996608
#> 67 3391.837 496.2 942272
#> 68 3393.402 496.2 888640
#> 69 3394.966 496.2 820160
#> 70 3396.531 496.2 744448
#> 71 3398.096 496.2 674688
#> 72 3399.661 496.2 609600
#> 73 3401.226 496.2 543552
#> 74 3402.791 496.2 480896
#> 75 3404.356 496.2 428032
#> 76 3405.921 496.2 387520
#> 77 3407.486 496.2 350976
#> 78 3409.051 496.2 313984
#> 79 3410.616 496.2 276224
#> 80 3412.181 496.2 243776
#> 81 3413.746 496.2 219264
#> 82 3415.311 496.2 202368
#> 83 3416.876 496.2 189184
#> 84 3418.441 496.2 174272
#> 85 3420.006 496.2 158080
#> 86 3421.571 496.2 143744
#> 87 3423.136 496.2 135808
#> 88 3424.701 496.2 131648
#> 89 3426.266 496.2 126784
#> 90 3427.831 496.2 118328
#> 91 3429.395 496.2 109144
#> 92 3430.960 496.2 101944
#> 93 3432.525 496.2 96896
#> 94 3434.090 496.2 92048
#> 95 3435.655 496.2 86408
#> 96 3437.220 496.2 81288
#> 97 3438.785 496.2 78144

多个参数控制文件注释:

  • peakStatistic :控制额外峰值统计的计算: “ppm_error”、“rt_dev_sec”、“tailing factor”和“asymmetry factor
  • plotEICsPath :如果不是 NA ,将全部的 ROI 的 EICs 保存为一个.png格式的文件,并保存到提供的路径(例如:'filepath/filename.png')。如果是 NA ,绘制的图形没有被保存。
  • getAcquTime :如果必须从mzML元数据中提取样本获取日期时间。样本获取时间不能从其他文件格式中提取。额外的文件访问将影响运行时间。
  • FIR :如果不是 NULL, 当一个特征没有被发现,定义一个后备集成区域(Fallback Integration Regions, FIR ),然后去积分。
  • verbose: 如果消息详细描述了计算进度,则消耗的时间和和发现的特征(总数和匹配到的目标)必须返回
  • ... :将参数传递给findTargetFeatures来改变peak-picking参数(例如,曲率、采样或拟合的参数(curveModel, the sampling or fitting params))

plotEICsPath生成的摘要图,对应于每个 ROI 的EICs,如下所示:

EICs 绘图: 每个面板对应一个目标特性,其中 EIC 信息提取自mzMinmzMax范围内的数据。红点标志着峰的顶点(peak apex)所在的RT,红线突出显示了基于 RT 的 peakwidth 范围(rtMin、rtMax)。

3. See Also

更新时间:2019-05-22 22:26:49

本文由 石九流 创作,如果您觉得本文不错,请随意赞赏
采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
原文链接:https://blog.computsystmed.com/archives/peakpanther-2-real-time-annotation
最后更新:2019-05-22 22:26:49

评论

Your browser is out of date!

Update your browser to view this website correctly. Update my browser now

×