From 750213d3fe501432a829fe0486d66c9db4f6c0e1 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 3 Apr 2024 13:52:10 +0000 Subject: [PATCH] cli-14591-2396 --- apple-touch-icon-120x120.png | Bin 9676 -> 9676 bytes apple-touch-icon-152x152.png | Bin 13068 -> 13068 bytes apple-touch-icon-180x180.png | Bin 16269 -> 16269 bytes apple-touch-icon-60x60.png | Bin 4132 -> 4132 bytes apple-touch-icon-76x76.png | Bin 5395 -> 5395 bytes apple-touch-icon.png | Bin 16269 -> 16269 bytes articles/LC-MS-feature-grouping.html | 2 +- articles/xcms-direct-injection.html | 2 +- articles/xcms-lcms-ms.html | 28 +- articles/xcms.html | 381 ++------------------------- favicon-16x16.png | Bin 1059 -> 1059 bytes favicon-32x32.png | Bin 2074 -> 2074 bytes pkgdown.yml | 2 +- reference/PlainTextParam.html | 2 +- reference/XCMSnExp-class.html | 2 +- reference/XChromatogram.html | 2 +- reference/applyAdjustedRtime.html | 2 +- reference/chromPeakSpectra.html | 12 +- reference/fillChromPeaks.html | 10 +- search.json | 2 +- 20 files changed, 53 insertions(+), 394 deletions(-) diff --git a/apple-touch-icon-120x120.png b/apple-touch-icon-120x120.png index 4a4afbde3fd1e6884f6157fc73c0983834791419..8ffcc9d9309953873a172fbdb548db74e18f4ead 100644 GIT binary patch delta 62 zcmX@(ea3r2H9N1K#`8HGPc}BqR1q|`GBL9ESw~d?Rdn+mu1}L= GRr3LzeH3*7 diff --git a/apple-touch-icon-152x152.png b/apple-touch-icon-152x152.png index 50e4d7c7025d184ffb2c70ae7ffdcbe4f5616378..1230e1bee4166c0915438570f191fb5e717681eb 100644 GIT binary patch delta 62 zcmeB4>q(nX&CaW*IbpU%(Z;5mhJwacCT3P9hS~-ORt5(8i;iEMoMWVbDjN5{K6mn5 GqkI66Iuw}z delta 62 zcmeB4>q(nX&CYG5yZ35%&&H;khJuDxrWRHvrrHJuRt5$s-**0*oMWVbDk{2~(QWcv GqkI6q92Bzv diff --git a/apple-touch-icon-180x180.png b/apple-touch-icon-180x180.png index c89cedee4930b95064928495f9b2d138b38c6f4f..d5df5f68deac0c6bd25332b7503756a620dac2d3 100644 GIT binary patch delta 62 zcmeCJ@2#Iu&CaW*#W^YS#Kxv5J3(VB6EiClBW(i%D+2>Lue&~z-`Xjlisp-_ewZw0 GpAP_b0TU_! delta 62 zcmeCJ@2#Iu&CYG5r*enQY-3ZDouHwWsfCq^nYMv}m4QL1+~V}fZ|xLNMOB=oZ%>x9 G&j$cmj}jmN diff --git a/apple-touch-icon-60x60.png b/apple-touch-icon-60x60.png index caaa7bc718a92c5bf98ec23569a7c4fb7bb1c16f..3878a8ad07b2a70535336b85d182e94b071b40aa 100644 GIT binary patch delta 62 zcmZ3YutZ@(H9N1K8iR`JxvOw6o|Ewl{`tPBh`{O^{Y+`_MbDtd5{@$$)A G`SSr)ZWCMp delta 62 zcmZ3YutZ@(H9NPJmh#3!`Wu@*@(CJRnOazx7-<_ASQ!{B3~Vo%+`_MbDtdv({>0?1 G{P_T9xf3}6 diff --git a/apple-touch-icon-76x76.png b/apple-touch-icon-76x76.png index 2ddd0a7540167cd459f33199052e16c658d1e7a8..f5042723f9c910d6cd5b329116c2accd58307d56 100644 GIT binary patch delta 89 zcmbQNHCbyyH9N1KdbzS_>Bgo9!cN9kCT3Q~mf8jeRt5%Q9S!Rl7#LJbTq844S>iv#1KV8`c(_z$xB4?0f<5wMF0Q* delta 89 zcmbQNHCbyyH9NPJcF49*J2y5x5Oy-OGPSTWG1fLPure@USL->zz`&qd;u=wsl30>z hm7AZEnO4bQWME{XYXC&XA%-X#%BoFjCNB}m2LSPG8lnII diff --git a/apple-touch-icon.png b/apple-touch-icon.png index 5173ab88f5609f520ff47972861afae7cc5acbbf..c3ba5cbf741000452478d0cd00cd55d389757a58 100644 GIT binary patch delta 62 zcmeCJ@2#Iu&CaW*T{kr{ZevrFouILmiJ6s&v9^JMm4U$y+iO22zqM096+M}d=Q3H& GJ|6&@`4n9M delta 62 zcmeCJ@2#Iu&CYG5AAH+v!N#U2J3&J$Qwu8-b8Q0yD+7binJX?&eru

Package: xcms
Authors: Johannes Rainer
Modified: 2024-04-03 10:51:43.204338
Compiled: Wed Apr 3 12:01:30 2024

+

Package: xcms
Authors: Johannes Rainer
Modified: 2024-04-03 12:41:11.589186
Compiled: Wed Apr 3 13:49:19 2024

Introduction

diff --git a/articles/xcms-direct-injection.html b/articles/xcms-direct-injection.html index 1ea86c36..56b5633e 100644 --- a/articles/xcms-direct-injection.html +++ b/articles/xcms-direct-injection.html @@ -255,7 +255,7 @@

Correspondence## Number of spectra: 4 ## MSn retention times: -1:59 - -1:59 minutes ## - - - Processing information - - - -## Data loaded [Wed Apr 3 12:02:22 2024] +## Data loaded [Wed Apr 3 13:50:09 2024] ## MSnbase version: 2.29.4 ## - - - Meta data - - - ## phenoData diff --git a/articles/xcms-lcms-ms.html b/articles/xcms-lcms-ms.html index 9ea545a1..7c3dc39e 100644 --- a/articles/xcms-lcms-ms.html +++ b/articles/xcms-lcms-ms.html @@ -103,7 +103,7 @@ if (links[i].hostname != window.location.hostname) links[i].target = '_blank'; }); -

Package: xcms
Authors: Johannes Rainer, Michael Witting
Modified: 2024-04-03 10:51:43.204338
Compiled: Wed Apr 3 12:02:31 2024

+

Package: xcms
Authors: Johannes Rainer, Michael Witting
Modified: 2024-04-03 12:41:11.589186
Compiled: Wed Apr 3 13:50:18 2024

Introduction

@@ -267,9 +267,9 @@

Analysis of DDA data## file(s): ## PestMix1_DDA.mzML ## Processing: -## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 12:02:44 2024] -## Filter: select MS level(s) 2 [Wed Apr 3 12:02:51 2024] -## Merge 1 Spectra into one [Wed Apr 3 12:02:52 2024] +## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 13:50:30 2024] +## Filter: select MS level(s) 2 [Wed Apr 3 13:50:37 2024] +## Merge 1 Spectra into one [Wed Apr 3 13:50:37 2024]

By default chromPeakSpectra returns all spectra associated with a MS1 chromatographic peak, but parameter method allows to choose and return only one spectrum per @@ -343,9 +343,9 @@

Analysis of DDA data## file(s): ## PestMix1_DDA.mzML ## Processing: -## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 12:02:44 2024] -## Filter: select MS level(s) 2 [Wed Apr 3 12:02:51 2024] -## Merge 1 Spectra into one [Wed Apr 3 12:02:52 2024] +## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 13:50:30 2024] +## Filter: select MS level(s) 2 [Wed Apr 3 13:50:37 2024] +## Merge 1 Spectra into one [Wed Apr 3 13:50:37 2024]

There are 5 MS2 spectra representing fragmentation of the ion(s) measured in our candidate chromatographic peak. We next reduce this to a single MS2 spectrum using the combineSpectra method @@ -371,9 +371,9 @@

Analysis of DDA data## 1 2 418.926 3505 ## ... 34 more variables/columns. ## Processing: -## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 12:02:44 2024] -## Filter: select MS level(s) 2 [Wed Apr 3 12:02:51 2024] -## Merge 1 Spectra into one [Wed Apr 3 12:02:52 2024] +## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 13:50:30 2024] +## Filter: select MS level(s) 2 [Wed Apr 3 13:50:37 2024] +## Merge 1 Spectra into one [Wed Apr 3 13:50:37 2024] ## ...1 more processings. Use 'processingLog' to list all.

Mass peaks from all input spectra with a difference in m/z smaller 20 ppm (parameter ppm) were combined into one peak and the @@ -832,7 +832,7 @@

Reconstruction of MS2 spectra## CP62 2 574.942 NA ## ... 20 more variables/columns. ## Processing: -## Merge 1 Spectra into one [Wed Apr 3 12:02:59 2024] +## Merge 1 Spectra into one [Wed Apr 3 13:50:45 2024]

As a result we got a Spectra object of length equal to the number of MS1 peaks in our data. The length of a spectrum represents the number of peaks it contains. Thus, a length of 0 indicates that no @@ -994,9 +994,9 @@

Reconstruction of MS2 spectra## file(s): ## PestMix1_DDA.mzML ## Processing: -## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 12:02:44 2024] -## Filter: select MS level(s) 2 [Wed Apr 3 12:02:51 2024] -## Merge 1 Spectra into one [Wed Apr 3 12:02:52 2024] +## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 13:50:30 2024] +## Filter: select MS level(s) 2 [Wed Apr 3 13:50:37 2024] +## Merge 1 Spectra into one [Wed Apr 3 13:50:37 2024]

In total 5 spectra were measured, some with a relatively high number of peaks. Next we combine them into a consensus spectrum.

diff --git a/articles/xcms.html b/articles/xcms.html
index 529f433e..3ad3d4c0 100644
--- a/articles/xcms.html
+++ b/articles/xcms.html
@@ -103,7 +103,7 @@
     if (links[i].hostname != window.location.hostname)
       links[i].target = '_blank';
 });
-

Package: xcms
Authors: Johannes Rainer
Modified: 2024-04-03 10:51:43.204338
Compiled: Wed Apr 3 12:03:08 2024

+

Package: xcms
Authors: Johannes Rainer
Modified: 2024-04-03 12:41:11.593186
Compiled: Wed Apr 3 13:50:53 2024

Introduction

@@ -1690,7 +1690,7 @@

Final result## [[1]] ## Object of class "XProcessHistory" ## type: Peak detection -## date: Wed Apr 3 12:03:44 2024 +## date: Wed Apr 3 13:51:27 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: CentWaveParam @@ -1699,7 +1699,7 @@

Final result## [[2]] ## Object of class "XProcessHistory" ## type: Peak refinement -## date: Wed Apr 3 12:03:46 2024 +## date: Wed Apr 3 13:51:29 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: MergeNeighboringPeaksParam @@ -1708,7 +1708,7 @@

Final result## [[3]] ## Object of class "XProcessHistory" ## type: Peak grouping -## date: Wed Apr 3 12:03:58 2024 +## date: Wed Apr 3 13:51:42 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: PeakDensityParam @@ -1717,7 +1717,7 @@

Final result## [[4]] ## Object of class "XProcessHistory" ## type: Retention time correction -## date: Wed Apr 3 12:03:58 2024 +## date: Wed Apr 3 13:51:42 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: PeakGroupsParam @@ -1726,7 +1726,7 @@

Final result## [[5]] ## Object of class "XProcessHistory" ## type: Peak grouping -## date: Wed Apr 3 12:04:03 2024 +## date: Wed Apr 3 13:51:46 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: PeakDensityParam @@ -1735,7 +1735,7 @@

Final result## [[6]] ## Object of class "XProcessHistory" ## type: Missing peak filling -## date: Wed Apr 3 12:04:08 2024 +## date: Wed Apr 3 13:51:52 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: ChromPeakAreaParam @@ -1747,7 +1747,7 @@

Final resultprocessHistory(faahko)[[1]]

## Object of class "XProcessHistory"
 ##  type: Peak detection 
-##  date: Wed Apr  3 12:03:44 2024 
+##  date: Wed Apr  3 13:51:27 2024 
 ##  info:  
 ##  fileIndex: 1,2,3,4,5,6,7,8 
 ##  Parameter class: CentWaveParam 
@@ -1983,355 +1983,14 @@ 

Alignment to an external ref
## 4 features were removed
 ref_mz_rt <- featureDefinitions(ref)[, c("mzmed","rtmed")]
-ref_mz_rt
-
##        mzmed    rtmed
-## FT001 200.10 2902.634
-## FT002 205.00 2789.901
-## FT003 206.00 2789.405
-## FT004 207.10 2718.560
-## FT005 233.00 3023.579
-## FT006 241.10 3683.299
-## FT007 242.10 3663.791
-## FT008 244.10 2833.307
-## FT009 249.10 3676.265
-## FT010 250.10 3674.656
-## FT011 255.15 3682.395
-## FT012 256.15 3677.129
-## FT013 266.20 3668.967
-## FT014 267.20 3668.040
-## FT015 268.20 3660.653
-## FT016 269.20 3891.155
-## FT017 272.10 3125.878
-## FT018 272.10 2733.522
-## FT019 279.00 2788.435
-## FT020 280.00 2792.156
-## FT021 281.20 3668.777
-## FT022 281.10 2787.464
-## FT023 282.20 3667.853
-## FT024 282.20 3475.313
-## FT025 283.20 3888.408
-## FT026 283.20 3665.355
-## FT027 284.10 2719.668
-## FT028 284.20 3695.535
-## FT029 286.20 3263.973
-## FT030 288.10 2799.792
-## FT031 289.10 2795.482
-## FT032 296.10 2730.256
-## FT033 300.20 3404.692
-## FT034 301.00 2789.217
-## FT035 301.20 3404.692
-## FT036 302.00 2623.296
-## FT037 302.00 2790.972
-## FT038 304.10 2923.870
-## FT039 305.10 2927.597
-## FT040 305.10 3504.720
-## FT041 306.10 3509.791
-## FT042 306.10 2936.499
-## FT043 307.00 2625.024
-## FT044 308.10 3259.275
-## FT045 309.10 2923.324
-## FT046 309.20 3669.158
-## FT047 309.10 3477.216
-## FT048 310.20 3653.792
-## FT049 311.10 3078.746
-## FT050 312.10 2998.566
-## FT051 312.20 3870.436
-## FT052 313.00 2788.781
-## FT053 313.20 3298.254
-## FT054 314.00 2788.704
-## FT055 314.15 3294.617
-## FT056 316.20 3079.072
-## FT057 317.00 2789.028
-## FT058 317.20 3083.760
-## FT059 321.20 3670.730
-## FT060 322.15 3507.645
-## FT061 322.10 3405.784
-## FT062 323.10 3504.998
-## FT063 324.10 2791.233
-## FT064 324.20 3290.215
-## FT065 326.20 3421.241
-## FT066 327.10 3498.317
-## FT067 328.20 3636.850
-## FT068 329.10 3501.392
-## FT069 329.20 3642.045
-## FT070 330.20 3643.682
-## FT071 331.20 3501.392
-## FT072 335.00 2788.704
-## FT073 336.00 2788.834
-## FT074 337.00 2554.317
-## FT075 338.10 3026.218
-## FT076 338.20 3668.967
-## FT077 338.20 3837.743
-## FT078 338.10 2789.028
-## FT079 339.20 3325.293
-## FT080 339.10 3129.855
-## FT081 340.10 3324.565
-## FT082 343.00 2684.205
-## FT083 343.10 2748.230
-## FT084 344.00 2685.831
-## FT085 344.20 3347.607
-## FT087 345.00 2685.895
-## FT088 346.10 3500.358
-## FT089 347.10 3504.998
-## FT090 348.20 3488.902
-## FT091 348.20 3306.792
-## FT092 350.20 3659.019
-## FT093 351.10 3503.953
-## FT094 352.10 3506.280
-## FT095 353.10 3504.855
-## FT096 354.20 3625.272
-## FT097 354.15 2793.799
-## FT098 355.20 3630.614
-## FT099 356.20 3840.640
-## FT100 357.20 3840.896
-## FT101 357.20 3478.920
-## FT102 359.00 3507.002
-## FT103 359.20 3724.544
-## FT104 360.00 2688.960
-## FT105 361.10 3168.466
-## FT106 361.10 2692.876
-## FT107 362.10 3169.834
-## FT108 362.10 2688.842
-## FT109 363.20 3267.053
-## FT110 363.10 3475.879
-## FT111 363.10 2880.969
-## FT112 364.20 3724.889
-## FT113 365.00 2686.765
-## FT114 365.00 2596.692
-## FT115 365.10 3406.876
-## FT116 366.00 2686.697
-## FT117 366.10 2790.396
-## FT118 366.20 3848.377
-## FT119 367.20 3531.475
-## FT120 367.20 4133.723
-## FT121 368.20 3533.547
-## FT122 370.20 3070.980
-## FT123 371.20 3638.709
-## FT124 371.20 3078.794
-## FT125 372.20 3259.275
-## FT126 372.20 3588.662
-## FT127 373.20 3262.143
-## FT128 376.20 3721.949
-## FT129 376.20 3473.786
-## FT130 379.10 3336.024
-## FT131 380.10 3160.644
-## FT132 380.20 3337.932
-## FT133 381.00 2684.371
-## FT134 381.10 3162.297
-## FT135 382.10 3260.500
-## FT136 382.20 3804.470
-## FT137 384.20 3998.978
-## FT138 385.10 3174.725
-## FT139 385.20 3454.142
-## FT140 386.20 3459.187
-## FT141 386.10 3170.726
-## FT142 389.20 3356.946
-## FT143 390.20 3356.872
-## FT144 391.10 3628.830
-## FT145 392.10 3629.508
-## FT146 392.20 2924.703
-## FT147 395.20 3724.144
-## FT148 396.20 3331.732
-## FT149 398.20 3311.895
-## FT150 398.20 3411.698
-## FT152 399.10 2798.412
-## FT153 400.10 2788.834
-## FT154 400.20 3599.478
-## FT155 401.20 3750.015
-## FT156 401.20 3598.683
-## FT157 404.10 2694.947
-## FT158 408.20 3458.669
-## FT159 408.10 2898.149
-## FT160 410.30 3942.862
-## FT161 411.20 3949.346
-## FT162 412.30 4122.768
-## FT163 413.10 3629.316
-## FT164 413.30 4126.558
-## FT165 414.20 3057.467
-## FT166 414.20 3640.275
-## FT167 416.10 2687.495
-## FT168 419.20 3774.261
-## FT169 423.10 3265.400
-## FT170 424.20 2954.912
-## FT171 424.20 3411.500
-## FT172 426.10 3018.408
-## FT173 426.20 3612.085
-## FT174 426.95 2689.693
-## FT175 427.10 3015.764
-## FT176 427.20 3612.085
-## FT177 429.20 3886.382
-## FT178 429.20 4046.373
-## FT179 430.10 2688.338
-## FT180 430.20 3885.895
-## FT181 431.10 2688.179
-## FT182 433.20 3817.913
-## FT183 436.20 3634.969
-## FT184 437.10 3234.009
-## FT185 438.20 3464.381
-## FT186 438.30 4065.152
-## FT187 439.20 3455.346
-## FT188 439.30 4068.469
-## FT189 440.20 3473.260
-## FT190 444.10 2687.328
-## FT191 444.20 2899.671
-## FT192 445.20 4056.466
-## FT193 447.20 3873.089
-## FT194 448.20 3873.680
-## FT195 448.20 3406.055
-## FT196 448.20 3563.688
-## FT197 449.20 3309.212
-## FT198 449.20 3404.502
-## FT199 452.10 3077.721
-## FT200 454.10 3298.016
-## FT201 455.10 3301.799
-## FT202 456.10 3291.767
-## FT203 458.20 3044.896
-## FT204 459.20 3036.864
-## FT205 462.20 3267.764
-## FT206 463.20 3039.707
-## FT207 464.20 3469.956
-## FT208 465.20 3469.475
-## FT209 466.20 3474.891
-## FT210 466.20 3706.509
-## FT211 467.20 3706.499
-## FT212 468.20 3139.599
-## FT213 468.30 2941.095
-## FT214 469.20 3146.568
-## FT215 474.10 3077.306
-## FT216 476.10 3284.737
-## FT217 478.20 3627.751
-## FT218 479.20 3623.061
-## FT219 480.20 3322.559
-## FT220 481.20 3324.503
-## FT221 482.20 3614.155
-## FT222 482.20 3323.935
-## FT223 483.20 3609.223
-## FT224 484.20 3613.406
-## FT225 485.20 3025.916
-## FT226 486.20 3474.656
-## FT227 486.20 2801.329
-## FT228 488.20 2882.531
-## FT229 491.20 3415.016
-## FT230 492.20 3670.340
-## FT231 493.20 3672.549
-## FT232 494.20 3428.262
-## FT233 494.20 3129.368
-## FT234 495.20 3427.712
-## FT235 496.20 3381.885
-## FT236 497.20 3392.735
-## FT237 498.20 3432.457
-## FT238 498.30 3917.185
-## FT239 500.10 3044.974
-## FT240 502.10 3171.596
-## FT241 502.20 3026.218
-## FT242 503.10 3171.421
-## FT243 503.20 3022.011
-## FT244 504.10 3265.566
-## FT245 505.15 3265.121
-## FT246 505.35 3747.909
-## FT247 506.20 3404.771
-## FT248 507.20 3402.436
-## FT249 507.20 3030.857
-## FT250 508.20 3532.072
-## FT251 508.10 3384.643
-## FT252 509.20 3530.981
-## FT253 510.20 3538.906
-## FT254 510.20 3786.659
-## FT255 511.20 3785.879
-## FT256 518.20 3432.440
-## FT257 519.20 3444.152
-## FT258 520.20 3241.104
-## FT259 521.20 3218.546
-## FT260 522.20 3405.966
-## FT261 523.20 3405.185
-## FT262 524.20 3679.669
-## FT263 524.20 3762.872
-## FT264 524.20 3420.753
-## FT265 525.20 3762.091
-## FT266 525.20 3685.573
-## FT267 526.10 3182.548
-## FT268 526.20 3764.267
-## FT269 526.20 3687.235
-## FT270 527.10 3188.114
-## FT271 528.10 3242.467
-## FT272 529.10 3248.059
-## FT273 530.20 3357.110
-## FT274 531.20 3357.891
-## FT275 532.20 3359.466
-## FT276 532.20 3492.017
-## FT277 532.20 2872.610
-## FT278 533.20 3490.591
-## FT280 534.20 3594.882
-## FT281 534.30 3867.615
-## FT282 535.20 3595.483
-## FT283 535.30 3862.145
-## FT284 536.20 3722.982
-## FT285 536.20 3574.110
-## FT286 537.20 3722.982
-## FT287 538.20 3720.958
-## FT288 538.30 4135.639
-## FT289 544.20 3220.128
-## FT290 544.20 3431.196
-## FT291 545.20 3215.566
-## FT292 546.20 3203.776
-## FT293 546.20 3678.966
-## FT294 546.20 3017.572
-## FT295 547.20 3011.595
-## FT296 547.20 3679.483
-## FT297 547.30 3011.072
-## FT298 548.10 3185.679
-## FT299 548.40 3519.761
-## FT300 549.30 4127.176
-## FT301 549.40 3740.574
-## FT302 550.20 3665.428
-## FT303 550.30 3626.778
-## FT304 551.20 3700.215
-## FT305 551.20 3013.723
-## FT306 551.20 3594.914
-## FT307 552.20 3665.603
-## FT308 552.20 3009.501
-## FT309 552.30 3841.421
-## FT310 554.15 3225.460
-## FT311 556.20 3456.269
-## FT312 556.30 2914.125
-## FT313 556.30 3115.298
-## FT314 557.20 2918.720
-## FT315 558.20 3397.529
-## FT316 558.20 3726.352
-## FT317 558.20 3535.474
-## FT318 560.20 3655.543
-## FT319 560.20 3090.011
-## FT321 564.20 3465.857
-## FT322 564.40 4149.660
-## FT323 566.20 3582.974
-## FT324 568.20 3226.395
-## FT325 568.30 3624.023
-## FT326 569.20 3226.395
-## FT327 570.10 3087.875
-## FT328 571.10 3087.916
-## FT329 571.40 3727.935
-## FT330 572.20 3415.383
-## FT331 572.20 3673.422
-## FT332 575.40 4060.457
-## FT333 576.25 2862.581
-## FT334 578.30 3819.405
-## FT335 579.10 2790.495
-## FT336 579.30 3820.827
-## FT337 579.40 3518.231
-## FT338 580.10 2790.972
-## FT339 580.20 3585.251
-## FT340 580.20 3408.398
-## FT341 590.30 3005.915
-## FT342 591.30 3005.743
-## FT343 592.15 3022.033
-## FT344 593.40 3720.198
-## FT345 594.20 3416.152
-## FT346 594.30 3620.732
-## FT347 595.25 3010.600
-## FT348 596.20 2997.776
-## FT349 596.30 3819.829
-## FT350 597.40 3820.880
-## FT351 599.30 4071.412
+head(ref_mz_rt)

+
##       mzmed    rtmed
+## FT001 200.1 2902.634
+## FT002 205.0 2789.901
+## FT003 206.0 2789.405
+## FT004 207.1 2718.560
+## FT005 233.0 3023.579
+## FT006 241.1 3683.299

This is what the lamas input should look like for alignment. In terms of how this method works, the alignment algorithm matches chromatographic peaks from the experimental data to the lamas, @@ -2408,7 +2067,7 @@

Alignment to an external ref
 #access summary of matches and model information
 summary <- summarizeLamaMatch(param)
-summary 
+summary

##   Total_peaks Matched_peaks Total_lamas Model_summary
 ## 1          87            34         347  30, c(0.....
 ## 2         100            51         347  48, c(0.....
@@ -2418,12 +2077,12 @@ 

Alignment to an external ref summary$Matched_peaks / summary$Total_peaks * 100

## [1] 39.08046 51.00000 55.73770
-#access the information on the model of for the first file 
+#access the information on the model of for the first file
 summary$model_summary[[1]]
## NULL
-# Plot obs vs. ref with fitting line 
-plot(param, index = 1L, main = "ChromPeaks versus Lamas for the first file", 
+# Plot obs vs. ref with fitting line
+plot(param, index = 1L, main = "ChromPeaks versus Lamas for the first file",
      colPoint = "red")

diff --git a/favicon-16x16.png b/favicon-16x16.png index e7c0805dbf26fe17ee0e7df5bedfb3b3ff93a27d..e9e02c89f6e677cc76a38aa8c3cded8ffc93c878 100644 GIT binary patch delta 91 zcmZ3?v6y3nHxoOrp23$76Elmsz*@sQu!kiBP{y!SM diff --git a/favicon-32x32.png b/favicon-32x32.png index 58dbcee4c33a81d7c947796ef8db6d14d9c8257a..6b07e4a414174a969705fe90264bee5eae34dd6c 100644 GIT binary patch delta 62 zcmbOwFiT)UH9N1KVe|I|DjS=gvk4konV4CbSZW&>SQ!||_;zlaT*a<{Dw-=`$TfL2 Gdp-bPzY*a8 delta 62 zcmbOwFiT)UH9NPJ>AIcgZ*6RP&L(JRWolt%YOHNwU}a!%x~C^@auvG*s_3qZCXXhs HX3qxzsOuFw diff --git a/pkgdown.yml b/pkgdown.yml index 6d2bbc9a..08a2eeab 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -6,7 +6,7 @@ articles: xcms-direct-injection: xcms-direct-injection.html xcms-lcms-ms: xcms-lcms-ms.html xcms: xcms.html -last_built: 2024-04-03T11:58Z +last_built: 2024-04-03T13:46Z urls: reference: https://sneumann.github.io/xcms/reference article: https://sneumann.github.io/xcms/articles diff --git a/reference/PlainTextParam.html b/reference/PlainTextParam.html index 2855c3c3..83f2d004 100644 --- a/reference/PlainTextParam.html +++ b/reference/PlainTextParam.html @@ -234,7 +234,7 @@

Examples ## Save as a collection of plain text files storeResults(object = faahko_sub, param = param) -#> Warning: '/tmp/RtmpuXxMBu/test' already exists +#> Warning: '/tmp/RtmprUV08K/test' already exists diff --git a/reference/XCMSnExp-class.html b/reference/XCMSnExp-class.html index 79dde916..1f9a78c6 100644 --- a/reference/XCMSnExp-class.html +++ b/reference/XCMSnExp-class.html @@ -1270,7 +1270,7 @@

Examples#> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] -#> Filter: select file(s) 2. [Wed Apr 3 11:59:18 2024] +#> Filter: select file(s) 2. [Wed Apr 3 13:47:13 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData diff --git a/reference/XChromatogram.html b/reference/XChromatogram.html index 78ad5e31..00ac4ef4 100644 --- a/reference/XChromatogram.html +++ b/reference/XChromatogram.html @@ -812,7 +812,7 @@

Examples#> [[1]] #> Object of class "XProcessHistory" #> type: Peak detection -#> date: Wed Apr 3 11:59:21 2024 +#> date: Wed Apr 3 13:47:15 2024 #> info: #> fileIndex: 1,2 #> Parameter class: CentWaveParam diff --git a/reference/applyAdjustedRtime.html b/reference/applyAdjustedRtime.html index 8ef63d07..96200fa5 100644 --- a/reference/applyAdjustedRtime.html +++ b/reference/applyAdjustedRtime.html @@ -162,7 +162,7 @@

Examples#> [[2]] #> Object of class "XProcessHistory" #> type: Retention time correction -#> date: Wed Apr 3 11:59:33 2024 +#> date: Wed Apr 3 13:47:28 2024 #> info: #> fileIndex: 1,2,3 #> Parameter class: ObiwarpParam diff --git a/reference/chromPeakSpectra.html b/reference/chromPeakSpectra.html index 92d5b338..0e0f1100 100644 --- a/reference/chromPeakSpectra.html +++ b/reference/chromPeakSpectra.html @@ -316,8 +316,8 @@

Examples#> file(s): #> PestMix1_DDA.mzML #> Processing: -#> Filter: select MS level(s) 2 [Wed Apr 3 11:59:40 2024] -#> Merge 1 Spectra into one [Wed Apr 3 11:59:40 2024] +#> Filter: select MS level(s) 2 [Wed Apr 3 13:47:35 2024] +#> Merge 1 Spectra into one [Wed Apr 3 13:47:35 2024] ## spectra variable *peak_id* contain the row names of the peaks in the ## chromPeak matrix and allow thus to map chromatographic peaks to the @@ -416,8 +416,8 @@

Examples#> file(s): #> PestMix1_DDA.mzML #> Processing: -#> Filter: select MS level(s) 2 [Wed Apr 3 11:59:40 2024] -#> Merge 1 Spectra into one [Wed Apr 3 11:59:41 2024] +#> Filter: select MS level(s) 2 [Wed Apr 3 13:47:35 2024] +#> Merge 1 Spectra into one [Wed Apr 3 13:47:35 2024] ## Parameter `msLevel` allows to define from which MS level spectra should ## be returned. By default `msLevel = 2L` but with `msLevel = 1L` all @@ -450,8 +450,8 @@

Examples#> file(s): #> PestMix1_DDA.mzML #> Processing: -#> Filter: select MS level(s) 1 [Wed Apr 3 11:59:41 2024] -#> Merge 1 Spectra into one [Wed Apr 3 11:59:41 2024] +#> Filter: select MS level(s) 1 [Wed Apr 3 13:47:35 2024] +#> Merge 1 Spectra into one [Wed Apr 3 13:47:35 2024] ## Parameter peaks would allow to extract spectra for specific peaks only. ## Peaks can be defined with parameter `peaks` which can be either an diff --git a/reference/fillChromPeaks.html b/reference/fillChromPeaks.html index 3639f173..529f49d3 100644 --- a/reference/fillChromPeaks.html +++ b/reference/fillChromPeaks.html @@ -465,7 +465,7 @@

Examplesph #> Object of class "XProcessHistory" #> type: Missing peak filling -#> date: Wed Apr 3 11:59:53 2024 +#> date: Wed Apr 3 13:47:46 2024 #> info: #> fileIndex: 1,2,3 #> Parameter class: ChromPeakAreaParam @@ -477,16 +477,16 @@

Examples#> Parameters: #> - rtmin: function (z) #> quantile(z, probs = 0.25, names = FALSE) -#> <environment: 0x560079c5b818> +#> <environment: 0x564cfaea3390> #> - rtmax: function (z) #> quantile(z, probs = 0.75, names = FALSE) -#> <environment: 0x560079c5b818> +#> <environment: 0x564cfaea3390> #> - mzmin: function (z) #> quantile(z, probs = 0.25, names = FALSE) -#> <environment: 0x560079c5b818> +#> <environment: 0x564cfaea3390> #> - mzmax: function (z) #> quantile(z, probs = 0.75, names = FALSE) -#> <environment: 0x560079c5b818> +#> <environment: 0x564cfaea3390> ## It is also possible to remove filled-in peaks: res <- dropFilledChromPeaks(res) diff --git a/search.json b/search.json index 08700ba4..bfb9c188 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Compounding (grouping) of LC-MS features","text":"typical LC-MS-based metabolomics experiment compounds eluting chromatography first ionized measured mass spectrometry (MS). ionization different (multiple) ions can generated compound measured MS. general, resulting data pre-processed identify chromatographic peaks data group across samples correspondence analysis. result distinct LC-MS features, characterized specific m/z retention time range. Different ions generated ionization detected different features. Compounding aims now grouping features presumably representing signal originating compound reduce data set complexity (aid subsequent annotation steps). General MS feature grouping functionality defined MsFeatures package additional functionality implemented xcms package enable compounding LC-MS data. document provides simple compounding workflow using xcms. Note present functionality (yet) aggregate combine actual features per values, define feature groups (one per compound).","code":""},{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"compounding-of-lc-ms-data","dir":"Articles","previous_headings":"","what":"Compounding of LC-MS data","title":"Compounding (grouping) of LC-MS features","text":"demonstrate compounding (feature grouping) functionality simple toy data set used also xcms package provided faahKO package. data set consists samples 4 mice knock-fatty acid amide hydrolase (FAAH) 4 wild type mice. Pre-processing data set described detail main vignette xcms package. load required packages result pre-processing updating also location respective raw data files current machine. performing feature grouping inspect result object. featureDefinitions can extract results correspondence analysis. row data frame represents definition one feature, average range m/z retention time. Column \"peakidx\" provides index chromatographic peak assigned feature chromPeaks matrix result object. featureValues function allows extract feature values, .e. matrix feature abundances, one row per feature columns representing samples present data set. extract feature values without filled-peak data. Without gap-filled data abundances detected chromatographic peaks reported. gap-filled data, samples chromatographic peak feature detected, signal m/z - retention time range defined based detected chromatographic peaks integrated. total 351 features defined present data set, many likely represent signal different ions (adducts isotopes) compound. aim grouping functions now define features likely come original compound. feature grouping functions base following assumptions/properties LC-MS data: Features (ions) compound similar retention time. abundance features (ions) compound similar pattern across samples, .e. compound highly concentrated one sample low another, ions follow pattern. peak shape extracted ion chromatograms (EIC) features compound similar follow elution pattern original compound LC. main method perform feature grouping called groupFeatures takes xcms result object (.e., XcmsExperiment XCMSnExp) input well parameter object chose grouping algorithm specify settings. xcms provides supports following grouping approaches: SimilarRtimeParam: perform initial grouping based similar retention time. AbundanceSimilarityParam: perform feature grouping based correlation feature abundances (values) across samples. EicSimilarityParam: perform feature grouping based correlation EICs. Calling groupFeatures xcms result object perform feature grouping assigning feature data set feature group. feature groups stored additional column called \"feature_group\" featureDefinition data frame result object can accessed featureGroups function. subsequent groupFeature call sub-group (refine) identified feature groups . thus possible use single grouping approach, combine multiple generate desired feature grouping incremental fashion. individual feature grouping algorithms can called order, advisable use EicSimilarityParam last refinement step, computationally expensive, especially applied result object without pre-defined feature groups feature groups large.","code":"library(MSnbase) library(xcms) library(faahKO) library(MsFeatures) xmse <- loadXcmsData(\"xmse\") featureDefinitions(xmse) |> head() ## mzmed mzmin mzmax rtmed rtmin rtmax npeaks KO WT peakidx ## FT001 200.1 200.1 200.1 2902.634 2882.603 2922.664 2 2 0 458, 116.... ## FT002 205.0 205.0 205.0 2789.901 2782.955 2796.531 8 4 4 44, 443,.... ## FT003 206.0 206.0 206.0 2789.405 2781.389 2794.219 7 3 4 29, 430,.... ## FT004 207.1 207.1 207.1 2718.560 2714.047 2727.347 7 4 3 16, 420,.... ## FT005 233.0 233.0 233.1 3023.579 3015.145 3043.959 7 3 4 69, 959,.... ## FT006 241.1 241.1 241.2 3683.299 3661.586 3695.886 8 3 4 276, 284.... ## ms_level ## FT001 1 ## FT002 1 ## FT003 1 ## FT004 1 ## FT005 1 ## FT006 1 head(featureValues(xmse, filled = FALSE)) ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF wt15.CDF wt16.CDF wt21.CDF ## FT001 NA 506848.9 NA 169955.6 NA NA NA ## FT002 1924712.0 1757151.0 1383416.7 1180288.2 2129885.1 1634342.0 1623589.2 ## FT003 213659.3 289500.7 NA 178285.7 253825.6 241844.4 240606.0 ## FT004 349011.5 451863.7 343897.8 208002.8 364609.8 360908.9 NA ## FT005 286221.4 NA 164009.0 149097.6 255697.7 311296.8 366441.5 ## FT006 1160580.5 NA 380970.3 588986.4 1286883.0 1739516.6 639755.3 ## wt22.CDF ## FT001 NA ## FT002 1354004.9 ## FT003 185399.5 ## FT004 221937.5 ## FT005 271128.0 ## FT006 508546.4 head(featureValues(xmse, filled = TRUE)) ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF wt15.CDF wt16.CDF wt21.CDF ## FT001 135162.4 506848.9 111657.3 169955.6 209929.4 141607.9 226853.7 ## FT002 1924712.0 1757151.0 1383416.7 1180288.2 2129885.1 1634342.0 1623589.2 ## FT003 213659.3 289500.7 164380.7 178285.7 253825.6 241844.4 240606.0 ## FT004 349011.5 451863.7 343897.8 208002.8 364609.8 360908.9 226234.4 ## FT005 286221.4 285857.6 164009.0 149097.6 255697.7 311296.8 366441.5 ## FT006 1160580.5 1102832.6 380970.3 588986.4 1286883.0 1739516.6 639755.3 ## wt22.CDF ## FT001 138341.2 ## FT002 1354004.9 ## FT003 185399.5 ## FT004 221937.5 ## FT005 271128.0 ## FT006 508546.4"},{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"grouping-of-features-by-similar-retention-time","dir":"Articles","previous_headings":"Compounding of LC-MS data","what":"Grouping of features by similar retention time","title":"Compounding (grouping) of LC-MS features","text":"intuitive simple way group features based retention time. perform initial grouping evaluate retention times m/z features present data set. Plot retention times m/z features data set. Several features retention time (different m/z) can spotted, especially beginning LC. thus group features within retention time window 10 seconds feature groups. results feature grouping can accessed featureGroups function. determine size feature groups (.e. many features grouped together). addition visualize feature groups plotFeatureGroups function shows features m/z - retention time space grouped features connected line. Feature groups defined rt window 10 seconds Let’s assume don’t agree feature grouping, also knowing quite large shifts retention times runs. thus first remove defined feature groups assigning value NULL re-perform feature grouping using larger rt window. Feature groups defined rt window 20 seconds Grouping similar retention time grouped total 351 features 118 feature groups.","code":"plot(featureDefinitions(xmse)$rtmed, featureDefinitions(xmse)$mzmed, xlab = \"retention time\", ylab = \"m/z\", main = \"features\", col = \"#00000080\", pch = 21, bg = \"#00000040\") grid() xmse <- groupFeatures(xmse, param = SimilarRtimeParam(10)) table(featureGroups(xmse)) ## ## FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 FG.009 FG.010 FG.011 ## 4 6 2 4 6 5 2 4 3 4 3 ## FG.012 FG.013 FG.014 FG.015 FG.016 FG.017 FG.018 FG.019 FG.020 FG.021 FG.022 ## 6 4 2 3 3 3 4 3 2 5 2 ## FG.023 FG.024 FG.025 FG.026 FG.027 FG.028 FG.029 FG.030 FG.031 FG.032 FG.033 ## 2 4 5 2 5 2 3 4 2 2 4 ## FG.034 FG.035 FG.036 FG.037 FG.038 FG.039 FG.040 FG.041 FG.042 FG.043 FG.044 ## 2 2 6 3 2 2 4 2 2 4 4 ## FG.045 FG.046 FG.047 FG.048 FG.049 FG.050 FG.051 FG.052 FG.053 FG.054 FG.055 ## 2 3 2 3 3 5 2 3 4 2 6 ## FG.056 FG.057 FG.058 FG.059 FG.060 FG.061 FG.062 FG.063 FG.064 FG.065 FG.066 ## 2 6 4 2 4 3 3 2 2 2 2 ## FG.067 FG.068 FG.069 FG.070 FG.071 FG.072 FG.073 FG.074 FG.075 FG.076 FG.077 ## 3 2 2 3 2 3 2 3 3 3 3 ## FG.078 FG.079 FG.080 FG.081 FG.082 FG.083 FG.084 FG.085 FG.086 FG.087 FG.088 ## 2 3 3 3 2 3 3 3 3 3 2 ## FG.089 FG.090 FG.091 FG.092 FG.093 FG.094 FG.095 FG.096 FG.097 FG.098 FG.099 ## 3 2 2 2 2 3 2 4 2 3 3 ## FG.100 FG.101 FG.102 FG.103 FG.104 FG.105 FG.106 FG.107 FG.108 FG.109 FG.110 ## 3 3 2 2 2 2 2 2 2 2 2 ## FG.111 FG.112 FG.113 FG.114 FG.115 FG.116 FG.117 FG.118 FG.119 FG.120 FG.121 ## 2 2 1 1 1 1 1 1 1 1 1 ## FG.122 FG.123 FG.124 FG.125 FG.126 FG.127 FG.128 FG.129 FG.130 FG.131 FG.132 ## 1 1 1 1 1 1 1 1 1 1 1 ## FG.133 ## 1 plotFeatureGroups(xmse, pch = 21, lwd = 2, col = \"#00000040\", bg = \"#00000020\") grid() ## Remove previous feature grouping results to repeat the rtime-based ## feature grouping with different setting featureDefinitions(xmse)$feature_group <- NULL ## Repeat the grouping xmse <- groupFeatures(xmse, SimilarRtimeParam(20)) table(featureGroups(xmse)) ## ## FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 FG.009 FG.010 FG.011 ## 4 6 2 4 6 5 2 4 3 4 3 ## FG.012 FG.013 FG.014 FG.015 FG.016 FG.017 FG.018 FG.019 FG.020 FG.021 FG.022 ## 6 4 2 3 3 3 4 3 2 5 2 ## FG.023 FG.024 FG.025 FG.026 FG.027 FG.028 FG.029 FG.030 FG.031 FG.032 FG.033 ## 2 4 6 3 5 2 3 4 2 2 4 ## FG.034 FG.035 FG.036 FG.037 FG.038 FG.039 FG.040 FG.041 FG.042 FG.043 FG.044 ## 2 2 6 3 2 2 4 2 2 4 5 ## FG.045 FG.046 FG.047 FG.048 FG.049 FG.050 FG.051 FG.052 FG.053 FG.054 FG.055 ## 2 3 2 3 4 5 2 4 4 2 6 ## FG.056 FG.057 FG.058 FG.059 FG.060 FG.061 FG.062 FG.063 FG.064 FG.065 FG.066 ## 2 6 4 2 5 3 3 2 2 2 2 ## FG.067 FG.068 FG.069 FG.070 FG.071 FG.072 FG.073 FG.074 FG.075 FG.076 FG.077 ## 4 2 2 3 2 3 2 4 3 3 3 ## FG.078 FG.079 FG.080 FG.081 FG.082 FG.083 FG.084 FG.085 FG.086 FG.087 FG.088 ## 2 3 3 3 2 3 3 4 3 4 2 ## FG.089 FG.090 FG.091 FG.092 FG.093 FG.094 FG.095 FG.096 FG.097 FG.098 FG.099 ## 3 2 2 2 2 3 3 4 2 3 4 ## FG.100 FG.101 FG.102 FG.103 FG.104 FG.105 FG.106 FG.107 FG.108 FG.109 FG.110 ## 3 3 3 2 2 3 2 3 2 2 2 ## FG.111 FG.112 FG.113 FG.114 FG.115 FG.116 FG.117 FG.118 ## 2 2 1 1 1 1 1 1 plotFeatureGroups(xmse, pch = 21, lwd = 2, col = \"#00000040\", bg = \"#00000020\") grid()"},{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"grouping-of-features-by-abundance-correlation-across-samples","dir":"Articles","previous_headings":"Compounding of LC-MS data","what":"Grouping of features by abundance correlation across samples","title":"Compounding (grouping) of LC-MS features","text":"Assuming OK crude initial feature grouping previous section, can next refine feature groups considering also feature abundances across samples. can use groupFeatures method AbundanceSimilarityParam object. approach performs pairwise correlation (non-missing) feature values (abundances; across samples) features predefined feature group (defined previous section). Features correlation >= threshold grouped together. Feature grouping based approach works best features higher variability concentration across samples. Parameter subset allows restrict analysis subset samples allows thus e.g. exclude QC sample pools correlation artificially increase correlation. parameters passed directly internal featureValues call extracts feature values correlation performed. performing grouping also evaluate correlation features based (log2 transformed) abundances across samples heatmap. Correlation features based feature abundances. large correlations can observed several groups features, many within feature group defined previous section (.e. eluting time). might thus represent correlated metabolites, ions adducts metabolite. use groupFeatures AbundanceSimilarityParam group features correlation coefficient higher 0.7 including detected filled-signal. Whether filled-detected signal used correlation analysis evaluated data set data set. specifying transform = log2 tell function log2 transform abundance prior correlation analysis. See help page groupFeatures AbundanceSimilarityParam xcms package details options. Many larger retention time-based feature groups splitted two sub-groups based correlation feature abundances (e.g. feature group FG.004 split feature groups FG.004.001, FG.004.002 FG.004.003). evaluate refinement feature group \"FG.040\" plotting pairwise correlation. better visualize feature grouping addition define custom panel plot pairs function plots data points blue features correlation coefficient selected threshold (0.7) red otherwise. Pairwise correlation plot features initially grouped feature group FG.040. Indeed, correlation seems present features retention time feature group, e.g. clearly FT273 FT274 also FT143 FT273. Note however abundance correlation suffers relatively samples (8 total), relatively small variance abundances across samples. feature grouping abundance correlation, 351 features grouped 249 feature groups.","code":"library(pheatmap) fvals <- log2(featureValues(xmse, filled = TRUE)) cormat <- cor(t(fvals), use = \"pairwise.complete.obs\") ann <- data.frame(fgroup = featureGroups(xmse)) rownames(ann) <- rownames(cormat) res <- pheatmap(cormat, annotation_row = ann, cluster_rows = TRUE, cluster_cols = TRUE) xmse <- groupFeatures( xmse, AbundanceSimilarityParam(threshold = 0.7, transform = log2), filled = TRUE) table(featureGroups(xmse)) ## ## FG.001.001 FG.001.002 FG.002.001 FG.002.002 FG.002.003 FG.002.004 FG.003.001 ## 3 1 2 2 1 1 1 ## FG.003.002 FG.004.001 FG.004.002 FG.004.003 FG.005.001 FG.005.002 FG.005.003 ## 1 2 1 1 3 2 1 ## FG.006.001 FG.006.002 FG.007.001 FG.008.001 FG.008.002 FG.008.003 FG.008.004 ## 4 1 2 1 1 1 1 ## FG.009.001 FG.010.001 FG.010.002 FG.011.001 FG.011.002 FG.012.001 FG.012.002 ## 3 3 1 2 1 3 2 ## FG.012.003 FG.013.001 FG.013.002 FG.014.001 FG.015.001 FG.015.002 FG.015.003 ## 1 3 1 2 1 1 1 ## FG.016.001 FG.016.002 FG.016.003 FG.017.001 FG.017.002 FG.018.001 FG.018.002 ## 1 1 1 2 1 2 2 ## FG.019.001 FG.019.002 FG.019.003 FG.020.001 FG.020.002 FG.021.001 FG.021.002 ## 1 1 1 1 1 1 1 ## FG.021.003 FG.021.004 FG.021.005 FG.022.001 FG.022.002 FG.023.001 FG.024.001 ## 1 1 1 1 1 2 2 ## FG.024.002 FG.025.001 FG.025.002 FG.025.003 FG.026.001 FG.026.002 FG.027.001 ## 2 4 1 1 2 1 2 ## FG.027.002 FG.027.003 FG.027.004 FG.028.001 FG.028.002 FG.029.001 FG.029.002 ## 1 1 1 1 1 1 1 ## FG.029.003 FG.030.001 FG.030.002 FG.031.001 FG.032.001 FG.032.002 FG.033.001 ## 1 3 1 2 1 1 2 ## FG.033.002 FG.033.003 FG.034.001 FG.034.002 FG.035.001 FG.036.001 FG.036.002 ## 1 1 1 1 2 3 1 ## FG.036.003 FG.036.004 FG.037.001 FG.038.001 FG.038.002 FG.039.001 FG.039.002 ## 1 1 3 1 1 1 1 ## FG.040.001 FG.040.002 FG.040.003 FG.040.004 FG.041.001 FG.041.002 FG.042.001 ## 1 1 1 1 1 1 1 ## FG.042.002 FG.043.001 FG.043.002 FG.044.001 FG.044.002 FG.045.001 FG.046.001 ## 1 3 1 3 2 2 1 ## FG.046.002 FG.046.003 FG.047.001 FG.047.002 FG.048.001 FG.048.002 FG.049.001 ## 1 1 1 1 2 1 1 ## FG.049.002 FG.049.003 FG.049.004 FG.050.001 FG.050.002 FG.051.001 FG.051.002 ## 1 1 1 4 1 1 1 ## FG.052.001 FG.052.002 FG.052.003 FG.052.004 FG.053.001 FG.053.002 FG.054.001 ## 1 1 1 1 2 2 1 ## FG.054.002 FG.055.001 FG.056.001 FG.057.001 FG.057.002 FG.057.003 FG.057.004 ## 1 6 2 2 1 1 1 ## FG.057.005 FG.058.001 FG.058.002 FG.058.003 FG.058.004 FG.059.001 FG.060.001 ## 1 1 1 1 1 2 2 ## FG.060.002 FG.060.003 FG.061.001 FG.061.002 FG.062.001 FG.062.002 FG.063.001 ## 2 1 2 1 2 1 1 ## FG.063.002 FG.064.001 FG.065.001 FG.065.002 FG.066.001 FG.067.001 FG.067.002 ## 1 2 1 1 2 3 1 ## FG.068.001 FG.068.002 FG.069.001 FG.070.001 FG.070.002 FG.071.001 FG.071.002 ## 1 1 2 2 1 1 1 ## FG.072.001 FG.072.002 FG.072.003 FG.073.001 FG.073.002 FG.074.001 FG.074.002 ## 1 1 1 1 1 2 1 ## FG.074.003 FG.075.001 FG.075.002 FG.075.003 FG.076.001 FG.076.002 FG.076.003 ## 1 1 1 1 1 1 1 ## FG.077.001 FG.077.002 FG.078.001 FG.079.001 FG.079.002 FG.079.003 FG.080.001 ## 2 1 2 1 1 1 2 ## FG.080.002 FG.081.001 FG.081.002 FG.082.001 FG.082.002 FG.083.001 FG.083.002 ## 1 2 1 1 1 1 1 ## FG.083.003 FG.084.001 FG.084.002 FG.084.003 FG.085.001 FG.085.002 FG.086.001 ## 1 1 1 1 3 1 2 ## FG.086.002 FG.087.001 FG.087.002 FG.088.001 FG.088.002 FG.089.001 FG.089.002 ## 1 2 2 1 1 2 1 ## FG.090.001 FG.090.002 FG.091.001 FG.092.001 FG.093.001 FG.094.001 FG.094.002 ## 1 1 2 2 2 2 1 ## FG.095.001 FG.096.001 FG.096.002 FG.097.001 FG.097.002 FG.098.001 FG.098.002 ## 3 3 1 1 1 1 1 ## FG.098.003 FG.099.001 FG.099.002 FG.099.003 FG.100.001 FG.100.002 FG.101.001 ## 1 2 1 1 2 1 3 ## FG.102.001 FG.102.002 FG.102.003 FG.103.001 FG.104.001 FG.104.002 FG.105.001 ## 1 1 1 2 1 1 2 ## FG.105.002 FG.106.001 FG.107.001 FG.107.002 FG.108.001 FG.108.002 FG.109.001 ## 1 2 2 1 1 1 1 ## FG.109.002 FG.110.001 FG.111.001 FG.112.001 FG.112.002 FG.113.001 FG.114.001 ## 1 2 2 1 1 1 1 ## FG.115.001 FG.116.001 FG.117.001 FG.118.001 ## 1 1 1 1 cor_plot <- function(x, y) { C <- cor(x, y, use = \"pairwise.complete.obs\") col <- ifelse(C >= 0.7, yes = \"#0000ff80\", no = \"#ff000080\") points(x, y, pch = 16, col = col) grid() } fts <- grep(\"FG.040\", featureGroups(xmse)) pairs(t(fvals[fts, ]), gap = 0.1, main = \"FG.040\", panel = cor_plot)"},{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"grouping-of-features-by-similarity-of-their-eics","dir":"Articles","previous_headings":"Compounding of LC-MS data","what":"Grouping of features by similarity of their EICs","title":"Compounding (grouping) of LC-MS features","text":"chromatographic peak shape ion compound highly similar elution pattern compound. Thus, features compound assumed similar peak shapes EICs within sample. grouping features based similarity EICs can performed groupFeatures EicSimilarityParam object. advisable perform peak shape correlation subset samples (peak shape correlation computationally intense chromatographic peaks low intensity features notoriously noisy). EicSimilarityParam approach allows select number top n samples (ordered total intensity feature abundances per feature group) correlation performed parameter n. n =3, 3 samples highest signal features respective feature group first identified pairwise similarity calculation performed EICs samples. resulting similarity score 3 samples aggregated single score taking 75% quantile across 3 samples. value subsequently compared cut-similarity (parameter threshold) features score >= threshold grouped feature group. group features based similarity EICs two samples highest total signal respective feature groups. default, Pearson correlation coefficient used similarity score similarity/distance metric function used instead (parameter FUN EicSimilarityParam - see respective help page ?EicSimilarityParam details options). define threshold correlation coefficient 0.7. computationally intense approach since involves also loading raw MS data extract ion chromatograms feature. results grouping shown . many cases, pre-defined feature groups (retention time similarity abundance correlation) subdivided. evaluate feature groups, starting FG.008.001 split two different feature groups based EIC correlation. first extract EICs features initial feature group. n = 1 specify extract EIC sample highest intensity. Next plot EICs using different color subgroups. peakType = \"none\" disable highlighting detected chromatographic peaks. Feature EICs per sample features feature group defined rentention time feature abudances across samples. Features high correlation EICs shown color. Feature EICs per sample normalized absolute intensity 1 features feature group defined rentention time feature abudances across samples. Features high correlation EICs shown color. One features (highlighted red plots ) within original feature group separated two low similarity EICs. fact, feature’s EIC shifted samples along retention time dimension can thus represent signal compound. evaluate next sub-grouping another feature group. Next plot EICs using different color subgroups. Feature EICs per sample features feature group defined rentention time feature abudances across samples. Features high correlation EICs shown color. Feature EICs per sample normalized absolute intensity 1 features feature group defined rentention time feature abudances across samples. Features high correlation EICs shown color. Based EIC correlation, initial feature group FG.045.001 grouped two separate sub-groups. grouping based EIC correlation pre-defined feature groups previous sections grouped 351 features 267 feature groups.","code":"xmse <- groupFeatures(xmse, EicSimilarityParam(threshold = 0.7, n = 2)) table(featureGroups(xmse)) ## ## FG.001.001.001 FG.001.002.001 FG.002.001.001 FG.002.002.001 FG.002.003.001 ## 3 1 2 2 1 ## FG.002.004.001 FG.003.001.001 FG.003.002.001 FG.004.001.001 FG.004.002.001 ## 1 1 1 2 1 ## FG.004.003.001 FG.005.001.001 FG.005.002.001 FG.005.003.001 FG.006.001.001 ## 1 3 2 1 4 ## FG.006.002.001 FG.007.001.001 FG.007.001.002 FG.008.001.001 FG.008.002.001 ## 1 1 1 1 1 ## FG.008.003.001 FG.008.004.001 FG.009.001.001 FG.010.001.001 FG.010.002.001 ## 1 1 3 3 1 ## FG.011.001.001 FG.011.002.001 FG.012.001.001 FG.012.002.001 FG.012.003.001 ## 2 1 3 2 1 ## FG.013.001.001 FG.013.002.001 FG.014.001.001 FG.015.001.001 FG.015.002.001 ## 3 1 2 1 1 ## FG.015.003.001 FG.016.001.001 FG.016.002.001 FG.016.003.001 FG.017.001.001 ## 1 1 1 1 2 ## FG.017.002.001 FG.018.001.001 FG.018.002.001 FG.019.001.001 FG.019.002.001 ## 1 2 2 1 1 ## FG.019.003.001 FG.020.001.001 FG.020.002.001 FG.021.001.001 FG.021.002.001 ## 1 1 1 1 1 ## FG.021.003.001 FG.021.004.001 FG.021.005.001 FG.022.001.001 FG.022.002.001 ## 1 1 1 1 1 ## FG.023.001.001 FG.024.001.001 FG.024.001.002 FG.024.002.001 FG.025.001.001 ## 2 1 1 2 4 ## FG.025.002.001 FG.025.003.001 FG.026.001.001 FG.026.001.002 FG.026.002.001 ## 1 1 1 1 1 ## FG.027.001.001 FG.027.002.001 FG.027.003.001 FG.027.004.001 FG.028.001.001 ## 2 1 1 1 1 ## FG.028.002.001 FG.029.001.001 FG.029.002.001 FG.029.003.001 FG.030.001.001 ## 1 1 1 1 2 ## FG.030.001.002 FG.030.002.001 FG.031.001.001 FG.032.001.001 FG.032.002.001 ## 1 1 2 1 1 ## FG.033.001.001 FG.033.002.001 FG.033.003.001 FG.034.001.001 FG.034.002.001 ## 2 1 1 1 1 ## FG.035.001.001 FG.036.001.001 FG.036.001.002 FG.036.002.001 FG.036.003.001 ## 2 2 1 1 1 ## FG.036.004.001 FG.037.001.001 FG.037.001.002 FG.038.001.001 FG.038.002.001 ## 1 2 1 1 1 ## FG.039.001.001 FG.039.002.001 FG.040.001.001 FG.040.002.001 FG.040.003.001 ## 1 1 1 1 1 ## FG.040.004.001 FG.041.001.001 FG.041.002.001 FG.042.001.001 FG.042.002.001 ## 1 1 1 1 1 ## FG.043.001.001 FG.043.002.001 FG.044.001.001 FG.044.001.002 FG.044.002.001 ## 3 1 2 1 1 ## FG.044.002.002 FG.045.001.001 FG.046.001.001 FG.046.002.001 FG.046.003.001 ## 1 2 1 1 1 ## FG.047.001.001 FG.047.002.001 FG.048.001.001 FG.048.002.001 FG.049.001.001 ## 1 1 2 1 1 ## FG.049.002.001 FG.049.003.001 FG.049.004.001 FG.050.001.001 FG.050.001.002 ## 1 1 1 3 1 ## FG.050.002.001 FG.051.001.001 FG.051.002.001 FG.052.001.001 FG.052.002.001 ## 1 1 1 1 1 ## FG.052.003.001 FG.052.004.001 FG.053.001.001 FG.053.002.001 FG.054.001.001 ## 1 1 2 2 1 ## FG.054.002.001 FG.055.001.001 FG.056.001.001 FG.056.001.002 FG.057.001.001 ## 1 6 1 1 2 ## FG.057.002.001 FG.057.003.001 FG.057.004.001 FG.057.005.001 FG.058.001.001 ## 1 1 1 1 1 ## FG.058.002.001 FG.058.003.001 FG.058.004.001 FG.059.001.001 FG.060.001.001 ## 1 1 1 2 2 ## FG.060.002.001 FG.060.003.001 FG.061.001.001 FG.061.002.001 FG.062.001.001 ## 2 1 2 1 2 ## FG.062.002.001 FG.063.001.001 FG.063.002.001 FG.064.001.001 FG.065.001.001 ## 1 1 1 2 1 ## FG.065.002.001 FG.066.001.001 FG.067.001.001 FG.067.002.001 FG.068.001.001 ## 1 2 3 1 1 ## FG.068.002.001 FG.069.001.001 FG.070.001.001 FG.070.002.001 FG.071.001.001 ## 1 2 2 1 1 ## FG.071.002.001 FG.072.001.001 FG.072.002.001 FG.072.003.001 FG.073.001.001 ## 1 1 1 1 1 ## FG.073.002.001 FG.074.001.001 FG.074.002.001 FG.074.003.001 FG.075.001.001 ## 1 2 1 1 1 ## FG.075.002.001 FG.075.003.001 FG.076.001.001 FG.076.002.001 FG.076.003.001 ## 1 1 1 1 1 ## FG.077.001.001 FG.077.002.001 FG.078.001.001 FG.079.001.001 FG.079.002.001 ## 2 1 2 1 1 ## FG.079.003.001 FG.080.001.001 FG.080.002.001 FG.081.001.001 FG.081.002.001 ## 1 2 1 2 1 ## FG.082.001.001 FG.082.002.001 FG.083.001.001 FG.083.002.001 FG.083.003.001 ## 1 1 1 1 1 ## FG.084.001.001 FG.084.002.001 FG.084.003.001 FG.085.001.001 FG.085.001.002 ## 1 1 1 1 1 ## FG.085.001.003 FG.085.002.001 FG.086.001.001 FG.086.001.002 FG.086.002.001 ## 1 1 1 1 1 ## FG.087.001.001 FG.087.002.001 FG.087.002.002 FG.088.001.001 FG.088.002.001 ## 2 1 1 1 1 ## FG.089.001.001 FG.089.002.001 FG.090.001.001 FG.090.002.001 FG.091.001.001 ## 2 1 1 1 2 ## FG.092.001.001 FG.093.001.001 FG.093.001.002 FG.094.001.001 FG.094.002.001 ## 2 1 1 2 1 ## FG.095.001.001 FG.095.001.002 FG.096.001.001 FG.096.002.001 FG.097.001.001 ## 2 1 3 1 1 ## FG.097.002.001 FG.098.001.001 FG.098.002.001 FG.098.003.001 FG.099.001.001 ## 1 1 1 1 2 ## FG.099.002.001 FG.099.003.001 FG.100.001.001 FG.100.002.001 FG.101.001.001 ## 1 1 2 1 2 ## FG.101.001.002 FG.102.001.001 FG.102.002.001 FG.102.003.001 FG.103.001.001 ## 1 1 1 1 2 ## FG.104.001.001 FG.104.002.001 FG.105.001.001 FG.105.002.001 FG.106.001.001 ## 1 1 2 1 2 ## FG.107.001.001 FG.107.001.002 FG.107.002.001 FG.108.001.001 FG.108.002.001 ## 1 1 1 1 1 ## FG.109.001.001 FG.109.002.001 FG.110.001.001 FG.111.001.001 FG.112.001.001 ## 1 1 2 2 1 ## FG.112.002.001 FG.113.001.001 FG.114.001.001 FG.115.001.001 FG.116.001.001 ## 1 1 1 1 1 ## FG.117.001.001 FG.118.001.001 ## 1 1 fidx <- grep(\"FG.013.001.\", featureGroups(xmse)) eics <- featureChromatograms( xmse, features = rownames(featureDefinitions(xmse))[fidx], filled = TRUE, n = 1) cols <- c(\"#ff000080\", \"#0000ff80\") names(cols) <- unique(featureGroups(xmse)[fidx]) plotChromatogramsOverlay(eics, col = cols[featureGroups(xmse)[fidx]], lwd = 2, peakType = \"none\") plotChromatogramsOverlay(normalize(eics), col = cols[featureGroups(xmse)[fidx]], lwd = 2, peakType = \"none\") fidx <- grep(\"FG.045.001.\", featureGroups(xmse)) eics <- featureChromatograms( xmse, features = rownames(featureDefinitions(xmse))[fidx], filled = TRUE, n = 1) cols <- c(\"#ff000080\", \"#0000ff80\") names(cols) <- unique(featureGroups(xmse)[fidx]) plotChromatogramsOverlay(eics, col = cols[featureGroups(xmse)[fidx]], lwd = 2, peakType = \"none\") plotChromatogramsOverlay(normalize(eics), col = cols[featureGroups(xmse)[fidx]], lwd = 2, peakType = \"none\")"},{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"grouping-of-subsets-of-features","dir":"Articles","previous_headings":"Compounding of LC-MS data","what":"Grouping of subsets of features","title":"Compounding (grouping) of LC-MS features","text":"previous sections always considering features data set, sometimes desirable just group pre-defined set features, example features found particular interest certain experiment (e.g. significant features). can easily achieved assigning features interest initial feature group, using NA group ID features. illustrate reset feature groups setting NA assign features interest (example just 30 randomly selected features) initial feature group \"FG\". call groupFeatures now simply sub-group set 30 features. feature NA \"feature_group\" column ignored.","code":"featureDefinitions(xmse)$feature_group <- NA_character_ set.seed(123) fts_idx <- sample(1:nrow(featureDefinitions(xmse)), 30) featureDefinitions(xmse)$feature_group[fts_idx] <- \"FG\" xmse <- groupFeatures(xmse, SimilarRtimeParam(diffRt = 20)) xmse <- groupFeatures(xmse, AbundanceSimilarityParam(threshold = 0.7)) table(featureGroups(xmse)) ## ## FG.001.001 FG.001.002 FG.002.001 FG.002.002 FG.003.001 FG.003.002 FG.004.001 ## 1 1 1 1 1 1 1 ## FG.004.002 FG.005.001 FG.006.001 FG.006.002 FG.006.003 FG.007.001 FG.007.002 ## 1 2 1 1 1 2 1 ## FG.008.001 FG.009.001 FG.010.001 FG.011.001 FG.012.001 FG.013.001 FG.014.001 ## 1 1 1 1 1 1 1 ## FG.015.001 FG.016.001 FG.017.001 FG.018.001 FG.019.001 FG.020.001 FG.021.001 ## 1 1 1 1 1 1 1"},{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"Compounding (grouping) of LC-MS features","text":"","code":"sessionInfo() ## R Under development (unstable) (2024-03-28 r86224) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.4 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] pheatmap_1.0.12 faahKO_1.43.0 MSnbase_2.29.4 ## [4] ProtGenerics_1.35.4 S4Vectors_0.41.5 mzR_2.37.3 ## [7] Rcpp_1.0.12 Biobase_2.63.1 BiocGenerics_0.49.1 ## [10] MsFeatures_1.11.0 xcms_4.1.12 BiocParallel_1.37.1 ## [13] BiocStyle_2.31.0 ## ## loaded via a namespace (and not attached): ## [1] DBI_1.2.2 rlang_1.1.3 ## [3] magrittr_2.0.3 clue_0.3-65 ## [5] MassSpecWavelet_1.69.0 matrixStats_1.2.0 ## [7] compiler_4.5.0 systemfonts_1.0.6 ## [9] vctrs_0.6.5 MetaboCoreUtils_1.11.2 ## [11] pkgconfig_2.0.3 crayon_1.5.2 ## [13] fastmap_1.1.1 XVector_0.43.1 ## [15] utf8_1.2.4 rmarkdown_2.26 ## [17] preprocessCore_1.65.0 ragg_1.3.0 ## [19] purrr_1.0.2 xfun_0.43 ## [21] MultiAssayExperiment_1.29.1 zlibbioc_1.49.3 ## [23] cachem_1.0.8 GenomeInfoDb_1.39.10 ## [25] jsonlite_1.8.8 progress_1.2.3 ## [27] highr_0.10 DelayedArray_0.29.9 ## [29] prettyunits_1.2.0 parallel_4.5.0 ## [31] cluster_2.1.6 R6_2.5.1 ## [33] bslib_0.7.0 RColorBrewer_1.1-3 ## [35] limma_3.59.6 GenomicRanges_1.55.4 ## [37] jquerylib_0.1.4 bookdown_0.38 ## [39] SummarizedExperiment_1.33.3 iterators_1.0.14 ## [41] knitr_1.45 IRanges_2.37.1 ## [43] Matrix_1.7-0 igraph_2.0.3 ## [45] tidyselect_1.2.1 abind_1.4-5 ## [47] yaml_2.3.8 doParallel_1.0.17 ## [49] codetools_0.2-20 affy_1.81.0 ## [51] lattice_0.22-6 tibble_3.2.1 ## [53] plyr_1.8.9 evaluate_0.23 ## [55] desc_1.4.3 Spectra_1.13.8 ## [57] pillar_1.9.0 affyio_1.73.0 ## [59] BiocManager_1.30.22 MatrixGenerics_1.15.0 ## [61] foreach_1.5.2 MALDIquant_1.22.2 ## [63] ncdf4_1.22 generics_0.1.3 ## [65] hms_1.1.3 ggplot2_3.5.0 ## [67] munsell_0.5.1 scales_1.3.0 ## [69] MsExperiment_1.5.4 glue_1.7.0 ## [71] lazyeval_0.2.2 tools_4.5.0 ## [73] mzID_1.41.0 QFeatures_1.13.3 ## [75] vsn_3.71.1 fs_1.6.3 ## [77] XML_3.99-0.16.1 grid_4.5.0 ## [79] impute_1.77.0 MsCoreUtils_1.15.6 ## [81] colorspace_2.1-0 GenomeInfoDbData_1.2.12 ## [83] PSMatch_1.7.2 cli_3.6.2 ## [85] textshaping_0.3.7 fansi_1.0.6 ## [87] S4Arrays_1.3.6 dplyr_1.1.4 ## [89] AnnotationFilter_1.27.0 pcaMethods_1.95.0 ## [91] gtable_0.3.4 sass_0.4.9 ## [93] digest_0.6.35 SparseArray_1.3.4 ## [95] farver_2.1.1 htmlwidgets_1.6.4 ## [97] memoise_2.0.1 htmltools_0.5.8 ## [99] pkgdown_2.0.7.9000 lifecycle_1.0.4 ## [101] statmod_1.5.0 MASS_7.3-60.2"},{"path":[]},{"path":"https://sneumann.github.io/xcms/articles/xcms-direct-injection.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Grouping FTICR-MS data with xcms","text":"document describes use xcms analysis direct injection mass spec data, including peak detection, calibration correspondence (grouping peaks across samples).","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms-direct-injection.html","id":"peak-detection","dir":"Articles","previous_headings":"","what":"Peak detection","title":"Grouping FTICR-MS data with xcms","text":"Prior analysis step, peaks identified mass spec data. contrast typical metabolomics workflow, peaks identified chromatographic (time) dimension, direct injection mass spec data sets peaks identified m/z dimension. xcms uses functionality MassSpecWavelet package identify peaks. load required packages. information parallel processing setup please see BiocParallel vignette. documentation use example data set msdata package. Assuming msdata installed, locate path package load data set. create also data.frame describing experimental setup based file names. data files direct injection mass spectrometry experiments, .e. single spectrum available sample retention times. Peaks identified within spectrum using mass spec wavelet method.","code":"library(MSnbase) library(xcms) library(MassSpecWavelet) register(SerialParam()) mzML_path <- system.file(\"fticr-mzML\", package = \"msdata\") mzML_files <- list.files(mzML_path, recursive = TRUE, full.names = TRUE) ## We're subsetting to 2 samples per condition mzML_files <- mzML_files[c(1, 2, 6, 7)] ## Create a data.frame assigning samples to sample groups, i.e. ham4 and ham5. grp <- rep(\"ham4\", length(mzML_files)) grp[grep(basename(mzML_files), pattern = \"^HAM005\")] <- \"ham5\" pd <- data.frame(filename = basename(mzML_files), sample_group = grp) ## Load the data. ham_raw <- readMSData(files = mzML_files, pdata = new(\"NAnnotatedDataFrame\", pd), mode = \"onDisk\") ## Only a single spectrum with an *artificial* retention time is available ## for each sample rtime(ham_raw) ## F1.S1 F2.S1 F3.S1 F4.S1 ## -1 -1 -1 -1 ## Define the parameters for the peak detection msw <- MSWParam(scales = c(1, 4, 9), nearbyPeak = TRUE, winSize.noise = 500, SNR.method = \"data.mean\", snthresh = 10) ham_prep <- findChromPeaks(ham_raw, param = msw) head(chromPeaks(ham_prep)) ## mz mzmin mzmax rt rtmin rtmax into maxo sn intf ## CP01 403.2367 403.2279 403.2447 -1 -1 -1 4735258 372259.4 22.97534 NA ## CP02 409.1845 409.1747 409.1936 -1 -1 -1 4158404 310572.1 20.61382 NA ## CP03 413.2677 413.2585 413.2769 -1 -1 -1 6099006 435462.6 27.21723 NA ## CP04 423.2363 423.2266 423.2459 -1 -1 -1 2708391 174252.7 14.74527 NA ## CP05 427.2681 427.2574 427.2779 -1 -1 -1 6302089 461385.6 32.50050 NA ## CP06 437.2375 437.2254 437.2488 -1 -1 -1 7523070 517917.6 34.37645 NA ## maxf sample ## CP01 814693.1 1 ## CP02 732119.9 1 ## CP03 1018994.8 1 ## CP04 435858.5 1 ## CP05 1125644.3 1 ## CP06 1282906.5 1"},{"path":"https://sneumann.github.io/xcms/articles/xcms-direct-injection.html","id":"calibration","dir":"Articles","previous_headings":"","what":"Calibration","title":"Grouping FTICR-MS data with xcms","text":"calibrate method can used correct m/z values identified peaks. currently implemented method requires identified peaks list m/z values known calibrants. identified peaks m/z values adjusted based differences calibrants’ m/z values m/z values closest peaks (within user defined permitted maximal distance). Note method presently calibrate identified peaks, original m/z values spectra. demonstrate calibrate method one data files artificially defined calibration m/z values. first subset data set first data file, extract m/z values 3 peaks modify values slightly. Next calibrate data set using previously defined artificial calibrants. using \"edgeshift\" method calibration adjusts peaks within range m/z values calibrants using linear interpolation shifts chromatographic peaks outside range constant factor (difference lowest respectively largest calibrant m/z closest peak’s m/z). Note real use case, m/z values obviously represent known m/z calibrants defined actual data. evaluate calibration plot difference adjusted raw m/z values (y-axis) raw m/z values.","code":"## Subset to the first file. first_file <- filterFile(ham_prep, file = 1) ## Extract 3 m/z values calib_mz <- chromPeaks(first_file)[c(1, 4, 7), \"mz\"] calib_mz <- calib_mz + 0.00001 * runif(1, 0, 0.4) * calib_mz + 0.0001 ## Set-up the parameter class for the calibration prm <- CalibrantMassParam(mz = calib_mz, method = \"edgeshift\", mzabs = 0.0001, mzppm = 5) first_file_calibrated <- calibrate(first_file, param = prm) diffs <- chromPeaks(first_file_calibrated)[, \"mz\"] - chromPeaks(first_file)[, \"mz\"] plot(x = chromPeaks(first_file)[, \"mz\"], xlab = expression(m/z[raw]), y = diffs, ylab = expression(m/z[calibrated] - m/z[raw]))"},{"path":"https://sneumann.github.io/xcms/articles/xcms-direct-injection.html","id":"correspondence","dir":"Articles","previous_headings":"","what":"Correspondence","title":"Grouping FTICR-MS data with xcms","text":"Correspondence aims group peaks across samples define features (ions m/z values). Peaks single spectrum, direct injection MS experiments can grouped MZclust method. perform correspondence analysis groupChromPeaks method using default settings. Getting overview performed processings: peak group information, .e. feature definitions can accessed featureDefinitions method. Plotting raw data direct injection samples involves little processing LC/GC-MS data can simply use chromatogram method extract data. extract m/z-intensity pairs peaks associated first feature. thus first identify peaks feature define m/z values range. Using range can subsequently use filterMz function sub-set full data set signal associated feature’s peaks. object can call mz intensity functions extract data. access actual intensity values feature sample featureValue method can used. setting value = \"\" tells function return integrated signal peak (one representative peak) per sample. NA reported features samples peak identified feature’s m/z value. instances might still signal feature’s position raw data files, peak detection failed identify peak. cases signal can recovered using fillChromPeaks method integrates raw signal feature’s location. signal location NA reported.","code":"## Using default settings but define sample group assignment mzc_prm <- MzClustParam(sampleGroups = ham_prep$sample_group) ham_prep <- groupChromPeaks(ham_prep, param = mzc_prm) ham_prep ## MSn experiment data (\"XCMSnExp\") ## Object size in memory: 0.04 Mb ## - - - Spectra data - - - ## MS level(s): 1 ## Number of spectra: 4 ## MSn retention times: -1:59 - -1:59 minutes ## - - - Processing information - - - ## Data loaded [Wed Apr 3 12:02:22 2024] ## MSnbase version: 2.29.4 ## - - - Meta data - - - ## phenoData ## rowNames: 1 2 3 4 ## varLabels: filename sample_group ## varMetadata: labelDescription ## Loaded from: ## [1] HAM004_641fE_14-11-07--Exp1.extracted.mzML... [4] HAM005_641fE_14-11-07--Exp2.extracted.mzML ## Use 'fileNames(.)' to see all files. ## protocolData: none ## featureData ## featureNames: F1.S1 F2.S1 F3.S1 F4.S1 ## fvarLabels: fileIdx spIdx ... spectrum (35 total) ## fvarMetadata: labelDescription ## experimentData: use 'experimentData(object)' ## - - - xcms preprocessing - - - ## Chromatographic peak detection: ## method: MSW ## 38 peaks identified in 4 samples. ## On average 9.5 chromatographic peaks per sample. ## Correspondence: ## method: mzClust ## 20 features identified. ## Median mz range of features: 9.1553e-05 ## Median rt range of features: 0 featureDefinitions(ham_prep) ## DataFrame with 20 rows and 10 columns ## mzmed mzmin mzmax rtmed rtmin rtmax npeaks ## ## FT01 402.285 402.285 402.286 -1 -1 -1 2 ## FT02 403.237 403.237 403.237 -1 -1 -1 4 ## FT03 405.109 405.109 405.109 -1 -1 -1 2 ## FT04 409.184 409.184 409.185 -1 -1 -1 2 ## FT05 410.144 410.144 410.145 -1 -1 -1 2 ## ... ... ... ... ... ... ... ... ## FT16 437.238 437.238 437.238 -1 -1 -1 2 ## FT17 438.240 438.240 438.240 -1 -1 -1 2 ## FT18 439.151 439.151 439.151 -1 -1 -1 2 ## FT19 441.130 441.130 441.131 -1 -1 -1 2 ## FT20 445.293 445.292 445.293 -1 -1 -1 2 ## ham4 ham5 peakidx ## ## FT01 0 2 16,28 ## FT02 2 2 17,29,1,... ## FT03 0 2 18,30 ## FT04 2 0 10,2 ## FT05 0 2 19,31 ## ... ... ... ... ## FT16 2 0 6,13 ## FT17 2 0 7,14 ## FT18 0 2 26,37 ## FT19 0 2 38,27 ## FT20 2 0 15,8 ## Get the peaks belonging to the first feature pks <- chromPeaks(ham_prep)[featureDefinitions(ham_prep)$peakidx[[1]], ] ## Define the m/z range mzr <- c(min(pks[, \"mzmin\"]) - 0.001, max(pks[, \"mzmax\"]) + 0.001) ## Subset the object to the m/z range ham_prep_sub <- filterMz(ham_prep, mz = mzr) ## Extract the mz and intensity values mzs <- mz(ham_prep_sub, bySample = TRUE) ints <- intensity(ham_prep_sub, bySample = TRUE) ## Plot the data plot(3, 3, pch = NA, xlim = range(mzs), ylim = range(ints), main = \"FT01\", xlab = \"m/z\", ylab = \"intensity\") ## Define colors cols <- rep(\"#ff000080\", length(mzs)) cols[ham_prep_sub$sample_group == \"ham5\"] <- \"#0000ff80\" tmp <- mapply(mzs, ints, cols, FUN = function(x, y, col) { points(x, y, col = col, type = \"l\") }) feat_vals <- featureValues(ham_prep, value = \"into\") head(feat_vals) ## HAM004_641fE_14-11-07--Exp1.extracted.mzML ## FT01 NA ## FT02 4735258 ## FT03 NA ## FT04 4158404 ## FT05 NA ## FT06 6099006 ## HAM004_641fE_14-11-07--Exp2.extracted.mzML ## FT01 NA ## FT02 6202418 ## FT03 NA ## FT04 5004546 ## FT05 NA ## FT06 4950642 ## HAM005_641fE_14-11-07--Exp1.extracted.mzML ## FT01 4095293 ## FT02 4811391 ## FT03 2982453 ## FT04 NA ## FT05 2872023 ## FT06 NA ## HAM005_641fE_14-11-07--Exp2.extracted.mzML ## FT01 4804763 ## FT02 2581183 ## FT03 2268984 ## FT04 NA ## FT05 2133219 ## FT06 NA ham_prep <- fillChromPeaks(ham_prep, param = FillChromPeaksParam()) head(featureValues(ham_prep, value = \"into\")) ## HAM004_641fE_14-11-07--Exp1.extracted.mzML ## FT01 768754.0 ## FT02 4735257.5 ## FT03 652566.6 ## FT04 4158404.5 ## FT05 652201.1 ## FT06 6099006.3 ## HAM004_641fE_14-11-07--Exp2.extracted.mzML ## FT01 1230140.4 ## FT02 6202417.6 ## FT03 374109.9 ## FT04 5004546.3 ## FT05 403448.4 ## FT06 4950641.7 ## HAM005_641fE_14-11-07--Exp1.extracted.mzML ## FT01 4095293 ## FT02 4811391 ## FT03 2982453 ## FT04 1221031 ## FT05 2872023 ## FT06 1573988 ## HAM005_641fE_14-11-07--Exp2.extracted.mzML ## FT01 4804762.5 ## FT02 2581183.1 ## FT03 2268984.5 ## FT04 1241294.4 ## FT05 2133219.4 ## FT06 977694.5"},{"path":"https://sneumann.github.io/xcms/articles/xcms-direct-injection.html","id":"further-analysis","dir":"Articles","previous_headings":"","what":"Further analysis","title":"Grouping FTICR-MS data with xcms","text":"analysis, .e. detection features/metabolites significantly different abundances, PCA analyses can performed feature matrix using functionality R packages, limma.","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms-direct-injection.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"Grouping FTICR-MS data with xcms","text":"","code":"sessionInfo() ## R Under development (unstable) (2024-03-28 r86224) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.4 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] MassSpecWavelet_1.69.0 xcms_4.1.12 BiocParallel_1.37.1 ## [4] MSnbase_2.29.4 ProtGenerics_1.35.4 S4Vectors_0.41.5 ## [7] mzR_2.37.3 Rcpp_1.0.12 Biobase_2.63.1 ## [10] BiocGenerics_0.49.1 BiocStyle_2.31.0 ## ## loaded via a namespace (and not attached): ## [1] DBI_1.2.2 rlang_1.1.3 ## [3] magrittr_2.0.3 clue_0.3-65 ## [5] matrixStats_1.2.0 compiler_4.5.0 ## [7] systemfonts_1.0.6 vctrs_0.6.5 ## [9] MetaboCoreUtils_1.11.2 pkgconfig_2.0.3 ## [11] crayon_1.5.2 fastmap_1.1.1 ## [13] XVector_0.43.1 utf8_1.2.4 ## [15] rmarkdown_2.26 preprocessCore_1.65.0 ## [17] ragg_1.3.0 purrr_1.0.2 ## [19] xfun_0.43 MultiAssayExperiment_1.29.1 ## [21] zlibbioc_1.49.3 cachem_1.0.8 ## [23] GenomeInfoDb_1.39.10 jsonlite_1.8.8 ## [25] progress_1.2.3 highr_0.10 ## [27] DelayedArray_0.29.9 prettyunits_1.2.0 ## [29] parallel_4.5.0 cluster_2.1.6 ## [31] R6_2.5.1 RColorBrewer_1.1-3 ## [33] bslib_0.7.0 limma_3.59.6 ## [35] GenomicRanges_1.55.4 jquerylib_0.1.4 ## [37] bookdown_0.38 SummarizedExperiment_1.33.3 ## [39] iterators_1.0.14 knitr_1.45 ## [41] IRanges_2.37.1 Matrix_1.7-0 ## [43] igraph_2.0.3 tidyselect_1.2.1 ## [45] abind_1.4-5 yaml_2.3.8 ## [47] doParallel_1.0.17 codetools_0.2-20 ## [49] affy_1.81.0 lattice_0.22-6 ## [51] tibble_3.2.1 plyr_1.8.9 ## [53] signal_1.8-0 evaluate_0.23 ## [55] desc_1.4.3 Spectra_1.13.8 ## [57] pillar_1.9.0 affyio_1.73.0 ## [59] BiocManager_1.30.22 MatrixGenerics_1.15.0 ## [61] foreach_1.5.2 MALDIquant_1.22.2 ## [63] ncdf4_1.22 generics_0.1.3 ## [65] hms_1.1.3 ggplot2_3.5.0 ## [67] munsell_0.5.1 scales_1.3.0 ## [69] MsExperiment_1.5.4 glue_1.7.0 ## [71] MsFeatures_1.11.0 lazyeval_0.2.2 ## [73] tools_4.5.0 mzID_1.41.0 ## [75] QFeatures_1.13.3 vsn_3.71.1 ## [77] fs_1.6.3 XML_3.99-0.16.1 ## [79] grid_4.5.0 impute_1.77.0 ## [81] MsCoreUtils_1.15.6 colorspace_2.1-0 ## [83] GenomeInfoDbData_1.2.12 PSMatch_1.7.2 ## [85] cli_3.6.2 textshaping_0.3.7 ## [87] fansi_1.0.6 S4Arrays_1.3.6 ## [89] dplyr_1.1.4 AnnotationFilter_1.27.0 ## [91] pcaMethods_1.95.0 gtable_0.3.4 ## [93] sass_0.4.9 digest_0.6.35 ## [95] SparseArray_1.3.4 htmlwidgets_1.6.4 ## [97] memoise_2.0.1 htmltools_0.5.8 ## [99] pkgdown_2.0.7.9000 lifecycle_1.0.4 ## [101] statmod_1.5.0 MASS_7.3-60.2"},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"LC-MS/MS data analysis with xcms","text":"Metabolite identification important step non-targeted metabolomics requires different steps. One involves use tandem mass spectrometry generate fragmentation spectra detected metabolites (LC-MS/MS), compared fragmentation spectra known metabolites. Different approaches exist generation fragmentation spectra, whereas used data dependent acquisition (DDA) also known top-n method. method top N intense ions (m/z values) MS1 scan selected fragmentation next N scans cycle starts . method allows generate clean MS2 fragmentation spectra fly acquisition without need experiments, suffers poor coverage detected metabolites (since limited number ions fragmented) less accurate quantification compounds (since fewer MS1 scans generated). Data independent approaches (DIA) like Bruker bbCID, Agilent AllIons Waters MSe don’t use preselection, rather fragment detected molecules . using alternating schemes scan low high collision energy collect MS1 MS2 data. Using approach, problem coverage, relation precursor fragment masses lost leading chimeric spectra. Sequential Window Acquisition Theoretical Mass Spectra (SWATH [1]) combines approaches middle-way approach. precursor selection acquisition independent acquired data, rather isolating precusors , defined windows (.e. ranges m/z values) used scanned. reduces overlap fragment spectra still keeping high coverage. document showcases analysis two small LC-MS/MS data sets using xcms. data files used reversed-phase LC-MS/MS runs Agilent Pesticide mix obtained Sciex 6600 Triple ToF operated SWATH acquisition mode. comparison DDA file sample included.","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"analysis-of-dda-data","dir":"Articles","previous_headings":"","what":"Analysis of DDA data","title":"LC-MS/MS data analysis with xcms","text":"load example DDA data set create total ion chromatogram MS1 data. According TIC signal measured ~ 200 600 seconds (see plot ). thus filter DDA data retention time range. variable dda_data contains now MS1 MS2 spectra specified mzML file. number spectra MS level listed . Note subset experiment first data file (using [1]) access directly spectra within sample spectra function (returns Spectra object Spectra package). Note use pipe operator |> better readability. MS2 spectra can get m/z precursor ion precursorMz function. first subset data set single sample filter spectra MS level 2 extracting precursor m/z values. precursorIntensity function also possible extract intensity precursor ion. manufacturers (like Sciex) don’t define/export precursor intensity thus either NA 0 reported. can however use estimatePrecursorIntensity function Spectra package determine precursor intensity MS 2 spectrum based intensity respective ion previous MS1 scan (note method = \"interpolation\" precursor intensity defined based interpolation intensity previous subsequent MS1 scan). estimate precursor intensities, full data (MS1 spectra NA value reported). next set precursor intensity spectrum metadata dda_data. can extracted later precursorIntensity function. Next perform chromatographic peak detection MS level 1 data findChromPeaks method. define settings centWave-based peak detection perform analysis. total 114 peaks identified present data set. advantage LC-MS/MS data (MS1) ions fragmented corresponding MS2 spectra measured. Thus, ions (identified MS1 chromatographic peaks) MS2 spectra available. can facilitate annotation respective MS1 chromatographic peaks (MS1 features correspondence analysis). Spectra identified chromatographic peaks can extracted chromPeakSpectra method. MS2 spectra precursor m/z retention time within rt m/z range chromatographic peak returned. default chromPeakSpectra returns spectra associated MS1 chromatographic peak, parameter method allows choose return one spectrum per peak (look ?chromPeakSpectra help page details). Also, possible extract MS1 spectra peak specifying msLevel = 1L call (e.g. evaluate full MS1 signal peak’s apex position). returned Spectra contains also reference respective chromatographic peak additional spectra variable \"peak_id\" contains identifier chromatographic peak (.e. row name chromPeaks matrix). Note also return.type = \"List\" list parallel chromPeaks matrix returned, .e. element list contain spectra chromatographic peak index. data representation might eventually simplify processing. next use MS2 information aid annotation chromatographic peak. example use chromatographic peak ion m/z 304.1131 extract code block . search potential ions similar m/z reference database (e.g. Metlin) returned large list potential hits, small ppm. two hits, Flumazenil (Metlin ID 2724) Fenamiphos (Metlin ID 72445) experimental MS2 spectra available. Thus, match MS2 spectrum identified chromatographic peak annotate ion. extract MS2 spectra associated candidate chromatographic peak using ID peak present data set. 5 MS2 spectra representing fragmentation ion(s) measured candidate chromatographic peak. next reduce single MS2 spectrum using combineSpectra method employing combinePeaks function determine peaks keep resulting spectrum (look ?combinePeaks help page details). Parameter f allows specify spectra input object combined one. Note combination multiple fragment spectra single spectrum might generally best approach suggested types data. Mass peaks input spectra difference m/z smaller 20 ppm (parameter ppm) combined one peak median m/z intensity reported . Due parameter minProp = 0.8, resulting MS2 spectrum contains peaks present 80% input spectra. plot consensus spectrum shown . Consensus MS2 spectrum created measured MS2 spectra ions chromatographic peak CP53. now match consensus spectrum database MS2 spectra. example simply load MS2 spectra two compounds matching m/z exported Metlin. compounds MS2 spectra created collision energies 0V, 10V, 20V 40V available. import respective data plot candidate spectrum MS2 spectra Flumanezil Fenamiphos (collision energy 20V). import files MGF format load MsBackendMgf Bioconductor package adds MGF file support Spectra package. Prior plotting scale experimental spectra replace peak intensities values relative maximum peak intensity (set value 100). Mirror plots candidate MS2 spectrum Flumanezil (left) Fenamiphos (right). upper panel represents candidate MS2 spectrum, lower target MS2 spectrum. Matching peaks indicated dot. candidate spectrum matches Fenamiphos, thus, example chromatographic peak represents signal measured compound. addition plotting spectra, can also calculate similarities compareSpectra method (uses default normalized dot-product calculate similarity). Clearly, candidate spectrum match Flumanezil, high similarity Fenamiphos. performed MS2-based annotation single chromatographic peak, easily extended full list MS2 spectra (returned chromPeakSpectra) chromatographic peaks experiment. See also alternative tutorials matching experimental fragment spectra reference. present example used single data file thus need perform sample alignment correspondence analysis. tasks however performed similarly plain LC-MS data, retention times recorded MS2 spectra however also adjusted alignment based MS1 data. correspondence analysis (peak grouping) MS2 spectra features can extracted featureSpectra function returns MS2 spectra associated chromatographic peak feature. Note also workflow can included Feature-Based Molecular Networking FBMN match MS2 spectra GNPS. See details examples.","code":"library(xcms) library(MsExperiment) dda_file <- system.file(\"TripleTOF-SWATH\", \"PestMix1_DDA.mzML\", package = \"msdata\") dda_data <- readMsExperiment(dda_file) chr <- chromatogram(dda_data, aggregationFun = \"sum\", msLevel = 1L) plot(chr) abline(v = c(230, 610)) ## filter the data dda_data <- filterRt(dda_data, rt = c(230, 610)) ## Filter spectra dda_data[1] |> spectra() |> msLevel() |> table() ## ## 1 2 ## 1389 2214 dda_data[1] |> spectra() |> filterMsLevel(2) |> precursorMz() |> head() ## [1] 182.18777 182.18893 55.00579 182.19032 237.12296 237.11987 dda_data[1] |> spectra() |> filterMsLevel(2) |> precursorIntensity() |> head() ## [1] 0 0 0 0 0 0 prec_int <- estimatePrecursorIntensity(spectra(dda_data)) spectra(dda_data)$precursorIntensity <- prec_int dda_data[1] |> spectra() |> filterMsLevel(2) |> precursorIntensity() |> head() ## [1] NA 9.198155 2.773988 27.590797 3.443145 7.621923 cwp <- CentWaveParam(snthresh = 5, noise = 100, ppm = 10, peakwidth = c(3, 30)) dda_data <- findChromPeaks(dda_data, param = cwp, msLevel = 1L) library(Spectra) dda_spectra <- chromPeakSpectra(dda_data, msLevel = 2L) dda_spectra ## MSn data (Spectra) with 142 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 2 237.869 1812 ## 2 2 241.299 1846 ## 3 2 325.763 2439 ## 4 2 326.583 2446 ## 5 2 327.113 2450 ## ... ... ... ... ## 138 2 574.725 5110 ## 139 2 575.255 5115 ## 140 2 596.584 5272 ## 141 2 592.424 5236 ## 142 2 596.054 5266 ## ... 34 more variables/columns. ## ## file(s): ## PestMix1_DDA.mzML ## Processing: ## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 12:02:44 2024] ## Filter: select MS level(s) 2 [Wed Apr 3 12:02:51 2024] ## Merge 1 Spectra into one [Wed Apr 3 12:02:52 2024] dda_spectra$peak_id ## [1] \"CP004\" \"CP004\" \"CP005\" \"CP005\" \"CP006\" \"CP006\" \"CP008\" \"CP008\" \"CP011\" ## [10] \"CP011\" \"CP012\" \"CP012\" \"CP013\" \"CP013\" \"CP013\" \"CP013\" \"CP014\" \"CP014\" ## [19] \"CP014\" \"CP014\" \"CP018\" \"CP022\" \"CP022\" \"CP022\" \"CP025\" \"CP025\" \"CP025\" ## [28] \"CP025\" \"CP026\" \"CP026\" \"CP026\" \"CP026\" \"CP033\" \"CP033\" \"CP034\" \"CP034\" ## [37] \"CP034\" \"CP034\" \"CP034\" \"CP035\" \"CP035\" \"CP035\" \"CP041\" \"CP041\" \"CP041\" ## [46] \"CP042\" \"CP042\" \"CP042\" \"CP043\" \"CP047\" \"CP047\" \"CP049\" \"CP049\" \"CP049\" ## [55] \"CP049\" \"CP050\" \"CP050\" \"CP050\" \"CP051\" \"CP051\" \"CP051\" \"CP054\" \"CP055\" ## [64] \"CP055\" \"CP055\" \"CP056\" \"CP056\" \"CP056\" \"CP056\" \"CP056\" \"CP060\" \"CP060\" ## [73] \"CP060\" \"CP060\" \"CP064\" \"CP064\" \"CP065\" \"CP065\" \"CP066\" \"CP066\" \"CP069\" ## [82] \"CP069\" \"CP069\" \"CP070\" \"CP070\" \"CP070\" \"CP072\" \"CP072\" \"CP072\" \"CP073\" ## [91] \"CP074\" \"CP074\" \"CP074\" \"CP074\" \"CP075\" \"CP075\" \"CP075\" \"CP077\" \"CP077\" ## [100] \"CP077\" \"CP079\" \"CP079\" \"CP079\" \"CP079\" \"CP080\" \"CP080\" \"CP080\" \"CP081\" ## [109] \"CP086\" \"CP086\" \"CP086\" \"CP086\" \"CP086\" \"CP088\" \"CP088\" \"CP088\" \"CP089\" ## [118] \"CP089\" \"CP091\" \"CP091\" \"CP093\" \"CP093\" \"CP094\" \"CP094\" \"CP094\" \"CP095\" ## [127] \"CP095\" \"CP095\" \"CP096\" \"CP096\" \"CP096\" \"CP098\" \"CP098\" \"CP098\" \"CP098\" ## [136] \"CP098\" \"CP099\" \"CP099\" \"CP099\" \"CP100\" \"CP101\" \"CP101\" ex_mz <- 304.1131 chromPeaks(dda_data, mz = ex_mz, ppm = 20) ## mz mzmin mzmax rt rtmin rtmax into intb ## CP056 304.1133 304.1126 304.1143 425.024 417.985 441.773 13040.8 13007.79 ## maxo sn sample ## CP056 3978.987 232 1 ex_id <- rownames(chromPeaks(dda_data, mz = ex_mz, ppm = 20)) ex_spectra <- dda_spectra[dda_spectra$peak_id == ex_id] ex_spectra ## MSn data (Spectra) with 5 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 2 418.926 3505 ## 2 2 419.306 3510 ## 3 2 423.036 3582 ## 4 2 423.966 3603 ## 5 2 424.296 3609 ## ... 34 more variables/columns. ## ## file(s): ## PestMix1_DDA.mzML ## Processing: ## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 12:02:44 2024] ## Filter: select MS level(s) 2 [Wed Apr 3 12:02:51 2024] ## Merge 1 Spectra into one [Wed Apr 3 12:02:52 2024] ex_spectrum <- combineSpectra(ex_spectra, FUN = combinePeaks, ppm = 20, peaks = \"intersect\", minProp = 0.8, intensityFun = median, mzFun = median, f = ex_spectra$peak_id) ## Warning in FUN(X[[i]], ...): 'combinePeaks' for lists of peak matrices is ## deprecated; please use 'combinePeaksData' instead. ex_spectrum ## MSn data (Spectra) with 1 spectra in a MsBackendMemory backend: ## msLevel rtime scanIndex ## ## 1 2 418.926 3505 ## ... 34 more variables/columns. ## Processing: ## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 12:02:44 2024] ## Filter: select MS level(s) 2 [Wed Apr 3 12:02:51 2024] ## Merge 1 Spectra into one [Wed Apr 3 12:02:52 2024] ## ...1 more processings. Use 'processingLog' to list all. plotSpectra(ex_spectrum) scale_fun <- function(z, ...) { z[, \"intensity\"] <- z[, \"intensity\"] / max(z[, \"intensity\"], na.rm = TRUE) * 100 z } ex_spectrum <- addProcessing(ex_spectrum, FUN = scale_fun) library(MsBackendMgf) flumanezil <- Spectra( system.file(\"mgf\", \"metlin-2724.mgf\", package = \"xcms\"), source = MsBackendMgf()) ## Start data import from 1 files ... done fenamiphos <- Spectra( system.file(\"mgf\", \"metlin-72445.mgf\", package = \"xcms\"), source = MsBackendMgf()) ## Start data import from 1 files ... done par(mfrow = c(1, 2)) plotSpectraMirror(ex_spectrum, flumanezil[3], main = \"against Flumanezil\", ppm = 40) plotSpectraMirror(ex_spectrum, fenamiphos[3], main = \"against Fenamiphos\", ppm = 40) compareSpectra(ex_spectrum, flumanezil, ppm = 40) ## [1] 4.520957e-02 3.283806e-02 2.049379e-03 3.374354e-05 compareSpectra(ex_spectrum, fenamiphos, ppm = 40) ## [1] 0.1326234432 0.4879399946 0.7198406271 0.3997922658 0.0004876129 ## [6] 0.0028408885 0.0071030051 0.0053809736"},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"dia-swath-data-analysis","dir":"Articles","previous_headings":"","what":"DIA (SWATH) data analysis","title":"LC-MS/MS data analysis with xcms","text":"section analyze small SWATH data set consisting single mzML file data sample analyzed previous section recorded SWATH mode. read data readMsExperiment function. resulting object contain recorded MS1 MS2 spectra specified file. Similar previous data file, filter file signal 230 610 seconds. determine number MS level 1 2 spectra present data set. described introduction, SWATH mode ions within pre-defined isolation windows fragmented MS2 spectra measured. definition isolation windows (SWATH pockets) imported mzML files available additional spectra variables. inspect respective information first spectra. upper lower isolation window m/z available spectra variables \"isolationWindowLowerMz\" \"isolationWindowUpperMz\" respectively target m/z isolation window \"isolationWindowTargetMz\". can use spectraData function extract information spectra within swath_data object. also access variables directly dedicated isolationWindowLowerMz isolationWindowUpperMz functions. present data set use value isolation window target m/z define individual SWATH pockets. list number spectra recorded pocket/isolation window. thus 422 423 MS2 spectra measured isolation window. inspect data can also extract chromatograms measured MS1 well MS2 data. MS2 data set parameter msLevel = 2L addition also specify isolation window want extract data. extract TIC MS1 data one isolation windows (isolation window target m/z 270.85) plot . TIC MS1 (upper panel) MS2 data isolation window target m/z 270.85 (lower panel). Note also DIA data manufacturers (e.g. Waters MSe) supported long spectra variable isolationWindowTargetMz available. variable provided raw data files can also manually assigned spectrum data set. example precursor m/z individual spectra used \"isolationWindowTargetMz\" (note: line shown example evaluated).","code":"swath_file <- system.file(\"TripleTOF-SWATH\", \"PestMix1_SWATH.mzML\", package = \"msdata\") swath_data <- readMsExperiment(swath_file) swath_data <- filterRt(swath_data, rt = c(230, 610)) spectra(swath_data) |> msLevel() |> table() ## ## 1 2 ## 422 3378 spectra(swath_data) |> spectraData(c(\"isolationWindowTargetMz\", \"isolationWindowLowerMz\", \"isolationWindowUpperMz\", \"msLevel\", \"rtime\")) |> head() ## DataFrame with 6 rows and 5 columns ## isolationWindowTargetMz isolationWindowLowerMz isolationWindowUpperMz ## ## 1 299.10 283.5 314.7 ## 2 329.80 313.7 345.9 ## 3 367.35 344.9 389.8 ## 4 601.85 388.8 814.9 ## 5 NA NA NA ## 6 163.75 139.5 188.0 ## msLevel rtime ## ## 1 2 230.073 ## 2 2 230.170 ## 3 2 230.267 ## 4 2 230.364 ## 5 1 230.459 ## 6 2 230.585 head(isolationWindowLowerMz(spectra(swath_data))) ## [1] 283.5 313.7 344.9 388.8 NA 139.5 head(isolationWindowUpperMz(spectra(swath_data))) ## [1] 314.7 345.9 389.8 814.9 NA 188.0 table(isolationWindowTargetMz(spectra(swath_data))) ## ## 163.75 208.95 244.05 270.85 299.1 329.8 367.35 601.85 ## 422 422 422 422 423 423 422 422 tic_ms1 <- chromatogram(swath_data, msLevel = 1L, aggregationFun = \"sum\") tic_ms2 <- chromatogram(swath_data, msLevel = 2L, aggregationFun = \"sum\", isolationWindowTargetMz = 270.85) par(mfrow = c(2, 1)) plot(tic_ms1, main = \"MS1\") plot(tic_ms2, main = \"MS2, isolation window m/z 270.85\") spectra(swath_data)$isolationWindowTargetMz <- precursorMz(spectra(swath_data))"},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"chromatographic-peak-detection-in-ms1-and-ms2-data","dir":"Articles","previous_headings":"DIA (SWATH) data analysis","what":"Chromatographic peak detection in MS1 and MS2 data","title":"LC-MS/MS data analysis with xcms","text":"Similar conventional LC-MS analysis, perform first chromatographic peak detection (MS level 1 data) findChromPeaks method. define settings centWave-based peak detection perform analysis. Next perform chromatographic peak detection MS level 2 data separately individual isolation window. use findChromPeaksIsolationWindow function employing peak detection algorithm reducing however required signal--noise ratio. isolationWindow parameter allows specify MS2 spectra belong isolation window hence defines set MS2 spectra chromatographic peak detection performed. default \"isolationWindowTargetMz\" variable object’s spectra used. findChromPeaksIsolationWindow function added peaks identified individual isolation windows chromPeaks matrix containing already MS1 chromatographic peaks. newly added peaks can identified \"isolationWindow\" column object’s chromPeakData. count number chromatographic peaks identified within isolation window (number chromatographic peaks identified MS1 62). thus successfully identified chromatographic peaks different MS levels isolation windows. next step identify measured signals represents data original compound reconstruct fragment spectra MS1 signal (chromatographic peak).","code":"cwp <- CentWaveParam(snthresh = 5, noise = 100, ppm = 10, peakwidth = c(3, 30)) swath_data <- findChromPeaks(swath_data, param = cwp) swath_data ## Object of class XcmsExperiment ## Spectra: MS1 (422) MS2 (3378) ## Experiment data: 1 sample(s) ## Sample data links: ## - spectra: 1 sample(s) to 3800 element(s). ## xcms results: ## - chromatographic peaks: 62 in MS level(s): 1 cwp <- CentWaveParam(snthresh = 3, noise = 10, ppm = 10, peakwidth = c(3, 30)) swath_data <- findChromPeaksIsolationWindow(swath_data, param = cwp) swath_data ## Object of class XcmsExperiment ## Spectra: MS1 (422) MS2 (3378) ## Experiment data: 1 sample(s) ## Sample data links: ## - spectra: 1 sample(s) to 3800 element(s). ## xcms results: ## - chromatographic peaks: 370 in MS level(s): 1, 2 chromPeakData(swath_data) ## DataFrame with 370 rows and 6 columns ## ms_level is_filled isolationWindow isolationWindowTargetMZ ## ## CP01 1 FALSE NA NA ## CP02 1 FALSE NA NA ## CP03 1 FALSE NA NA ## CP04 1 FALSE NA NA ## CP05 1 FALSE NA NA ## ... ... ... ... ... ## CP366 2 FALSE 601.85 601.85 ## CP367 2 FALSE 601.85 601.85 ## CP368 2 FALSE 601.85 601.85 ## CP369 2 FALSE 601.85 601.85 ## CP370 2 FALSE 601.85 601.85 ## isolationWindowLowerMz isolationWindowUpperMz ## ## CP01 NA NA ## CP02 NA NA ## CP03 NA NA ## CP04 NA NA ## CP05 NA NA ## ... ... ... ## CP366 388.8 814.9 ## CP367 388.8 814.9 ## CP368 388.8 814.9 ## CP369 388.8 814.9 ## CP370 388.8 814.9 table(chromPeakData(swath_data)$isolationWindow) ## ## 163.75 208.95 244.05 270.85 299.1 329.8 367.35 601.85 ## 2 38 32 14 105 23 62 32"},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"reconstruction-of-ms2-spectra","dir":"Articles","previous_headings":"DIA (SWATH) data analysis","what":"Reconstruction of MS2 spectra","title":"LC-MS/MS data analysis with xcms","text":"Identifying signal fragment ions precursor measured MS1 chromatographic peak non-trivial task. MS2 spectrum fragment ion MS1 chromatographic peak reconstructed available MS2 signal (.e. chromatographic peaks identified MS level 2). SWATH data, fragment ion signal present isolation window contains m/z precursor ion chromatographic peak shape MS2 chromatographic peaks fragment ions specific precursor similar retention time peak shape precursor’s MS1 chromatographic peak. detection MS1 MS2 chromatographic peaks performed, can reconstruct MS2 spectra using reconstructChromPeakSpectra function. function defines MS2 spectrum MS1 chromatographic peak based following approach: Identify MS2 chromatographic peaks isolation window containing m/z ion (MS1 chromatographic peak) approximately retention time MS1 chromatographic peak (accepted difference retention time can defined diffRt parameter). Extract MS1 chromatographic peak MS2 chromatographic peaks identified previous step correlate peak shapes candidate MS2 chromatographic peaks shape MS1 peak. MS2 chromatographic peaks correlation coefficient larger minCor retained. Reconstruct MS2 spectrum using m/z selected MS2 chromatographic peaks intensity; MS2 chromatographic peak selected MS1 peak thus represent one mass peak reconstructed spectrum. illustrate process perform individual steps example fenamiphos (exact mass 303.105800777 m/z [M+H]+ adduct 304.113077). first step extract chromatographic peak ion. Next identify MS2 chromatographic peaks identified isolation window containing m/z fenamiphos. information isolation window chromatographic peak identified available chromPeakData. also require retention time MS2 chromatographic peaks similar retention time MS1 peak extract corresponding peak information. thus select chromatographic peaks retention time range contains retention time apex position MS1 chromatographic peak. total 24 MS2 chromatographic peaks match conditions. Next extract ion chromatogram MS1 peak selected candidate MS2 signals. ensure chromatograms extracted spectra correct isolation window need specify respective isolation window passing isolation window target m/z chromatogram function (addition setting msLevel = 2). can done either getting isolationWindowTargetMz spectra data subset using filterIsolationWindow (done ) selecting isolationWindowTargetMz closest m/z compound interest. target m/z isolation window containing m/z interest thus 299.1 can use chromatogram call extract data correct (MS2) spectra. can now plot extracted ion chromatogram MS1 extracted MS2 data. Extracted ion chromatograms Fenamiphos MS1 (blue) potentially related signal MS2 (grey). Next can calculate correlations peak shapes MS2 chromatogram MS1 peak. illustrate process example one MS2 chromatographic peaks. Note , MS1 MS2 spectra recorded consecutively, retention times individual data points differ MS2 MS1 chromatographic data data points thus matched (aligned) performing correlation analysis. done automatically correlate function. See help align method information alignment options. identifying MS2 chromatographic peaks shapes enough high similarity MS1 chromatographic peaks, MS2 spectrum reconstructed based m/z intensities MS2 chromatographic peaks (.e., using \"mz\" \"maxo\" \"\" values). Instead performing assignment MS2 signal MS1 chromatographic peaks manually , can use reconstructChromPeakSpectra function performs exact steps MS1 chromatographic peaks DIA data set. use function reconstruct MS2 spectra example data requiring peak shape correlation higher 0.9 candidate MS2 chromatographic peak target MS1 chromatographic peak. result got Spectra object length equal number MS1 peaks data. length spectrum represents number peaks contains. Thus, length 0 indicates matching peak (MS2 signal) found respective MS1 chromatographic peak. reconstructed spectra additional annotations available IDs MS2 chromatographic peaks spectrum reconstructed (\"ms2_peak_id\") well correlation coefficient chromatographic peak shape precursor’s shape (\"ms2_peak_cor\"). Metadata column \"peak_id\" contains ID MS1 chromatographic peak: next extract MS2 spectrum example peak likely representing [M+H]+ ions Fenamiphos using chromatographic peak ID: can now compare reconstructed spectrum example consensus spectrum DDA experiment previous section (variable ex_spectrum) well MS2 spectrum Fenamiphos Metlin (collision energy 10V). better visualization normalize also peak intensities reconstructed SWATH spectrum function used experimental DDA spectrum. Mirror plot comparing reconstructed MS2 spectrum Fenamiphos (upper panel) measured spectrum DDA data Fenamiphhos spectrum Metlin. wanted get EICs MS2 chromatographic peaks used generate MS2 spectrum can use IDs peaks provided $ms2_peak_id result spectrum. peak IDs available can extract retention time window m/z ranges chromPeaks matrix use chromatogram function extract EIC. Note however SWATH data MS2 signal different isolation windows. Thus first filter swath_data object isolation window containing precursor m/z filterIsolationWindow subset data MS2 spectra related ion interest. addition, use msLevel = 2L chromatogram call chromatogram extracts default data MS1 spectra need specify target m/z isolation window containing fragment data compound interest. row ms2_eics contains now EIC one MS2 chromatographic peaks. can also plot overlay plot. Overlay EICs chromatographic peaks used reconstruct MS2 spectrum fenamiphos. second example analyze signal [M+H]+ ion m/z 376.0381 (match Prochloraz). first identify MS1 chromatographic peak m/z retrieve reconstructed MS2 spectrum peak. MS2 spectrum (tentative) MS1 signal prochloraz reconstructed SWATH MS2 data thus 9 peaks. addition identify corresponding MS1 peak DDA data set, extract measured MS2 chromatographic peaks build consensus spectrum . retention times chromatographic peaks DDA SWATH data match almost perfectly. Next get MS2 spectra peak. total 5 spectra measured, relatively high number peaks. Next combine consensus spectrum. last load also Prochloraz MS2 spectra (different collision energies) Metlin. validate reconstructed spectrum plot corresponding DDA spectrum MS2 spectrum Prochloraz (collision energy 10V) Metlin. Mirror plot comparing reconstructed MS2 spectrum Prochloraz (upper panel) measured spectrum DDA data Prochloraz spectrum Metlin. spectra fit relatively well. Interestingly, peak representing precursor (right-peak) seems slightly shifted m/z value reconstructed spectrum. Also, closer inspecting spectrum two groups peaks small differences m/z can observed (see plot ). SWATH-derived MS2 spectrum prochloraz. represent fragments isotopes original compound. DIA MS2 data, since ions given retention time fragmented, can contain fragments isotopes. thus use isotopologues function MetaboCoreUtils package check presence potential isotope peaks reconstructed MS2 spectrum prochloraz. Indeed, peaks 3, 4 5 well 6 7 assigned group potential isotope peaks. proof peaks indeed fragment isotopes prochloraz highly likely (given difference m/z relative intensity differences). thus define function keeps monoisotopic peak isotope group spectrum. SWATH MS2 spectrum prochloraz (left) deisotoping (right). Removing isotope peaks SWATH MS2 spectrum increases also spectra similarity score (since reference spectra generally contain fragments ion interest, isotopes). Similar DDA data, reconstructed MS2 spectra SWATH data used annotation MS1 chromatographic peaks.","code":"fenamiphos_mz <- 304.113077 fenamiphos_ms1_peak <- chromPeaks(swath_data, mz = fenamiphos_mz, ppm = 2) fenamiphos_ms1_peak ## mz mzmin mzmax rt rtmin rtmax into intb ## CP34 304.1124 304.1121 304.1126 423.945 419.445 428.444 10697.34 10688.34 ## maxo sn sample ## CP34 2401.849 618 1 keep <- chromPeakData(swath_data)$isolationWindowLowerMz < fenamiphos_mz & chromPeakData(swath_data)$isolationWindowUpperMz > fenamiphos_mz keep <- keep & chromPeaks(swath_data)[, \"rtmin\"] < fenamiphos_ms1_peak[, \"rt\"] & chromPeaks(swath_data)[, \"rtmax\"] > fenamiphos_ms1_peak[, \"rt\"] fenamiphos_ms2_peak <- chromPeaks(swath_data)[which(keep), ] rtr <- fenamiphos_ms1_peak[, c(\"rtmin\", \"rtmax\")] mzr <- fenamiphos_ms1_peak[, c(\"mzmin\", \"mzmax\")] fenamiphos_ms1_chr <- chromatogram(swath_data, rt = rtr, mz = mzr) ## Processing chromatographic peaks rtr <- fenamiphos_ms2_peak[, c(\"rtmin\", \"rtmax\")] mzr <- fenamiphos_ms2_peak[, c(\"mzmin\", \"mzmax\")] ## Get the isolationWindowTargetMz for spectra containing the m/z of the ## compound of interest swath_data |> filterIsolationWindow(mz = fenamiphos_mz) |> spectra() |> isolationWindowTargetMz() |> table() ## ## 299.1 ## 423 fenamiphos_ms2_chr <- chromatogram( swath_data, rt = rtr, mz = mzr, msLevel = 2L, isolationWindowTargetMz = rep(299.1, nrow(rtr))) ## Processing chromatographic peaks plot(rtime(fenamiphos_ms1_chr[1, 1]), intensity(fenamiphos_ms1_chr[1, 1]), xlab = \"retention time [s]\", ylab = \"intensity\", pch = 16, ylim = c(0, 5000), col = \"blue\", type = \"b\", lwd = 2) #' Add data from all MS2 peaks tmp <- lapply(fenamiphos_ms2_chr@.Data, function(z) points(rtime(z), intensity(z), col = \"#00000080\", type = \"b\", pch = 16)) compareChromatograms(fenamiphos_ms2_chr[1, 1], fenamiphos_ms1_chr[1, 1], ALIGNFUNARGS = list(method = \"approx\")) ## [1] 0.9997871 swath_spectra <- reconstructChromPeakSpectra(swath_data, minCor = 0.9) swath_spectra ## MSn data (Spectra) with 62 spectra in a MsBackendMemory backend: ## msLevel rtime scanIndex ## ## CP01 2 239.458 NA ## CP02 2 240.358 NA ## CP03 2 329.577 NA ## CP04 2 329.771 NA ## CP05 2 346.164 NA ## ... ... ... ... ## CP58 2 551.735 NA ## CP59 2 551.735 NA ## CP60 2 575.134 NA ## CP61 2 575.134 NA ## CP62 2 574.942 NA ## ... 20 more variables/columns. ## Processing: ## Merge 1 Spectra into one [Wed Apr 3 12:02:59 2024] lengths(swath_spectra) ## [1] 0 0 1 1 1 0 0 0 0 0 0 0 3 0 3 4 0 3 0 1 0 9 14 1 0 ## [26] 0 15 4 1 1 2 4 6 15 12 11 2 4 13 0 0 0 0 1 2 0 1 0 0 0 ## [51] 3 0 2 1 7 7 0 0 0 0 0 2 spectraData(swath_spectra, c(\"peak_id\", \"ms2_peak_id\", \"ms2_peak_cor\")) ## DataFrame with 62 rows and 3 columns ## peak_id ms2_peak_id ms2_peak_cor ## ## CP01 CP01 ## CP02 CP02 ## CP03 CP03 CP063 0.950582 ## CP04 CP04 CP105 0.95157 ## CP05 CP05 CP153 0.924545 ## ... ... ... ... ## CP58 CP58 ## CP59 CP59 ## CP60 CP60 ## CP61 CP61 ## CP62 CP62 CP334,CP329 0.918915,0.911944 fenamiphos_swath_spectrum <- swath_spectra[ swath_spectra$peak_id == rownames(fenamiphos_ms1_peak)] fenamiphos_swath_spectrum <- addProcessing(fenamiphos_swath_spectrum, scale_fun) par(mfrow = c(1, 2)) plotSpectraMirror(fenamiphos_swath_spectrum, ex_spectrum, ppm = 50, main = \"against DDA\") plotSpectraMirror(fenamiphos_swath_spectrum, fenamiphos[2], ppm = 50, main = \"against Metlin\") pk_ids <- fenamiphos_swath_spectrum$ms2_peak_id[[1]] pk_ids ## [1] \"CP199\" \"CP201\" \"CP211\" \"CP208\" \"CP200\" \"CP202\" \"CP217\" \"CP215\" \"CP205\" ## [10] \"CP212\" \"CP221\" \"CP223\" \"CP213\" \"CP207\" \"CP220\" rt_range <- chromPeaks(swath_data)[pk_ids, c(\"rtmin\", \"rtmax\")] mz_range <- chromPeaks(swath_data)[pk_ids, c(\"mzmin\", \"mzmax\")] pmz <- precursorMz(fenamiphos_swath_spectrum)[1] ## Determine the isolation window target m/z tmz <- swath_data |> filterIsolationWindow(mz = pmz) |> spectra() |> isolationWindowTargetMz() |> unique() ms2_eics <- chromatogram( swath_data, rt = rt_range, mz = mz_range, msLevel = 2L, isolationWindowTargetMz = rep(tmz, nrow(rt_range))) ## Processing chromatographic peaks plotChromatogramsOverlay(ms2_eics) prochloraz_mz <- 376.0381 prochloraz_ms1_peak <- chromPeaks(swath_data, msLevel = 1L, mz = prochloraz_mz, ppm = 5) prochloraz_ms1_peak ## mz mzmin mzmax rt rtmin rtmax into intb ## CP22 376.0373 376.037 376.0374 405.046 401.446 409.546 3664.051 3655.951 ## maxo sn sample ## CP22 897.3923 278 1 prochloraz_swath_spectrum <- swath_spectra[ swath_spectra$peak_id == rownames(prochloraz_ms1_peak)] lengths(prochloraz_swath_spectrum) ## [1] 9 prochloraz_dda_peak <- chromPeaks(dda_data, msLevel = 1L, mz = prochloraz_mz, ppm = 5) prochloraz_dda_peak ## mz mzmin mzmax rt rtmin rtmax into intb ## CP034 376.0385 376.0378 376.0391 405.295 401.166 410.145 5082.157 5072.77 ## maxo sn sample ## CP034 1350.633 310 1 prochloraz_dda_spectra <- dda_spectra[ dda_spectra$peak_id == rownames(prochloraz_dda_peak)] prochloraz_dda_spectra ## MSn data (Spectra) with 5 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 2 401.438 3253 ## 2 2 402.198 3259 ## 3 2 404.677 3306 ## 4 2 405.127 3316 ## 5 2 405.877 3325 ## ... 34 more variables/columns. ## ## file(s): ## PestMix1_DDA.mzML ## Processing: ## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 12:02:44 2024] ## Filter: select MS level(s) 2 [Wed Apr 3 12:02:51 2024] ## Merge 1 Spectra into one [Wed Apr 3 12:02:52 2024] prochloraz_dda_spectrum <- combineSpectra( prochloraz_dda_spectra, FUN = combinePeaks, ppm = 20, peaks = \"intersect\", minProp = 0.8, intensityFun = median, mzFun = median, f = prochloraz_dda_spectra$peak_id) ## Backend of the input object is read-only, will change that to an 'MsBackendMemory' ## Warning in FUN(X[[i]], ...): 'combinePeaks' for lists of peak matrices is ## deprecated; please use 'combinePeaksData' instead. prochloraz <- Spectra( system.file(\"mgf\", \"metlin-68898.mgf\", package = \"xcms\"), source = MsBackendMgf()) ## Start data import from 1 files ... done prochloraz_swath_spectrum <- addProcessing(prochloraz_swath_spectrum, scale_fun) prochloraz_dda_spectrum <- addProcessing(prochloraz_dda_spectrum, scale_fun) par(mfrow = c(1, 2)) plotSpectraMirror(prochloraz_swath_spectrum, prochloraz_dda_spectrum, ppm = 40, main = \"against DDA\") plotSpectraMirror(prochloraz_swath_spectrum, prochloraz[2], ppm = 40, main = \"against Metlin\") plotSpectra(prochloraz_swath_spectrum) library(MetaboCoreUtils) isotopologues(peaksData(prochloraz_swath_spectrum)[[1]]) ## [[1]] ## [1] 3 4 5 ## ## [[2]] ## [1] 6 7 ## Function to keep only the first (monoisotopic) peak for potential ## isotopologue peak groups. rem_iso <- function(x, ...) { idx <- isotopologues(x) idx <- unlist(lapply(idx, function(z) z[-1]), use.names = FALSE) if (length(idx)) x[-idx, , drop = FALSE] else x } prochloraz_swath_spectrum2 <- addProcessing(prochloraz_swath_spectrum, rem_iso) par(mfrow = c(1, 2)) plotSpectra(prochloraz_swath_spectrum) plotSpectra(prochloraz_swath_spectrum2) compareSpectra(prochloraz_swath_spectrum, prochloraz_dda_spectrum) ## [1] 0.4623719 compareSpectra(prochloraz_swath_spectrum2, prochloraz_dda_spectrum) ## [1] 0.5932303"},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"outlook","dir":"Articles","previous_headings":"","what":"Outlook","title":"LC-MS/MS data analysis with xcms","text":"Currently, spectra data representation, handling processing re-implemented part RforMassSpectrometry initiative aiming increasing performance methods simplifying use. Thus, parts workflow described changed (improved) future. Along developments, improved matching strategies larger data sets implemented well functionality compare Spectra directly reference MS2 spectra public annotation resources (e.g. Massbank HMDB). See example information. Regarding SWATH data analysis, future development involve improved selection correct MS2 chromatographic peaks considering also correlation intensity values across several samples.","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"LC-MS/MS data analysis with xcms","text":"","code":"sessionInfo() ## R Under development (unstable) (2024-03-28 r86224) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.4 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] MetaboCoreUtils_1.11.2 MsBackendMgf_1.11.2 MsExperiment_1.5.4 ## [4] pander_0.6.5 Spectra_1.13.8 ProtGenerics_1.35.4 ## [7] S4Vectors_0.41.5 BiocGenerics_0.49.1 xcms_4.1.12 ## [10] BiocParallel_1.37.1 BiocStyle_2.31.0 ## ## loaded via a namespace (and not attached): ## [1] DBI_1.2.2 rlang_1.1.3 ## [3] magrittr_2.0.3 clue_0.3-65 ## [5] MassSpecWavelet_1.69.0 matrixStats_1.2.0 ## [7] compiler_4.5.0 systemfonts_1.0.6 ## [9] vctrs_0.6.5 pkgconfig_2.0.3 ## [11] crayon_1.5.2 fastmap_1.1.1 ## [13] XVector_0.43.1 utf8_1.2.4 ## [15] rmarkdown_2.26 preprocessCore_1.65.0 ## [17] ragg_1.3.0 purrr_1.0.2 ## [19] xfun_0.43 MultiAssayExperiment_1.29.1 ## [21] zlibbioc_1.49.3 cachem_1.0.8 ## [23] GenomeInfoDb_1.39.10 jsonlite_1.8.8 ## [25] progress_1.2.3 highr_0.10 ## [27] DelayedArray_0.29.9 prettyunits_1.2.0 ## [29] parallel_4.5.0 cluster_2.1.6 ## [31] R6_2.5.1 bslib_0.7.0 ## [33] RColorBrewer_1.1-3 limma_3.59.6 ## [35] GenomicRanges_1.55.4 jquerylib_0.1.4 ## [37] Rcpp_1.0.12 bookdown_0.38 ## [39] SummarizedExperiment_1.33.3 iterators_1.0.14 ## [41] knitr_1.45 IRanges_2.37.1 ## [43] Matrix_1.7-0 igraph_2.0.3 ## [45] tidyselect_1.2.1 abind_1.4-5 ## [47] yaml_2.3.8 doParallel_1.0.17 ## [49] codetools_0.2-20 affy_1.81.0 ## [51] lattice_0.22-6 tibble_3.2.1 ## [53] plyr_1.8.9 Biobase_2.63.1 ## [55] evaluate_0.23 desc_1.4.3 ## [57] pillar_1.9.0 affyio_1.73.0 ## [59] BiocManager_1.30.22 MatrixGenerics_1.15.0 ## [61] foreach_1.5.2 MSnbase_2.29.4 ## [63] MALDIquant_1.22.2 ncdf4_1.22 ## [65] generics_0.1.3 hms_1.1.3 ## [67] ggplot2_3.5.0 munsell_0.5.1 ## [69] scales_1.3.0 glue_1.7.0 ## [71] MsFeatures_1.11.0 lazyeval_0.2.2 ## [73] tools_4.5.0 mzID_1.41.0 ## [75] QFeatures_1.13.3 vsn_3.71.1 ## [77] mzR_2.37.3 fs_1.6.3 ## [79] XML_3.99-0.16.1 grid_4.5.0 ## [81] impute_1.77.0 MsCoreUtils_1.15.6 ## [83] colorspace_2.1-0 GenomeInfoDbData_1.2.12 ## [85] PSMatch_1.7.2 cli_3.6.2 ## [87] textshaping_0.3.7 fansi_1.0.6 ## [89] S4Arrays_1.3.6 dplyr_1.1.4 ## [91] AnnotationFilter_1.27.0 pcaMethods_1.95.0 ## [93] gtable_0.3.4 sass_0.4.9 ## [95] digest_0.6.35 SparseArray_1.3.4 ## [97] htmlwidgets_1.6.4 memoise_2.0.1 ## [99] htmltools_0.5.8 pkgdown_2.0.7.9000 ## [101] lifecycle_1.0.4 statmod_1.5.0 ## [103] MASS_7.3-60.2"},{"path":[]},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"LC-MS data pre-processing and analysis with xcms","text":"xcms package provides functionality perform pre-processing LC-MS, GC-MS LC-MS/MS data raw signals mzML, mzXML CDF files processed feature abundances. pre-processing includes chromatographic peak detection, sample alignment correspondence analysis. first version package already published 2006 [1] since updated modernized several rounds better integrate R-based packages analysis untargeted metabolomics data. includes version 3 xcms used MSnbase package MS data representation [2]. recent update (xcms version 4) enables addition pre-processing MS data represented modern MsExperiment Spectra packages provides even better integration RforMassSpectrometry R package ecosystem simplifying e.g. also compound annotation [3]. document describes data import, exploration pre-processing simple test LC-MS data set xcms package version >= 4. functions can applied older MSnbase-based workflows (xcms version 3). Additional documents tutorials covering also topics untargeted metabolomics analysis listed end document. also xcms tutorial available examples details.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"data-import","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Data import","title":"LC-MS data pre-processing and analysis with xcms","text":"xcms supports analysis LC-MS(/MS) data can imported Spectra package. data typically provided (AIA/ANDI) NetCDF, mzXML mzML format can, dedicated extensions Spectra package, also imported sources, e.g. also directly raw data files manufacturer’s formats. demonstration purpose analyze document small subset data [4] metabolic consequences knock-fatty acid amide hydrolase (FAAH) gene mice investigated. raw data files (NetCDF format) provided faahKO data package. data set consists samples spinal cords 6 knock-6 wild-type mice. file contains data centroid mode acquired positive ion polarity 200-600 m/z 2500-4500 seconds. speed-processing vignette restrict analysis 8 files. load required packages, locate raw CDF files within faahKO package build phenodata data.frame describing experimental setup. Generally, data frames contain relevant experimental variables sample descriptions (including also names raw data files) imported R using either read.table function (file csv tabulator delimited text file format) also using functions readxl R package Excel file format. next load data using readMsExperiment function MsExperiment package. MS spectra data experiment now available Spectra object within faahko. Note MsExperiment container addition spectra data also contain types data also references files. See vignette MsExperiment details. Also, loading data mzML, mzXML CDF files, default general spectra data loaded memory actual peaks data, .e. m/z intensity values retrieved --fly raw files needed (similar MSnbase -disk mode described [2]). guarantees low memory footprint hence allowing analyze also large experiments without need high performance computing environments. Note also different alternative backends (hence data representations) used Spectra object within faahko eventually even lower memory footprint, higher performance. See package vignette Spectra package SpectraTutorials tutorial details Spectra backends change .","code":"library(xcms) library(faahKO) library(RColorBrewer) library(pander) library(pheatmap) library(MsExperiment) ## Get the full path to the CDF files cdfs <- dir(system.file(\"cdf\", package = \"faahKO\"), full.names = TRUE, recursive = TRUE)[c(1, 2, 5, 6, 7, 8, 11, 12)] ## Create a phenodata data.frame pd <- data.frame(sample_name = sub(basename(cdfs), pattern = \".CDF\", replacement = \"\", fixed = TRUE), sample_group = c(rep(\"KO\", 4), rep(\"WT\", 4)), stringsAsFactors = FALSE) faahko <- readMsExperiment(spectraFiles = cdfs, sampleData = pd) faahko ## Object of class MsExperiment ## Spectra: MS1 (10224) ## Experiment data: 8 sample(s) ## Sample data links: ## - spectra: 8 sample(s) to 10224 element(s)."},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"initial-data-inspection","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Initial data inspection","title":"LC-MS data pre-processing and analysis with xcms","text":"MsExperiment object simple flexible container MS experiments. raw MS data stored Spectra object can accessed spectra function. spectra organized sequentially (.e., file) fromFile function can used get spectrum information data files belongs. simply count number spectra per file. Information samples can retrieved sampleData function. row DataFrame represents one sample (input file). Using [ possible subset MsExperiment object sample. subset faahko 3rd sample (file) access spectra sample data. first evaluation data plot base peak chromatogram (BPC) file experiment. use chromatogram method set aggregationFun \"max\" return spectrum maximal intensity hence create BPC raw data. create total ion chromatogram set aggregationFun \"sum\". Base peak chromatogram. chromatogram method returned MChromatograms object organizes individual Chromatogram objects (fact contain chromatographic data) two-dimensional array: columns represent samples rows (optionally) m/z /retention time ranges. extract chromatogram first sample access retention time intensity values. BPC seems around 4200 seconds signal measured anymore. Thus, filter full data set retention time range 2550 4250 seconds using filterRt function. Note present subset spectra within MsExperiment. Subsequently re-create also BPC. next create boxplots representing distribution total ion currents per data file. plots can useful spot potentially problematic MS runs. extract information, use tic function Spectra object within faahko split values file using fromFile. Distribution total ion currents per file. addition, can also cluster samples based similarity base peak chromatograms. Samples thus grouped based similarity LC runs. need however bin data along retention time axis, since retention times generally differ samples. use bin function BPC bin intensities 2 second wide retention time bins. clustering performed using complete linkage hierarchical clustering pairwise correlations binned base peak chromatograms. Grouping samples based similarity base peak chromatogram. samples cluster pairwise manner, KO WT samples sample index similar BPC.","code":"spectra(faahko) ## MSn data (Spectra) with 10224 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 1 2501.38 1 ## 2 1 2502.94 2 ## 3 1 2504.51 3 ## 4 1 2506.07 4 ## 5 1 2507.64 5 ## ... ... ... ... ## 10220 1 4493.56 1274 ## 10221 1 4495.13 1275 ## 10222 1 4496.69 1276 ## 10223 1 4498.26 1277 ## 10224 1 4499.82 1278 ## ... 33 more variables/columns. ## ## file(s): ## ko15.CDF ## ko16.CDF ## ko21.CDF ## ... 5 more files table(fromFile(faahko)) ## ## 1 2 3 4 5 6 7 8 ## 1278 1278 1278 1278 1278 1278 1278 1278 sampleData(faahko) ## DataFrame with 8 rows and 3 columns ## sample_name sample_group spectraOrigin ## ## 1 ko15 KO /__w/_temp... ## 2 ko16 KO /__w/_temp... ## 3 ko21 KO /__w/_temp... ## 4 ko22 KO /__w/_temp... ## 5 wt15 WT /__w/_temp... ## 6 wt16 WT /__w/_temp... ## 7 wt21 WT /__w/_temp... ## 8 wt22 WT /__w/_temp... faahko_3 <- faahko[3] spectra(faahko_3) ## MSn data (Spectra) with 1278 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 1 2501.38 1 ## 2 1 2502.94 2 ## 3 1 2504.51 3 ## 4 1 2506.07 4 ## 5 1 2507.64 5 ## ... ... ... ... ## 1274 1 4493.56 1274 ## 1275 1 4495.13 1275 ## 1276 1 4496.69 1276 ## 1277 1 4498.26 1277 ## 1278 1 4499.82 1278 ## ... 33 more variables/columns. ## ## file(s): ## ko21.CDF sampleData(faahko_3) ## DataFrame with 1 row and 3 columns ## sample_name sample_group spectraOrigin ## ## 1 ko21 KO /__w/_temp... ## Get the base peak chromatograms. This reads data from the files. bpis <- chromatogram(faahko, aggregationFun = \"max\") ## Define colors for the two groups group_colors <- paste0(brewer.pal(3, \"Set1\")[1:2], \"60\") names(group_colors) <- c(\"KO\", \"WT\") ## Plot all chromatograms. plot(bpis, col = group_colors[sampleData(faahko)$sample_group]) bpi_1 <- bpis[1, 1] rtime(bpi_1) |> head() ## [1] 2501.378 2502.943 2504.508 2506.073 2507.638 2509.203 intensity(bpi_1) |> head() ## [1] 43888 43960 43392 42632 42200 42288 faahko <- filterRt(faahko, rt = c(2550, 4250)) ## Filter spectra ## creating the BPC on the subsetted data bpis <- chromatogram(faahko, aggregationFun = \"max\") ## Get the total ion current by file tc <- spectra(faahko) |> tic() |> split(f = fromFile(faahko)) boxplot(tc, col = group_colors[sampleData(faahko)$sample_group], ylab = \"intensity\", main = \"Total ion current\") ## Bin the BPC bpis_bin <- bin(bpis, binSize = 2) ## Calculate correlation on the log2 transformed base peak intensities cormat <- cor(log2(do.call(cbind, lapply(bpis_bin, intensity)))) colnames(cormat) <- rownames(cormat) <- bpis_bin$sample_name ## Define which phenodata columns should be highlighted in the plot ann <- data.frame(group = bpis_bin$sample_group) rownames(ann) <- bpis_bin$sample_name ## Perform the cluster analysis pheatmap(cormat, annotation = ann, annotation_color = list(group = group_colors))"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"chromatographic-peak-detection","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Chromatographic peak detection","title":"LC-MS data pre-processing and analysis with xcms","text":"Chromatographic peak detection aims identifying signal sample created ions originating compound species. Chromatographic peak detection can performed xcms findChromPeaks function parameter object defines configures algorithm used (see ?findChromPeaks list supported algorithms). running peak detection however strongly suggested first visually inspect extracted ion chromatogram e.g. internal standards compounds known present samples order evaluate adapt settings peak detection algorithm since default settings appropriate LC-MS setups. extract EIC one compound using chromatogram function specifying addition m/z retention time range expect signal compound. Extracted ion chromatogram one peak. Note Chromatogram objects extracted chromatogram method contain NA value certain scan (.e. spectrum specific retention time) signal measured respective m/z range. reflected lines drawn continuous lines plot . peak thus width 50 seconds. can use information define peakwidth parameter centWave peak detection method [5] use chromatographic peak detection data. peakwidth parameter allows define expected lower upper width (retention time dimension) chromatographic peaks. data set thus peakwidth = c(20, 80). second important parameter centWave ppm defines expected maximum deviation m/z values centroids included one chromatographic peak (note precision m/z values provided MS instrument manufacturer). ppm parameter extract full MS data (intensity, retention time m/z values) corresponding peak. end first filter raw object retention time, m/z finally plot object type = \"XIC\" produce plot . use pipe (|>) operator better illustrate corresponding workflow. Visualization raw MS data one peak. plot: upper panel: chromatogram plotting intensity values retention time, lower panel m/z retention time plot. individual data points colored according intensity. present data actually variation m/z values. Usually m/z values individual centroids (lower panel) plots scatter around real m/z value compound (intensity dependent manner). first step centWave algorithm defines regions interest (ROI) subsequently screened presence chromatographic peaks. ROIs defined based difference m/z values centroids consecutive scans (spectra). detail, centroids consecutive scans included ROI difference m/z mean m/z ROI smaller user defined ppm parameter. reasonable choice ppm thus maximal m/z difference data points neighboring scans/spectra part chromatographic peak internal standard known compound. suggested inspect ranges m/z values several compounds (either internal standards compounds known present sample) define ppm parameter centWave according . See also tutorial additional information examples choosing testing peak detection settings. Chromatographic peak detection can also performed extracted ion chromatograms, helps testing tuning peak detection settings. Note however peak detection EICs involve first step centWave described thus consider ppm parameter. Also, since less data available algorithms, background signal estimation performed differently different settings snthresh need used (generally lower snthresh used EICs since estimated background signal tends higher data subsets full data). perform peak detection findChromPeaks function EIC generated . submitted parameter object defines algorithm used allows define settings algorithm. use CentWaveParam parameter object use configure centWave algorithm default settings, except snthresh. can access identified chromatographic peaks chromPeaks function. Parallel chromPeaks matrix also chromPeakData data frame allows add arbitrary annotations chromatographic peak, e.g. MS level peak detected: plot EIC along identified chromatographic peaks using plot function result object . Additional parameters peakCol peakBg allow define foreground background (fill) color identified chromatographic peak provided result object (.e., need define one color row chromPeaks(xchr) - column \"column\" (\"sample\" present) peak matrix specifies sample peak identified). Signal example peak. Red blue colors represent KO wild type samples, respectively. Peak area identified chromatographic peaks highlighted sample group color. happy settings can use peak detection full data set (.e. MsExperiment object data whole experiment). Note set argument prefilter c(6, 5000) noise 5000 reduce run time vignette. setting consider ROIs least 6 centroids intensity larger 5000 centWave chromatographic peak detection. results findChromPeaks MsExperiment object returned XcmsExperiment object. object extends MsExperiment directly (hence providing access raw data) contains xcms pre-processing results. Note also additional rounds chromatographic peak detections performed results added existing peak detection results additional calls findChromPeaks result object using parameter add = TRUE. chromPeaks function can also used access results chromatographic peak detection. show first 6 identified chromatographic peaks. Columns chromPeaks matrix might differ depending used peak detection algorithm. Columns algorithms provide : \"mz\", \"mzmin\", \"mzmax\", \"rt\", \"rtmin\" \"rtmax\" define m/z retention time range chromatographic peak (.e. mass peaks within area used integrate peak signal) well m/z retention time peak apex. mandatory columns \"\" \"maxo\" absolute integrated peak signal maximum peak intensity. Finally, \"sample\" provides index sample peak identified. Additional annotations individual peak can extracted chromPeakData function. data frame also used add/store arbitrary annotations detected peak (don’t necessarily need numeric). Peak detection always work perfectly types peak shapes present data set leading peak detection artifacts, (partially completely) overlapping peaks artificially split peaks (common issues especially centWave). xcms provides refineChromPeaks function can called peak detection results order refine (clean) peak detection results either removing identified peaks passing certain criteria merging artificially split partially completely overlapping chromatographic peaks. Different algorithms available can configured respective parameter objects: CleanPeaksParam FilterIntensityParam allow remove peaks retention time range intensity specified threshold, respectively. MergeNeighboringPeaksParam possible merge chromatographic peaks hence remove many mentioned (centWave) peak detection artifacts. See also ?refineChromPeaks information help different methods. post-process peak detection results merging peaks overlap 4 second window per file signal lower 75% smaller peak’s maximal intensity. See ?MergeNeighboringPeaksParam help page detailed description settings approach. example merged peak given . Result peak refinement step. Left: data processing, right: refinement. splitted peak merged one. centWave thus detected originally 3 chromatographic peaks m/z slice (left panel plot ) peak refinement MergeNeighboringPeaksParam specified settings merged first two peaks single one (right panel figure ). close peaks, lower intensity , however merged (see ). Result peak refinement step. Left: data processing, right: refinement. peaks merged. also possible perform peak refinement extracted ion chromatograms. used test fine-tune settings parameter avoid potential problematic behavior. minProp parameter example carefully chosen avoid merging isomer peaks (like example ). default minProp = 0.75 peaks merged signal two peaks higher 75% smaller peak’s maximal intensity. Setting value low eventually result merging isomers shown . Thus, running peak refinement evaluate isomers present data set wrongly merged based chosen settings. proceeding next replace faahko object results peak refinement step. use data chromPeaks matrix calculate per-file summaries peak detection results, number peaks per file well distribution retention time widths. Summary statistics identified chromatographic peaks. Shown number identified peaks per sample widths/duration chromatographic peaks. default chromPeaks return identified chromatographic peaks result object also possible extract chromatographic peaks specified m/z /rt range: can also plot location identified chromatographic peaks m/z - retention time space one file using plotChromPeaks function. plot information third sample. Identified chromatographic peaks m/z retention time space one sample. general overview peak detection results can addition visualize number identified chromatographic peaks per file along retention time axis. Parameter binSize allows define width bins rt dimension peaks counted. number chromatographic peaks within bin shown color-coded resulting plot. Frequency identified chromatographic peaks along retention time axis. frequency color coded higher frequency represented yellow-white. line shows peak frequency one file. Note extracting ion chromatorams xcms result object addition chromatographic data also extract identified chromatographic peaks within region. can thus also used validate verify used peak detection settings identified e.g. peaks known compounds internal standards properly. extract ion chromatogram m/z - rt region access detected peaks region using chromPeaks function. can also plot extracted ion chromatogram also visualize identified chromatographic peaks region. Signal example peak. Red blue colors represent KO wild type samples, respectively. signal area identified chromatographic peaks filled color. Chromatographic peaks can visualized also ways: setting peakType = \"rectangle\" indicated rectangle instead default highlighting option (peakType = \"polygon\") used . third alternative also possible just indicate apex position identified chromatographic peak single point (peakType = \"point\"). plot data using peakType = \"rectangle\". Signal example peak. Red blue colors represent KO wild type samples, respectively. rectangles indicate identified chromatographic peaks per sample. Finally plot also distribution peak intensity per sample. allows investigate whether systematic differences peak signals samples present. Peak intensity distribution per sample. signal identified chromatographic peaks comparable across samples, exception samples 3, 4 , degree, also 7 show slightly higher average intensities, also lower number detected peaks (indicated smaller width boxes). Note addition described identification chromatographic peaks, also possible manually define add chromatographic peaks manualChromPeaks function (see ?manualChromPeaks help page information).","code":"## Define the rt and m/z range of the peak area rtr <- c(2700, 2900) mzr <- c(334.9, 335.1) ## extract the chromatogram chr_raw <- chromatogram(faahko, mz = mzr, rt = rtr) plot(chr_raw, col = group_colors[chr_raw$sample_group]) faahko |> filterRt(rt = rtr) |> filterMz(mz = mzr) |> plot(type = \"XIC\") xchr <- findChromPeaks(chr_raw, param = CentWaveParam(snthresh = 2)) chromPeaks(xchr) ## rt rtmin rtmax into intb maxo sn row column ## [1,] 2781.505 2761.160 2809.674 412134.255 355516.374 16856 13 1 1 ## [2,] 2786.199 2764.290 2812.803 1496244.206 1391821.332 58736 20 1 2 ## [3,] 2734.556 2714.211 2765.855 21579.367 18449.428 899 4 1 3 ## [4,] 2797.154 2775.245 2815.933 159058.782 150289.314 6295 12 1 3 ## [5,] 2784.635 2761.160 2808.109 54947.545 37923.532 2715 2 1 4 ## [6,] 2859.752 2845.668 2878.532 13895.212 13874.868 905 904 1 4 ## [7,] 2897.311 2891.051 2898.876 5457.155 5450.895 995 994 1 4 ## [8,] 2819.064 2808.109 2834.713 19456.914 19438.134 1347 1576 1 4 ## [9,] 2789.329 2762.725 2808.109 174473.311 91114.975 8325 3 1 5 ## [10,] 2786.199 2764.290 2812.803 932645.211 569236.246 35856 2 1 6 ## [11,] 2792.461 2768.987 2823.760 876585.527 511324.134 27200 2 1 7 ## [12,] 2789.329 2773.680 2806.544 89582.569 73871.386 5427 6 1 8 chromPeakData(xchr) ## DataFrame with 12 rows and 4 columns ## ms_level is_filled row column ## ## 1 1 FALSE 1 1 ## 2 1 FALSE 1 2 ## 3 1 FALSE 1 3 ## 4 1 FALSE 1 3 ## 5 1 FALSE 1 4 ## ... ... ... ... ... ## 8 1 FALSE 1 4 ## 9 1 FALSE 1 5 ## 10 1 FALSE 1 6 ## 11 1 FALSE 1 7 ## 12 1 FALSE 1 8 ## Define a color for each sample sample_colors <- group_colors[xchr$sample_group] ## Define the background color for each chromatographic peak bg <- sample_colors[chromPeaks(xchr)[, \"column\"]] ## Parameter `col` defines the color of each sample/line, `peakBg` of each ## chromatographic peak. plot(xchr, col = sample_colors, peakBg = bg) cwp <- CentWaveParam(peakwidth = c(20, 80), noise = 5000, prefilter = c(6, 5000)) faahko <- findChromPeaks(faahko, param = cwp) chromPeaks(faahko) |> head() ## mz mzmin mzmax rt rtmin rtmax into intb maxo sn ## CP0001 594.0 594.0 594.0 2601.535 2581.191 2637.529 161042.2 146073.3 7850 11 ## CP0002 577.0 577.0 577.0 2604.665 2581.191 2626.574 136105.2 128067.9 6215 11 ## CP0003 307.0 307.0 307.0 2618.750 2592.145 2645.354 284782.4 264907.0 16872 20 ## CP0004 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 669778.1 30552 43 ## CP0005 370.1 370.1 370.1 2673.523 2643.789 2700.127 449284.6 417225.3 25672 17 ## CP0006 427.0 427.0 427.0 2675.088 2643.789 2684.478 283334.7 263943.2 11025 13 ## sample ## CP0001 1 ## CP0002 1 ## CP0003 1 ## CP0004 1 ## CP0005 1 ## CP0006 1 chromPeakData(faahko) ## DataFrame with 2908 rows and 2 columns ## ms_level is_filled ## ## CP0001 1 FALSE ## CP0002 1 FALSE ## CP0003 1 FALSE ## CP0004 1 FALSE ## CP0005 1 FALSE ## ... ... ... ## CP2904 1 FALSE ## CP2905 1 FALSE ## CP2906 1 FALSE ## CP2907 1 FALSE ## CP2908 1 FALSE mpp <- MergeNeighboringPeaksParam(expandRt = 4) faahko_pp <- refineChromPeaks(faahko, mpp) mzr_1 <- 305.1 + c(-0.01, 0.01) chr_1 <- chromatogram(faahko[1], mz = mzr_1) ## Processing chromatographic peaks chr_2 <- chromatogram(faahko_pp[1], mz = mzr_1) ## Processing chromatographic peaks par(mfrow = c(1, 2)) plot(chr_1) plot(chr_2) mzr_1 <- 496.2 + c(-0.01, 0.01) chr_1 <- chromatogram(faahko[1], mz = mzr_1) ## Processing chromatographic peaks chr_2 <- chromatogram(faahko_pp[1], mz = mzr_1) ## Processing chromatographic peaks par(mfrow = c(1, 2)) plot(chr_1) plot(chr_2) #' Too low minProp could cause merging of isomers! res <- refineChromPeaks(chr_1, MergeNeighboringPeaksParam(minProp = 0.05)) chromPeaks(res) ## mz mzmin mzmax rt rtmin rtmax into intb maxo sn ## CPM1 496.2 496.19 496.21 3384.012 3294.809 3412.181 45940118 NA 1128960 177 ## sample row column ## CPM1 1 1 1 plot(res) faahko <- faahko_pp summary_fun <- function(z) c(peak_count = nrow(z), rt = quantile(z[, \"rtmax\"] - z[, \"rtmin\"])) T <- chromPeaks(faahko) |> split.data.frame(f = chromPeaks(faahko)[, \"sample\"]) |> lapply(FUN = summary_fun) |> do.call(what = rbind) rownames(T) <- basename(fileNames(faahko)) pandoc.table( T, caption = paste0(\"Summary statistics on identified chromatographic\", \" peaks. Shown are number of identified peaks per\", \" sample and widths/duration of chromatographic \", \"peaks.\")) chromPeaks(faahko, mz = c(334.9, 335.1), rt = c(2700, 2900)) ## mz mzmin mzmax rt rtmin rtmax into intb maxo sn ## CP0038 335 335 335 2781.505 2761.160 2809.674 412134.3 383167.4 16856 23 ## CP0494 335 335 335 2786.199 2764.290 2812.803 1496244.2 1461187.3 58736 72 ## CP1025 335 335 335 2797.154 2775.245 2815.933 159058.8 149229.6 6295 13 ## CP1964 335 335 335 2786.199 2764.290 2812.803 932645.2 915333.8 35856 66 ## CP2349 335 335 335 2792.461 2768.987 2823.760 876585.5 848569.1 27200 36 ## sample ## CP0038 1 ## CP0494 2 ## CP1025 3 ## CP1964 6 ## CP2349 7 plotChromPeaks(faahko, file = 3) plotChromPeakImage(faahko, binSize = 10) chr_ex <- chromatogram(faahko, mz = mzr, rt = rtr) chromPeaks(chr_ex) ## mz mzmin mzmax rt rtmin rtmax into intb maxo sn ## CP0038 335 335 335 2781.505 2761.160 2809.674 412134.3 383167.4 16856 23 ## CP0494 335 335 335 2786.199 2764.290 2812.803 1496244.2 1461187.3 58736 72 ## CP1025 335 335 335 2797.154 2775.245 2815.933 159058.8 149229.6 6295 13 ## CP1964 335 335 335 2786.199 2764.290 2812.803 932645.2 915333.8 35856 66 ## CP2349 335 335 335 2792.461 2768.987 2823.760 876585.5 848569.1 27200 36 ## sample row column ## CP0038 1 1 1 ## CP0494 2 1 2 ## CP1025 3 1 3 ## CP1964 6 1 6 ## CP2349 7 1 7 sample_colors <- group_colors[chr_ex$sample_group] plot(chr_ex, col = group_colors[chr_raw$sample_group], lwd = 2, peakBg = sample_colors[chromPeaks(chr_ex)[, \"sample\"]]) plot(chr_ex, col = sample_colors, peakType = \"rectangle\", peakCol = sample_colors[chromPeaks(chr_ex)[, \"sample\"]], peakBg = NA) ## Extract a list of per-sample peak intensities (in log2 scale) ints <- split(log2(chromPeaks(faahko)[, \"into\"]), f = chromPeaks(faahko)[, \"sample\"]) boxplot(ints, varwidth = TRUE, col = sample_colors, ylab = expression(log[2]~intensity), main = \"Peak intensities\") grid(nx = NA, ny = NULL)"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"alignment","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Alignment","title":"LC-MS data pre-processing and analysis with xcms","text":"time analytes elute chromatography can vary samples (even compounds). differences already visible BPC even extracted ion chromatogram plot previous section. alignment step, also referred retention time correction, aims adjust differences shifting signals along retention time axis aligning different samples within experiment. plethora alignment algorithms exist (see [6]), also implemented xcms. Alignment LC-MS data can performed xcms using adjustRtime method algorithm-specific parameter class (see ?adjustRtime overview available methods xcms). example use obiwarp method [7] align samples. use binSize = 0.6 creates warping functions m/z bins 0.6. Also advisable modify adapt settings experiment. Note adjustRtime, besides calculating adjusted retention times spectrum, adjusts also retention times identified chromatographic peaks xcms result object. Adjusted retention times individual spectra can extracted result object using either adjustedRtime function using rtime parameter adjusted = TRUE (default): evaluate impact alignment plot BPC adjusted data. addition plot also differences adjusted raw retention times per sample using plotAdjustedRtime function. disable automatic extraction identified chromatographic peaks chromatogram function (make much sense BPC) use chromPeaks = \"none\" . Obiwarp aligned data. Base peak chromatogram (top) alignment (middle) difference adjusted raw retention times along retention time axis (bottom). large differences adjusted raw retention times indicate poorly performing samples alignment. last evaluate also impact alignment test peak. Example extracted ion chromatogram (top) alignment (bottom). Note: xcms result objects (XcmsExperiment well XCMSnExp) contain raw adjusted retention times spectra subset operation many cases drop adjusted retention times. Thus might sometimes useful immediately replace raw retention times data using applyAdjustedRtime function.","code":"faahko <- adjustRtime(faahko, param = ObiwarpParam(binSize = 0.6)) ## Extract adjusted retention times adjustedRtime(faahko) |> head() ## [1] 2551.457 2553.089 2554.720 2556.352 2557.983 2559.615 ## Or simply use the rtime method rtime(faahko) |> head() ## [1] 2551.457 2553.089 2554.720 2556.352 2557.983 2559.615 ## Get raw (unadjusted) retention times rtime(faahko, adjusted = FALSE) |> head() ## [1] 2551.457 2553.022 2554.586 2556.151 2557.716 2559.281 ## Get the base peak chromatograms. bpis_adj <- chromatogram(faahko, aggregationFun = \"max\", chromPeaks = \"none\") par(mfrow = c(3, 1), mar = c(4.5, 4.2, 1, 0.5)) plot(bpis, col = sample_colors) grid() plot(bpis_adj, col = sample_colors) grid() ## Plot also the difference of adjusted to raw retention time. plotAdjustedRtime(faahko, col = sample_colors) grid() par(mfrow = c(2, 1)) ## Plot the raw data plot(chr_raw, col = sample_colors) grid() ## Extract the chromatogram from the adjusted object chr_adj <- chromatogram(faahko, rt = rtr, mz = mzr) plot(chr_adj, col = sample_colors, peakType = \"none\") grid()"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"subset-based-alignment","dir":"Articles","previous_headings":"Pre-processing of LC-MS data > Alignment","what":"Subset-based alignment","title":"LC-MS data pre-processing and analysis with xcms","text":"experiments might better perform alignment based subset available samples, e.g. pooled QC samples injected regular intervals experiment contains blanks. alignment methods xcms support subset-based alignment retention time shifts estimated specified subset samples followed alignment whole data set based aligned subset. subset samples alignment can specified parameter subset PeakGroupsParam ObiwarpParam object. Parameter subsetAdjust allows specify method left-samples adjusted. currently two options available: subsetAdjust = \"previous\": adjust retention times non-subset sample based alignment results previous subset sample (e.g. QC sample). samples e.g. order A1, B1, B2, A2, B3, B4 representing QC samples B study samples, using subset = c(1, 4) subsetAdjust = \"previous\" result samples aligned non-subset samples B1 B2 adjusted based alignment result subset samples A1 B3 B4 A2. subsetAdjust = \"average\": adjust retention times non-subset samples based interpolation alignment results previous subsequent subset sample. example , B1 adjusted based average adjusted retention times subset (QC) samples A1 A2. Since subset sample non-subset samples B3 B4 adjusted based alignment results A2 alone. Note weighted average used calculate adjusted retention time averages, uses inverse difference index non-subset sample subset samples weights. Thus, setup like A1, B1, B2, A2 adjusted retention times A1 get larger weight A2 adjustment non-subset sample B1 causing ’s adjusted retention times closer A1 A2. See examples. Important: cases require meaningful/correct ordering samples within object (.e., samples ordered injection index). examples aim illustrate effect alignment options. assume samples 1, 4 7 faahKO data set QC pool samples. thus want perform alignment based samples subsequently adjust retention times left-samples (2, 3, 5, 6 8) based interpolation results neighboring subset (QC) samples. initial peak grouping perform subset-based alignment peak groups method passing indices QC samples subset parameter PeakGroupsParam function set subsetAdjust = \"average\" adjust study samples based interpolation alignment results neighboring subset/QC samples. Note subset-alignment parameters minFraction relative subset, full experiment! first remove previous alignment results dropAdjustedRtime function allow fresh alignment using subset-based option outlined . addition removing adjusted retention times spectra, function also restore original retention times identified chromatographic peaks. alignment peak groups method initial peak grouping (correspondence) analysis required, algorithm estimates retention times shifts samples using retention times hook peaks (.e. chromatographic peaks present /samples). use default settings peak density method-based correspondence, strongly advised adapt parameters data set (details next section). definition sample groups (.e. assignment individual samples sample groups experiment) mandatory PeakDensityParam. sample groups experiment, sampleGroups set single value file (e.g. rep(1, length(fileNames(faahko))). plot results alignment highlighting subset samples green. nicely shows interpolation subsetAdjust = \"average\" works: retention times sample 2 adjusted based subset sample 1 4, giving however weight closer subset sample 1 results adjusted retention times 2 similar sample 1. Sample 3 hand gets adjusted giving weight second subset sample (4). Subset-alignment results option average. Difference adjusted raw retention times along retention time axis. Samples alignment models estimated shown green, study samples grey. Option subsetAdjust = \"previous\" adjust retention times non-subset sample based single subset sample (previous), results cases adjusted retention times non-subset sample highly similar subset sample used adjustment.","code":"faahko <- dropAdjustedRtime(faahko) ## Define the experimental layout sampleData(faahko)$sample_type <- \"study\" sampleData(faahko)$sample_type[c(1, 4, 7)] <- \"QC\" ## Initial peak grouping. Use sample_type as grouping variable pdp_subs <- PeakDensityParam(sampleGroups = sampleData(faahko)$sample_type, minFraction = 0.9) faahko <- groupChromPeaks(faahko, param = pdp_subs) ## Define subset-alignment options and perform the alignment pgp_subs <- PeakGroupsParam( minFraction = 0.85, subset = which(sampleData(faahko)$sample_type == \"QC\"), subsetAdjust = \"average\", span = 0.4) faahko <- adjustRtime(faahko, param = pgp_subs) clrs <- rep(\"#00000040\", 8) clrs[sampleData(faahko)$sample_type == \"QC\"] <- c(\"#00ce0080\") par(mfrow = c(2, 1), mar = c(4, 4.5, 1, 0.5)) plot(chromatogram(faahko, aggregationFun = \"max\", chromPeaks = \"none\"), col = clrs) grid() plotAdjustedRtime(faahko, col = clrs, peakGroupsPch = 1, peakGroupsCol = \"#00ce0040\") grid()"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"correspondence","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Correspondence","title":"LC-MS data pre-processing and analysis with xcms","text":"Correspondence usually final step LC-MS data pre-processing data, presumably representing signal originating ions, matched across samples. result, chromatographic peaks different samples similar m/z retention times get grouped LC-MS features. function perform correspondence xcms called groupChromPeaks supports different algorithms can selected configured specific parameter object (see ?groupChromPeaks overview). example use peak density method [1] , within small slices along m/z dimension, combines chromatographic peaks depending density peaks along retention time axis. illustrate , simulate peak grouping m/z slice containing multiple chromatoghaphic peaks within sample using plotChromPeakDensity function PeakDensityParam object parameter minFraction = 0.4 (features defined least 40% samples chromatographic peak present) - parameter sampleGroups used define sample group sample belongs. Example peak density correspondence. Upper panel: chromatogram mz slice multiple chromatographic peaks. lower panel: identified chromatographic peaks retention time (x-axis) index within samples experiments (y-axis) different values bw parameter. black line represents peak density estimate. Grouping peaks (based provided settings) indicated grey rectangles. upper panel plot shows extracted ion chromatogram sample detected peaks highlighted. retention times individual chromatographic peaks sample (y-axis index sample data set) shown lower panel solid black line representing density estimate distribution detected peaks along retention time. Parameter bw defines smoothness estimation. grey rectangles indicate chromatographic peaks grouped feature (grey rectangle thus representing one feature). type visualization thus ideal test, validate optimize correspondence settings manually defined m/z slices applying full data set. tested m/z slice settings seemed OK thus applying full data set . Especially parameter bw data set dependent (specifically LC-dependent) adapted data set. Another important parameter binSize defines size m/z slices (bins) within peaks grouped. parameter thus defines required similarity m/z values chromatographic peaks assumed represent signal (type ion ) compound hence evaluated grouping. default, constant m/z bin size used, changing parameter ppm value larger 0, m/z-relative bin sizes used instead (.e., bin size increase m/z value hence better representing measurement error/precision MS instruments). bin sizes (subsequently m/z width defined features) reach maximal value binSize plus ppm parts-per-million largest m/z value chromatographic peak data set. See also xcms tutorial examples details. alternative perform correspondence using m/z relative bin sizes. results mostly similar, except higher m/z range (larger m/z bins used). plot m/z range features median m/z. present data set (acquired triple quad instrument) clear difference can seen two approaches hence proceed analysis fixed bin size setting. stronger relationship expected example data measured TOF instruments. Relationship feature’s m/z m/z width (max - min m/z) feature. Red points represent results fixed m/z bin size, blue m/z-relative bin size. Results correspondence analysis can accessed featureDefinitions featureValues function. former returns data frame general information defined features, row one feature columns providing information median m/z retention time well indices chromatographic peaks assigned feature column \"peakidx\". show information first 6 features. featureValues function returns matrix rows features columns samples. content matrix can defined using value argument can column name chromPeaks matrix. default value = \"\" matrix integrated signal peaks corresponding feature sample returned. generally used intensity matrix downstream analysis. extract intensities first 6 features. can see several missing values feature matrix. Missing values reported one sample chromatographic peak detected m/z - rt region feature. however necessarily mean signal specific ion sample. chromatographic peak detection algorithm also just failed identify peak region, e.g. signal noisy low. Thus advisable perform, correspondence, also gap-filling (see next section). performance peak detection, alignment correspondence always evaluated inspecting extracted ion chromatograms e.g. known compounds, internal standards identified features general. featureChromatograms function allows extract chromatograms feature present featureDefinitions. returned MChromatograms object contains ion chromatogram feature (row containing data one feature) sample (column representing containing data one sample). Parameter features allows define specific features EIC returned. can specified index ID (.e. row name featureDefinitions data frame. features defined, EICs returned features data set, can take also considerable amount time. extract chromatograms first 4 features. plot extracted ion chromatograms. use group color identified peak fill area. Extracted ion chromatograms features 1 4. access EICs second feature can simply subset feature_chroms object.","code":"## Define the mz slice. mzr <- c(305.05, 305.15) ## Extract and plot the chromatograms chr_mzr <- chromatogram(faahko, mz = mzr) ## Define the parameters for the peak density method pdp <- PeakDensityParam(sampleGroups = sampleData(faahko)$sample_group, minFraction = 0.4, bw = 30) plotChromPeakDensity(chr_mzr, col = sample_colors, param = pdp, peakBg = sample_colors[chromPeaks(chr_mzr)[, \"sample\"]], peakCol = sample_colors[chromPeaks(chr_mzr)[, \"sample\"]], peakPch = 16) ## Perform the correspondence using fixed m/z bin sizes. pdp <- PeakDensityParam(sampleGroups = sampleData(faahko)$sample_group, minFraction = 0.4, bw = 30) faahko <- groupChromPeaks(faahko, param = pdp) ## Drop feature definitions and re-perform the correspondence ## using m/z-relative bin sizes. faahko_ppm <- groupChromPeaks( dropFeatureDefinitions(faahko), PeakDensityParam(sampleGroups = sampleData(faahko)$sample_group, minFraction = 0.4, bw = 30, ppm = 10)) ## Calculate m/z width of features mzw <- featureDefinitions(faahko)$mzmax - featureDefinitions(faahko)$mzmin mzw_ppm <- featureDefinitions(faahko_ppm)$mzmax - featureDefinitions(faahko_ppm)$mzmin plot(featureDefinitions(faahko_ppm)$mzmed, mzw_ppm, xlab = \"m/z\", ylab = \"m/z width\", pch = 21, col = \"#0000ff20\", bg = \"#0000ff10\") points(featureDefinitions(faahko)$mzmed, mzw, pch = 21, col = \"#ff000020\", bg = \"#ff000010\") featureDefinitions(faahko) |> head() ## mzmed mzmin mzmax rtmed rtmin rtmax npeaks KO WT peakidx ## FT001 200.1 200.1 200.1 2902.634 2882.603 2922.664 2 2 0 458, 1161 ## FT002 205.0 205.0 205.0 2789.901 2782.955 2796.531 8 4 4 44, 443,.... ## FT003 206.0 206.0 206.0 2789.405 2781.389 2794.219 7 3 4 29, 430,.... ## FT004 207.1 207.1 207.1 2718.560 2714.047 2727.347 7 4 3 16, 420,.... ## FT005 233.0 233.0 233.1 3023.579 3015.145 3043.959 7 3 4 69, 959,.... ## FT006 241.1 241.1 241.2 3683.299 3661.586 3695.886 8 3 4 276, 284.... ## ms_level ## FT001 1 ## FT002 1 ## FT003 1 ## FT004 1 ## FT005 1 ## FT006 1 featureValues(faahko, value = \"into\") |> head() ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF wt15.CDF wt16.CDF wt21.CDF ## FT001 NA 506848.9 NA 169955.6 NA NA NA ## FT002 1924712.0 1757151.0 1383416.7 1180288.2 2129885.1 1634342.0 1623589.2 ## FT003 213659.3 289500.7 NA 178285.7 253825.6 241844.4 240606.0 ## FT004 349011.5 451863.7 343897.8 208002.8 364609.8 360908.9 NA ## FT005 286221.4 NA 164009.0 149097.6 255697.7 311296.8 366441.5 ## FT006 1160580.5 NA 380970.3 588986.4 1286883.0 1739516.6 639755.3 ## wt22.CDF ## FT001 NA ## FT002 1354004.9 ## FT003 185399.5 ## FT004 221937.5 ## FT005 271128.0 ## FT006 508546.4 feature_chroms <- featureChromatograms(faahko, features = 1:4) feature_chroms ## XChromatograms with 4 rows and 8 columns ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF ## ## [1,] peaks: 0 peaks: 1 peaks: 0 peaks: 1 ## [2,] peaks: 1 peaks: 1 peaks: 1 peaks: 1 ## [3,] peaks: 1 peaks: 1 peaks: 0 peaks: 1 ## [4,] peaks: 1 peaks: 1 peaks: 1 peaks: 1 ## wt15.CDF wt16.CDF wt21.CDF wt22.CDF ## ## [1,] peaks: 0 peaks: 0 peaks: 0 peaks: 0 ## [2,] peaks: 1 peaks: 1 peaks: 1 peaks: 1 ## [3,] peaks: 1 peaks: 1 peaks: 1 peaks: 1 ## [4,] peaks: 1 peaks: 1 peaks: 0 peaks: 1 ## phenoData with 4 variables ## featureData with 4 variables ## - - - xcms preprocessing - - - ## Chromatographic peak detection: ## method: centWave ## Correspondence: ## method: chromatographic peak density ## 4 feature(s) identified. plot(feature_chroms, col = sample_colors, peakBg = sample_colors[chromPeaks(feature_chroms)[, \"sample\"]]) eic_2 <- feature_chroms[2, ] chromPeaks(eic_2) ## mz mzmin mzmax rt rtmin rtmax into intb maxo sn ## CP0048 205 205 205 2791.873 2771.300 2815.623 1924712 1850331 84280 64 ## CP0495 205 205 205 2795.796 2773.702 2821.043 1757151 1711473 68384 69 ## CP1033 205 205 205 2796.531 2774.506 2821.697 1383417 1334570 47384 54 ## CP1255 205 205 205 2789.405 2769.019 2812.924 1180288 1126958 48336 32 ## CP1535 205 205 205 2782.955 2762.596 2806.444 2129885 2054677 93312 44 ## CP1967 205 205 205 2787.464 2767.135 2812.486 1634342 1566379 67984 53 ## CP2350 205 205 205 2790.396 2763.847 2821.630 1623589 1531573 49208 28 ## CP2601 205 205 205 2787.273 2766.970 2812.261 1354005 1299188 55712 35 ## sample row column ## CP0048 1 1 1 ## CP0495 2 1 2 ## CP1033 3 1 3 ## CP1255 4 1 4 ## CP1535 5 1 5 ## CP1967 6 1 6 ## CP2350 7 1 7 ## CP2601 8 1 8"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"gap-filling","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Gap filling","title":"LC-MS data pre-processing and analysis with xcms","text":"Missing values LC-MS data many cases result chromatographic peak detection algorithm failing identify peaks (noisy low intensity signal). aim gap filling step reduce number missing values integrating signals original data files samples chromatographic peak found m/z - rt region signal ion expected. Gap filling can performed xcms fillChromPeaks function parameter object selecting configuring gap filling algorithm. method choice ChromPeakAreaParam integrates signal (samples chromatographic peak found feature) m/z - rt region defined based m/z retention time ranges detected chromatographic peaks specific feature. lower m/z limit area defined lower quartile (25% quantile) \"mzmin\" values peaks feature, upper m/z value upper quartile (75% quantile) \"mzmax\" values, lower rt value lower quartile (25% quantile) \"rtmin\" upper rt value upper quartile (75% quantile) \"rtmax\" values. perform gap filling test data extract feature values first 6 features gap filling. NA reported signal measured specific sample.","code":"faahko <- fillChromPeaks(faahko, param = ChromPeakAreaParam()) featureValues(faahko, value = \"into\") |> head() ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF wt15.CDF wt16.CDF wt21.CDF ## FT001 135162.4 506848.9 111657.3 169955.6 209929.4 141607.9 226853.7 ## FT002 1924712.0 1757151.0 1383416.7 1180288.2 2129885.1 1634342.0 1623589.2 ## FT003 213659.3 289500.7 164380.7 178285.7 253825.6 241844.4 240606.0 ## FT004 349011.5 451863.7 343897.8 208002.8 364609.8 360908.9 226234.4 ## FT005 286221.4 285857.6 164009.0 149097.6 255697.7 311296.8 366441.5 ## FT006 1160580.5 1102832.6 380970.3 588986.4 1286883.0 1739516.6 639755.3 ## wt22.CDF ## FT001 138341.2 ## FT002 1354004.9 ## FT003 185399.5 ## FT004 221937.5 ## FT005 271128.0 ## FT006 508546.4"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"final-result","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Final result","title":"LC-MS data pre-processing and analysis with xcms","text":"can continue using xcms result set analysis (e.g. also feature grouping MsFeatures package; see LC-MS feature grouping vignette details) also extract results SummarizedExperiment object. standard data container Bioconductor defined SummarizedExperiment package integration Bioconductor packages might thus easier using type object. use quantify function extract xcms pre-processing results SummarizedExperiment object. Internally, featureValues function used generate feature value matrix. can pass parameters function quantify call. use value = \"\" method = \"sum\" report integrated peak signal intensity sum values samples one chromatographic peak assigned feature (option important run refineChromPeaks like described merge overlapping peaks sample). information featureDefinitions now stored rowData object. rowData provides annotations information row SummarizedExperiment (case features). Annotations columns (case samples) stored colData. data frame row contains annotations one sample (hence one column feature values matrix). Finally, feature matrix stored assay within object. Note SummarizedExperiment can multiple assays numeric matrices number rows columns matching number features samples, respectively. list names available assays. can access actual data using assay function, optionally also providing name assay want access. show first 6 lines matrix. Since SummarizedExperiment supports multiple assays, addition add also feature value matrix without filled-values (.e. feature intensities added gap filling step). now two assays result object. can extract feature values without gap-filling: Finally, history full processing xcms available metadata SummarizedExperiment. information can also extracted xcms result object using processHistory function. extract information first processing step. processing steps contain also individual parameter objects used analysis, hence allowing exactly reproduce analysis. last perform also principal component analysis evaluate grouping samples experiment. Note perform data normalization hence grouping might () also influenced technical biases. PCA faahKO data set, un-normalized intensities. can see expected separation KO WT samples PC2. PC1 samples separate based ID, samples ID <= 18 samples ID > 18. separation might caused technical bias (e.g. measurements performed different days/weeks) due biological properties mice analyzed (sex, age, litter mates etc).","code":"library(SummarizedExperiment) ## Loading required package: MatrixGenerics ## Loading required package: matrixStats ## ## Attaching package: 'MatrixGenerics' ## The following objects are masked from 'package:matrixStats': ## ## colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse, ## colCounts, colCummaxs, colCummins, colCumprods, colCumsums, ## colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs, ## colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats, ## colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds, ## colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads, ## colWeightedMeans, colWeightedMedians, colWeightedSds, ## colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet, ## rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods, ## rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps, ## rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins, ## rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks, ## rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars, ## rowWeightedMads, rowWeightedMeans, rowWeightedMedians, ## rowWeightedSds, rowWeightedVars ## Loading required package: GenomicRanges ## Loading required package: stats4 ## Loading required package: BiocGenerics ## ## Attaching package: 'BiocGenerics' ## The following objects are masked from 'package:stats': ## ## IQR, mad, sd, var, xtabs ## The following objects are masked from 'package:base': ## ## anyDuplicated, aperm, append, as.data.frame, basename, cbind, ## colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find, ## get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply, ## match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, ## Position, rank, rbind, Reduce, rownames, sapply, setdiff, table, ## tapply, union, unique, unsplit, which.max, which.min ## Loading required package: S4Vectors ## ## Attaching package: 'S4Vectors' ## The following object is masked from 'package:utils': ## ## findMatches ## The following objects are masked from 'package:base': ## ## expand.grid, I, unname ## Loading required package: IRanges ## ## Attaching package: 'IRanges' ## The following object is masked from 'package:xcms': ## ## distance ## Loading required package: GenomeInfoDb ## Loading required package: Biobase ## Welcome to Bioconductor ## ## Vignettes contain introductory material; view with ## 'browseVignettes()'. To cite Bioconductor, see ## 'citation(\"Biobase\")', and for packages 'citation(\"pkgname\")'. ## ## Attaching package: 'Biobase' ## The following object is masked from 'package:MatrixGenerics': ## ## rowMedians ## The following objects are masked from 'package:matrixStats': ## ## anyMissing, rowMedians res <- quantify(faahko, value = \"into\", method = \"sum\") res ## class: SummarizedExperiment ## dim: 351 8 ## metadata(6): '' '' ... '' '' ## assays(1): raw ## rownames(351): FT001 FT002 ... FT350 FT351 ## rowData names(10): mzmed mzmin ... WT ms_level ## colnames(8): ko15.CDF ko16.CDF ... wt21.CDF wt22.CDF ## colData names(4): sample_name sample_group spectraOrigin sample_type rowData(res) ## DataFrame with 351 rows and 10 columns ## mzmed mzmin mzmax rtmed rtmin rtmax npeaks ## ## FT001 200.1 200.1 200.1 2902.63 2882.60 2922.66 2 ## FT002 205.0 205.0 205.0 2789.90 2782.95 2796.53 8 ## FT003 206.0 206.0 206.0 2789.40 2781.39 2794.22 7 ## FT004 207.1 207.1 207.1 2718.56 2714.05 2727.35 7 ## FT005 233.0 233.0 233.1 3023.58 3015.14 3043.96 7 ## ... ... ... ... ... ... ... ... ## FT347 595.25 595.2 595.3 3010.60 2992.76 3014.37 6 ## FT348 596.20 596.2 596.2 2997.78 2992.76 3002.79 2 ## FT349 596.30 596.3 596.3 3819.83 3811.52 3836.39 4 ## FT350 597.40 597.4 597.4 3820.88 3817.76 3826.13 3 ## FT351 599.30 599.3 599.3 4071.41 4044.94 4125.32 3 ## KO WT ms_level ## ## FT001 2 0 1 ## FT002 4 4 1 ## FT003 3 4 1 ## FT004 4 3 1 ## FT005 3 4 1 ## ... ... ... ... ## FT347 2 3 1 ## FT348 0 2 1 ## FT349 2 2 1 ## FT350 1 2 1 ## FT351 1 2 1 colData(res) ## DataFrame with 8 rows and 4 columns ## sample_name sample_group spectraOrigin sample_type ## ## ko15.CDF ko15 KO /__w/_temp... QC ## ko16.CDF ko16 KO /__w/_temp... study ## ko21.CDF ko21 KO /__w/_temp... study ## ko22.CDF ko22 KO /__w/_temp... QC ## wt15.CDF wt15 WT /__w/_temp... study ## wt16.CDF wt16 WT /__w/_temp... study ## wt21.CDF wt21 WT /__w/_temp... QC ## wt22.CDF wt22 WT /__w/_temp... study assayNames(res) ## [1] \"raw\" assay(res) |> head() ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF wt15.CDF wt16.CDF wt21.CDF ## FT001 135162.4 506848.9 111657.3 169955.6 209929.4 141607.9 226853.7 ## FT002 1924712.0 1757151.0 1383416.7 1180288.2 2129885.1 1634342.0 1623589.2 ## FT003 213659.3 289500.7 164380.7 178285.7 253825.6 241844.4 240606.0 ## FT004 349011.5 451863.7 343897.8 208002.8 364609.8 360908.9 226234.4 ## FT005 286221.4 285857.6 164009.0 149097.6 255697.7 311296.8 366441.5 ## FT006 1923307.8 1102832.6 380970.3 588986.4 1286883.0 1739516.6 639755.3 ## wt22.CDF ## FT001 138341.2 ## FT002 1354004.9 ## FT003 185399.5 ## FT004 221937.5 ## FT005 271128.0 ## FT006 508546.4 assays(res)$raw_nofill <- featureValues(faahko, filled = FALSE, method = \"sum\") assayNames(res) ## [1] \"raw\" \"raw_nofill\" assay(res, \"raw_nofill\") |> head() ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF wt15.CDF wt16.CDF wt21.CDF ## FT001 NA 506848.9 NA 169955.6 NA NA NA ## FT002 1924712.0 1757151.0 1383416.7 1180288.2 2129885.1 1634342.0 1623589.2 ## FT003 213659.3 289500.7 NA 178285.7 253825.6 241844.4 240606.0 ## FT004 349011.5 451863.7 343897.8 208002.8 364609.8 360908.9 NA ## FT005 286221.4 NA 164009.0 149097.6 255697.7 311296.8 366441.5 ## FT006 1923307.8 NA 380970.3 588986.4 1286883.0 1739516.6 639755.3 ## wt22.CDF ## FT001 NA ## FT002 1354004.9 ## FT003 185399.5 ## FT004 221937.5 ## FT005 271128.0 ## FT006 508546.4 metadata(res) ## [[1]] ## Object of class \"XProcessHistory\" ## type: Peak detection ## date: Wed Apr 3 12:03:44 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: CentWaveParam ## MS level(s) 1 ## ## [[2]] ## Object of class \"XProcessHistory\" ## type: Peak refinement ## date: Wed Apr 3 12:03:46 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: MergeNeighboringPeaksParam ## MS level(s) 1 ## ## [[3]] ## Object of class \"XProcessHistory\" ## type: Peak grouping ## date: Wed Apr 3 12:03:58 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: PeakDensityParam ## MS level(s) 1 ## ## [[4]] ## Object of class \"XProcessHistory\" ## type: Retention time correction ## date: Wed Apr 3 12:03:58 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: PeakGroupsParam ## MS level(s) 1 ## ## [[5]] ## Object of class \"XProcessHistory\" ## type: Peak grouping ## date: Wed Apr 3 12:04:03 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: PeakDensityParam ## MS level(s) 1 ## ## [[6]] ## Object of class \"XProcessHistory\" ## type: Missing peak filling ## date: Wed Apr 3 12:04:08 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: ChromPeakAreaParam ## MS level(s) 1 processHistory(faahko)[[1]] ## Object of class \"XProcessHistory\" ## type: Peak detection ## date: Wed Apr 3 12:03:44 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: CentWaveParam ## MS level(s) 1 processHistory(faahko)[[1]] |> processParam() ## Object of class: CentWaveParam ## Parameters: ## - ppm: [1] 25 ## - peakwidth: [1] 20 80 ## - snthresh: [1] 10 ## - prefilter: [1] 6 5000 ## - mzCenterFun: [1] \"wMean\" ## - integrate: [1] 1 ## - mzdiff: [1] -0.001 ## - fitgauss: [1] FALSE ## - noise: [1] 5000 ## - verboseColumns: [1] FALSE ## - roiList: list() ## - firstBaselineCheck: [1] TRUE ## - roiScales: numeric(0) ## - extendLengthMSW: [1] FALSE ## - verboseBetaColumns: [1] FALSE ## Extract the features and log2 transform them ft_ints <- log2(assay(res, \"raw\")) ## Perform the PCA omitting all features with an NA in any of the ## samples. Also, the intensities are mean centered. pc <- prcomp(t(na.omit(ft_ints)), center = TRUE) ## Plot the PCA pcSummary <- summary(pc) plot(pc$x[, 1], pc$x[,2], pch = 21, main = \"\", xlab = paste0(\"PC1: \", format(pcSummary$importance[2, 1] * 100, digits = 3), \" % variance\"), ylab = paste0(\"PC2: \", format(pcSummary$importance[2, 2] * 100, digits = 3), \" % variance\"), col = \"darkgrey\", bg = sample_colors, cex = 2) grid() text(pc$x[, 1], pc$x[,2], labels = res$sample_name, col = \"darkgrey\", pos = 3, cex = 2)"},{"path":[]},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"quality-based-filtering-of-features","dir":"Articles","previous_headings":"Further data processing and analysis","what":"Quality-based filtering of features","title":"LC-MS data pre-processing and analysis with xcms","text":"dealing metabolomics results, often necessary filter features based certain criteria. criteria typically derived statistical formulas applied full rows data, row represents feature. filterFeatures function provides robust solution filtering features based conventional quality assessment criteria. supports multiple types filtering, allowing users tailor filtering process specific needs, controlled filter argument. function implementations applicable XcmsExperiment results objects SummarizedExperiment objects. demonstrate use filterFeatures function perform quality assessment filtering faahko res variables defined . filter argument can accommodate various types input, determining specific type quality assessment filtering performed. RsdFilter enable users filter features based relative standard deviation (coefficient variation) specified threshold. recommended base computation quality control (QC) samples, demonstrated : features RSD (CV) strictly larger 0.3 QC samples thus removed data set. DratioFilter can used filter features based D-ratio dispersion ratio, compares standard deviation QC samples study samples. features D-ratio strictly larger 0.5 thus removed data set. PercentMissingFilter allows filter features based percentage missing values feature. function takes input parameter f supposed vector length equal length object (.e. number samples) sample type . function computes percentage missing values per sample groups filters features based . Features percent missing values larger threshold sample groups removed. Another option base quality assessment filtering QC samples. examples shown : , feature removed, meaning features less 30% NA values least one sample type. Although directly relevant experiment, BlankFlag filter can used flag features based intensity relationship blank QC samples. information can found documentation filter:","code":"# Set up parameters for RsdFilter rsd_filter <- RsdFilter(threshold = 0.3, qcIndex = sampleData(faahko)$sample_type == \"QC\") # Apply the filter to faakho object filtered_faahko <- filterFeatures(object = faahko, filter = rsd_filter) ## 255 features were removed # Now apply the same strategy to the res object rsd_filter <- RsdFilter(threshold = 0.3, qcIndex = res$sample_type == \"QC\") filtered_res <- filterFeatures(object = res, filter = rsd_filter, assay = \"raw\") ## 260 features were removed # Set up parameters for DratioFilter dratio_filter <- DratioFilter( threshold = 0.5, qcIndex = sampleData(filtered_faahko)$sample_type == \"QC\", studyIndex = sampleData(filtered_faahko)$sample_type == \"study\") # Apply the filter to faahko object filtered_faakho <- filterFeatures(object = filtered_faahko, filter = dratio_filter) ## 38 features were removed # Now same but for the res object dratio_filter <- DratioFilter( threshold = 0.5, qcIndex = filtered_res$sample_type == \"QC\", studyIndex = filtered_res$sample_type == \"study\") filtered_res <- filterFeatures(object = filtered_res, filter = dratio_filter) ## 38 features were removed # To set up parameter `f` to filter only based on QC samples f <- sampleData(filtered_faakho)$sample_type f[f != \"QC\"] <- NA # To set up parameter `f` to filter per sample type excluding QC samples f <- sampleData(filtered_faakho)$sample_type f[f == \"QC\"] <- NA missing_filter <- PercentMissingFilter(threshold = 30, f = f) # Apply the filter to faakho object filtered_faakho <- filterFeatures(object = filtered_faakho, filter = missing_filter) ## 0 features were removed # Apply the filter to res object missing_filter <- PercentMissingFilter(threshold = 30, f = f) filtered_res <- filterFeatures(object = filtered_res, filter = missing_filter) ## 0 features were removed # Retrieve documentation for the main function and the specific filter. ?filterFeatures ## Help on topic 'filterFeatures' was found in the following packages: ## ## Package Library ## ProtGenerics /__w/_temp/Library ## xcms /__w/_temp/Library ## QFeatures /__w/_temp/Library ## ## ## Using the first match ... ?BlankFlag"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"normalization","dir":"Articles","previous_headings":"Further data processing and analysis","what":"Normalization","title":"LC-MS data pre-processing and analysis with xcms","text":"Normalizing features’ signal intensities required, present (yet) supported xcms (methods might added near future). advised use SummarizedExperiment returned quantify method data processing, type object stores feature definitions, sample annotations well feature abundances object. identification e.g. features significant different intensities/abundances suggested use functionality provided R packages, Bioconductor’s excellent limma package.","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"alignment-to-an-external-reference-dataset","dir":"Articles","previous_headings":"Further data processing and analysis","what":"Alignment to an external reference dataset","title":"LC-MS data pre-processing and analysis with xcms","text":"certain experiments, aligning two different datasets necessary. can involve comparing runs samples conducted across different laboratories runs MS2 recorded initial MS1 run. Across laboratories time, samples may result variation retention time, especially LC system can quite unstable. cases, alignment step using adjustRtime() function LamaParam parameter can allow user perform type alignment. go step step . Let’s load already analyzed dataset ref previous dataset alignment, tst. first restrict retention time range dataset. Now, attempt align two samples previous dataset. first step extract landmark features (referred lamas). achieve , identify features present every QC sample ref dataset. , categorize (using factor()) data sample_type retain QC samples. variable utilized filter features using PercentMissingFilter() parameter within filterFeatures() function (see section information method) lamas input look like alignment. terms method works, alignment algorithm matches chromatographic peaks experimental data lamas, fitting model based match adjust retention times minimize differences two datasets. Now can define param object LamaParama prepare alignment. Parameters tolerance, toleranceRt, ppm relate matching chromatographic peaks lamas. parameters related type fitting generated data points. details parameter overall method can found searching ?adjustRtime. example using default parameters. extract base peak chromatogram (BPC) visualize evaluate alignment: generate plots visually compare alignment reference dataset (black) (red) (blue) adjustment: appears certain time intervals (2500 3000 3500 4500 seconds) exhibit better alignment others. variance can elucidated examining distribution matched peaks, illustrated . matchLamaChromPeaks() function facilitates assessment well lamas correspond chromatographic peaks file. analysis can conducted prior adjustments. overlay BPC provides insight correlation accurate alignment presence peaks matching lamas. Furthermore, detailed examination matching model used fitting file possible. Numerical information can obtained using summarizeLamaMatch() function. , percentage chromatographic peaks utilized alignment can computed relative total number peaks file. Additionally, feasible directly plot() param object file interest, showcasing distribution chromatographic peaks along fitted model line.","code":"ref <- loadXcmsData(\"xmse\") tst <- loadXcmsData(\"faahko_sub2\") f <- sampleData(ref)$sample_type f[f != \"QC\"] <- NA ref <- filterFeatures(ref, PercentMissingFilter(threshold = 0, f = f)) ## 4 features were removed ref_mz_rt <- featureDefinitions(ref)[, c(\"mzmed\",\"rtmed\")] ref_mz_rt ## mzmed rtmed ## FT001 200.10 2902.634 ## FT002 205.00 2789.901 ## FT003 206.00 2789.405 ## FT004 207.10 2718.560 ## FT005 233.00 3023.579 ## FT006 241.10 3683.299 ## FT007 242.10 3663.791 ## FT008 244.10 2833.307 ## FT009 249.10 3676.265 ## FT010 250.10 3674.656 ## FT011 255.15 3682.395 ## FT012 256.15 3677.129 ## FT013 266.20 3668.967 ## FT014 267.20 3668.040 ## FT015 268.20 3660.653 ## FT016 269.20 3891.155 ## FT017 272.10 3125.878 ## FT018 272.10 2733.522 ## FT019 279.00 2788.435 ## FT020 280.00 2792.156 ## FT021 281.20 3668.777 ## FT022 281.10 2787.464 ## FT023 282.20 3667.853 ## FT024 282.20 3475.313 ## FT025 283.20 3888.408 ## FT026 283.20 3665.355 ## FT027 284.10 2719.668 ## FT028 284.20 3695.535 ## FT029 286.20 3263.973 ## FT030 288.10 2799.792 ## FT031 289.10 2795.482 ## FT032 296.10 2730.256 ## FT033 300.20 3404.692 ## FT034 301.00 2789.217 ## FT035 301.20 3404.692 ## FT036 302.00 2623.296 ## FT037 302.00 2790.972 ## FT038 304.10 2923.870 ## FT039 305.10 2927.597 ## FT040 305.10 3504.720 ## FT041 306.10 3509.791 ## FT042 306.10 2936.499 ## FT043 307.00 2625.024 ## FT044 308.10 3259.275 ## FT045 309.10 2923.324 ## FT046 309.20 3669.158 ## FT047 309.10 3477.216 ## FT048 310.20 3653.792 ## FT049 311.10 3078.746 ## FT050 312.10 2998.566 ## FT051 312.20 3870.436 ## FT052 313.00 2788.781 ## FT053 313.20 3298.254 ## FT054 314.00 2788.704 ## FT055 314.15 3294.617 ## FT056 316.20 3079.072 ## FT057 317.00 2789.028 ## FT058 317.20 3083.760 ## FT059 321.20 3670.730 ## FT060 322.15 3507.645 ## FT061 322.10 3405.784 ## FT062 323.10 3504.998 ## FT063 324.10 2791.233 ## FT064 324.20 3290.215 ## FT065 326.20 3421.241 ## FT066 327.10 3498.317 ## FT067 328.20 3636.850 ## FT068 329.10 3501.392 ## FT069 329.20 3642.045 ## FT070 330.20 3643.682 ## FT071 331.20 3501.392 ## FT072 335.00 2788.704 ## FT073 336.00 2788.834 ## FT074 337.00 2554.317 ## FT075 338.10 3026.218 ## FT076 338.20 3668.967 ## FT077 338.20 3837.743 ## FT078 338.10 2789.028 ## FT079 339.20 3325.293 ## FT080 339.10 3129.855 ## FT081 340.10 3324.565 ## FT082 343.00 2684.205 ## FT083 343.10 2748.230 ## FT084 344.00 2685.831 ## FT085 344.20 3347.607 ## FT087 345.00 2685.895 ## FT088 346.10 3500.358 ## FT089 347.10 3504.998 ## FT090 348.20 3488.902 ## FT091 348.20 3306.792 ## FT092 350.20 3659.019 ## FT093 351.10 3503.953 ## FT094 352.10 3506.280 ## FT095 353.10 3504.855 ## FT096 354.20 3625.272 ## FT097 354.15 2793.799 ## FT098 355.20 3630.614 ## FT099 356.20 3840.640 ## FT100 357.20 3840.896 ## FT101 357.20 3478.920 ## FT102 359.00 3507.002 ## FT103 359.20 3724.544 ## FT104 360.00 2688.960 ## FT105 361.10 3168.466 ## FT106 361.10 2692.876 ## FT107 362.10 3169.834 ## FT108 362.10 2688.842 ## FT109 363.20 3267.053 ## FT110 363.10 3475.879 ## FT111 363.10 2880.969 ## FT112 364.20 3724.889 ## FT113 365.00 2686.765 ## FT114 365.00 2596.692 ## FT115 365.10 3406.876 ## FT116 366.00 2686.697 ## FT117 366.10 2790.396 ## FT118 366.20 3848.377 ## FT119 367.20 3531.475 ## FT120 367.20 4133.723 ## FT121 368.20 3533.547 ## FT122 370.20 3070.980 ## FT123 371.20 3638.709 ## FT124 371.20 3078.794 ## FT125 372.20 3259.275 ## FT126 372.20 3588.662 ## FT127 373.20 3262.143 ## FT128 376.20 3721.949 ## FT129 376.20 3473.786 ## FT130 379.10 3336.024 ## FT131 380.10 3160.644 ## FT132 380.20 3337.932 ## FT133 381.00 2684.371 ## FT134 381.10 3162.297 ## FT135 382.10 3260.500 ## FT136 382.20 3804.470 ## FT137 384.20 3998.978 ## FT138 385.10 3174.725 ## FT139 385.20 3454.142 ## FT140 386.20 3459.187 ## FT141 386.10 3170.726 ## FT142 389.20 3356.946 ## FT143 390.20 3356.872 ## FT144 391.10 3628.830 ## FT145 392.10 3629.508 ## FT146 392.20 2924.703 ## FT147 395.20 3724.144 ## FT148 396.20 3331.732 ## FT149 398.20 3311.895 ## FT150 398.20 3411.698 ## FT152 399.10 2798.412 ## FT153 400.10 2788.834 ## FT154 400.20 3599.478 ## FT155 401.20 3750.015 ## FT156 401.20 3598.683 ## FT157 404.10 2694.947 ## FT158 408.20 3458.669 ## FT159 408.10 2898.149 ## FT160 410.30 3942.862 ## FT161 411.20 3949.346 ## FT162 412.30 4122.768 ## FT163 413.10 3629.316 ## FT164 413.30 4126.558 ## FT165 414.20 3057.467 ## FT166 414.20 3640.275 ## FT167 416.10 2687.495 ## FT168 419.20 3774.261 ## FT169 423.10 3265.400 ## FT170 424.20 2954.912 ## FT171 424.20 3411.500 ## FT172 426.10 3018.408 ## FT173 426.20 3612.085 ## FT174 426.95 2689.693 ## FT175 427.10 3015.764 ## FT176 427.20 3612.085 ## FT177 429.20 3886.382 ## FT178 429.20 4046.373 ## FT179 430.10 2688.338 ## FT180 430.20 3885.895 ## FT181 431.10 2688.179 ## FT182 433.20 3817.913 ## FT183 436.20 3634.969 ## FT184 437.10 3234.009 ## FT185 438.20 3464.381 ## FT186 438.30 4065.152 ## FT187 439.20 3455.346 ## FT188 439.30 4068.469 ## FT189 440.20 3473.260 ## FT190 444.10 2687.328 ## FT191 444.20 2899.671 ## FT192 445.20 4056.466 ## FT193 447.20 3873.089 ## FT194 448.20 3873.680 ## FT195 448.20 3406.055 ## FT196 448.20 3563.688 ## FT197 449.20 3309.212 ## FT198 449.20 3404.502 ## FT199 452.10 3077.721 ## FT200 454.10 3298.016 ## FT201 455.10 3301.799 ## FT202 456.10 3291.767 ## FT203 458.20 3044.896 ## FT204 459.20 3036.864 ## FT205 462.20 3267.764 ## FT206 463.20 3039.707 ## FT207 464.20 3469.956 ## FT208 465.20 3469.475 ## FT209 466.20 3474.891 ## FT210 466.20 3706.509 ## FT211 467.20 3706.499 ## FT212 468.20 3139.599 ## FT213 468.30 2941.095 ## FT214 469.20 3146.568 ## FT215 474.10 3077.306 ## FT216 476.10 3284.737 ## FT217 478.20 3627.751 ## FT218 479.20 3623.061 ## FT219 480.20 3322.559 ## FT220 481.20 3324.503 ## FT221 482.20 3614.155 ## FT222 482.20 3323.935 ## FT223 483.20 3609.223 ## FT224 484.20 3613.406 ## FT225 485.20 3025.916 ## FT226 486.20 3474.656 ## FT227 486.20 2801.329 ## FT228 488.20 2882.531 ## FT229 491.20 3415.016 ## FT230 492.20 3670.340 ## FT231 493.20 3672.549 ## FT232 494.20 3428.262 ## FT233 494.20 3129.368 ## FT234 495.20 3427.712 ## FT235 496.20 3381.885 ## FT236 497.20 3392.735 ## FT237 498.20 3432.457 ## FT238 498.30 3917.185 ## FT239 500.10 3044.974 ## FT240 502.10 3171.596 ## FT241 502.20 3026.218 ## FT242 503.10 3171.421 ## FT243 503.20 3022.011 ## FT244 504.10 3265.566 ## FT245 505.15 3265.121 ## FT246 505.35 3747.909 ## FT247 506.20 3404.771 ## FT248 507.20 3402.436 ## FT249 507.20 3030.857 ## FT250 508.20 3532.072 ## FT251 508.10 3384.643 ## FT252 509.20 3530.981 ## FT253 510.20 3538.906 ## FT254 510.20 3786.659 ## FT255 511.20 3785.879 ## FT256 518.20 3432.440 ## FT257 519.20 3444.152 ## FT258 520.20 3241.104 ## FT259 521.20 3218.546 ## FT260 522.20 3405.966 ## FT261 523.20 3405.185 ## FT262 524.20 3679.669 ## FT263 524.20 3762.872 ## FT264 524.20 3420.753 ## FT265 525.20 3762.091 ## FT266 525.20 3685.573 ## FT267 526.10 3182.548 ## FT268 526.20 3764.267 ## FT269 526.20 3687.235 ## FT270 527.10 3188.114 ## FT271 528.10 3242.467 ## FT272 529.10 3248.059 ## FT273 530.20 3357.110 ## FT274 531.20 3357.891 ## FT275 532.20 3359.466 ## FT276 532.20 3492.017 ## FT277 532.20 2872.610 ## FT278 533.20 3490.591 ## FT280 534.20 3594.882 ## FT281 534.30 3867.615 ## FT282 535.20 3595.483 ## FT283 535.30 3862.145 ## FT284 536.20 3722.982 ## FT285 536.20 3574.110 ## FT286 537.20 3722.982 ## FT287 538.20 3720.958 ## FT288 538.30 4135.639 ## FT289 544.20 3220.128 ## FT290 544.20 3431.196 ## FT291 545.20 3215.566 ## FT292 546.20 3203.776 ## FT293 546.20 3678.966 ## FT294 546.20 3017.572 ## FT295 547.20 3011.595 ## FT296 547.20 3679.483 ## FT297 547.30 3011.072 ## FT298 548.10 3185.679 ## FT299 548.40 3519.761 ## FT300 549.30 4127.176 ## FT301 549.40 3740.574 ## FT302 550.20 3665.428 ## FT303 550.30 3626.778 ## FT304 551.20 3700.215 ## FT305 551.20 3013.723 ## FT306 551.20 3594.914 ## FT307 552.20 3665.603 ## FT308 552.20 3009.501 ## FT309 552.30 3841.421 ## FT310 554.15 3225.460 ## FT311 556.20 3456.269 ## FT312 556.30 2914.125 ## FT313 556.30 3115.298 ## FT314 557.20 2918.720 ## FT315 558.20 3397.529 ## FT316 558.20 3726.352 ## FT317 558.20 3535.474 ## FT318 560.20 3655.543 ## FT319 560.20 3090.011 ## FT321 564.20 3465.857 ## FT322 564.40 4149.660 ## FT323 566.20 3582.974 ## FT324 568.20 3226.395 ## FT325 568.30 3624.023 ## FT326 569.20 3226.395 ## FT327 570.10 3087.875 ## FT328 571.10 3087.916 ## FT329 571.40 3727.935 ## FT330 572.20 3415.383 ## FT331 572.20 3673.422 ## FT332 575.40 4060.457 ## FT333 576.25 2862.581 ## FT334 578.30 3819.405 ## FT335 579.10 2790.495 ## FT336 579.30 3820.827 ## FT337 579.40 3518.231 ## FT338 580.10 2790.972 ## FT339 580.20 3585.251 ## FT340 580.20 3408.398 ## FT341 590.30 3005.915 ## FT342 591.30 3005.743 ## FT343 592.15 3022.033 ## FT344 593.40 3720.198 ## FT345 594.20 3416.152 ## FT346 594.30 3620.732 ## FT347 595.25 3010.600 ## FT348 596.20 2997.776 ## FT349 596.30 3819.829 ## FT350 597.40 3820.880 ## FT351 599.30 4071.412 param <- LamaParama(lamas = ref_mz_rt, method = \"loess\", span = 0.5, outlierTolerance = 3, zeroWeight = 10, ppm = 20, tolerance = 0, toleranceRt = 20, bs = \"tp\") #' input into `adjustRtime()` tst_adjusted <- adjustRtime(tst, param = param) tst_adjusted <- applyAdjustedRtime(tst_adjusted) #' evaluate the results with BPC bpc <- chromatogram(ref, chromPeaks = \"none\") bpc_tst_raw <- chromatogram(tst, chromPeaks = \"none\") bpc_tst_adj <- chromatogram(tst_adjusted, chromPeaks = \"none\") #' BPC of a sample par(mfrow = c(1, 2), mar = c(4, 2.5, 1, 0.5)) plot(bpc[1, 1], col = \"#00000080\", main = \"Before Alignment\") points(rtime(bpc_tst_raw[1, 1]), intensity(bpc_tst_raw[1, 1]), type = \"l\", col = \"#ff000080\") grid() plot(bpc[1, 1], col = \"#00000080\", main = \"After Alignment\") points(rtime(bpc_tst_adj[1, 1]), intensity(bpc_tst_adj[1, 1]), type = \"l\", col = \"#0000ff80\") grid() param <- matchLamasChromPeaks(tst, param = param) mtch <- matchedRtimes(param) #' BPC of the first sample with matches to lamas overlay par(mfrow = c(1, 1)) plot(bpc[1, 1], col = \"#00000080\", main = \"Distribution CP matched to Lamas\") points(rtime(bpc_tst_adj[1, 1]), intensity(bpc_tst_adj[1, 1]), type = \"l\", col = \"#0000ff80\") grid() abline(v = mtch[[1]]$obs) #access summary of matches and model information summary <- summarizeLamaMatch(param) summary ## Total_peaks Matched_peaks Total_lamas Model_summary ## 1 87 34 347 30, c(0..... ## 2 100 51 347 48, c(0..... ## 3 61 34 347 33, c(0..... # coverage for each file summary$Matched_peaks / summary$Total_peaks * 100 ## [1] 39.08046 51.00000 55.73770 #access the information on the model of for the first file summary$model_summary[[1]] ## NULL # Plot obs vs. ref with fitting line plot(param, index = 1L, main = \"ChromPeaks versus Lamas for the first file\", colPoint = \"red\")"},{"path":[]},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"subsetting-and-filtering","dir":"Articles","previous_headings":"Additional details and notes","what":"Subsetting and filtering","title":"LC-MS data pre-processing and analysis with xcms","text":"xcms result objects can subset/filtered sample using [ method one filter* functions (although XcmsExperiment supports present selected filter functions). cases filtering can remove pre-processing results, filter functions support parameters keepFeatures keepAdjustedRtime can set TRUE avoid removal.","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"parallel-processing","dir":"Articles","previous_headings":"Additional details and notes","what":"Parallel processing","title":"LC-MS data pre-processing and analysis with xcms","text":"functions xcms support parallel processing, enabled default performed, operations, per-file basis. Parallel processing handled configured BiocParallel Bioconductor package can globally defined R session. Note , data objects designed low memory footprint loading peak data memory needed, parallel processing increase demand: general, full data many files parallel processes loaded memory. needs also considered, number parallel processes defined. Unix-based systems (Linux, macOS) support multicore-based parallel processing. configure globally register parameter class. Note also bpstart used initialize parallel processes. Windows supports socket-based parallel processing:","code":"register(bpstart(MulticoreParam(2))) register(bpstart(SnowParam(2)))"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"main-differences-to-the-msnbase-based-xcms-version-3","dir":"Articles","previous_headings":"Additional details and notes","what":"Main differences to the MSnbase-based xcms version 3","title":"LC-MS data pre-processing and analysis with xcms","text":"Spectra used main container (raw) MS data. Thus changing backends supported stage analysis (e.g. load data memory load data remote databases).","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"additional-documentation-resources","dir":"Articles","previous_headings":"","what":"Additional documentation resources","title":"LC-MS data pre-processing and analysis with xcms","text":"documentations listed still based xcms version 3 subsequently updated. Metabolomics pre-processing xcms: detailed description pre-processing LC-MS data xcms. MetaboAnnotationTutorials: examples annotation metabolomics data [3]. [2]: describes concept -disk data modes used also xcms. SpectraTutorials: tutorials describing Spectra package functionality.","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"LC-MS data pre-processing and analysis with xcms","text":"R packages used document listed .","code":"sessionInfo() ## R Under development (unstable) (2024-03-28 r86224) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.4 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] SummarizedExperiment_1.33.3 Biobase_2.63.1 ## [3] GenomicRanges_1.55.4 GenomeInfoDb_1.39.10 ## [5] IRanges_2.37.1 S4Vectors_0.41.5 ## [7] BiocGenerics_0.49.1 MatrixGenerics_1.15.0 ## [9] matrixStats_1.2.0 MsExperiment_1.5.4 ## [11] ProtGenerics_1.35.4 pheatmap_1.0.12 ## [13] RColorBrewer_1.1-3 pander_0.6.5 ## [15] faahKO_1.43.0 xcms_4.1.12 ## [17] BiocParallel_1.37.1 BiocStyle_2.31.0 ## ## loaded via a namespace (and not attached): ## [1] DBI_1.2.2 rlang_1.1.3 ## [3] magrittr_2.0.3 clue_0.3-65 ## [5] MassSpecWavelet_1.69.0 compiler_4.5.0 ## [7] systemfonts_1.0.6 vctrs_0.6.5 ## [9] MetaboCoreUtils_1.11.2 pkgconfig_2.0.3 ## [11] crayon_1.5.2 fastmap_1.1.1 ## [13] XVector_0.43.1 utf8_1.2.4 ## [15] rmarkdown_2.26 preprocessCore_1.65.0 ## [17] ragg_1.3.0 purrr_1.0.2 ## [19] xfun_0.43 MultiAssayExperiment_1.29.1 ## [21] zlibbioc_1.49.3 cachem_1.0.8 ## [23] jsonlite_1.8.8 progress_1.2.3 ## [25] highr_0.10 DelayedArray_0.29.9 ## [27] prettyunits_1.2.0 parallel_4.5.0 ## [29] cluster_2.1.6 R6_2.5.1 ## [31] bslib_0.7.0 limma_3.59.6 ## [33] jquerylib_0.1.4 Rcpp_1.0.12 ## [35] bookdown_0.38 iterators_1.0.14 ## [37] knitr_1.45 Matrix_1.7-0 ## [39] igraph_2.0.3 tidyselect_1.2.1 ## [41] abind_1.4-5 yaml_2.3.8 ## [43] doParallel_1.0.17 codetools_0.2-20 ## [45] affy_1.81.0 lattice_0.22-6 ## [47] tibble_3.2.1 plyr_1.8.9 ## [49] evaluate_0.23 desc_1.4.3 ## [51] Spectra_1.13.8 pillar_1.9.0 ## [53] affyio_1.73.0 BiocManager_1.30.22 ## [55] foreach_1.5.2 MSnbase_2.29.4 ## [57] MALDIquant_1.22.2 ncdf4_1.22 ## [59] generics_0.1.3 hms_1.1.3 ## [61] ggplot2_3.5.0 munsell_0.5.1 ## [63] scales_1.3.0 glue_1.7.0 ## [65] MsFeatures_1.11.0 lazyeval_0.2.2 ## [67] tools_4.5.0 mzID_1.41.0 ## [69] QFeatures_1.13.3 vsn_3.71.1 ## [71] mzR_2.37.3 fs_1.6.3 ## [73] XML_3.99-0.16.1 grid_4.5.0 ## [75] impute_1.77.0 MsCoreUtils_1.15.6 ## [77] colorspace_2.1-0 GenomeInfoDbData_1.2.12 ## [79] PSMatch_1.7.2 cli_3.6.2 ## [81] textshaping_0.3.7 fansi_1.0.6 ## [83] S4Arrays_1.3.6 dplyr_1.1.4 ## [85] AnnotationFilter_1.27.0 pcaMethods_1.95.0 ## [87] gtable_0.3.4 sass_0.4.9 ## [89] digest_0.6.35 SparseArray_1.3.4 ## [91] farver_2.1.1 htmlwidgets_1.6.4 ## [93] memoise_2.0.1 htmltools_0.5.8 ## [95] pkgdown_2.0.7.9000 lifecycle_1.0.4 ## [97] statmod_1.5.0 MASS_7.3-60.2"},{"path":[]},{"path":"https://sneumann.github.io/xcms/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Colin . Smith. Author. Ralf Tautenhahn. Author. Steffen Neumann. Author, maintainer. Paul Benton. Author. Christopher Conley. Author. Johannes Rainer. Author. Michael Witting. Contributor. William Kumler. Author. Philippine Louail. Author. Pablo Vangeenderhuysen. Contributor. Carl Brunius. Contributor.","code":""},{"path":"https://sneumann.github.io/xcms/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Smith, C.. Want, E.J. O'Maille, G. Abagyan,R. Siuzdak, G.: XCMS: Processing mass spectrometry data metabolite profiling using nonlinear peak alignment, matching identification, Analytical Chemistry, 78:779-787 (2006) Ralf Tautenhahn, Christoph Boettcher, Steffen Neumann: Highly sensitive feature detection high resolution LC/MS BMC Bioinformatics, 9:504 (2008) H. Paul Benton, Elizabeth J. Want Timothy M. D. Ebbels Correction mass calibration gaps liquid chromatography-mass spectrometry metabolomics data Bioinformatics, 26:2488 (2010)","code":"@Article{, author = {{Smith} and {C.A.} and {Want} and {E.J.} and {O'Maille} and {G.} and {Abagyan,R.} and {Siuzdak} and {G.}}, title = {XCMS: Processing mass spectrometry data for metabolite profiling using nonlinear peak alignment, matching and identification}, journal = {Analytical Chemistry}, year = {2006}, volume = {78}, pages = {779--787}, } @Article{, author = {Ralf Tautenhahn and Christoph Boettcher and Steffen Neumann}, title = {Highly sensitive feature detection for high resolution LC/MS}, journal = {BMC Bioinformatics}, year = {2008}, volume = {9}, pages = {504}, } @Article{, author = {H. Paul Benton and Elizabeth J. Want and Timothy M. D. Ebbels}, title = {Correction of mass calibration gaps in liquid chromatography-mass spectrometry metabolomics data}, journal = {BIOINFORMATICS}, year = {2010}, volume = {26}, pages = {2488}, }"},{"path":"https://sneumann.github.io/xcms/index.html","id":"the-xcms-package-pre-processing-gclc-msms-data","dir":"","previous_headings":"","what":"LC-MS and GC-MS Data Analysis","title":"LC-MS and GC-MS Data Analysis","text":"Please see package documentation information examples news latest changes.","code":""},{"path":"https://sneumann.github.io/xcms/index.html","id":"version-4","dir":"","previous_headings":"","what":"Version 4","title":"LC-MS and GC-MS Data Analysis","text":"Version 4 adds native support Spectra package xcms allows perform pre-processing MsExperiment objects (MsExperiment. new supported data containers (Spectra, MsExperiment XcmsExperiment) allow flexible analyses seamless future extensions additional types data (ion mobility data). Ultimately, changes also allow easier integration xcms R packages MsFeatures MetaboAnnotation. suggested users switch newer data result objects, functionality version 3 remain fully supported.","code":""},{"path":"https://sneumann.github.io/xcms/index.html","id":"version-3","dir":"","previous_headings":"","what":"Version 3","title":"LC-MS and GC-MS Data Analysis","text":"Version >= 3 xcms package updated partially re-written versions original xcms package. version number 3 selected avoid confusions xcms2 (http://pubs.acs.org/doi/abs/10.1021/ac800795f) software. providing original software’s functionality, xcms version >= 3 aims : Better integration Bioconductor framework: Make use extend classes defined MSnbase package. Implement class versioning (Biobase’s Versioned class). Use BiocParallel parallel processing. Implementation validation methods classes ensure data integrity. Easier faster access raw spectra data. Cleanup source code: Remove obsolete redundant functionality (getEIC, rawEIC etc). Unify interfaces, .e. implement layer base functions accessing analysis methods (implemented C, C++ R). Using consistent naming scheme methods follows established naming conventions (e.g. correspondence instead grouping). Update, improve extend documentation. Establishing layer base R-functions interface analysis methods. take M/Z, retention time (scan index) intensity values input along optional arguments downstream functions (implemented C, C++ R). input arguments basic R objects (numeric vectors) thus enabling easy integration analysis methods R packages. user interface’s analysis methods take (raw) data object parameter class, used dispatching corresponding analysis algorithm. Add unit tests. Discussions suggestions welcome: https://github.com/sneumann/xcms/issues","code":""},{"path":"https://sneumann.github.io/xcms/index.html","id":"contribution","dir":"","previous_headings":"","what":"Contribution","title":"LC-MS and GC-MS Data Analysis","text":"Contributions xcms package welcome, whether form ideas, documentation, code, packages, … contribution guideline please see guideline RforMassSpectrometry initiative. seamless integration, contributors expected adhere RforMassSpectrometry coding syle.","code":""},{"path":"https://sneumann.github.io/xcms/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"LC-MS and GC-MS Data Analysis","text":"contributors maintainers package, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. See RforMassSpectrometry Code Conduct information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/AutoLockMass-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","title":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","text":"AutoLockMass - function decides lock mass scans \txcmsRaw object. done using scan time differences.","code":""},{"path":"https://sneumann.github.io/xcms/reference/AutoLockMass-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","text":"object = \"xcmsRaw\" signature(object = \"xcmsRaw\")","code":""},{"path":"https://sneumann.github.io/xcms/reference/AutoLockMass-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","text":"object xcmsRaw-class object","code":""},{"path":"https://sneumann.github.io/xcms/reference/AutoLockMass-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","text":"AutoLockMass numeric vector scan locations corresponding lock Mass scans","code":""},{"path":"https://sneumann.github.io/xcms/reference/AutoLockMass-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","text":"Paul Benton, hpaul.benton08@imperial.ac.uk","code":""},{"path":"https://sneumann.github.io/xcms/reference/AutoLockMass-methods.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","text":"","code":"if (FALSE) library(xcms) library(faahKO) ## These files do not have this problem ## to correct for but just for an example cdfpath <- system.file(\"cdf\", package = \"faahKO\") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE) xr<-xcmsRaw(cdffiles[1]) #> Create profile matrix with method 'bin' and step 1 ... #> OK xr #> An \"xcmsRaw\" object with 1278 mass spectra #> #> Time range: 2501.4-4499.8 seconds (41.7-75 minutes) #> Mass range: 200-600 m/z #> Intensity range: 70-1373180 #> #> MSn data on 0 mass(es) #> \twith 0 MSn spectra #> Profile method: bin #> Profile step: 1 m/z (401 grid points from 200 to 600 m/z) #> #> Memory usage: 10.8 MB ##Lets assume that the lockmass starts at 1 and is every 100 scans lockMass<-xcms:::makeacqNum(xr, freq=100, start=1) ## these are equalvent lockmass2<-AutoLockMass(xr) #> Warning: #> Lock mass frequency wasn't detected all((lockmass == lockmass2) == TRUE) #> Error in eval(expr, envir, enclos): object 'lockmass' not found ob<-stitch(xr, lockMass) #> Warning: no non-missing arguments to min; returning Inf #> Warning: no non-missing arguments to max; returning -Inf"},{"path":"https://sneumann.github.io/xcms/reference/BlankFlag.html","id":null,"dir":"Reference","previous_headings":"","what":"Flag features based on the intensity in blank samples — BlankFlag","title":"Flag features based on the intensity in blank samples — BlankFlag","text":"`BlankFlag` class method enable users flag features `XcmsExperiment` `SummarizedExperiment` object based relationship intensity feature blanks compared intensity samples. class method part possible dispatch generic function `filterFeatures`. Features ** (`<`) user-input threshold flagged calling `filterFeatures` function. means extra column created `featureDefinitions` `rowData` called `possible_contaminants` logical value feature.","code":""},{"path":"https://sneumann.github.io/xcms/reference/BlankFlag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Flag features based on the intensity in blank samples — BlankFlag","text":"","code":"BlankFlag( threshold = 2, blankIndex = integer(), qcIndex = integer(), na.rm = TRUE ) # S4 method for XcmsResult,BlankFlag filterFeatures(object, filter, ...) # S4 method for SummarizedExperiment,BlankFlag filterFeatures(object, filter, assay = 1)"},{"path":"https://sneumann.github.io/xcms/reference/BlankFlag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Flag features based on the intensity in blank samples — BlankFlag","text":"threshold `numeric` indicates minimum difference required mean abundance feature samples compared mean abundance feature blanks considered possible contaminant. example, default threshold 2 signifies mean abundance features samples least twice mean abundance blanks flagged possible contaminant. blankIndex `integer` (`logical`) vector corresponding indices blank samples. qcIndex `integer` (`logical`) vector corresponding indices quality control (QC) samples. na.rm `logical` indicates whether missing values (`NA`) removed prior calculations. object XcmsExperiment SummarizedExperiment. XcmsExperiment object, featureValues(object) evaluated, Summarizedesxperiment assay(object, assay). object filtered. filter parameter object selecting configuring type filtering. can one following classes: RsdFilter, DratioFilter, PercentMissingFilter BlankFlag. ... Optional parameters. object XcmsExperiment: parameters featureValues() call. assay filtering SummarizedExperiment objects . Indicates assay filtering based . Note features entire object removed, computations performed single assay. Default 1, means first assay object evaluated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/BlankFlag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Flag features based on the intensity in blank samples — BlankFlag","text":"`BlankFlag`: `BlankFlag` class. `filterFeatures` returns input object added column features metadata called `possible_contaminants` logical value feature. added `featureDefinitions` `XcmsExperiment` objects `rowData` `SummarizedExperiment` objects.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/BlankFlag.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Flag features based on the intensity in blank samples — BlankFlag","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/DratioFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter features based on the dispersion ratio — DratioFilter","title":"Filter features based on the dispersion ratio — DratioFilter","text":"`DratioFilter` class method enable users filter features `XcmsExperiment` `SummarizedExperiment` object based D-ratio *dispersion ratio*. defined standard deviation QC samples divided standard deviation biological test samples, feature object (Broadhurst et al.). `filter` part possible dispatch generic function `filterFeatures`. Features ** (`>`) user-input threshold removed entire dataset.","code":""},{"path":"https://sneumann.github.io/xcms/reference/DratioFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter features based on the dispersion ratio — DratioFilter","text":"","code":"DratioFilter( threshold = 0.5, qcIndex = integer(), studyIndex = integer(), na.rm = TRUE, mad = FALSE ) # S4 method for XcmsResult,DratioFilter filterFeatures(object, filter, ...) # S4 method for SummarizedExperiment,DratioFilter filterFeatures(object, filter, assay = 1)"},{"path":"https://sneumann.github.io/xcms/reference/DratioFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter features based on the dispersion ratio — DratioFilter","text":"threshold `numeric` value representing threshold. Features D-ratio *strictly higher* (`>`) removed entire dataset. qcIndex `integer` (`logical`) vector corresponding indices QC samples. studyIndex `integer` (`logical`) vector corresponding indices study samples. na.rm `logical` Indicates whether missing values (`NA`) removed prior calculations. mad `logical` Indicates whether *Median Absolute Deviation* (MAD) used instead standard deviation. suggested non-gaussian distributed data. object XcmsExperiment SummarizedExperiment. XcmsExperiment object, featureValues(object) evaluated, Summarizedesxperiment assay(object, assay). object filtered. filter parameter object selecting configuring type filtering. can one following classes: RsdFilter, DratioFilter, PercentMissingFilter BlankFlag. ... Optional parameters. object XcmsExperiment: parameters featureValues() call. assay filtering SummarizedExperiment objects . Indicates assay filtering based . Note features entire object removed, computations performed single assay. Default 1, means first assay object evaluated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/DratioFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter features based on the dispersion ratio — DratioFilter","text":"`DratioFilter`: `DratioFilter` class. `filterFeatures` return input object minus features met user input threshold","code":""},{"path":"https://sneumann.github.io/xcms/reference/DratioFilter.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Filter features based on the dispersion ratio — DratioFilter","text":"Broadhurst D, Goodacre R, Reinke SN, Kuligowski J, Wilson ID, Lewis MR, Dunn WB. Guidelines considerations use system suitability quality control samples mass spectrometry assays applied untargeted clinical metabolomic studies. Metabolomics. 2018;14(6):72. doi: 10.1007/s11306-018-1367-3. Epub 2018 May 18. PMID: 29805336; PMCID: PMC5960010.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/DratioFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filter features based on the dispersion ratio — DratioFilter","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":null,"dir":"Reference","previous_headings":"","what":"Generic parameter class — GenericParam-class","title":"Generic parameter class — GenericParam-class","text":"GenericParam class allows store generic parameter information name function /called (slot fun) arguments (slot args). object used track process history data processings XCMSnExp object. contrast e.g. CentWaveParam object passed actual processing method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generic parameter class — GenericParam-class","text":"","code":"GenericParam(fun = character(), args = list())"},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generic parameter class — GenericParam-class","text":"fun character representing name function. args list (ideally named) arguments function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generic parameter class — GenericParam-class","text":"GenericParam function returns GenericParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Generic parameter class — GenericParam-class","text":"fun character specifying function name. args list (ideally named) arguments function.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generic parameter class — GenericParam-class","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generic parameter class — GenericParam-class","text":"","code":"prm <- GenericParam(fun = \"mean\") prm <- GenericParam(fun = \"mean\", args = list(na.rm = TRUE))"},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":null,"dir":"Reference","previous_headings":"","what":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"Alignment achieved using ['adjustRtime()'] method `param` class `LamaParama`. method corrects retention time aligning chromatographic data external reference dataset. Chromatographic peaks experimental data first matched predefined (external) landmark features based mass--charge ratio retention time subsequently data aligned minimizing differences retention times matched chromatographic peaks lamas. adjustment performed file file. Adjustable parameters `ppm`, `tolerance`, `toleranceRt` define acceptable deviations matching process. crucial note lamas chromatographic peaks exhibiting one--one mapping considered estimating retention time shifts. file peaks matching lamas, adjustment performed, retention times returned -. Users can evaluate matching, example, checking number matches ranges matching peaks, first running `[matchLamasChromPeaks()]`. Different warping methods available; users can choose fit *loess* (`method = \"loess\"`, default) *gam* (`method = \"gam\"`) reference data points observed matching ChromPeaks. Additional parameters `span`, `weight`, `outlierTolerance`, `zeroWeight`, `bs` specific models. parameters offer flexibility fine-tuning matching chromatographic peaks fitted lamas, thereby generating model align overall retention time single file. functions related method: - `LamaParama()`: return respective parameter object alignment using `adjustRtime()` function. also input functions listed . - `matchLamasChromPeaks()`: quickly matches file's ChromPeaks Lamas, allowing user evaluate matches file. - `summarizeLamaMatch()`: generates summary `LamaParama` method. See details return object. - `matchedRtimes()`: Access list `data.frame` saved `LamaParama` object, generated `matchLamasChromPeaks()` function. - `plot()`:plot chromatographic peaks versus reference lamas well fitting line chosen model type. user can decide file inspect specifying assay number parameter `assay`","code":""},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"","code":"# S4 method for XcmsExperiment,LamaParama adjustRtime(object, param, BPPARAM = bpparam(), ...) matchLamasChromPeaks(object, param, BPPARAM = bpparam()) summarizeLamaMatch(param) matchedRtimes(param) LamaParama( lamas = matrix(ncol = 2, nrow = 0, dimnames = list(NULL, c(\"mz\", \"rt\"))), method = c(\"loess\", \"gam\"), span = 0.5, outlierTolerance = 3, zeroWeight = 10, ppm = 20, tolerance = 0, toleranceRt = 5, bs = \"tp\" ) # S4 method for LamaParama,ANY plot( x, index = 1L, colPoints = \"#00000060\", colFit = \"#00000080\", xlab = \"Matched Chromatographic peaks\", ylab = \"Lamas\", ... )"},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"object object class `XcmsExperiment` defined ChromPeaks. param object class `LamaParama` later used adjustment using `[adjustRtime()]` function. BPPARAM `matchLamasChromPeaks()`: parallel processing setup. Defaults `BPPARAM = bpparam()`. See [bpparam()] information. ... `plot()`: extra parameters passed function. lamas `LamaParama`: `matrix` `data.frame` m/z retention times values features (first second column) external dataset alignment based . method `LamaParama`:`character(1)` type warping. Either `method = \"gam\"` `method = \"loess\"` (default). span `LamaParama`: `numeric(1)` defining degree smoothing (`method = \"loess\"`). parameter passed internal call [loess()]. outlierTolerance `LamaParama`: `numeric(1)` defining settings outlier removal fitting. default (`outlierTolerance = 3`), data points absolute residuals larger 3 times mean absolute residual data points first, initial fit, removed final model fit. zeroWeight `LamaParama`: `numeric(1)`: defines weight first data point (.e. retention times first lama-chromatographic peak pair). Values larger 1 reduce warping problems early RT range. ppm `LamaParama`: `numeric(1)` defining m/z-relative maximal allowed difference m/z `lamas` chromatographic peaks. Used mapping identified chromatographic peaks lamas. tolerance `LamaParama`: `numeric(1)` defining absolute acceptable difference m/z lamas chromatographic peaks. Used mapping identified chromatographic peaks `lamas`. toleranceRt `LamaParama`: `numeric(1)` defining absolute acceptable difference retention time lamas chromatographic peaks. Used mapping identified chromatographic peaks `lamas`. bs `LamaParama()`: `character(1)` defining GAM smoothing method. (defaults thin plate, `bs = \"tp\"`) x `plot()`: object class `LamaParama` plotted. index `plot()`: `numeric(1)` index file plotted. colPoints `plot()`: color plotting datapoint. colFit `plot()`: color fitting line. xlab, ylab `plot()`: x- y-axis labels.","code":""},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"`matchLamasChromPeaks()`: `LamaParama` object new slot `rtMap` composed list matrices representing 1:1 matches Lamas (ref) ChromPeaks (obs). access , `matchedRtimes()` can used. `matchedRtimes()`: list `data.frame` representing matches chromPeaks `lamas` files. `summarizeLamaMatch()`:`data.frame` : - \"Total_peaks\": total number chromatographic peaks file. - \"Matched_peak\": number matched peaks Lamas. - \"Total_Lamas\": Total number Lamas. - \"Model_summary\": `summary.loess` `summary.gam` object file.","code":""},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"matches using `matchLamasChromPeaks()`, file retention adjusted calling [adjustRtime()] `LamaParama` `XcmsExperiment` object. see examples utilize methods functionality, see vignette.","code":""},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"Carl Brunius, Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"","code":"## load test and reference datasets ref <- loadXcmsData(\"xmse\") tst <- loadXcmsData(\"faahko_sub2\") ## create lamas input from the reference dataset library(MsExperiment) #> Loading required package: ProtGenerics #> #> Attaching package: ‘ProtGenerics’ #> The following object is masked from ‘package:stats’: #> #> smooth f <- sampleData(ref)$sample_type f[f == \"QC\"] <- NA ref <- filterFeatures(ref, PercentMissingFilter(threshold = 0, f = f)) #> 5 features were removed ref_mz_rt <- featureDefinitions(ref)[, c(\"mzmed\",\"rtmed\")] ## Set up the LamaParama object param <- LamaParama(lamas = ref_mz_rt, method = \"loess\", span = 0.5, outlierTolerance = 3, zeroWeight = 10, ppm = 20, tolerance = 0, toleranceRt = 20, bs = \"tp\") ## input into `adjustRtime()` tst_adjusted <- adjustRtime(tst, param = param) ## run diagnostic functions to pre-evaluate alignment param <- matchLamasChromPeaks(tst, param = param) mtch <- matchedRtimes(param) ## Access summary of matches and model information summary <- summarizeLamaMatch(param) ##coverage for each file summary$Matched_peaks / summary$Total_peaks * 100 #> [1] 39.08046 51.00000 55.73770 ## Access the information on the model of for the first file summary$model_summary[[1]] #> NULL"},{"path":"https://sneumann.github.io/xcms/reference/PercentMissingFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter features based on the percentage of missing data — PercentMissingFilter","title":"Filter features based on the percentage of missing data — PercentMissingFilter","text":"`PercentMissingFilter` class method enable users filter features `XcmsExperiment` `SummarizedExperiment` object based percentage (values 1 100) missing values features different sample groups filters according provided threshold. `filter` part possible dispatch generic function `filterFeatures`. Features percentage missing values *higher* (`>`) user input threshold sample groups removed (.e. features proportion missing values (`<=`) threshold least one sample group retained).","code":""},{"path":"https://sneumann.github.io/xcms/reference/PercentMissingFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter features based on the percentage of missing data — PercentMissingFilter","text":"","code":"PercentMissingFilter(threshold = 30, f = factor()) # S4 method for XcmsResult,PercentMissingFilter filterFeatures(object, filter, ...) # S4 method for SummarizedExperiment,PercentMissingFilter filterFeatures(object, filter, assay = 1)"},{"path":"https://sneumann.github.io/xcms/reference/PercentMissingFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter features based on the percentage of missing data — PercentMissingFilter","text":"threshold `numeric` percentage (0 100) accepted missing values feature one sample group. f `vector` length `object`, specifying sample type sample dataset. percentage missing values per feature computed within sample groups. Parameter `f`, already `factor`, converted one using factor function. Samples `NA` value `f` excluded calculation. object XcmsExperiment SummarizedExperiment. XcmsExperiment object, featureValues(object) evaluated, Summarizedesxperiment assay(object, assay). object filtered. filter parameter object selecting configuring type filtering. can one following classes: RsdFilter, DratioFilter, PercentMissingFilter BlankFlag. ... Optional parameters. object XcmsExperiment: parameters featureValues() call. assay filtering SummarizedExperiment objects . Indicates assay filtering based . Note features entire object removed, computations performed single assay. Default 1, means first assay object evaluated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/PercentMissingFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter features based on the percentage of missing data — PercentMissingFilter","text":"`PercentMissingFilter`: `PercentMissingFilter` class. `filterFeatures` return input object minus features met user input threshold","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/PercentMissingFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filter features based on the percentage of missing data — PercentMissingFilter","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/PlainTextParam.html","id":null,"dir":"Reference","previous_headings":"","what":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","title":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","text":"`PlainTextParam` class method enable users save `MsExperiment` `XcmsExperiment` objects collections plain text files specified folder. Note , xcms results within `XcmsExperiment` can exported, full raw MS data (object's `Spectra` object) currently exported plain text format. `Spectra` using [MsBackendMzR()] backend, names raw data files however exported (enables *restore* full `Spectra` respectively `MsExperiment` objects). `MsExperiment` object, exported files include: - [sampleData()] stored text file named *sample_data.txt*. - [fileNames()] *Spectra* object stored tabular format text file named *spectra_files.txt*.file names exported `Spectra` object uses [MsBackendMzR()] backend. backends information raw spectra data currently exported `PlainTextParam`. - Processing queue `Spectra` object, ensuring spectra data modifications retained. stored `json` file named *spectra_processing_queue.json*. `XcmsExperiment` object, exported files `MsExperiment` object, addition following: - [processHistory()] information object, stored `json` file named *process_history.json*. - chromatographic peak information obtained [chromPeaks()] [chromPeaksData()], stored tabular format text files *chrom_peaks.txt* *chrom_peak_data.txt* respectively. - retention time information obtained [adjustedRtime()] stored text file named *rtime_adjusted.txt*. - [featureDefinitions()] stored text file named *feature_definitions.txt*. Additionally, second file named *feature_peak_index.txt* generated connect features' definitions names. `param` class method part possible dispatch generic function `storeResults`. folder created calling `storeResults`. folder already exists, previous exports folder might get overwritten.","code":""},{"path":"https://sneumann.github.io/xcms/reference/PlainTextParam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","text":"","code":"PlainTextParam(path = tempdir()) # S4 method for MsExperiment,PlainTextParam storeResults(object, param) # S4 method for XcmsExperiment,PlainTextParam storeResults(object, param)"},{"path":"https://sneumann.github.io/xcms/reference/PlainTextParam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","text":"path `PlainTextParam` `character(1)`, defining files going stored. default `tempdir()`. object MsExperiment XcmsExperiment data object needs saved. param parameter object selecting configuring format saving. can one following classes: RDataParam, PlainTextParam, MzTabMParam.","code":""},{"path":"https://sneumann.github.io/xcms/reference/PlainTextParam.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","text":"`PlainTextParam`: `PlainTextParam` class. `storeResults` return anything saves object collections different plain text files folder.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/PlainTextParam.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","text":"Philippine Louail, Johannes Rainer.","code":""},{"path":"https://sneumann.github.io/xcms/reference/PlainTextParam.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","text":"","code":"## Load test data set of class `MsExperiment` library(MsExperiment) fls <- dir(system.file(\"sciex\", package = \"msdata\"), full.names = TRUE) pd <- data.frame(file = basename(fls), sample = c(\"POOL_1\", \"POOL_2\"), injection_index = c(1, 19), group = \"POOL\") rownames(pd) <- c(\"1\", \"2\") mse <- readMsExperiment(fls, sampleData = pd) ## Define param pth = file.path(tempdir(), \"test\") param <- PlainTextParam(path = pth) ## Save as a collection of plain text files storeResults(object = mse, param = param) ## Load a test data set with detected peaks, of class `XcmsExperiment` faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Define param pth = file.path(tempdir(), \"test\") param <- PlainTextParam(path = pth) ## Save as a collection of plain text files storeResults(object = faahko_sub, param = param) #> Warning: '/tmp/RtmpuXxMBu/test' already exists"},{"path":"https://sneumann.github.io/xcms/reference/ProcessHistory-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Tracking data processing — ProcessHistory-class","title":"Tracking data processing — ProcessHistory-class","text":"Objects type ProcessHistory allow keep track data processing step metabolomics experiment. created data processing methods, findChromPeaks added corresponding results objects. Thus, usually, users need create . XProcessHistory extends ProcessHistory adding slot param allows store actual parameter class processing step. processParam, processParam<-: get set parameter class XProcessHistory object. msLevel: returns MS level certain analysis performed, NA defined. processType method returns character specifying processing step type. processDate extracts start date processing step. processInfo extracts optional additional information processing step. fileIndex extracts indices files processing step applied.","code":""},{"path":"https://sneumann.github.io/xcms/reference/ProcessHistory-class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tracking data processing — ProcessHistory-class","text":"","code":"# S4 method for ProcessHistory show(object) # S4 method for XProcessHistory show(object) # S4 method for XProcessHistory processParam(object) # S4 method for XProcessHistory msLevel(object) # S4 method for ProcessHistory processType(object) # S4 method for ProcessHistory processDate(object) # S4 method for ProcessHistory processInfo(object) # S4 method for ProcessHistory fileIndex(object)"},{"path":"https://sneumann.github.io/xcms/reference/ProcessHistory-class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tracking data processing — ProcessHistory-class","text":"object ProcessHistory XProcessHistory object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/ProcessHistory-class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tracking data processing — ProcessHistory-class","text":"processParam: parameter object extending Param class. processType method returns character string processing step type. processDate method returns character string time stamp processing step start. processInfo method returns character string optional additional informations. fileIndex method returns integer vector index files/samples processing step applied.","code":""},{"path":"https://sneumann.github.io/xcms/reference/ProcessHistory-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Tracking data processing — ProcessHistory-class","text":"type character(1): string defining type processing step. string match predefined values. Use processHistoryTypes list . date character(1): date time stamp processing step started. info character(1): optional additional information. fileIndex integer length 1 > 1 specify samples object processing performed. error (): used store eventual calculation errors. param (Param): object type Param (e.g. CentWaveParam) specifying settings processing step. msLevel: integer definining MS level(s) analysis performed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/ProcessHistory-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Tracking data processing — ProcessHistory-class","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/RDataParam.html","id":null,"dir":"Reference","previous_headings":"","what":"Store `XcmsExperiment` object as .RData file — RDataParam","title":"Store `XcmsExperiment` object as .RData file — RDataParam","text":"`RDataParam` class method allow users save `XcmsExperiment` object .RData file chosen filename. object gets exported using [`save()`] function. `param` class method part possible dispatch generic function `storeResults`.","code":""},{"path":"https://sneumann.github.io/xcms/reference/RDataParam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Store `XcmsExperiment` object as .RData file — RDataParam","text":"","code":"RDataParam(fileName = tempfile()) # S4 method for XcmsExperiment,RDataParam storeResults(object, param)"},{"path":"https://sneumann.github.io/xcms/reference/RDataParam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Store `XcmsExperiment` object as .RData file — RDataParam","text":"fileName `RDataParam` `character(1)`, defining file name. default `tempfile()`. object MsExperiment XcmsExperiment data object needs saved. param parameter object selecting configuring format saving. can one following classes: RDataParam, PlainTextParam, MzTabMParam.","code":""},{"path":"https://sneumann.github.io/xcms/reference/RDataParam.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Store `XcmsExperiment` object as .RData file — RDataParam","text":"`RDataParam`: `RDataParam` class. `storeResults` return anything saves object RData file.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/RDataParam.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Store `XcmsExperiment` object as .RData file — RDataParam","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/RDataParam.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Store `XcmsExperiment` object as .RData file — RDataParam","text":"","code":"## Load a test data set with detected peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Define param param <- RDataParam(fileName = \"example_xcms_object\") ## Save as RData storeResults(object = faahko_sub, param = param)"},{"path":"https://sneumann.github.io/xcms/reference/RsdFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter features based on their coefficient of variation — RsdFilter","title":"Filter features based on their coefficient of variation — RsdFilter","text":"`RsdFilter` class methods enable users filter features `XcmsExperiment` `SummarizedExperiment` object based relative standard deviation (coefficient variation) specified threshold. `filter` part possible dispatch generic function `filterFeatures`. Features ** (`>`) user-input threshold removed entire dataset.","code":""},{"path":"https://sneumann.github.io/xcms/reference/RsdFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter features based on their coefficient of variation — RsdFilter","text":"","code":"RsdFilter(threshold = 0.3, qcIndex = integer(), na.rm = TRUE, mad = FALSE) # S4 method for XcmsResult,RsdFilter filterFeatures(object, filter, ...) # S4 method for SummarizedExperiment,RsdFilter filterFeatures(object, filter, assay = 1)"},{"path":"https://sneumann.github.io/xcms/reference/RsdFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter features based on their coefficient of variation — RsdFilter","text":"threshold `numeric` value representing threshold. Features coefficient variation *strictly higher* (`>`) removed entire dataset. qcIndex `integer` (`logical`) vector corresponding indices QC samples. na.rm `logical` indicates whether missing values (`NA`) removed prior calculations. mad `logical` indicates whether *Median Absolute Deviation* (MAD) used instead standard deviation. suggested non-gaussian distributed data. object XcmsExperiment SummarizedExperiment. XcmsExperiment object, featureValues(object) evaluated, Summarizedesxperiment assay(object, assay). object filtered. filter parameter object selecting configuring type filtering. can one following classes: RsdFilter, DratioFilter, PercentMissingFilter BlankFlag. ... Optional parameters. object XcmsExperiment: parameters featureValues() call. assay filtering SummarizedExperiment objects . Indicates assay filtering based . Note features entire object removed, computations performed single assay. Default 1, means first assay object evaluated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/RsdFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter features based on their coefficient of variation — RsdFilter","text":"`RsdFilter`: `RsdFilter` class. `filterFeatures` return input object minus features met user input threshold.","code":""},{"path":"https://sneumann.github.io/xcms/reference/RsdFilter.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Filter features based on their coefficient of variation — RsdFilter","text":"assumed abundance values natural scale. Abundances log scale first transformed natural scale calculating RSD.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/RsdFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filter features based on their coefficient of variation — RsdFilter","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/SSgauss.html","id":null,"dir":"Reference","previous_headings":"","what":"Gaussian Model — SSgauss","title":"Gaussian Model — SSgauss","text":"selfStart model evalueates Gaussian model gradient. initial attribute evalueate inital estimates parameters mu, sigma, h.","code":""},{"path":"https://sneumann.github.io/xcms/reference/SSgauss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gaussian Model — SSgauss","text":"","code":"SSgauss(x, mu, sigma, h)"},{"path":"https://sneumann.github.io/xcms/reference/SSgauss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gaussian Model — SSgauss","text":"x numeric vector values evaluate model mu mean distribution function sigma standard deviation distribution fuction h height distribution function","code":""},{"path":"https://sneumann.github.io/xcms/reference/SSgauss.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gaussian Model — SSgauss","text":"Initial values mu h chosen maximal value x. initial value sigma determined area x divided h*sqrt(2*pi).","code":""},{"path":"https://sneumann.github.io/xcms/reference/SSgauss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gaussian Model — SSgauss","text":"numeric vector length x. value expression h*exp(-(x-mu)^2/(2*sigma^2), modified gaussian function maximum height treated separate parameter dependent sigma. arguments mu, sigma, h names objects, gradient matrix respect names attached attribute named gradient.","code":""},{"path":"https://sneumann.github.io/xcms/reference/SSgauss.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Gaussian Model — SSgauss","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Data container storing xcms preprocessing results — XCMSnExp-class","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"XCMSnExp object container results G/LC-MS data preprocessing comprises chromatographic peak detection, alignment correspondence. results can accessed chromPeaks, adjustedRtime featureDefinitions functions; see (Usage, Arguments, Value Slots sections) details). Along results, object contains processing history allows track processing step along used settings. can extracted processHistory method. XCMSnExp objects, directly extending OnDiskMSnExp object MSnbase package, inherit functionality allows thus easy access full raw data stage analysis. support interaction packages requiring old objects, XCMSnExp objects can coerced xcmsSet objects using method (see examples ). preprocessing results passed along resulting xcmsSet object. General functions XCMSnExp objects (see specific function handle chromatographic peak data, alignment correspondence results): processHistoryTypes returns available types process histories. can passed argument type processHistory method extract specific process step(s). hasFilledChromPeaks: whether filled-peaks present . profMat: creates profile matrix, n x m matrix, n (rows) representing equally spaced m/z values (bins) m (columns) retention time corresponding scans. cell contains maximum intensity measured specific scan m/z values. See profMat details description various binning methods. hasAdjustedRtime: whether object provides adjusted retention times. hasFeatures: whether object contains correspondence results (.e. features). hasChromPeaks: whether object contains peak detection results. hasFilledChromPeaks: whether object contains filled-chromatographic peaks. adjustedRtime,adjustedRtime<-: extract/set adjusted retention times. adjustedRtime<- called manually, called internally adjustRtime methods. XCMSnExp objects, adjustedRtime<- also apply retention time adjustments eventually present chromatographic peaks. bySample parameter allows specify whether adjusted retention time grouped sample (file). featureDefinitions, featureDefinitions<-: extract set correspondence results, .e. mz-rt features (peak groups). Similar chromPeaks possible extract features specified m/z /rt ranges. function supports also parameter type allows specify features returned rt mz specified. details see help chromPeaks. See also featureSummary function calculate simple feature summaries. chromPeaks, chromPeaks<-: extract set matrix containing information identified chromatographic peaks. Rownames matrix represent unique IDs respective peaks within experiment. Parameter bySample allows specify whether peaks returned ungrouped (default bySample = FALSE) grouped sample (bySample = TRUE). chromPeaks<- method XCMSnExp objects removes also correspondence (peak grouping) retention time correction (alignment) results. optional arguments rt, mz, ppm type allow extract chromatographic peaks overlapping defined retention time /m/z ranges. Argument type allows define overlapping determined: type == \"\" (default), peaks even partially overlapping region returned (.e. either \"mzmin\" \"mzmax\" chromPeaks featureDefinitions matrix within provided m/z range), type == \"within\" full peak within region (.e. \"mzmin\" \"mzmax\" within m/z range) type == \"apex_within\" peak's apex position (highest signal peak) within region (.e. peak's features m/z within m/z range). See description return value details returned matrix. Users usually use chromPeaks<- method directly detected chromatographic peaks added object findChromPeaks method. Also, chromPeaks<- replace existing chromPeakData. chromPeakData chromPeakData<- allow get set arbitrary chromatographic peak annotations. returned ar returned DataFrame. Note number rows rownames DataFrame match chromPeaks. rtime: extracts retention time scan. bySample parameter allows return values grouped sample/file adjusted whether adjusted raw retention times returned. default method returns adjusted retention times, available (.e. retention times adjusted using adjustRtime method). mz: extracts mz values scan files within XCMSnExp object. values extracted original data files eventual processing steps applied fly. Using bySample parameter possible switch default grouping mz values spectrum/scan grouping sample/file. intensity: extracts intensity values scan files within XCMSnExp object. values extracted original data files eventual processing steps applied fly. Using bySample parameter possible switch default grouping intensity values spectrum/scan grouping sample/file. spectra: extracts Spectrum objects containing data object. values extracted original data files eventual processing steps applied fly. setting bySample = TRUE, spectra returned grouped sample/file. XCMSnExp object contains adjusted retention times, returned default Spectrum objects (can overwritten setting adjusted = FALSE). processHistory: returns list ProcessHistory objects (objects inheriting base class) representing individual processing steps performed, eventually along settings (Param parameter class). Optional arguments fileIndex, type msLevel allow restrict process steps certain type performed certain file MS level. dropChromPeaks: drops identified chromatographic peaks returns object without information. Note XCMSnExp objects method drops default also results correspondence (peak grouping) analysis. Adjusted retention times removed alignment performed peak detection. can overruled keepAdjustedRtime = TRUE. dropFeatureDefinitions: drops results correspondence (peak grouping) analysis, .e. definition mz-rt features returns object without information. Note XCMSnExp objects method also default drop retention time adjustment results, performed last peak grouping (.e. base results peak grouping going removed). related process history steps removed well eventually filled peaks (fillChromPeaks). parameter keepAdjustedRtime can used avoid removal adjusted retention times. dropAdjustedRtime: drops retention time adjustment information returns object without adjusted retention time. XCMSnExp objects, also reverts retention times reported chromatographic peaks peak matrix original, raw, ones (chromatographic peak detection). Note XCMSnExp objects method drops also peak grouping results performed retention time adjustment. related process history steps removed . findChromPeaks performs chromatographic peak detection provided XCMSnExp objects. details see method XCMSnExp. Note default (parameter add = FALSE) previous peak detection results removed. Use add = TRUE perform second round peak detection add newly identified peaks previous peak detection results. Correspondence results (features) always removed prior peak detection. Previous alignment (retention time adjustment) results kept, .e. chromatographic peak detection performed using adjusted retention times data first aligned using e.g. obiwarp (adjustRtime). dropFilledChromPeaks: drops filled-chromatographic peaks (filled fillChromPeaks method) related process history steps. spectrapply applies provided function Spectrum object returns results. function specified function simply returns list Spectrum objects. XCMSnExp objects can combined c function. combines identified chromatographic peaks objects' pheno data discards alignment results feature definitions. plot plots spectrum data (see plot MSnExp objects MSnbase package details. type = \"XIC\", identified chromatographic peaks indicated rectangles border color peakCol.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"","code":"processHistoryTypes() # S4 method for XCMSnExp hasFilledChromPeaks(object) # S4 method for OnDiskMSnExp profMat( object, method = \"bin\", step = 0.1, baselevel = NULL, basespace = NULL, mzrange. = NULL, fileIndex, ... ) # S4 method for XCMSnExp show(object) # S4 method for XCMSnExp hasAdjustedRtime(object) # S4 method for XCMSnExp hasFeatures(object, msLevel = integer()) # S4 method for XCMSnExp hasChromPeaks(object, msLevel = integer()) # S4 method for XCMSnExp hasFilledChromPeaks(object) # S4 method for XCMSnExp adjustedRtime(object, bySample = FALSE) # S4 method for XCMSnExp adjustedRtime(object) <- value # S4 method for XCMSnExp featureDefinitions( object, mz = numeric(), rt = numeric(), ppm = 0, type = c(\"any\", \"within\", \"apex_within\"), msLevel = integer() ) # S4 method for XCMSnExp featureDefinitions(object) <- value # S4 method for XCMSnExp chromPeaks( object, bySample = FALSE, rt = numeric(), mz = numeric(), ppm = 0, msLevel = integer(), type = c(\"any\", \"within\", \"apex_within\"), isFilledColumn = FALSE ) # S4 method for XCMSnExp chromPeaks(object) <- value # S4 method for XCMSnExp rtime(object, bySample = FALSE, adjusted = hasAdjustedRtime(object)) # S4 method for XCMSnExp mz(object, bySample = FALSE, BPPARAM = bpparam()) # S4 method for XCMSnExp intensity(object, bySample = FALSE, BPPARAM = bpparam()) # S4 method for XCMSnExp spectra( object, bySample = FALSE, adjusted = hasAdjustedRtime(object), BPPARAM = bpparam() ) # S4 method for XCMSnExp processHistory(object, fileIndex, type, msLevel) # S4 method for XCMSnExp dropChromPeaks(object, keepAdjustedRtime = FALSE) # S4 method for XCMSnExp dropFeatureDefinitions(object, keepAdjustedRtime = FALSE, dropLastN = -1) # S4 method for XCMSnExp dropAdjustedRtime(object) # S4 method for XCMSnExp profMat( object, method = \"bin\", step = 0.1, baselevel = NULL, basespace = NULL, mzrange. = NULL, fileIndex, ... ) # S4 method for XCMSnExp,Param findChromPeaks( object, param, BPPARAM = bpparam(), return.type = \"XCMSnExp\", msLevel = 1L, add = FALSE ) # S4 method for XCMSnExp dropFilledChromPeaks(object) # S4 method for XCMSnExp spectrapply(object, FUN = NULL, BPPARAM = bpparam(), ...) # S3 method for XCMSnExp c(...) # S4 method for XCMSnExp chromPeakData(object, ...) # S4 method for XCMSnExp chromPeakData(object) <- value # S4 method for XCMSnExp,missing plot(x, y, type = c(\"spectra\", \"XIC\"), peakCol = \"#ff000060\", ...)"},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"object adjustedRtime, featureDefinitions, chromPeaks, hasAdjustedRtime, hasFeatures hasChromPeaks either MsFeatureData XCMSnExp object, methods XCMSnExp object. method character(1) defining profile matrix generation method. Allowed \"bin\", \"binlin\", \"binlinbase\" \"intlin\". See details section information. step numeric(1) representing m/z bin size. baselevel numeric(1) representing base value empty elements (.e. m/z bins without measured intensity) set. considered method = \"binlinbase\". See baseValue parameter imputeLinInterpol() details. basespace numeric(1) representing m/z length signal drop base level. Linear interpolation used consecutive data points falling within 2 * basespace . considered method = \"binlinbase\". specified, defaults 0.075. Internally parameter translated distance parameter imputeLinInterpol() function distance = floor(basespace / step). See distance parameter imputeLinInterpol() details. mzrange. Optional numeric(2) manually specifying mz value range used binnind. provided, whole m/z value range used. fileIndex processHistory: optional integer specifying index files/samples ProcessHistory objects retrieved. ... Additional parameters. msLevel integer specifying MS level(s) identified chromatographic peaks returned. bySample logical(1) specifying whether results grouped sample. value adjustedRtime<-: list (length equal number samples) numeric vectors representing adjusted retention times per scan. featureDefinitions<-: DataFrame peak grouping information. See return value featureDefinitions method expected format. chromPeaks<-: matrix information detected peaks. See return value chromPeaks method expected format. mz optional numeric(2) defining mz range chromatographic peaks returned. rt optional numeric(2) defining retention time range chromatographic peaks returned. ppm optional numeric(1) specifying ppm mz range extended. value ppm = 10, peaks within mz[1] - ppm / 1e6 mz[2] + ppm / 1e6 returned. type processHistory: restrict returned ProcessHistory objects analysis steps certain type. Use processHistoryTypes list supported values. chromPeaks: character specifying peaks return rt mz defined. type = \"\" chromatographic peaks partially overlapping range defined mz /rt returned, type = \"within\" returns peaks completely within region type = \"apex_within\" peaks peak's apex within region. isFilledColumn logical(1) whether column \"is_filled\" included returned \"matrix\" providing information peak filled . Alternatively, information provided chromPeakData data frame. adjusted logical(1) whether adjusted raw (.e. original retention times reported files) returned. BPPARAM Parameter class parallel processing. See bpparam. keepAdjustedRtime dropFeatureDefinitions,XCMSnExp: logical(1) defining whether eventually present retention time adjustment dropped. default dropping feature definitions drops retention time adjustment results . dropLastN dropFeatureDefinitions,XCMSnExp: numeric(1) defining number peak grouping related process history steps remove. default dropLastN = -1, dropping chromatographic peaks removes process history steps related peak grouping. Setting e.g. dropLastN = 1 remove recent peak grouping related process history step. param CentWaveParam, MatchedFilterParam, MassifquantParam, MSWParam CentWavePredIsoParam object settings chromatographic peak detection algorithm. return.type Character specifying type object method return. Can either \"XCMSnExp\" (default), \"list\" \"xcmsSet\". add findChromPeaks: newly identified chromatographic peaks added peak matrix already identified chromatographic peaks. default (add = FALSE) previous peak detection results removed. FUN spectrapply: function applied spectrum object. x plot: XCMSnExp object. y plot: used. peakCol plot: color used indicate identified chromatographic peaks (combination type = \"XIC\" chromatographic peaks present).","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"profMat: list profile matrix matrix (matrices fileIndex specified length(fileIndex) > 1). See profile-matrix general help information profile matrix. adjustedRtime: bySample = FALSE numeric vector adjusted retention spectrum files/samples within object. bySample = TRUE list (length equal number samples) adjusted retention times grouped sample. Returns NULL adjusted retention times present. featureDefinitions: DataFrame peak grouping information, row corresponding one mz-rt feature (grouped peaks within across samples) columns \"mzmed\" (median mz value), \"mzmin\" (minimal mz value), \"mzmax\" (maximum mz value), \"rtmed\" (median retention time), \"rtmin\" (minimal retention time), \"rtmax\" (maximal retention time) \"peakidx\". Column \"peakidx\" contains list indices chromatographic peaks (rows) matrix returned chromPeaks method belong feature group. method returns NULL feature definitions present. featureDefinitions supports also parameters mz, rt, ppm type return features within certain ranges (see description chromPeaks details). chromPeaks: bySample = FALSE matrix (row chromatographic peak, rownames representing unique IDs peaks) least following columns: \"mz\" (intensity-weighted mean mz values peak across scans/retention times), \"mzmin\" (minimal mz value), \"mzmax\" (maximal mz value), \"rt\" (retention time peak apex), \"rtmin\" (minimal retention time), \"rtmax\" (maximal retention time), \"\" (integrated, original, intensity peak), \"maxo\" (maximum intentity peak), \"sample\" (sample index peak identified) Depending employed peak detection algorithm verboseColumns parameter , additional columns might returned. parameter isFilledColumn set TRUE column named \"is_filled\" also returned. bySample = TRUE chromatographic peaks returned list matrices, containing chromatographic peaks specific sample. samples peaks detected matrix 0 rows returned. rtime: bySample = FALSE numeric vector retention times scan, bySample = TRUE list numeric vectors retention times per sample. mz: bySample = FALSE list mz values (numeric vectors) scan. bySample = TRUE list mz values per sample. intensity: bySample = FALSE list intensity values (numeric vectors) scan. bySample = TRUE list intensity values per sample. spectra: bySample = FALSE list Spectrum objects. bySample = TRUE result grouped sample, .e. list lists, element outer list list spectra specific file. processHistory: list ProcessHistory objects providing details individual data processing steps performed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":".processHistory list XProcessHistory objects tracking individual analysis steps performed. msFeatureData MsFeatureData class extending environment containing results chromatographic peak detection (element \"chromPeaks\"), peak grouping (element \"featureDefinitions\") retention time correction (element \"adjustedRtime\") steps. object manipulated directly.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"\"chromPeaks\" element msFeatureData slot equivalent @peaks slot xcmsSet object, \"featureDefinitions\" contains information @groups @groupidx slots xcmsSet object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"chromatographic-peak-data","dir":"Reference","previous_headings":"","what":"Chromatographic peak data","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"Chromatographic peak data added XCMSnExp object findChromPeaks function. Functions access chromatographic peak data : hasChromPeaks whether chromatographic peak data available, see help function. chromPeaks access chromatographic peaks (see help). dropChromPeaks remove chromatographic peaks (see help). dropFilledChromPeaks remove filled-peaks (see help). fillChromPeaks fill-missing peaks (see respective help page). plotChromPeaks plot identified peaks file (see respective help page). plotChromPeakImage plot distribution peaks along retention time axis (see respective help page). highlightChromPeaks add chromatographic peaks existing plot Chromatogram (see respective help page).","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"adjusted-retention-times","dir":"Reference","previous_headings":"","what":"Adjusted retention times","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"Adjusted retention times stored XCMSnExp object besides original, raw, retention times, allowing switch raw adjusted times. also possible replace raw retention times adjusted ones applyAdjustedRtime. adjusted retention times added XCMSnExp adjustRtime function. functions related access adjusted retention times : hasAdjustedRtime whether adjusted retention times available (see help). dropAdjustedRtime remove adjusted retention times (see help). applyAdjustedRtime replace raw retention times adjusted ones (see respective help page). plotAdjustedRtime plot differences adjusted raw retention times (see respective help page).","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"correspondence-results-features","dir":"Reference","previous_headings":"","what":"Correspondence results, features","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"correspondence analysis (groupChromPeaks) adds feature definitions XCMSnExp object. functions related listed : hasFeatures whether correspondence results available (see help). featureDefinitions access definitions features (see help). dropFeatureDefinitions remove correspondence results (see help). featureValues access values features (see respective help page). featureSummary perform simple summary defined features (see respective help page). overlappingFeatures identify features overlapping close m/z - rt space (see respective help page). quantify extract feature intensities put , along feature definitions phenodata information, SummarizedExperiment. See help page details.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"","code":"## Load a test data set with detected peaks library(MSnbase) #> Loading required package: BiocGenerics #> #> Attaching package: ‘BiocGenerics’ #> The following objects are masked from ‘package:stats’: #> #> IQR, mad, sd, var, xtabs #> The following objects are masked from ‘package:base’: #> #> Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append, #> as.data.frame, basename, cbind, colnames, dirname, do.call, #> duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted, #> lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin, #> pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply, #> union, unique, unsplit, which.max, which.min #> Loading required package: Biobase #> Welcome to Bioconductor #> #> Vignettes contain introductory material; view with #> 'browseVignettes()'. To cite Bioconductor, see #> 'citation(\"Biobase\")', and for packages 'citation(\"pkgname\")'. #> Loading required package: mzR #> Loading required package: Rcpp #> Loading required package: S4Vectors #> Loading required package: stats4 #> #> Attaching package: ‘S4Vectors’ #> The following object is masked from ‘package:utils’: #> #> findMatches #> The following objects are masked from ‘package:base’: #> #> I, expand.grid, unname #> #> This is MSnbase version 2.29.4 #> Visit https://lgatto.github.io/MSnbase/ to get started. #> Consider switching to the 'R for Mass Spectrometry' #> packages - see https://RforMassSpectrometry.org for details. #> #> Attaching package: ‘MSnbase’ #> The following object is masked from ‘package:base’: #> #> trimws data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) ## The results from the peak detection are now stored in the XCMSnExp ## object faahko_sub #> MSn experiment data (\"XCMSnExp\") #> Object size in memory: 1.22 Mb #> - - - Spectra data - - - #> MS level(s): 1 #> Number of spectra: 3834 #> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData #> rowNames: ko15.CDF ko16.CDF ko18.CDF #> varLabels: sampleNames #> varMetadata: labelDescription #> Loaded from: #> [1] ko15.CDF... [3] ko18.CDF #> Use 'fileNames(.)' to see all files. #> protocolData: none #> featureData #> featureNames: F1.S0001 F1.S0002 ... F3.S1278 (3834 total) #> fvarLabels: fileIdx spIdx ... spectrum (35 total) #> fvarMetadata: labelDescription #> experimentData: use 'experimentData(object)' #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave #> 248 peaks identified in 3 samples. #> On average 82.7 chromatographic peaks per sample. ## The detected peaks can be accessed with the chromPeaks method. head(chromPeaks(faahko_sub)) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP001 453.2 453.2 453.2 2506.073 2501.378 2527.982 1007409.0 1007380.8 38152 #> CP002 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> CP003 344.0 344.0 344.0 2679.783 2646.919 2709.517 5210015.9 5135916.9 152320 #> CP004 430.1 430.1 430.1 2681.348 2639.094 2712.647 2395840.3 2299899.6 65752 #> CP005 366.0 366.0 366.0 2679.783 2642.224 2718.907 3365174.0 3279468.3 79928 #> CP006 343.0 343.0 343.0 2678.218 2637.529 2712.647 24147443.2 23703761.7 672064 #> sn sample #> CP001 38151 1 #> CP002 46 1 #> CP003 68 1 #> CP004 42 1 #> CP005 49 1 #> CP006 87 1 ## The settings of the chromatographic peak detection can be accessed with ## the processHistory method processHistory(faahko_sub) #> [[1]] #> Object of class \"XProcessHistory\" #> type: Peak detection #> date: Thu Mar 14 11:42:34 2024 #> info: #> fileIndex: 1,2,3 #> Parameter class: CentWaveParam #> MS level(s) 1 #> ## Also the parameter class for the peak detection can be accessed processParam(processHistory(faahko_sub)[[1]]) #> Object of class: CentWaveParam #> Parameters: #> - ppm: [1] 25 #> - peakwidth: [1] 20 50 #> - snthresh: [1] 40 #> - prefilter: [1] 3 10000 #> - mzCenterFun: [1] \"wMean\" #> - integrate: [1] 1 #> - mzdiff: [1] -0.001 #> - fitgauss: [1] FALSE #> - noise: [1] 10000 #> - verboseColumns: [1] FALSE #> - roiList: list() #> - firstBaselineCheck: [1] TRUE #> - roiScales: numeric(0) #> - extendLengthMSW: [1] FALSE #> - verboseBetaColumns: [1] FALSE ## The XCMSnExp inherits all methods from the pSet and OnDiskMSnExp classes ## defined in Bioconductor's MSnbase package. To access the (raw) retention ## time for each spectrum we can use the rtime method. Setting bySample = TRUE ## would cause the retention times to be grouped by sample head(rtime(faahko_sub)) #> F1.S0001 F1.S0002 F1.S0003 F1.S0004 F1.S0005 F1.S0006 #> 2501.378 2502.943 2504.508 2506.073 2507.638 2509.203 ## Similarly it is possible to extract the mz values or the intensity values ## using the mz and intensity method, respectively, also with the option to ## return the results grouped by sample instead of the default, which is ## grouped by spectrum. Finally, to extract all of the data we can use the ## spectra method which returns Spectrum objects containing all raw data. ## Note that all these methods read the information from the original input ## files and subsequently apply eventual data processing steps to them. mzs <- mz(faahko_sub, bySample = TRUE) length(mzs) #> [1] 3 lengths(mzs) #> 1 2 3 #> 445769 440794 442516 ## The full data could also be read using the spectra data, which returns ## a list of Spectrum object containing the mz, intensity and rt values. ## spctr <- spectra(faahko_sub) ## To get all spectra of the first file we can split them by file ## head(split(spctr, fromFile(faahko_sub))[[1]]) ############ ## Filtering ## ## XCMSnExp objects can be filtered by file, retention time, mz values or ## MS level. For some of these filter preprocessing results (mostly ## retention time correction and peak grouping results) will be dropped. ## Below we filter the XCMSnExp object by file to extract the results for ## only the second file. xod_2 <- filterFile(faahko_sub, file = 2) xod_2 #> MSn experiment data (\"XCMSnExp\") #> Object size in memory: 0.48 Mb #> - - - Spectra data - - - #> MS level(s): 1 #> Number of spectra: 1278 #> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] #> Filter: select file(s) 2. [Wed Apr 3 11:59:18 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData #> rowNames: ko16.CDF #> varLabels: sampleNames #> varMetadata: labelDescription #> Loaded from: #> ko16.CDF #> protocolData: none #> featureData #> featureNames: F2.S0001 F2.S0002 ... F2.S1278 (1278 total) #> fvarLabels: fileIdx spIdx ... spectrum (35 total) #> fvarMetadata: labelDescription #> experimentData: use 'experimentData(object)' #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave #> 100 peaks identified in 1 samples. #> On average 100 chromatographic peaks per sample. ## Now the objects contains only the idenfified peaks for the second file head(chromPeaks(xod_2)) #> mz mzmin mzmax rt rtmin rtmax into intb #> CP088 384.1 384.1 384.1 2603.100 2592.145 2614.054 274906.3 274885.96 #> CP089 533.3 533.3 533.3 2686.042 2681.347 2689.172 70456.3 70450.04 #> CP090 344.0 344.0 344.0 2686.042 2648.483 2714.211 5700652.0 5574744.87 #> CP091 366.0 366.0 366.0 2686.042 2639.094 2725.166 3448376.1 3338483.07 #> CP092 343.0 343.0 343.0 2686.042 2645.353 2717.341 26229546.1 25615117.17 #> CP093 365.0 365.0 365.0 2686.042 2639.094 2726.731 15565868.0 14884380.84 #> maxo sn sample #> CP088 15187 15186 1 #> CP089 11819 11818 1 #> CP090 151744 87 1 #> CP091 77640 42 1 #> CP092 692352 68 1 #> CP093 345536 48 1 ########## ## Coercing to an xcmsSet object ## ## We can also coerce the XCMSnExp object into an xcmsSet object: xs <- as(faahko_sub, \"xcmsSet\") #> Note: you might want to set/adjust the 'sampclass' of the returned xcmSet object before proceeding with the analysis. head(peaks(xs)) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP001 453.2 453.2 453.2 2506.073 2501.378 2527.982 1007409.0 1007380.8 38152 #> CP002 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> CP003 344.0 344.0 344.0 2679.783 2646.919 2709.517 5210015.9 5135916.9 152320 #> CP004 430.1 430.1 430.1 2681.348 2639.094 2712.647 2395840.3 2299899.6 65752 #> CP005 366.0 366.0 366.0 2679.783 2642.224 2718.907 3365174.0 3279468.3 79928 #> CP006 343.0 343.0 343.0 2678.218 2637.529 2712.647 24147443.2 23703761.7 672064 #> sn sample #> CP001 38151 1 #> CP002 46 1 #> CP003 68 1 #> CP004 42 1 #> CP005 49 1 #> CP006 87 1"},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"methods listed page allow filter subset XCMSnExp objects. inherited OnDiskMSnExp object defined MSnbase package adapted XCMSnExp enable correct subsetting preprocessing results. [: subset XCMSnExp object spectra. aware removes preprocessing results, except adjusted retention times keepAdjustedRtime = TRUE passed method. [[: extracts single Spectrum object (defined MSnbase). reported retention time adjusted retention time alignment performed. filterChromPeaks: subset chromPeaks matrix object. Parameter method allows specify chromatographic peaks filtered. Currently, method = \"keep\" supported allows specify chromatographic peaks keep parameter keep (.e. provide logical, integer character defining chromatographic peaks keep). Feature definitions (present) updated correspondingly. filterFeatureDefinitions: allows subset feature definitions XCMSnExp object. Parameter features allow define features keep. can logical, integer (index features keep) character (feature IDs) vector. filterFile: allows reduce XCMSnExp data selected files. Identified chromatographic peaks files retained correspondence results (feature definitions) removed default. force keeping feature definitions use keepFeatures = TRUE. Adjusted retention times (present) retained default present. Use keepAdjustedRtime = FALSE drop . filterMsLevel: reduces XCMSnExp object spectra specified MS level(s). Chromatographic peaks identified features also subsetted respective MS level. See also filterMsLevel documentation MSnbase details examples. filterMz: filters data set based provided m/z value range. chromatographic peaks features (grouped peaks) apex falling within provided mz value range retained (.e. chromPeaks(object)[, \"mz\"] >= mz[1] <= mz[2]). Adjusted retention times, present, kept. filterRt: filters data set based provided retention time range. chromatographic peaks features (grouped peaks) within specified retention time window retained (.e. retention time corresponding peak's apex within specified rt range). retention time correction performed, method default filter object adjusted retention times. argument adjusted allows specify manually whether filtering performed raw adjusted retention times. Filtering retention time drop preprocessing results remove change alignment results (.e. adjusted retention times). method returns empty object spectrum feature within specified retention time range. split: splits XCMSnExp object list XCMSnExp objects based provided parameter f. Note default pre-processing results removed splitting, except adjusted retention times, optional argument keepAdjustedRtime = TRUE provided.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"","code":"# S4 method for XCMSnExp,ANY,ANY,ANY [(x, i, j, ..., drop = TRUE) # S4 method for XCMSnExp,ANY,ANY [[(x, i, j, drop = FALSE) # S4 method for XCMSnExp filterMsLevel(object, msLevel., keepAdjustedRtime = hasAdjustedRtime(object)) # S4 method for XCMSnExp filterFile( object, file, keepAdjustedRtime = hasAdjustedRtime(object), keepFeatures = FALSE ) # S4 method for XCMSnExp filterMz(object, mz, msLevel., ...) # S4 method for XCMSnExp filterRt(object, rt, msLevel., adjusted = hasAdjustedRtime(object)) # S4 method for XCMSnExp,ANY split(x, f, drop = FALSE, ...) # S4 method for XCMSnExp filterChromPeaks( object, keep = rep(TRUE, nrow(chromPeaks(object))), method = \"keep\", ... ) # S4 method for XCMSnExp filterFeatureDefinitions(object, features = integer())"},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"x [ [[: XCMSnExp object. [: numeric logical vector specifying spectra data set reduced. [[: single integer character. j [ [[: supported. ... Optional additional arguments. drop [ [[: supported. object XCMSnExp object. msLevel. filterMz, filterRt: numeric defining MS level(s) operations applied object subsetted. keepAdjustedRtime filterFile, filterMsLevel, [, split: logical(1) defining whether adjusted retention times kept, even e.g. features removed (retention time correction performed features). file filterFile: integer defining file index within object subset object file character specifying file names sub set. indices expected increasingly ordered, ordered internally. keepFeatures filterFile: logical(1) whether correspondence results (feature definitions) kept dropped. Defaults keepFeatures = FALSE hence feature definitions removed returned object default. mz filterMz: numeric(2) defining lower upper mz value filtering. rt filterRt: numeric(2) defining retention time window (lower upper bound) filtering. adjusted filterRt: logical indicating whether object filtered original (adjusted = FALSE) adjusted retention times (adjusted = TRUE). spectra: whether retention times individual Spectrum objects adjusted raw retention times. f split vector length equal length x defining x splitted. converted internally factor. keep filterChromPeaks: logical, integer character defining chromatographic peaks retained. method filterChromPeaks: character(1) allowing specify method chromatographic peaks filtered. Currently method = \"keep\" supported (.e. specify parameter keep chromatographic peaks retained). features filterFeatureDefinitions: either integer specifying indices features (rows) keep, logical length matching number rows featureDefinitions character feature (row) names.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"methods return XCMSnExp object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"subsetting methods try ensure returned data consistent. Correspondence results example removed default data set sub-setted file, since correspondence results dependent files correspondence performed. can changed setting keepFeatures = TRUE. adjusted retention times, subsetting methods support argument keepAdjustedRtime (even [ method) forces adjusted retention times retained even default drop .","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"filterFile method removes also process history steps related files object sub-setted updates fileIndex attribute accordingly. Also, method allow arbitrary ordering files re-ordering files within object. Note also filtering methods, also subsetting operations [ drop selected preprocessing results. consolidate alignment results, .e. ensure adjusted retention times always preserved, use applyAdjustedRtime() function object contains alignment results. replaces raw retention times adjusted ones.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"","code":"## Loading a test data set with identified chromatographic peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) ## Subset the dataset to the first and third file. xod_sub <- filterFile(faahko_sub, file = c(1, 3)) ## The number of chromatographic peaks per file for the full object table(chromPeaks(faahko_sub)[, \"sample\"]) #> #> 1 2 3 #> 87 100 61 ## The number of chromatographic peaks per file for the subset table(chromPeaks(xod_sub)[, \"sample\"]) #> #> 1 2 #> 87 61 basename(fileNames(faahko_sub)) #> [1] \"ko15.CDF\" \"ko16.CDF\" \"ko18.CDF\" basename(fileNames(xod_sub)) #> [1] \"ko15.CDF\" \"ko18.CDF\" ## Filter on mz values; chromatographic peaks and features within the ## mz range are retained (as well as adjusted retention times). xod_sub <- filterMz(faahko_sub, mz = c(300, 400)) head(chromPeaks(xod_sub)) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP002 302 302 302 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> CP003 344 344 344 2679.783 2646.919 2709.517 5210015.9 5135916.9 152320 #> CP005 366 366 366 2679.783 2642.224 2718.907 3365174.0 3279468.3 79928 #> CP006 343 343 343 2678.218 2637.529 2712.647 24147443.2 23703761.7 672064 #> CP007 365 365 365 2679.783 2634.399 2717.342 14975760.8 14525699.1 357632 #> CP009 313 313 313 2783.070 2768.985 2806.544 1744615.5 1698756.0 74080 #> sn sample #> CP002 46 1 #> CP003 68 1 #> CP005 49 1 #> CP006 87 1 #> CP007 111 1 #> CP009 44 1 nrow(chromPeaks(xod_sub)) #> [1] 89 nrow(chromPeaks(faahko_sub)) #> [1] 248 ## Filter on rt values. All chromatographic peaks and features within the ## retention time range are retained. Filtering is performed by default on ## adjusted retention times, if present. xod_sub <- filterRt(faahko_sub, rt = c(2700, 2900)) range(rtime(xod_sub)) #> [1] 2700.127 2898.877 head(chromPeaks(xod_sub)) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP008 579.1 579.1 579.1 2786.200 2765.855 2806.544 1669436.8 1642951.6 87656 #> CP009 313.0 313.0 313.0 2783.070 2768.985 2806.544 1744615.5 1698756.0 74080 #> CP010 301.0 301.0 301.0 2786.200 2765.855 2809.674 3051847.8 2958809.7 118512 #> CP011 279.0 279.0 279.0 2787.765 2764.290 2814.369 17140627.0 16526792.4 805248 #> CP012 279.1 279.1 279.1 2825.323 2820.629 2828.453 106769.4 106763.2 17760 #> CP018 453.2 453.2 453.2 2720.472 2678.218 2786.200 2987076.3 2986966.8 34208 #> sn sample #> CP008 57 1 #> CP009 44 1 #> CP010 62 1 #> CP011 45 1 #> CP012 17759 1 #> CP018 33983 1 range(chromPeaks(xod_sub)[, \"rt\"]) #> [1] 2701.693 2895.746 nrow(chromPeaks(faahko_sub)) #> [1] 248 nrow(chromPeaks(xod_sub)) #> [1] 21 ## Extract a single Spectrum faahko_sub[[4]] #> Object of class \"Spectrum1\" #> Retention time: 41:46 #> MSn level: 1 #> Total ion count: 427 #> Polarity: -1 ## Subsetting using [ removes all preprocessing results - using ## keepAdjustedRtime = TRUE would keep adjusted retention times, if present. xod_sub <- faahko_sub[fromFile(faahko_sub) == 1] #> Warning: Removed preprocessing results xod_sub #> MSn experiment data (\"XCMSnExp\") #> Object size in memory: 0.48 Mb #> - - - Spectra data - - - #> MS level(s): 1 #> Number of spectra: 1278 #> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData #> rowNames: ko15.CDF #> varLabels: sampleNames #> varMetadata: labelDescription #> Loaded from: #> ko15.CDF #> protocolData: none #> featureData #> featureNames: F1.S0001 F1.S0002 ... F1.S1278 (1278 total) #> fvarLabels: fileIdx spIdx ... spectrum (35 total) #> fvarMetadata: labelDescription #> experimentData: use 'experimentData(object)' #> - - - xcms preprocessing - - - ## Using split does also remove preprocessing results, but it supports the ## optional parameter keepAdjustedRtime. ## Split the object into a list of XCMSnExp objects, one per file xod_list <- split(faahko_sub, f = fromFile(faahko_sub)) xod_list #> $`1` #> MSn experiment data (\"XCMSnExp\") #> Object size in memory: 0.48 Mb #> - - - Spectra data - - - #> MS level(s): 1 #> Number of spectra: 1278 #> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData #> rowNames: ko15.CDF #> varLabels: sampleNames #> varMetadata: labelDescription #> Loaded from: #> ko15.CDF #> protocolData: none #> featureData #> featureNames: F1.S0001 F1.S0002 ... F1.S1278 (1278 total) #> fvarLabels: fileIdx spIdx ... spectrum (35 total) #> fvarMetadata: labelDescription #> experimentData: use 'experimentData(object)' #> - - - xcms preprocessing - - - #> #> $`2` #> MSn experiment data (\"XCMSnExp\") #> Object size in memory: 0.48 Mb #> - - - Spectra data - - - #> MS level(s): 1 #> Number of spectra: 1278 #> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData #> rowNames: ko16.CDF #> varLabels: sampleNames #> varMetadata: labelDescription #> Loaded from: #> ko16.CDF #> protocolData: none #> featureData #> featureNames: F2.S0001 F2.S0002 ... F2.S1278 (1278 total) #> fvarLabels: fileIdx spIdx ... spectrum (35 total) #> fvarMetadata: labelDescription #> experimentData: use 'experimentData(object)' #> - - - xcms preprocessing - - - #> #> $`3` #> MSn experiment data (\"XCMSnExp\") #> Object size in memory: 0.48 Mb #> - - - Spectra data - - - #> MS level(s): 1 #> Number of spectra: 1278 #> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData #> rowNames: ko18.CDF #> varLabels: sampleNames #> varMetadata: labelDescription #> Loaded from: #> ko18.CDF #> protocolData: none #> featureData #> featureNames: F3.S0001 F3.S0002 ... F3.S1278 (1278 total) #> fvarLabels: fileIdx spIdx ... spectrum (35 total) #> fvarMetadata: labelDescription #> experimentData: use 'experimentData(object)' #> - - - xcms preprocessing - - - #>"},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-inherited-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"XCMSnExp data manipulation methods inherited from MSnbase — bin,XCMSnExp-method","title":"XCMSnExp data manipulation methods inherited from MSnbase — bin,XCMSnExp-method","text":"methods listed page XCMSnExp methods inherited parent, OnDiskMSnExp class MSnbase package, alter raw data related data subsetting. Thus calling methods causes xcms pre-processing results removed XCMSnExp object ensure data integrity. bin: allows bin spectra. See bin documentation MSnbase package details examples. clean: removes unused 0 intensity data points. See clean documentation MSnbase package details examples. filterAcquisitionNum: filters XCMSnExp object keeping spectra provided acquisition numbers. See filterAcquisitionNum details examples. normalize method performs basic normalization spectra intensities. See normalize documentation MSnbase package details examples. pickPeaks method performs peak picking. See pickPeaks documentation details examples. removePeaks method removes mass peaks (intensities) lower threshold. Note peaks refer mass peaks, different chromatographic peaks detected analyzed metabolomics experiment! See removePeaks documentation details examples. smooth method smooths spectra. See smooth documentation MSnbase details examples.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-inherited-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"XCMSnExp data manipulation methods inherited from MSnbase — bin,XCMSnExp-method","text":"","code":"# S4 method for XCMSnExp bin(x, binSize = 1L, msLevel.) # S4 method for XCMSnExp clean(object, all = FALSE, verbose = FALSE, msLevel.) # S4 method for XCMSnExp filterAcquisitionNum(object, n, file) # S4 method for XCMSnExp normalize(object, method = c(\"max\", \"sum\"), ...) # S4 method for XCMSnExp pickPeaks( object, halfWindowSize = 3L, method = c(\"MAD\", \"SuperSmoother\"), SNR = 0L, ... ) # S4 method for XCMSnExp removePeaks(object, t = \"min\", verbose = FALSE, msLevel.) # S4 method for XCMSnExp smooth( x, method = c(\"SavitzkyGolay\", \"MovingAverage\"), halfWindowSize = 2L, verbose = FALSE, ... )"},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-inherited-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"XCMSnExp data manipulation methods inherited from MSnbase — bin,XCMSnExp-method","text":"x XCMSnExp OnDiskMSnExp object. binSize numeric(1) defining size bin (Dalton). msLevel. bin, clean, filterMsLevel, removePeaks: numeric(1) defining MS level(s) operations applied object subsetted. object XCMSnExp OnDiskMSnExp object. clean: logical(1), TRUE zeros removed. verbose logical(1) whether progress information displayed. n filterAcquisitionNum: integer defining acquisition numbers spectra data set sub-setted. file filterAcquisitionNum: integer defining file index within object subset object file. method normalize: character(1) specifying normalization method. See normalize MSnbase package details. pickPeaks: character(1) defining method. See pickPeaks options. smooth: character(1) defining method. See smooth MSnbase package options details. ... Optional additional arguments. halfWindowSize pickPeaks smooth: integer(1) defining window size peak picking. See pickPeaks smooth MSnbase package details options. SNR pickPeaks: numeric(1) defining signal noise ratio considered. See pickPeaks documentation details. t removePeaks: either numeric(1) \"min\" defining threshold (method) used. See removePeaks details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-inherited-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"XCMSnExp data manipulation methods inherited from MSnbase — bin,XCMSnExp-method","text":"methods: XCMSnExp object.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-inherited-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"XCMSnExp data manipulation methods inherited from MSnbase — bin,XCMSnExp-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-peak-grouping-results.html","id":null,"dir":"Reference","previous_headings":"","what":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","title":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","text":"featureValues,XCMSnExp : extract matrix feature values rows representing features columns samples. Parameter value allows define column chromPeaks matrix returned. Multiple chromatographic peaks sample can assigned feature. Parameter method allows specify method used cases chose peaks value returned. Parameter `msLevel` allows choose specific MS level feature values returned (given features defined MS level). quantify,XCMSnExp: return preprocessing results SummarizedExperiment object containing feature abundances assay matrix, feature definitions (returned featureDefinitions) rowData phenotype information colData. ideal container processing data. Internally, featureValues method used extract feature abundances, parameters method can passed quantify ....","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-peak-grouping-results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","text":"","code":"# S4 method for XCMSnExp quantify(object, ...) # S4 method for XCMSnExp featureValues( object, method = c(\"medret\", \"maxint\", \"sum\"), value = \"into\", intensity = \"into\", filled = TRUE, missing = NA, msLevel = integer() )"},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-peak-grouping-results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","text":"object XCMSnExp object providing feature definitions. ... quantify: additional parameters passed featureValues method. method character specifying method resolve multi-peak mappings within sample, .e. define representative peak feature samples one peak assigned feature. \"medret\": select peak closest median retention time feature. \"maxint\": select peak yielding largest signal. \"sum\": sum values (value \"\" \"maxo\". value character specifying name column chromPeaks(object) returned. Defaults \"\" case integrated peak area returned. get index peak chromPeaks(object) matrix use \"index\". intensity character specifying name column chromPeaks(objects) matrix containing intensity value peak used conflict resolution method = \"maxint\". filled logical(1) specifying whether values filled-peaks returned . filled = FALSE, NA returned matrix respective peak. See fillChromPeaks details peak filling. missing missing values reported. Allowed values NA (default), numeric missing = \"rowmin_half\". latter replaces NA half row's minimal (non-missing) value. msLevel `featureValues`: `integer` defining MS level(s) feature values returned. default, values features defined MS levels returned.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-peak-grouping-results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","text":"featureValues: matrix feature values, columns representing samples, rows features. order features matches order found featureDefinitions(object) DataFrame. rownames matrix featureDefinitions DataFrame. NA reported features without corresponding chromatographic peak respective sample(s). quantify: SummarizedExperiment representing preprocessing results.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-peak-grouping-results.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","text":"method equivalent groupval xcmsSet objects. Note missing = 0 used get behaviour groupval, .e. report missing values 0 call fillPeaks.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-peak-grouping-results.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Containers for chromatographic and peak detection data — XChromatograms","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"XChromatogram object allows store chromatographic data (e.g. extracted ion chromatogram) along identified chromatographic peaks within data. object inherits functions Chromatogram() object MSnbase package. Multiple XChromatogram objects can stored XChromatograms object. class extends MChromatograms() MSnbase package allows thus arrange chromatograms matrix-like structure, columns representing samples rows m/z-retention time ranges. functions described (grouped topic-related sections) Arguments section.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"","code":"XChromatograms(data, phenoData, featureData, chromPeaks, chromPeakData, ...) XChromatogram( rtime = numeric(), intensity = numeric(), mz = c(NA_real_, NA_real_), filterMz = c(NA_real_, NA_real_), precursorMz = c(NA_real_, NA_real_), productMz = c(NA_real_, NA_real_), fromFile = integer(), aggregationFun = character(), msLevel = 1L, chromPeaks, chromPeakData ) # S4 method for XChromatogram show(object) # S4 method for XChromatogram chromPeaks( object, rt = numeric(), mz = numeric(), ppm = 0, type = c(\"any\", \"within\", \"apex_within\"), msLevel ) # S4 method for XChromatogram chromPeaks(object) <- value # S4 method for XChromatogram,ANY plot( x, col = \"#00000060\", lty = 1, type = \"l\", xlab = \"retention time\", ylab = \"intensity\", main = NULL, peakType = c(\"polygon\", \"point\", \"rectangle\", \"none\"), peakCol = \"#00000060\", peakBg = \"#00000020\", peakPch = 1, ... ) # S4 method for XChromatogram filterMz(object, mz, ...) # S4 method for XChromatogram filterRt(object, rt, ...) # S4 method for XChromatogram hasChromPeaks(object) # S4 method for XChromatogram dropFilledChromPeaks(object) # S4 method for XChromatogram chromPeakData(object) # S4 method for XChromatogram chromPeakData(object) <- value # S4 method for XChromatogram,MergeNeighboringPeaksParam refineChromPeaks(object, param = MergeNeighboringPeaksParam()) # S4 method for XChromatogram filterChromPeaks(object, method = c(\"keepTop\"), ...) # S4 method for XChromatogram transformIntensity(object, FUN = identity) # S4 method for XChromatograms show(object) # S4 method for XChromatograms hasChromPeaks(object) # S4 method for XChromatograms hasFilledChromPeaks(object) # S4 method for XChromatograms chromPeaks( object, rt = numeric(), mz = numeric(), ppm = 0, type = c(\"any\", \"within\", \"apex_within\"), msLevel ) # S4 method for XChromatograms chromPeakData(object) # S4 method for XChromatograms filterMz(object, mz, ...) # S4 method for XChromatograms filterRt(object, rt, ...) # S4 method for XChromatograms,ANY plot( x, col = \"#00000060\", lty = 1, type = \"l\", xlab = \"retention time\", ylab = \"intensity\", main = NULL, peakType = c(\"polygon\", \"point\", \"rectangle\", \"none\"), peakCol = \"#00000060\", peakBg = \"#00000020\", peakPch = 1, ... ) # S4 method for XChromatograms processHistory(object, fileIndex, type) # S4 method for XChromatograms hasFeatures(object, ...) # S4 method for XChromatograms dropFeatureDefinitions(object, ...) # S4 method for XChromatograms,PeakDensityParam groupChromPeaks(object, param) # S4 method for XChromatograms featureDefinitions( object, mz = numeric(), rt = numeric(), ppm = 0, type = c(\"any\", \"within\", \"apex_within\") ) # S4 method for XChromatograms,ANY,ANY,ANY [(x, i, j, drop = TRUE) # S4 method for XChromatograms featureValues( object, method = c(\"medret\", \"maxint\", \"sum\"), value = \"into\", intensity = \"into\", missing = NA, ... ) # S4 method for XChromatograms plotChromPeakDensity( object, param, col = \"#00000060\", xlab = \"retention time\", main = NULL, peakType = c(\"polygon\", \"point\", \"rectangle\", \"none\"), peakCol = \"#00000060\", peakBg = \"#00000020\", peakPch = 1, simulate = TRUE, ... ) # S4 method for XChromatograms dropFilledChromPeaks(object) # S4 method for XChromatograms,MergeNeighboringPeaksParam refineChromPeaks(object, param = MergeNeighboringPeaksParam()) # S4 method for XChromatograms filterChromPeaks(object, method = c(\"keepTop\"), ...) # S4 method for XChromatograms transformIntensity(object, FUN = identity)"},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"data XChromatograms: list Chromatogram XChromatogram objects. phenoData XChromatograms: either data.frame, AnnotatedDataFrame NAnnotatedDataFrame describing phenotypical information samples. featureData XChromatograms: either data.frame AnnotatedDataFrame additional information row chromatograms. chromPeaks XChromatogram: matrix required columns \"rt\", \"rtmin\", \"rtmax\", \"\", \"maxo\" \"sn\". XChromatograms: list, length data, chromatographic peaks chromatogram. element matrix, ordering match order chromatograms data. chromPeakData XChromatogram: DataFrame optional additional annotations chromatographic peak. number rows match number chromatographic peaks. ... filterChromPeaks: additional parameters defining filter chromatographic peaks. See function description details. rtime XChromatogram: numeric retention times (length equal length intensity). intensity XChromatogram: numeric intensity values (length equal length rtime). mz XChromatogram: numeric(2) representing m/z value range (min, max) chromatogram created. supposed contain real range m/z values contrast filterMz . chromPeaks featureDefinitions: numeric(2) defining m/z range chromatographic peaks features returned. filterMz: numeric(2) defining m/z range chromatographic peaks retained.#' filterMz XChromatogram: numeric(2) representing m/z value range (min, max) used filter original object m/z dimension. applicable use filterMz = c(0, 0). precursorMz XChromatogram: numeric(2) SRM/MRM transitions. Represents mz precursor ion. See details information. productMz XChromatogram: numeric(2) SRM/MRM transitions. Represents mz product. See details information. fromFile XChromatogram: integer(1) index file within OnDiskMSnExp MSnExp object chromatogram extracted. aggregationFun XChromatogram: character(1) specifying function used aggregate intensity values retention time across m/z range. msLevel XChromatogram: integer MS level chromatogram extracted. chromPeaks chromPeakData: extract chromatographic peaks certain MS level. object XChromatogram XChromatograms object. rt chromPeaks featureDefinitions: numeric(2) defining retention time range chromatographic peaks features returned. filterRt: numeric(2) defining retention time range reduce object . ppm chromPeaks featureDefinitions: numeric(1) defining ppm expand provided m/z range. type chromPeaks featureDefinitions: character(1) defining peaks features return rt mz provided: \"\" (default) return peaks even partially overlapping rt, \"within\" return peaks completely within rt \"apex_within\" return peaks apex within rt. value chromPeaks<-: numeric matrix required columns \"rt\", \"rtmin\", \"rtmax\", \"\" \"maxo\". x plot: XChromatogram XChromatograms object. col plot: color used draw chromatogram. lty plot plotChromPeakDensity: line type. xlab plot plotChromPeakDensity: x axis label. ylab plot: y axis label. main plot plotChromPeakDensity: optional title plot. peakType plot plotChromPeakDensity: character(1) defining () identified chromatographic peak within chromatogram plotted. Options \"polygon\" (default): draw peak borders peakCol color fill peak area peakBg color, \"point\": indicate peak's apex point, \"rectangle\": draw rectangle around identified peak \"none\": draw peaks. peakCol plot plotChromPeakDensity: foreground color peaks. peakType = \"polygon\" peakType = \"rectangle\" color border. Use NA use foreground color. either single color vector colors length chromPeaks(x) rows. peakBg plot plotChromPeakDensity: background color peaks. peakType = \"polygon\" peakType = \"rectangle\" peak rectangle filled color. Use NA skip. either single color vector colors length chromPeaks(x) rows. peakPch plot plotChromPeakDensity: point character used peakType = \"point\". See plot() graphics package details. param groupChromPeaks plotChromPeakDensity: PeakDensityParam() object settings peak density correspondence analysis algorithm. method featureValues: character(1) specifying method resolve multi-peak mappings within sample sample, .e. select representative peak feature one peak assigned one sample. Options \"medret\" (default): select peak closest median retention time feature, \"maxint\": select peak largest signal \"sum\": sum values peaks (value \"\" \"maxo\"). filterChromPeaks: character(1) defining method used filter chromatographic peaks. See help filterChromPeaks details. FUN transformIntensity: function transform intensity values object. fileIndex processHistory: optional integer specifying index files/samples ProcessHistory objects returned. [: integer row indices subset XChromatograms object. j [: integer column indices subset XChromatograms object. drop [: logical(1) whether dimensionality dropped (possible). Defaults drop = TRUE, thus, length j 1 XChromatogram returned. Note drop ignored length j larger 1, thus XChromatograms returned. missing featureValues: missing values reported. Allowed values NA (default), numeric(1) replace NAs value missing = \"rowmin_half\" replace NAs half row's minimal (non-missing) value. simulate plotChromPeakDensity: logical(1) whether correspondence analysis simulated based available data provided PeakDensityParam() param argument. See section Correspondence analysis details.","code":"For `featureValues`: `character(1)` specifying the name of the column in `chromPeaks(object)` containing the intensity value of the peak that should be used for the `method = \"maxint\"` conflict resolution if. For `plot`: what type of plot should be used for the chromatogram (such as `\"l\"` for lines, `\"p\"` for points etc), see help of [plot()] in the `graphics` package for more details. For `processHistory`: restrict returned processing steps to specific types. Use [processHistoryTypes()] to list all supported values. For `featureValues`: `character(1)` specifying the name of the column in `chromPeaks(object)` that should be returned or `\"index\"` (default) to return the index of the peak associated with the feature in each sample. To return the integrated peak area instead of the index use `value = \"into\"`."},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"See help individual functions.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"Highlighting peak area(s) XChromatogram XChromatograms object (plot peakType = \"polygon\") draws polygon representing displayed chromatogram peak's minimal retention time maximal retention time. XChromatograms extracted XCMSnExp() object chromatogram() function might represent actual identified peak area m/z range used extract chromatogram larger peak's m/z.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"creation-of-objects","dir":"Reference","previous_headings":"","what":"Creation of objects","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"Objects can created contructor function XChromatogram XChromatograms, respectively. Also, can coerced Chromatogram MChromatograms() objects using (object, \"XChromatogram\") (object, \"XChromatograms\").","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"filtering-and-subsetting","dir":"Reference","previous_headings":"","what":"Filtering and subsetting","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"Besides classical subsetting [ specific filter operations MChromatograms() XChromatograms objects available. See filterColumnsIntensityAbove() details. [ allows subset XChromatograms object row () column (j), j type integer. featureDefinitions also subsetted accordingly peakidx column updated. filterMz filters chromatographic peaks within XChromatogram XChromatograms, column \"mz\" present chromPeaks matrix. case XChromatogram extracted XCMSnExp() object chromatogram() function. chromatographic peaks m/z within m/z range defined mz retained. Also feature definitions (present) subset accordingly. function returns filtered XChromatogram XChromatograms object. filterRt filters chromatogram(s) provided retention time range. eventually present chromatographic peaks apex within retention time range specified rt retained. Also feature definitions, present, filtered accordingly. function returns filtered XChromatogram XChromatograms object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"accessing-data","dir":"Reference","previous_headings":"","what":"Accessing data","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"See also help Chromatogram MSnbase package general information data access. methods listed specific XChromatogram XChromatograms objects. chromPeaks, chromPeaks<-: extract set matrix chromatographic peak definitions. Parameter rt allows specify retention time range peaks returned along parameter type defines overlapping defined (parameter description details). XChromatogram objects function returns matrix columns \"rt\" (retention time peak apex), \"rtmin\" (lower peak boundary), \"rtmax\" (upper peak boundary), \"\" (ingegrated peak signal/area peak), \"maxo\" (maximum instensity peak \"sn\" (signal noise ratio). Note , depending peak detection algorithm, matrix may contain additional columns. XChromatograms objects matrix contains also columns \"row\" \"column\" specifying chromatogram object peak identified. Chromatographic peaks ordered row. chromPeakData, chromPeakData<-: extract set DataFrame() optional chromatographic peak annotations. hasChromPeaks: infer whether XChromatogram (XChromatograms) chromatographic peaks. XChromatogram: returns logical(1), XChromatograms: returns matrix, dimensions object either TRUE FALSE chromatographic peaks available chromatogram respective position. hasFilledChromPeaks: whether XChromatogram (XChromatogram XChromatograms) filled-chromatographic peaks. XChromatogram: returns logical(1), XChromatograms: returns matrix, dimensions object either TRUE FALSE chromatographic peaks available chromatogram respective position. dropFilledChromPeaks: removes filled-chromatographic peaks. See dropFilledChromPeaks() help XCMSnExp() objects information. hasFeatures: XChromatograms objects : correspondence analysis performed m/z-rt feature definitions present. Returns logical(1). dropFeatureDefinitions: XChrmomatograms objects : delete correspondence analysis results (related process history). featureDefinitions: XChromatograms objects . Extract results correspondence analysis (performed groupChromPeaks). Returns DataFrame properties defined m/z-rt features: m/z retention time range. Columns peakidx row contain index chromatographic peaks chromPeaks matrix associated feature row XChromatograms object feature defined. Similar chromPeaks method possible filter returned feature matrix mz, rt ppm parameters. featureValues: XChromatograms objects . Extract abundance estimates individuals features. Note default (parameter value = \"index\" matrix indices peaks chromPeaks matrix associated feature returned. extract integrated peak area use value = \"\". function returns matrix one row per feature (featureDefinitions) column sample (.e. column object). features without peak associated certain sample NA returned. can changed missing argument function. filterChromPeaks: filters chromatographic peaks object depending parameter method method-specific parameters passed additional arguments .... Available methods : method = \"keepTop\": keep top n (default n = 1L) peaks chromatogram ordered column order (defaults order = \"maxo\"). Parameter decreasing (default decreasing = TRUE) can used order peaks descending (decreasing = TRUE) ascending ( decreasing = FALSE) order keep top n peaks largest smallest values, respectively. processHistory: returns list ProcessHistory objects representing individual performed processing steps. Optional parameters type fileIndex allow specify processing steps return.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"manipulating-data","dir":"Reference","previous_headings":"","what":"Manipulating data","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"transformIntensity: transforms intensity values chromatograms provided function FUN. See transformIntensity() MSnbase package details. XChromatogram XChromatograms addition intensity values also columns \"\" \"maxo\" object's chromPeaks matrix transformed function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"plotting-and-visualizing","dir":"Reference","previous_headings":"","what":"Plotting and visualizing","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"plot draws chromatogram highlights addition chromatographic peaks present XChromatogram XChromatograms (unless peakType = \"none\" specified). draw peaks different colors vector color definitions length equal nrow(chromPeaks(x)) submitted peakCol /peakBg defining one color peak (order peaks chromPeaks(x)). base peak chromatograms total ion chromatograms might better set peakType = \"none\" avoid generating busy plots. plotChromPeakDensity: visualize peak density-based correspondence analysis results. See section Correspondence analysis details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"chromatographic-peak-detection","dir":"Reference","previous_headings":"","what":"Chromatographic peak detection","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"See findChromPeaks-Chromatogram-CentWaveParam information. chromatographic peak detection also possible refine identified chromatographic peaks refineChromPeaks method (e.g. reduce peak detection artifacts). Currently, peak refinement using merge neighboring peaks method available (see MergeNeighboringPeaksParam() detailed description approach.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"correspondence-analysis","dir":"Reference","previous_headings":"","what":"Correspondence analysis","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"Identified chromatographic peaks XChromatograms object can grouped features groupChromPeaks function. Currently, correspondence analysis can performed peak density method (see groupChromPeaks details) specifying algorithm settings PeakDensityParam() object. correspondence analysis performed separately row XChromatograms object grouping chromatographic peaks across samples (columns). analysis results stored returned XChromatograms object can accessed featureDefinitions method returns DataFrame one row feature. Column \"row\" specifies row XChromatograms object feature identified. plotChromPeakDensity method can used visualize peak density correspondence results, simulate peak density correspondence analysis chromatographic data. resulting plot consists two panels, upper panel showing chromatographic data well identified chromatographic peaks, lower panel distribution peaks (peak density) along retention time axis. plot shows peak point peak's retention time x-axis, sample found y-axis. distribution peaks along retention time axis visualized density estimate. Grouped chromatographic peaks indicated grey shaded rectangles. Parameter simulate allows define whether correspondence analysis simulated ( simulate=TRUE, based available data provided PeakDensityParam() parameter class) (simulate=FALSE). latter assumed correspondence analysis performed peak density method object. See examples . Abundance estimates feature can extracted featureValues function using parameter value = \"\" extract integrated peak area feature. result matrix, columns samples rows features.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"","code":"## ---- Creation of XChromatograms ---- ## ## Create a XChromatograms from Chromatogram objects library(MSnbase) dta <- list(Chromatogram(rtime = 1:7, c(3, 4, 6, 12, 8, 3, 2)), Chromatogram(1:10, c(4, 6, 3, 4, 7, 13, 43, 34, 23, 9))) ## Create an XChromatograms without peak data xchrs <- XChromatograms(dta) ## Create an XChromatograms with peaks data pks <- list(matrix(c(4, 2, 5, 30, 12, NA), nrow = 1, dimnames = list(NULL, c(\"rt\", \"rtmin\", \"rtmax\", \"into\", \"maxo\", \"sn\"))), NULL) xchrs <- XChromatograms(dta, chromPeaks = pks) ## Create an XChromatograms from XChromatogram objects dta <- lapply(dta, as, \"XChromatogram\") chromPeaks(dta[[1]]) <- pks[[1]] xchrs <- XChromatograms(dta, nrow = 1) hasChromPeaks(xchrs) #> 1 2 #> 1 TRUE FALSE ## Loading a test data set with identified chromatographic peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Subset the dataset to the first and third file. xod_sub <- filterFile(faahko_sub, file = c(1, 3)) od <- as(xod_sub, \"MsExperiment\") ## Extract chromatograms for a m/z - retention time slice chrs <- chromatogram(od, mz = 344, rt = c(2500, 3500)) chrs #> MChromatograms with 1 row and 2 columns #> 1 2 #> #> [1,] length: 639 length: 639 #> phenoData with 2 variables #> featureData with 4 variables ## --------------------------------------------------- ## ## Chromatographic peak detection ## ## --------------------------------------------------- ## ## Perform peak detection using CentWave xchrs <- findChromPeaks(chrs, param = CentWaveParam()) xchrs #> XChromatograms with 1 row and 2 columns #> 1 2 #> #> [1,] peaks: 2 peaks: 1 #> phenoData with 2 variables #> featureData with 4 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave ## Do we have chromatographic peaks? hasChromPeaks(xchrs) #> 1 2 #> 1 TRUE TRUE ## Process history processHistory(xchrs) #> [[1]] #> Object of class \"XProcessHistory\" #> type: Peak detection #> date: Wed Apr 3 11:59:21 2024 #> info: #> fileIndex: 1,2 #> Parameter class: CentWaveParam #> ## The chromatographic peaks, columns \"row\" and \"column\" provide information ## in which sample the peak was identified. chromPeaks(xchrs) #> rt rtmin rtmax into intb maxo sn row column #> [1,] 2589.015 2571.801 2612.490 592297.3 554533.9 27600 14 1 1 #> [2,] 2679.783 2646.919 2709.517 5210015.9 5071346.6 152320 30 1 1 #> [3,] 2682.914 2643.790 2731.427 5255689.5 4983388.9 125632 28 1 2 ## Spectifically extract chromatographic peaks for one sample/chromatogram chromPeaks(xchrs[1, 2]) #> rt rtmin rtmax into intb maxo sn #> [1,] 2682.914 2643.79 2731.427 5255689 4983389 125632 28 ## Plot the results plot(xchrs) ## Plot the results using a different color for each sample sample_colors <- c(\"#ff000040\", \"#00ff0040\", \"#0000ff40\") cols <- sample_colors[chromPeaks(xchrs)[, \"column\"]] plot(xchrs, col = sample_colors, peakBg = cols) ## Indicate the peaks with a rectangle plot(xchrs, col = sample_colors, peakCol = cols, peakType = \"rectangle\", peakBg = NA) ## --------------------------------------------------- ## ## Correspondence analysis ## ## --------------------------------------------------- ## ## Group chromatographic peaks across samples prm <- PeakDensityParam(sampleGroup = rep(1, 2)) res <- groupChromPeaks(xchrs, param = prm) hasFeatures(res) #> [1] TRUE featureDefinitions(res) #> DataFrame with 2 rows and 10 columns #> mzmed mzmin mzmax rtmed rtmin rtmax npeaks #> #> FT1 NA NA NA 2681.35 2679.78 2682.91 2 #> FT2 NA NA NA 2589.01 2589.01 2589.01 1 #> X1 peakidx row #> #> FT1 2 2,3 1 #> FT2 1 1 1 ## Plot the correspondence results. Use simulate = FALSE to show the ## actual results. Grouped chromatographic peaks are indicated with ## grey shaded rectangles. plotChromPeakDensity(res, simulate = FALSE) ## Simulate a correspondence analysis based on different settings. Larger ## bw will increase the smoothing of the density estimate hence grouping ## chromatographic peaks that are more apart on the retention time axis. prm <- PeakDensityParam(sampleGroup = rep(1, 3), bw = 60) plotChromPeakDensity(res, param = prm) ## Delete the identified feature definitions res <- dropFeatureDefinitions(res) hasFeatures(res) #> [1] FALSE library(MSnbase) ## Create a XChromatogram object pks <- matrix(nrow = 1, ncol = 6) colnames(pks) <- c(\"rt\", \"rtmin\", \"rtmax\", \"into\", \"maxo\", \"sn\") pks[, \"rtmin\"] <- 2 pks[, \"rtmax\"] <- 9 pks[, \"rt\"] <- 4 pks[, \"maxo\"] <- 19 pks[, \"into\"] <- 93 xchr <- XChromatogram(rtime = 1:10, intensity = c(4, 8, 14, 19, 18, 12, 9, 8, 5, 2), chromPeaks = pks) xchr #> Object of class: XChromatogram #> length of object: 10 #> from file: #> mz range: [NA, NA] #> rt range: [1, 10] #> MS level: 1 #> Identified chromatographic peaks (1): #> rt\trtmin\trtmax\tinto\tmaxo\tsn #> 4\t2\t9\t93\t19\tNA ## Add arbitrary peak annotations df <- DataFrame(peak_id = c(\"a\")) xchr <- XChromatogram(rtime = 1:10, intensity = c(4, 8, 14, 19, 18, 12, 9, 8, 5, 2), chromPeaks = pks, chromPeakData = df) xchr #> Object of class: XChromatogram #> length of object: 10 #> from file: #> mz range: [NA, NA] #> rt range: [1, 10] #> MS level: 1 #> Identified chromatographic peaks (1): #> rt\trtmin\trtmax\tinto\tmaxo\tsn #> 4\t2\t9\t93\t19\tNA chromPeakData(xchr) #> DataFrame with 1 row and 3 columns #> peak_id ms_level is_filled #> #> 1 a 1 FALSE ## Extract the chromatographic peaks chromPeaks(xchr) #> rt rtmin rtmax into maxo sn #> [1,] 4 2 9 93 19 NA ## Plotting of a single XChromatogram object ## o Don't highlight chromatographic peaks plot(xchr, peakType = \"none\") ## o Indicate peaks with a polygon plot(xchr) ## Add a second peak to the data. pks <- rbind(chromPeaks(xchr), c(7, 7, 10, NA, 15, NA)) chromPeaks(xchr) <- pks ## Plot the peaks in different colors plot(xchr, peakCol = c(\"#ff000080\", \"#0000ff80\"), peakBg = c(\"#ff000020\", \"#0000ff20\")) ## Indicate the peaks as rectangles plot(xchr, peakCol = c(\"#ff000060\", \"#0000ff60\"), peakBg = NA, peakType = \"rectangle\") ## Filter the XChromatogram by retention time xchr_sub <- filterRt(xchr, rt = c(4, 6)) xchr_sub #> Object of class: XChromatogram #> length of object: 3 #> from file: #> mz range: [NA, NA] #> rt range: [4, 6] #> MS level: 1 #> Identified chromatographic peaks (1): #> rt\trtmin\trtmax\tinto\tmaxo\tsn #> 4\t2\t9\t93\t19\tNA plot(xchr_sub)"},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":null,"dir":"Reference","previous_headings":"","what":"Next Generation xcms Result Object — filterFeatureDefinitions","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"XcmsExperiment data container xcms preprocessing results (.e. results chromatographic peak detection, alignment correspondence analysis). provides functionality XCMSnExp object, uses advanced modern MS infrastructure provided MsExperiment Spectra Bioconductor packages. comes higher flexibility store data. Documentation various functions XcmsExperiment objects grouped topic provided sections . default xcms workflow perform chromatographic peak detection using findChromPeaks() optionally refine identified chromatographic peaks using refineChromPeaks() perform alignment (retention time adjustment) using adjustRtime(). Depending method used requires run correspondence analysis first perform correspondence analysis using groupChromPeaks() function group chromatographic peaks across samples define LC-MS features. optionally perform gap-filling rescue signal samples chromatographic peak identified hence missing value reported. can performed using fillChromPeaks() function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"","code":"filterFeatureDefinitions(object, ...) # S4 method for MsExperiment filterRt(object, rt = numeric(), ...) # S4 method for MsExperiment filterMzRange(object, mz = numeric(), msLevel. = uniqueMsLevels(object)) # S4 method for MsExperiment filterMz(object, mz = numeric(), msLevel. = uniqueMsLevels(object)) # S4 method for MsExperiment filterMsLevel(object, msLevel. = uniqueMsLevels(object)) # S4 method for MsExperiment uniqueMsLevels(object) # S4 method for MsExperiment filterFile(object, file = integer(), ...) # S4 method for MsExperiment rtime(object) # S4 method for MsExperiment fromFile(object) # S4 method for MsExperiment fileNames(object) # S4 method for MsExperiment polarity(object) # S4 method for MsExperiment filterIsolationWindow(object, mz = numeric()) # S4 method for MsExperiment chromatogram( object, rt = matrix(nrow = 0, ncol = 2), mz = matrix(nrow = 0, ncol = 2), aggregationFun = \"sum\", msLevel = 1L, isolationWindowTargetMz = NULL, chunkSize = 2L, return.type = \"MChromatograms\", BPPARAM = bpparam() ) featureArea( object, mzmin = min, mzmax = max, rtmin = min, rtmax = max, features = character() ) # S4 method for MsExperiment,missing plot(x, y, msLevel = 1L, peakCol = \"#ff000060\", ...) # S4 method for XcmsExperiment,ANY,ANY,ANY [(x, i, j, ..., drop = TRUE) # S4 method for XcmsExperiment filterIsolationWindow(object, mz = numeric()) # S4 method for XcmsExperiment filterRt(object, rt, msLevel.) # S4 method for XcmsExperiment filterMzRange(object, mz = numeric(), msLevel. = uniqueMsLevels(object)) # S4 method for XcmsExperiment filterMsLevel(object, msLevel. = uniqueMsLevels(object)) # S4 method for XcmsExperiment hasChromPeaks(object, msLevel = integer()) # S4 method for XcmsExperiment dropChromPeaks(object, keepAdjustedRtime = FALSE) # S4 method for XcmsExperiment chromPeaks(object) <- value # S4 method for XcmsExperiment chromPeaks( object, rt = numeric(), mz = numeric(), ppm = 0, msLevel = integer(), type = c(\"any\", \"within\", \"apex_within\"), isFilledColumn = FALSE ) # S4 method for XcmsExperiment chromPeakData(object) <- value # S4 method for XcmsExperiment chromPeakData( object, msLevel = integer(), return.type = c(\"DataFrame\", \"data.frame\") ) # S4 method for XcmsExperiment filterChromPeaks( object, keep = rep(TRUE, nrow(.chromPeaks(object))), method = \"keep\", ... ) # S4 method for XcmsExperiment dropAdjustedRtime(object) # S4 method for MsExperiment hasAdjustedRtime(object) # S4 method for XcmsExperiment rtime(object, adjusted = hasAdjustedRtime(object)) # S4 method for XcmsExperiment adjustedRtime(object) # S4 method for XcmsExperiment hasFeatures(object, msLevel = integer()) # S4 method for XcmsExperiment featureDefinitions(object) <- value # S4 method for XcmsExperiment featureDefinitions( object, mz = numeric(), rt = numeric(), ppm = 0, type = c(\"any\", \"within\", \"apex_within\"), msLevel = integer() ) # S4 method for XcmsExperiment dropFeatureDefinitions(object, keepAdjustedRtime = FALSE) # S4 method for XcmsExperiment filterFeatureDefinitions(object, features = integer()) # S4 method for XcmsExperiment hasFilledChromPeaks(object) # S4 method for XcmsExperiment dropFilledChromPeaks(object) # S4 method for XcmsExperiment quantify(object, ...) # S4 method for XcmsExperiment featureValues( object, method = c(\"medret\", \"maxint\", \"sum\"), value = \"into\", intensity = \"into\", filled = TRUE, missing = NA_real_, msLevel = integer() ) # S4 method for XcmsExperiment chromatogram( object, rt = matrix(nrow = 0, ncol = 2), mz = matrix(nrow = 0, ncol = 2), aggregationFun = \"sum\", msLevel = 1L, chunkSize = 2L, isolationWindowTargetMz = NULL, return.type = c(\"XChromatograms\", \"MChromatograms\"), include = character(), chromPeaks = c(\"apex_within\", \"any\", \"none\"), BPPARAM = bpparam() ) # S4 method for XcmsExperiment processHistory(object, type) # S4 method for XcmsExperiment filterFile( object, file, keepAdjustedRtime = hasAdjustedRtime(object), keepFeatures = FALSE, ... )"},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"object XcmsExperiment object. ... Additional optional parameters. quantify: parameter featureValues call used extract feature value matrix. rt chromPeaks featureDefinitions: numeric(2) defining retention time range chromatographic peaks features returned. full range used default. chromatogram: two column numerical matrix row representing lower upper retention time window(s) chromatograms. provided full retention time range used. mz chromPeaks featureDefinitions: numeric(2) optionally defining m/z range chromatographic peaks feature definitions returned. full m/z range used default. chromatogram: two-column numerical matrix row representing m/z range aggregated chromatogram. provided full m/z range data used (hence total ion chromatogram returned aggregationFun = \"sum\" used). filterIsolationWindow: numeric(1) defining m/z contained within spectra's isolation window. msLevel. filterRt: ignored. filterRt always filter retention times MS levels regardless parameter. chromatogram: integer MS level chromatogram(s) extracted. either length 1 length equal numer rows parameters mz rt defining m/z rt regions chromatograms created. Defaults msLevel = 1L. filterMsLevel: integer defining MS level(s) data subset. file filterFile: integer indices samples (files) data subsetted. aggregationFun chromatogram: character(1) defining function used aggregate intensities retention time (.e. spectrum) along specified m/z range (parameter mz). Defaults aggregationFun = \"sum\" hence intensities summed . Alternatively, use aggregationFun = \"max\" use maximal intensity per m/z range create base peak chromatogram (BPC). msLevel integer defining MS level (multiple MS level function supports ). isolationWindowTargetMz chromatogram: numeric (length equal number rows rt mz) isolation window target m/z MS2 spectra chromatgrom generated. MS1 data (msLevel = 1L, default), parameter ignored. See examples chromatogram information. chunkSize chromatogram: integer(1) defining number files data loaded time memory. Defaults chunkSize = 2L. return.type chromPeakData: character(1) defining class returned object. Can either \"DataFrame\" (default) \"data.frame\". chromatogram: character(1) defining type returned object. Currently return.type = \"MChromatograms\" supported. BPPARAM chromatogram: parallel processing setup. Defaults BPPARAM = bpparam(). See bpparam() information. mzmin featureArea: function calculate \"mzmin\" feature based \"mzmin\" values individual chromatographic peaks assigned feature. Defaults mzmin = min. mzmax featureArea: function calculate \"mzmax\" feature based \"mzmax\" values individual chromatographic peaks assigned feature. Defaults mzmax = max. rtmin featureArea: function calculate \"rtmin\" feature based \"rtmin\" values individual chromatographic peaks assigned feature. Defaults rtmin = min. rtmax featureArea: function calculate \"rtmax\" feature based \"rtmax\" values individual chromatographic peaks assigned feature. Defaults rtmax = max. features filterFeatureDefinitions featureArea: logical, integer character defining features keep extract feature area, respectively. See function description information. x XcmsExperiment object. y plot: defined supported. peakCol plot: defines border color rectangles indicating identified chromatographic peaks. single color supported. Defaults `peakCol = \"#ff000060\". [: integer logical defining samples/files subset. j [: supported. drop [: ignored. keepAdjustedRtime logical(1): whether adjusted retention times (present) retained. value featureValues: character(1) defining value reported feature sample. Can column chromPeaks matrix \"index\" simply index assigned peak returned. Defaults value = \"\" thus integrated peak area reported. ppm chromPeaks featureDefinitions: optional numeric(1) specifying ppm m/z range (defined mz extended. value ppm = 10, peaks within mz[1] - ppm / 1e6 mz[2] + ppm / 1e6 returned. type chromPeaks featureDefinitions either mz rt defined : character(1): defining peaks (features) returned. type = \"\": returns chromatographic peaks features also partially overlapping provided ranges. type = \"within\": returns peaks features completely within region defined mz /rt. type = \"apex_within\": returns peaks features m/z retention time peak's apex within region defined mz /rt. processHistory: restrict returned processing steps specific types. Use processHistoryTypes() list supported values. isFilledColumn chromPeaks: logical(1) whether column \"is_filled\" included returned matrix information whether peak detected filled-. Note information also provided chromPeakData data frame. keep filterChromPeaks: logical, integer character specifying chromatographic peaks keep. logical length keep needs match number rows chromPeaks. Alternatively, keep allows specify index (row) peaks keep ID (.e. row name chromPeaks). method featureValues: character(1) specifying method resolve multi-peak mappings within sample (correspondence analysis can assign one chromatographic peak within sample feature, e.g. close retention time). Options: method = \"medret\": report value chromatographic peak closest feature's median retention time. method = \"maxint\": report value chromatographic peak largest signal (parameter intensity allows select column chromPeaks used signal). method = \"sum\": sum value chromatographic peaks sample assigned feature. default method = \"medret\". filterChromPeaks: currently method = \"keep\" supported. adjusted rtime,XcmsExperiment: whether adjusted raw retention times returned. default return adjusted retention times, available. intensity featureValues: character(1) specifying name column chromPeaks(objects) matrix containing intensity value peak used conflict resolution method = \"maxint\". filled featureValues: logical(1) specifying whether values filled-peaks reported. filled = TRUE (default) filled peak values returned, otherwise NA reported respective features samples peak detected. missing featureValues: default value missing values. Allows define value reported missing peak intensity. Defaults missing = NA_real_. include chromatogram: deprecated; use parameter chromPeaks instead. chromPeaks chromatogram: character(1) defining chromatographic peaks returned. Can either chromPeaks = \"apex_within\" (default) return chromatographic peaks m/z RT apex within m/z retention time window, chromPeaks = \"\" chromatographic peaks overlapping m/z - retention time window chromPeaks = \"none\" include chromatographic peaks. See also parameter type additional information. keepFeatures subsetting functions ([, filterFile): logical(1): wheter eventually present feature definitions retained returned (filtered) object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"subsetting-and-filtering","dir":"Reference","previous_headings":"","what":"Subsetting and filtering","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"[: subset XcmsExperiment sample (parameter ). Subsetting default drop correspondence results (subsetting samples obviously affect feature definition) alignment results (adjusted retention times) identified chromatographic peaks (selected samples) retained. preprocessing results kept dropped can also configured optional parameters keepChromPeaks (default TRUE), keepAdjustedRtime (default FALSE) keepFeatures (default FALSE). filterChromPeaks: filter chromatographic peaks XcmsExperiment keeping specified parameter keep. Returns XcmsExperiment filtered data. Chromatographic peaks retain can specified either providing index chromPeaks matrix, ID (rowname chromPeaks) logical vector length number rows chromPeaks. Assignment chromatographic peaks updated eventually present feature definitions filtering. filterFeatureDefinitions: filter feature definitions XcmsExperiment keeping defined parameter features, can logical length equal number features, integer index features featureDefinitions(object) keep character feature IDs (.e. row names featureDefinitions(object)). filterFile: filter XcmsExperiment (MsExperiment) file (sample). index samples data subsetted can specified parameter file. sole purpose function provide backward compatibility MSnbase package. Wherever possible, [ function used instead sample-based subsetting. Parameters keepChromPeaks, keepAdjustedRtime keepChromPeaks can passed using .... Note also contrast [, filterFile support subsetting arbitrary order. filterIsolationWindow: filter spectra within MsExperiment XcmsExperiment object keeping isolation window containing specified m/z (.e., keeping spectra \"isolationWindowLowerMz\" smaller user-provided mz \"isolationWindowUpperMz\" larger mz). XcmsExperiment also chromatographic peaks (subsequently also features) removed range \"isolationWindowLowerMz\" \"isolationWindowUpperMz\" (columns chromPeakData) contain user provided mz. filterMsLevel: filter data XcmsExperiment MsExperiment keep data MS level(s) specified parameter msLevel.. filterMz, filterMzRange: filter spectra within XcmsExperiment MsExperiment specified m/z range (parameter mz). XcmsExperiment also identified chromatographic peaks features filtered keeping within specified m/z range (.e. m/z peak apex within m/z range). Parameter msLevels. allows restrict filtering specified MS levels. default data MS levels filtered. filterRt: filter XcmsExperiment keeping data within specified retention time range (parameter rt). function keep preprocessing results present within retention time range: identified chromatographic peaks retention time apex position within retention time range rt retained along, present, associated features. Parameter msLevel. currently ignored, .e. filtering always performed MS levels object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"functionality-related-to-chromatographic-peaks","dir":"Reference","previous_headings":"","what":"Functionality related to chromatographic peaks","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"chromatogram: extract chromatographic data data set. Parameters mz rt allow define specific m/z - retention time regions extract data (e.g. extracted ion chromatograms EICs). parameters expected numerical two-column matrices first column defining lower second upper margin. row can define separate m/z - retention time region. Currently function returns MChromatograms() object object MsExperiment , object XcmsExperiment, either MChromatograms XChromatograms() depending parameter return.type (can either \"MChromatograms\" \"XChromatograms\"). latter also chromatographic peaks detected within provided m/z retention times returned. Parameter chromPeaks allows specify chromatographic peaks reported. See documentation chromPeaks parameter information. XcmsExperiment contains correspondence results, also associated feature definitions included returned XChromatograms. default function returns chromatograms MS1 data, setting parameter msLevel = 2L possible e.g. extract also MS2 chromatograms. msLevel 1 addition important also specify isolationWindowTargetMz MS2 data extracted (e.g. SWATH data MS2 spectra created different m/z isolation windows isolationWindowTargetMz parameter allows define MS2 chromatogram extracted. Note future efficient data structures chromatographic data available well. chromPeaks: returns numeric matrix identified chromatographic peaks. row represents chromatographic peak identified one sample (file). number columns depends peak detection algorithm (see findChromPeaks()) methods return following columns: \"mz\" (intensity-weighted mean m/z values mass peaks included chromatographic peak), \"mzmin\" ( smallest m/z value mass peak chromatographic peak), \"mzmax\" (largest m/z value mass peak chromatographic peak), \"rt\" (retention time peak apex), \"rtmin\" (retention time first scan/mass peak chromatographic peak), \"rtmax\" (retention time last scan/mass peak chromatographic peak), \"\" (integrated intensity chromatographic peak), \"maxo\" (maximal intensity mass peak chromatographic peak), \"sample\" (index sample object peak identified). Parameters rt, mz, ppm, msLevel type allow extract subsets identified chromatographic peaks object. See parameter description details. chromPeakData: returns DataFrame potential additional annotations identified chromatographic peaks. row DataFrame corresponds row (index row name) chromPeaks matrix. default annotations \"ms_level\" (MS level peak identified) \"is_filled\" (whether chromatographic peak detected (findChromPeaks) filled-(fillChromPeaks). chromPeakSpectra: extract MS spectra identified chromatographic peaks. can either (full scan) MS1 spectra retention times retention time range chromatographic peak, MS2 spectra (present) retention time within retention time range (MS1) chromatographic peak precursor m/z within m/z range chromatographic peak single, selected spectra depending total signal highest signal. Parameter msLevel allows define MS level spectra extracted, parameter method allows define selected spectra returned. See chromPeakSpectra() details. dropChromPeaks: removes () chromatographic peak detection results object. also remove correspondence results (.e. features) eventually present adjusted retention times object alignment performed peak detection. Alignment results (adjusted retention times) can retained parameter keepAdjustedRtime set TRUE. dropFilledChromPeaks: removes chromatographic peaks added gap filling fillChromPeaks. fillChromPeaks: perform gap filling integrate signal missing values samples chromatographic peak found. depends correspondence results, hence groupChromPeaks needs called first. details options see fillChromPeaks(). findChromPeaks: perform chromatographic peak detection. See findChromPeaks() details. hasChromPeaks: whether object contains peak detection results. Parameter msLevel allows check whether peak detection results available specified MS level(s). hasFilledChromPeaks: whether gap-filling results (.e., filled-chromatographic peaks) present. manualChromPeaks: manually add chromatographic peaks defining m/z retention time ranges. See manualChromPeaks() details examples. plotChromPeakImage: show density identified chromatographic peaks per file along retention time. See plotChromPeakImage() details. plotChromPeaks: indicate identified chromatographic peaks one sample RT-m/z space. See plotChromPeaks() details. refineChromPeaks: refines identified chromatographic peaks object. See refineChromPeaks() details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"functionality-related-to-alignment","dir":"Reference","previous_headings":"","what":"Functionality related to alignment","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"adjustedRtime: extract adjusted retention times. just alias rtime(object, adjusted = TRUE). adjustRtime: performs retention time adjustment (alignment) data. See adjustRtime() details. applyAdjustedRtime: replaces original (raw) retention times adjusted ones. See applyAdjustedRtime() information. dropAdjustedRtime: drops alignment results (adjusted retention time) result object. also reverts retention times identified chromatographic peaks present result object. Note results correspondence analysis (.e. feature definitions) dropped (correspondence analysis performed alignment). can overruled keepAdjustedRtime = TRUE. hasAdjustedRtime: whether alignment performed object (.e., object contains alignment results). plotAdjustedRtime: plot alignment results; see plotAdjustedRtime() information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"functionality-related-to-correspondence-analysis","dir":"Reference","previous_headings":"","what":"Functionality related to correspondence analysis","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"dropFeatureDefinitions: removes correspondence analysis results object well filled-chromatographic peaks. default (parameter keepAdjustedRtime = FALSE) also alignment results removed alignment performed correspondence analysis. can overruled keepAdjustedRtime = TRUE. featureArea: returns matrix columns \"mzmin\", \"mzmax\", \"rtmin\" \"rtmax\" m/z retention time range feature (row) object. default represent minimal m/z retention times well maximal m/z retention times chromatographic peaks assigned feature. Parameter features allows extract values selected features . Parameters mzmin, mzmax, rtmin rtmax allow define function calculate reported \"mzmin\", \"mzmax\", \"rtmin\" \"rtmax\" values. featureChromatograms: extract ion chromatograms (EICs) feature object. See featureChromatograms() details. featureDefinitions: returns data.frame feature definitions empty data.frame correspondence analysis results present. Parameters msLevel, mz, ppm rt allow define subsets feature definitions returned parameter type defining parameters used subset returned data.frame. See parameter descriptions details. featureSpectra: returns Spectra() List Spectra (MS1 MS2) spectra associated feature. See featureSpectra() details available parameters. featuresSummary: calculate simple summary features. See featureSummary() details. groupChromPeaks: performs correspondence analysis (.e., grouping chromatographic peaks LC-MS features). See groupChromPeaks() details. hasFeatures: whether correspondence analysis results presentin object. optional parameter msLevel allows define MS level(s) determined feature definitions available. overlappingFeatures: identify features overlapping close m/z - rt dimension. See overlappingFeatures() information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"extracting-data-and-results-from-an-xcmsexperiment","dir":"Reference","previous_headings":"","what":"Extracting data and results from an XcmsExperiment","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"Preprocessing results can extracted using following functions: chromPeaks: extract identified chromatographic peaks. See section chromatographic peak detection details. featureDefinitions: extract definition features (chromatographic peaks grouped across samples). See section correspondence analysis details. featureValues: extract matrix values features sample (file). Rows features, columns samples. value returned can defined parameter value, can column chromPeaks matrix. default (value = \"\") integrated chromatographic peak intensities returned. parameter msLevel possible extract values features certain MS levels. correspondence analysis, one chromatographic peak per sample can assigned feature (e.g. close retention time). Parameter method allows define strategy deal cases: method = \"medret\": report value chromatographic peak apex position closest feautre's median retention time. method = \"maxint\": report value chromatographic peak largest signal (parameter intensity allows define column chromPeaks selected; defaults intensity = \"\"). method = \"sum\"`: sum values chromatographic peaks assigned feature sample. quantify: extract correspondence analysis results SummarizedExperiment(). feature values used assay returned SummarizedExperiment, rowData contains featureDefinitions (without column \"peakidx\") colData sampleData object. Additional parameters featureValues function (used extract feature value matrix) can passed via ....","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"visualization","dir":"Reference","previous_headings":"","what":"Visualization","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"plot: plot file position individual peaks m/z - retention time space (color-coded intensity) base peak chromatogram. function ideally called data subset (.e. using filterRt filterMz restrict region interest). Parameter msLevel allows define MS level plot created. x XcmsExperiment available identified chromatographic peaks, also region defining peaks indicated rectangle. Parameter peakCol allows define color border rectangles. plotAdjustedRtime: plot alignment results; see plotAdjustedRtime() information. plotChromPeakImage: show density identified chromatographic peaks per file along retention time. See plotChromPeakImage() details. plotChromPeaks: indicate identified chromatographic peaks one sample RT-m/z space. See plotChromPeaks() details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"general-functionality-and-functions-for-backward-compatibility","dir":"Reference","previous_headings":"","what":"General functionality and functions for backward compatibility","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"uniqueMsLevels: returns unique MS levels spectra object. functions listed ensure compatibility older XCMSnExp() xcms result object. fileNames: returns original data file names spectra data. Ideally, dataOrigin dataStorage spectra variables object's spectra used instead. fromFile: returns file (sample) index spectrum within object. Generally, subsetting sample using [ preferred way get spectra specific sample. polarity: returns polarity information spectrum object. processHistory: returns list ProcessHistory process history objects contain also parameter object used different processings. Optional parameter type allows query specific processing steps. rtime: extract retention times spectra MsExperiment XcmsExperiment object. thus shortcut rtime(spectra(object)) preferred way extract retention times MsExperiment. rtime method XcmsExperiment additional parameter adjusted allows define whether adjusted retention times (present - adjusted = TRUE) raw retention times (adjusted = FALSE) returned. default adjusted retention times returned available.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"differences-compared-to-the-xcmsnexp-object","dir":"Reference","previous_headings":"","what":"Differences compared to the XCMSnExp() object","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"Subsetting [ supports arbitrary ordering.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"","code":"## Creating a MsExperiment object representing the data from an LC-MS ## experiment. library(MsExperiment) ## Defining the raw data files fls <- c(system.file('cdf/KO/ko15.CDF', package = \"faahKO\"), system.file('cdf/KO/ko16.CDF', package = \"faahKO\"), system.file('cdf/KO/ko18.CDF', package = \"faahKO\")) ## Defining a data frame with the sample characterization df <- data.frame(mzML_file = basename(fls), sample = c(\"ko15\", \"ko16\", \"ko18\")) ## Importing the data. This will initialize a `Spectra` object representing ## the raw data and assign these to the individual samples. mse <- readMsExperiment(spectraFiles = fls, sampleData = df) ## Extract a total ion chromatogram and base peak chromatogram ## from the data bpc <- chromatogram(mse, aggregationFun = \"max\") tic <- chromatogram(mse) ## Plot them par(mfrow = c(2, 1)) plot(bpc, main = \"BPC\") plot(tic, main = \"TIC\") ## Extracting MS2 chromatographic data ## ## To show how MS2 chromatograms can be extracted we first load a DIA ## (SWATH) data set. mse_dia <- readMsExperiment(system.file(\"TripleTOF-SWATH\", \"PestMix1_SWATH.mzML\", package = \"msdata\")) ## Extracting MS2 chromatogram requires also to specify the isolation ## window from which to extract the data. Without that chromatograms ## will be empty: chr_ms2 <- chromatogram(mse_dia, msLevel = 2L) intensity(chr_ms2[[1L]]) #> numeric(0) ## First we list available isolation windows table(isolationWindowTargetMz(spectra(mse_dia))) #> #> 163.75 208.95 244.05 270.85 299.1 329.8 367.35 601.85 #> 1000 1000 1000 1000 1000 1000 1000 1000 ## We can then extract the TIC of MS2 data for a specific isolation window chr_ms2 <- chromatogram(mse_dia, msLevel = 2L, isolationWindowTargetMz = 244.05) plot(chr_ms2) #### ## Chromatographic peak detection ## Perform peak detection on the data using the centWave algorith. Note ## that the parameters are chosen to reduce the run time of the example. p <- CentWaveParam(noise = 10000, snthresh = 40, prefilter = c(3, 10000)) xmse <- findChromPeaks(mse, param = p) xmse #> Object of class XcmsExperiment #> Spectra: MS1 (3834) #> Experiment data: 3 sample(s) #> Sample data links: #> - spectra: 3 sample(s) to 3834 element(s). #> xcms results: #> - chromatographic peaks: 248 in MS level(s): 1 ## Have a quick look at the identified chromatographic peaks head(chromPeaks(xmse)) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP001 453.2 453.2 453.2 2506.073 2501.378 2527.982 1007409.0 1007380.8 38152 #> CP002 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> CP003 344.0 344.0 344.0 2679.783 2646.919 2709.517 5210015.9 5135916.9 152320 #> CP004 430.1 430.1 430.1 2681.348 2639.094 2712.647 2395840.3 2299899.6 65752 #> CP005 366.0 366.0 366.0 2679.783 2642.224 2718.907 3365174.0 3279468.3 79928 #> CP006 343.0 343.0 343.0 2678.218 2637.529 2712.647 24147443.2 23703761.7 672064 #> sn sample #> CP001 38151 1 #> CP002 46 1 #> CP003 68 1 #> CP004 42 1 #> CP005 49 1 #> CP006 87 1 ## Extract chromatographic peaks identified between 3000 and 3300 seconds chromPeaks(xmse, rt = c(3000, 3300), type = \"within\") #> mz mzmin mzmax rt rtmin rtmax into intb #> CP021 453.2 453.2 453.2 3063.196 3035.027 3114.840 3001594.78 3001514.97 #> CP030 361.1 361.1 361.1 3147.704 3141.444 3153.964 367361.84 362278.28 #> CP031 340.3 340.3 340.3 3230.646 3225.952 3233.776 68671.25 68664.99 #> CP032 526.2 526.2 526.2 3243.166 3238.471 3246.296 374698.56 374692.30 #> CP033 313.1 313.1 313.1 3276.030 3254.121 3290.115 1199152.63 1162839.05 #> CP034 454.1 454.1 454.1 3276.030 3261.945 3294.809 12283448.95 12024951.77 #> CP108 307.1 307.1 307.1 3143.009 3121.099 3164.918 2191519.65 2063202.03 #> CP109 278.1 278.1 278.1 3196.217 3180.568 3213.432 657840.25 651048.36 #> CP110 526.1 526.1 526.1 3179.003 3150.833 3210.302 21334966.98 21147392.01 #> CP111 380.1 380.1 380.1 3152.398 3132.054 3174.308 2201517.91 2201474.09 #> CP112 380.1 380.1 380.1 3210.302 3210.302 3216.561 187031.44 187023.61 #> CP113 380.1 380.1 380.1 3202.477 3174.308 3216.561 1156780.73 1156736.91 #> CP114 380.1 380.1 380.1 3222.821 3216.561 3240.036 485818.25 485793.21 #> CP115 286.2 286.2 286.2 3258.815 3246.296 3280.725 1264118.64 1247233.70 #> CP116 308.1 308.1 308.1 3261.945 3241.601 3285.419 2066854.37 2025917.82 #> CP204 380.1 380.1 380.1 3150.835 3128.925 3171.179 2036803.99 1937655.24 #> CP205 286.2 286.2 286.2 3250.992 3233.777 3257.252 732016.23 722185.86 #> CP206 568.2 568.2 568.2 3207.173 3185.264 3232.212 3951832.25 3866503.74 #> maxo sn sample #> CP021 53096 53095 1 #> CP030 49240 57 1 #> CP031 11391 11390 1 #> CP032 60800 60799 1 #> CP033 55392 50 1 #> CP034 554112 58 1 #> CP108 101400 43 2 #> CP109 30208 54 2 #> CP110 622144 251 2 #> CP111 95176 95175 2 #> CP112 25144 28791 2 #> CP113 28920 28919 2 #> CP114 23176 23535 2 #> CP115 67600 41 2 #> CP116 96272 78 2 #> CP204 82624 49 3 #> CP205 74824 68 3 #> CP206 164352 113 3 ## Extract ion chromatograms (EIC) for the first two chromatographic ## peaks. chrs <- chromatogram(xmse, mz = chromPeaks(xmse)[1:2, c(\"mzmin\", \"mzmax\")], rt = chromPeaks(xmse)[1:2, c(\"rtmin\", \"rtmax\")]) #> Processing chromatographic peaks ## An EIC for each sample and each of the two regions was extracted. ## Identified chromatographic peaks in the defined regions are extracted ## as well. chrs #> XChromatograms with 2 rows and 3 columns #> 1 2 3 #> #> [1,] peaks: 1 peaks: 0 peaks: 0 #> [2,] peaks: 1 peaks: 0 peaks: 0 #> phenoData with 3 variables #> featureData with 4 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave ## Plot the EICs for the second defined region plot(chrs[2, ]) ## Subsetting the data to the results (and data) for the second sample a <- xmse[2] nrow(chromPeaks(xmse)) #> [1] 248 nrow(chromPeaks(a)) #> [1] 100 ## Filtering the result by retention time: keeping all spectra and ## chromatographic peaks within 3000 and 3500 seconds. xmse_sub <- filterRt(xmse, rt = c(3000, 3500)) #> Filter spectra xmse_sub #> Object of class XcmsExperiment #> Spectra: MS1 (960) #> Experiment data: 3 sample(s) #> Sample data links: #> - spectra: 3 sample(s) to 960 element(s). #> xcms results: #> - chromatographic peaks: 79 in MS level(s): 1 nrow(chromPeaks(xmse_sub)) #> [1] 79 ## Perform an initial feature grouping to allow alignment using the ## peak groups method: pdp <- PeakDensityParam(sampleGroups = rep(1, 3)) xmse <- groupChromPeaks(xmse, param = pdp) ## Perform alignment using the peak groups method. pgp <- PeakGroupsParam(span = 0.4) xmse <- adjustRtime(xmse, param = pgp) #> Performing retention time correction using 19 peak groups. ## Visualizing the alignment results plotAdjustedRtime(xmse) ## Performing the final correspondence analysis xmse <- groupChromPeaks(xmse, param = pdp) ## Show the definition of the first 6 features featureDefinitions(xmse) |> head() #> mzmed mzmin mzmax rtmed rtmin rtmax npeaks 1 peakidx #> FT01 279.0 279.0 279.0 2789.588 2787.430 2791.746 2 2 11, 199 #> FT02 286.2 286.2 286.2 3253.923 3245.811 3262.034 2 2 115, 205 #> FT03 300.2 300.2 300.2 3385.835 3384.068 3390.895 4 3 35, 125,.... #> FT04 301.0 301.0 301.0 2789.066 2787.430 2790.180 3 3 10, 97, 198 #> FT05 305.1 305.1 305.1 2927.922 2922.158 2933.686 2 2 14, 202 #> FT06 305.1 305.1 305.1 3000.543 2991.470 3009.616 2 2 15, 203 #> ms_level #> FT01 1 #> FT02 1 #> FT03 1 #> FT04 1 #> FT05 1 #> FT06 1 ## Extract the feature values; show the results for the first 6 rows. featureValues(xmse) |> head() #> ko15.CDF ko16.CDF ko18.CDF #> FT01 17140627.0 NA 16919266.9 #> FT02 NA 1264119 732016.2 #> FT03 4700903.2 5313736 5169558.2 #> FT04 3051847.8 1964444 2774885.3 #> FT05 1070389.9 NA 1983342.5 #> FT06 847473.1 NA 1003750.6 ## The full results can also be extracted as a `SummarizedExperiment` ## that would eventually simplify subsequent analyses with other packages. ## Any additional parameters passed to the function are passed to the ## `featureValues` function that is called to generate the feature value ## matrix. se <- quantify(xmse, method = \"sum\") ## EICs for all features can be extracted with the `featureChromatograms` ## function. Note that, depending on the data set, extracting this for ## all features might take some time. Below we extract EICs for the ## first 10 features by providing the feature IDs. chrs <- featureChromatograms(xmse, features = rownames(featureDefinitions(xmse))[1:10]) chrs #> XChromatograms with 10 rows and 3 columns #> ko15.CDF ko16.CDF ko18.CDF #> #> [1,] peaks: 1 peaks: 0 peaks: 1 #> [2,] peaks: 0 peaks: 1 peaks: 1 #> ... ... ... ... #> [9,] peaks: 1 peaks: 2 peaks: 0 #> [10,] peaks: 1 peaks: 1 peaks: 1 #> phenoData with 3 variables #> featureData with 4 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave #> Correspondence: #> method: chromatographic peak density #> 10 feature(s) identified. plot(chrs[3, ])"},{"path":"https://sneumann.github.io/xcms/reference/absent-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine which peaks are absent / present in a sample class — absent-methods","title":"Determine which peaks are absent / present in a sample class — absent-methods","text":"Determine peaks absent / present sample class","code":""},{"path":"https://sneumann.github.io/xcms/reference/absent-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Determine which peaks are absent / present in a sample class — absent-methods","text":"object = \"xcmsSet\" absent(object, ...) present(object, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/absent-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine which peaks are absent / present in a sample class — absent-methods","text":"object xcmsSet-class object class Name sample class sampclass minfrac minimum fraction samples necessary class absent/present","code":""},{"path":"https://sneumann.github.io/xcms/reference/absent-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Determine which peaks are absent / present in a sample class — absent-methods","text":"Determine peaks absent / present sample class functions treat peaks present fillPeaks correctly, .e. count present.","code":""},{"path":"https://sneumann.github.io/xcms/reference/absent-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine which peaks are absent / present in a sample class — absent-methods","text":"logical vector length nrow(groups(object)).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":null,"dir":"Reference","previous_headings":"","what":"Alignment: Retention time correction methods. — adjustRtime","title":"Alignment: Retention time correction methods. — adjustRtime","text":"adjustRtime method(s) perform retention time correction (alignment) chromatograms different samples/dataset. Alignment performed default MS level 1 data. Retention times spectra MS levels, present, subsequently adjusted based adjusted retention times MS1 spectra. Note calling adjustRtime xcms result object remove eventually present previous alignment results well correspondence analysis results. run second round alignment, raw retention times need replaced adjusted ones using applyAdjustedRtime() function. alignment method can specified (configured) using dedicated param argument. Supported param objects : ObiwarpParam: performs retention time adjustment based full m/z - rt data using obiwarp method (Prince (2006)). based original code supports addition alignment multiple samples aligning center sample. alignment performed directly profile-matrix can hence performed independently peak detection peak grouping. PeakGroupsParam: performs retention time correction based alignment features defined /samples (corresponding house keeping compounds marker compounds) (Smith 2006). First retention time deviation features described fitting either polynomial (smooth = \"loess\") linear (smooth = \"linear\") function data points. subsequently used adjust retention time spectrum sample (even spectra MS levels different MS 1). Since function based features (.e. chromatographic peaks grouped across samples) initial correspondence analysis performed using groupChromPeaks() function. Alternatively, also possible manually define numeric matrix retention times markers samples used alignment. matrix can passed alignment function using peakGroupsMatrix parameter PeakGroupsParam parameter object. default adjustRtimePeakGroups function used define matrix. function identifies peak groups (features) alignment object based parameters defined param. See also do_adjustRtime_peakGroups() core API function. LamaParama: function performs retention time correction aligning chromatographic data external reference dataset (concept initial implementation Carl Brunius). process involves identifying aligning peaks within experimental chromatographic data, represented XcmsExperiment object, predefined set landmark features called \"lamas\". landmark features characterized mass--charge ratio (m/z) retention time. see LamaParama() information method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Alignment: Retention time correction methods. — adjustRtime","text":"","code":"adjustRtime(object, param, ...) # S4 method for MsExperiment,ObiwarpParam adjustRtime(object, param, chunkSize = 2L, BPPARAM = bpparam()) # S4 method for MsExperiment,PeakGroupsParam adjustRtime(object, param, msLevel = 1L, ...) PeakGroupsParam( minFraction = 0.9, extraPeaks = 1, smooth = \"loess\", span = 0.2, family = \"gaussian\", peakGroupsMatrix = matrix(nrow = 0, ncol = 0), subset = integer(), subsetAdjust = c(\"average\", \"previous\") ) ObiwarpParam( binSize = 1, centerSample = integer(), response = 1L, distFun = \"cor_opt\", gapInit = numeric(), gapExtend = numeric(), factorDiag = 2, factorGap = 1, localAlignment = FALSE, initPenalty = 0, subset = integer(), subsetAdjust = c(\"average\", \"previous\") ) adjustRtimePeakGroups(object, param = PeakGroupsParam(), msLevel = 1L) # S4 method for OnDiskMSnExp,ObiwarpParam adjustRtime(object, param, msLevel = 1L) # S4 method for PeakGroupsParam minFraction(object) # S4 method for PeakGroupsParam minFraction(object) <- value # S4 method for PeakGroupsParam extraPeaks(object) # S4 method for PeakGroupsParam extraPeaks(object) <- value # S4 method for PeakGroupsParam smooth(x) # S4 method for PeakGroupsParam smooth(object) <- value # S4 method for PeakGroupsParam span(object) # S4 method for PeakGroupsParam span(object) <- value # S4 method for PeakGroupsParam family(object) # S4 method for PeakGroupsParam family(object) <- value # S4 method for PeakGroupsParam peakGroupsMatrix(object) # S4 method for PeakGroupsParam peakGroupsMatrix(object) <- value # S4 method for PeakGroupsParam subset(x) # S4 method for PeakGroupsParam subset(object) <- value # S4 method for PeakGroupsParam subsetAdjust(object) # S4 method for PeakGroupsParam subsetAdjust(object) <- value # S4 method for ObiwarpParam binSize(object) # S4 method for ObiwarpParam binSize(object) <- value # S4 method for ObiwarpParam centerSample(object) # S4 method for ObiwarpParam centerSample(object) <- value # S4 method for ObiwarpParam response(object) # S4 method for ObiwarpParam response(object) <- value # S4 method for ObiwarpParam distFun(object) # S4 method for ObiwarpParam distFun(object) <- value # S4 method for ObiwarpParam gapInit(object) # S4 method for ObiwarpParam gapInit(object) <- value # S4 method for ObiwarpParam gapExtend(object) # S4 method for ObiwarpParam gapExtend(object) <- value # S4 method for ObiwarpParam factorDiag(object) # S4 method for ObiwarpParam factorDiag(object) <- value # S4 method for ObiwarpParam factorGap(object) # S4 method for ObiwarpParam factorGap(object) <- value # S4 method for ObiwarpParam localAlignment(object) # S4 method for ObiwarpParam localAlignment(object) <- value # S4 method for ObiwarpParam initPenalty(object) # S4 method for ObiwarpParam initPenalty(object) <- value # S4 method for ObiwarpParam subset(x) # S4 method for ObiwarpParam subset(object) <- value # S4 method for ObiwarpParam subsetAdjust(object) # S4 method for ObiwarpParam subsetAdjust(object) <- value # S4 method for XCMSnExp,PeakGroupsParam adjustRtime(object, param, msLevel = 1L) # S4 method for XCMSnExp,ObiwarpParam adjustRtime(object, param, msLevel = 1L)"},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Alignment: Retention time correction methods. — adjustRtime","text":"object adjustRtime: OnDiskMSnExp(), XCMSnExp(), MsExperiment() XcmsExperiment() object. param parameter object defining alignment method (setting). ... ignored. chunkSize adjustRtime object either MsExperiment XcmsExperiment: integer(1) defining number files (samples) loaded memory processed time. Alignment performed parallel (per sample) subset loaded data. setting thus allows balance memory demand speed (due parallel processing). parallel processing can performed subset data currently loaded memory iteration, value chunkSize match defined parallel setting setup. Using parallel processing setup using 4 CPUs (separate processes) using chunkSize = 1will perform parallel processing, data one sample loaded memory time. hand, settingchunkSize` total number samples experiment load full MS data memory thus settings cause --memory error. BPPARAM parallel processing setup. Defaults BPPARAM = bpparam(). See bpparam() details. msLevel adjustRtime: integer(1) defining MS level alignment performed. minFraction PeakGroupsParam: numeric(1) 0 1 defining minimum required proportion samples peaks peak group identified. Peak groups passing criteria aligned across samples retention times individual spectra adjusted based alignment. minFraction = 1 peak group contain peaks samples experiment. Note subset provided, specified fraction relative defined subset samples total number samples within experiment (.e., peak present specified proportion subset samples). extraPeaks PeakGroupsParam: numeric(1) defining maximal number additional peaks samples assigned peak group (feature) retention time correction. data set 6 samples, extraPeaks = 1 uses peak groups total peak count <= 6 + 1. total peak count total number peaks assigned peak group considers also multiple peaks within sample assigned group. smooth PeakGroupsParam: character(1) defining function used interpolate corrected retention times peak groups. Can either \"loess\" \"linear\". span PeakGroupsParam: numeric(1) defining degree smoothing (smooth = \"loess\"). parameter passed internal call loess(). family PeakGroupsParam: character(1) defining method loess smoothing. Allowed values \"gaussian\" \"symmetric\". See loess() information. peakGroupsMatrix PeakGroupsParam: optional matrix (raw) retention times (marker) peak groups alignment performed. column represents sample, row feature/peak group. adjustRtimePeakGroups method used default determine matrix provided object. subset ObiwarpParam PeakGroupsParam: integer indices samples within experiment alignment models estimated. Samples part subset adjusted based closest subset sample. See Subset-based alignment section details. subsetAdjust ObiwarpParam PeakGroupsParam: character(1) specifying method non-subset samples adjusted. Supported options \"previous\" \"average\" (default). See Subset-based alignment section details. binSize numeric(1) defining bin size (mz dimension) used profile matrix generation. See step parameter profile-matrix documentation details. centerSample integer(1) defining index center sample experiment. defaults floor(median(1:length(fileNames(object)))). Note subset used, index passed centerSample within subset samples. response ObiwarpParam: numeric(1) defining responsiveness warping response = 0 giving linear warping start end points response = 100 warping using bijective anchors. distFun ObiwarpParam: character(1) defining distance function used. Allowed values \"cor\" (Pearson's correlation), \"cor_opt\" (calculate 10% diagonal band distance matrix; better runtime), \"cov\" (covariance), \"prd\" (product) \"euc\" (Euclidian distance). default value distFun = \"cor_opt\". gapInit ObiwarpParam: numeric(1) defining penalty gap opening. default value depends value distFun: distFun = \"cor\" distFun = \"cor_opt\" 0.3, distFun = \"cov\" distFun = \"prd\" 0.0 distFun = \"euc\" 0.9. gapExtend ObiwarpParam: numeric(1) defining penalty gap enlargement. default value gapExtend depends value distFun: distFun = \"cor\" distFun = \"cor_opt\" 2.4, distFun = \"cov\" 11.7, distFun = \"euc\" 1.8 distFun = \"prd\" 7.8. factorDiag ObiwarpParam: numeric(1) defining local weight applied diagonal moves alignment. factorGap ObiwarpParam: numeric(1) defining local weight gap moves alignment. localAlignment ObiwarpParam: logical(1) whether local alignment performed instead default global alignment. initPenalty ObiwarpParam: numeric(1) defining penalty initiating alignment (local alignment ). value value slot. x ObiwarpParam, PeakGroupsParam LamaParama object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Alignment: Retention time correction methods. — adjustRtime","text":"adjustRtime OnDiskMSnExp XCMSnExp object return XCMSnExp object alignment results. adjustRtime MsExperiment XcmsExperiment return XcmsExperiment adjusted retention times stored new spectra variable rtime_adjusted object's spectra. ObiwarpParam, PeakGroupsParam LamaParama return respective parameter object. adjustRtimeGroups returns matrix retention times marker features sample (row one feature, row one sample).","code":""},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":"subset-based-alignment","dir":"Reference","previous_headings":"","what":"Subset-based alignment","title":"Alignment: Retention time correction methods. — adjustRtime","text":"alignment methods allow perform retention time correction user-selected subset samples (e.g. QC samples) samples part subset adjusted based adjusted retention times closest subset sample (close terms index within object hence possibly injection index). thus suggested load MS data files order samples injected measurement run(s). non-subset samples adjusted depends also parameter subsetAdjust: subsetAdjust = \"previous\", non-subset sample adjusted based closest previous subset sample results cases adjusted retention times non-subset sample identical subset sample adjustment bases. second, default, option subsetAdjust = \"average\" case non subset sample adjusted based average retention time adjustment previous following subset sample. average, weighted mean used weights inverse distance non-subset sample subset samples used alignment. See also section Alignment experiments including blanks xcms vignette details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Alignment: Retention time correction methods. — adjustRtime","text":"Prince, J. T., Marcotte, E. M. (2006) \"Chromatographic Alignment ESI-LC-MS Proteomic Data Sets Ordered Bijective Interpolated Warping\" Anal. Chem., 78 (17), 6140-6152. Smith, C.., Want, E.J., O'Maille, G., Abagyan, R. Siuzdak, G. (2006). \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 78:779-787.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Alignment: Retention time correction methods. — adjustRtime","text":"Colin Smith, Johannes Rainer, Philippine Louail, Carl Brunius","code":""},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace raw with adjusted retention times — applyAdjustedRtime","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"Replaces raw retention times adjusted retention time returns object unchanged none present.","code":""},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"","code":"applyAdjustedRtime(object)"},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"object XCMSnExp XcmsExperiment object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"XCMSnExp XcmsExperiment object raw (original) retention times replaced adjusted retention time.","code":""},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"Adjusted retention times stored parallel adjusted retention times XCMSnExp XcmsExperiment objects. applyAdjustedRtime replaces raw (original) retention times adjusted retention times.","code":""},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"Replacing raw retention times adjusted retention times disables possibility restore raw retention times using dropAdjustedRtime() method. function remove retention time processing step settings alignment processHistory() object ensure processing history preserved.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"","code":"## Load a test data set with detected peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) xod <- adjustRtime(faahko_sub, param = ObiwarpParam()) #> Sample number 2 used as center sample. #> Aligning ko15.CDF against ko16.CDF ... #> OK #> Aligning ko18.CDF against ko16.CDF ... #> OK #> Applying retention time adjustment to the identified chromatographic peaks ... #> OK hasAdjustedRtime(xod) #> [1] TRUE ## Replace raw retention times with adjusted retention times. xod <- applyAdjustedRtime(xod) ## No adjusted retention times present hasAdjustedRtime(xod) #> [1] FALSE ## Raw retention times have been replaced with adjusted retention times plot(split(rtime(faahko_sub), fromFile(faahko_sub))[[1]] - split(rtime(xod), fromFile(xod))[[1]], type = \"l\") ## And the process history still contains the settings for the alignment processHistory(xod) #> [[1]] #> Object of class \"XProcessHistory\" #> type: Peak detection #> date: Thu Mar 14 11:42:34 2024 #> info: #> fileIndex: 1,2,3 #> Parameter class: CentWaveParam #> MS level(s) 1 #> #> [[2]] #> Object of class \"XProcessHistory\" #> type: Retention time correction #> date: Wed Apr 3 11:59:33 2024 #> info: #> fileIndex: 1,2,3 #> Parameter class: ObiwarpParam #> MS level(s) 1 #>"},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":null,"dir":"Reference","previous_headings":"","what":"Aggregate values in y for bins defined on x — binYonX","title":"Aggregate values in y for bins defined on x — binYonX","text":"functions takes two -sized numeric vectors x y, bins/cuts x bins (either pre-defined number equal-sized bins bins pre-defined size) aggregates values y corresponding x values falling within bin. default (.e. method = \"max\") maximal y value corresponding x values identified. x expected incrementally sorted , , internally sorted ( case also y ordered according order x).","code":""},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Aggregate values in y for bins defined on x — binYonX","text":"","code":"binYonX( x, y, breaks, nBins, binSize, binFromX, binToX, fromIdx = 1L, toIdx = length(x), method = \"max\", baseValue, sortedX = !is.unsorted(x), shiftByHalfBinSize = FALSE, returnIndex = FALSE, returnX = TRUE )"},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Aggregate values in y for bins defined on x — binYonX","text":"x Numeric vector used binning. y Numeric vector (length x) maximum values bin defined. provided, x used. breaks Numeric vector defining breaks bins, .e. lower upper values bin. See examples . nBins integer(1) defining number desired bins. binSize numeric(1) defining desired bin size. binFromX Optional numeric(1) allowing manually specify range x-values used binning. affect calculation breaks bins (.e. nBins binSize provided). provided minimal value sub-set fromIdx-toIdx input vector x used. binToX binFromX, defining maximum x-value used binning. fromIdx Integer vector defining start position one multiple sub-sets input vector x used binning. toIdx toIdx, defining maximum index (indices) x used binning. method character string specifying method used aggregate values y. Allowed \"max\", \"min\", \"sum\" \"mean\" identify maximal minimal value sum values within bin calculate mean value. baseValue base value empty bins (.e. bins either values x fall, NA values y assigned). default (.e. specified), NA assigned bins. sortedX Whether x sorted. shiftByHalfBinSize Logical specifying whether bins shifted half bin size left. Thus, first bin center fromX lower upper boundary fromX - binSize/2 fromX + binSize/2. argument ignored breaks provided. returnIndex Logical indicating whether index max (method = \"max\") min (method = \"min\") value within bin input vector x also reported. methods \"max\" \"min\" argument ignored. returnX logical allowing avoid returning $x, .e. mid-points bins. returnX = FALSE might useful cases breaks pre-defined considerably reduces memory demand.","code":""},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Aggregate values in y for bins defined on x — binYonX","text":"Returns list length 2, first element (named \"x\") contains bin mid-points, second element (named \"y\") aggregated values input vector y within bin. returnIndex = TRUE list contains additional element \"index\" index max min (depending whether method = \"max\" method = \"min\") value within bin input vector x.","code":""},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Aggregate values in y for bins defined on x — binYonX","text":"breaks defining boundary bin can either passed directly function argument breaks, calculated data based arguments nBins binSize along fromIdx, toIdx optionally binFromX binToX. Arguments fromIdx toIdx allow specify subset(s) input vector x bins calculated. default full x vector considered. Also, specified otherwise arguments binFromX binToX , range bins within sub-sets x[fromIdx] x[toIdx]. Arguments binFromX binToX allow overwrite manually defining range breaks calculated. See examples details. Calculation breaks: nBins breaks correspond seq(min(x[fromIdx])), max(x[fromIdx], length.= (nBins + 1)). binSize breaks correspond seq(min(x[fromIdx]), max(x[toIdx]), = binSize) exception last break value forced equal max(x[toIdx]). ensures values specified range covered breaks defining bins. last bin however instances slightly larger binSize. See breaks_on_binSize breaks_on_nBins details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Aggregate values in y for bins defined on x — binYonX","text":"function ensures values within range used define breaks considered binning (assigned bin). means bins except last one values x >= xlower < xupper (xlower xupper lower upper boundary, respectively). last bin condition x >= xlower & x <= xupper. Note also shiftByHalfBinSize TRUE range values used binning expanded binSize (.e. lower boundary fromX - binSize/2, upper toX + binSize/2). Setting argument TRUE resembles binning /used profBin function xcms < 1.51. NA handling: default function ignores NA values y (thus inherently assumes na.rm = TRUE). NA values allowed x.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Aggregate values in y for bins defined on x — binYonX","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Aggregate values in y for bins defined on x — binYonX","text":"","code":"######## ## Simple example illustrating the breaks and the binning. ## ## Define breaks for 5 bins: brks <- seq(2, 12, length.out = 6) ## The first bin is then [2,4), the second [4,6) and so on. brks #> [1] 2 4 6 8 10 12 ## Get the max value falling within each bin. binYonX(x = 1:16, y = 1:16, breaks = brks) #> $x #> [1] 3 5 7 9 11 #> #> $y #> [1] 3 5 7 9 12 #> ## Thus, the largest value in x = 1:16 falling into the bin [2,4) (i.e. being ## >= 2 and < 4) is 3, the largest one falling into [4,6) is 5 and so on. ## Note however the function ensures that the minimal and maximal x-value ## (in this example 1 and 12) fall within a bin, i.e. 12 is considered for ## the last bin. ####### ## Performing the binning ons sub-set of x ## X <- 1:16 ## Bin X from element 4 to 10 into 5 bins. X[4:10] #> [1] 4 5 6 7 8 9 10 binYonX(X, X, nBins = 5L, fromIdx = 4, toIdx = 10) #> $x #> [1] 4.6 5.8 7.0 8.2 9.4 #> #> $y #> [1] 5 6 7 8 10 #> ## This defines breaks for 5 bins on the values from 4 to 10 and bins ## the values into these 5 bins. Alternatively, we could manually specify ## the range for the binning, i.e. the minimal and maximal value for the ## breaks: binYonX(X, X, nBins = 5L, fromIdx = 4, toIdx = 10, binFromX = 1, binToX = 16) #> $x #> [1] 2.5 5.5 8.5 11.5 14.5 #> #> $y #> [1] NA 6 9 10 NA #> ## In this case the breaks for 5 bins were defined from a value 1 to 16 and ## the values 4 to 10 were binned based on these breaks. ####### ## Bin values within a sub-set of x, second example ## ## This example illustrates how the fromIdx and toIdx parameters can be used. ## x defines 3 times the sequence form 1 to 10, while y is the sequence from ## 1 to 30. In this very simple example x is supposed to represent M/Z values ## from 3 consecutive scans and y the intensities measured for each M/Z in ## each scan. We want to get the maximum intensities for M/Z value bins only ## for the second scan, and thus we use fromIdx = 11 and toIdx = 20. The breaks ## for the bins are defined with the nBins, binFromX and binToX. X <- rep(1:10, 3) Y <- 1:30 ## Bin the M/Z values in the second scan into 5 bins and get the maximum ## intensity for each bin. Note that we have to specify sortedX = TRUE as ## the x and y vectors would be sorted otherwise. binYonX(X, Y, nBins = 5L, sortedX = TRUE, fromIdx = 11, toIdx = 20) #> $x #> [1] 1.9 3.7 5.5 7.3 9.1 #> #> $y #> [1] 12 14 16 18 20 #> ####### ## Bin in overlapping sub-sets of X ## ## In this example we define overlapping sub-sets of X and perform the binning ## within these. X <- 1:30 ## Define the start and end indices of the sub-sets. fIdx <- c(2, 8, 21) tIdx <- c(10, 25, 30) binYonX(X, nBins = 5L, fromIdx = fIdx, toIdx = tIdx) #> [[1]] #> [[1]]$x #> [1] 2.8 4.4 6.0 7.6 9.2 #> #> [[1]]$y #> [1] 3 5 6 8 10 #> #> #> [[2]] #> [[2]]$x #> [1] 9.7 13.1 16.5 19.9 23.3 #> #> [[2]]$y #> [1] 11 14 18 21 25 #> #> #> [[3]] #> [[3]]$x #> [1] 21.9 23.7 25.5 27.3 29.1 #> #> [[3]]$y #> [1] 22 24 26 28 30 #> #> ## The same, but pre-defining also the desired range of the bins. binYonX(X, nBins = 5L, fromIdx = fIdx, toIdx = tIdx, binFromX = 4, binToX = 28) #> [[1]] #> [[1]]$x #> [1] 6.4 11.2 16.0 20.8 25.6 #> #> [[1]]$y #> [1] 8 10 NA NA NA #> #> #> [[2]] #> [[2]]$x #> [1] 6.4 11.2 16.0 20.8 25.6 #> #> [[2]]$y #> [1] 8 13 18 23 25 #> #> #> [[3]] #> [[3]]$x #> [1] 6.4 11.2 16.0 20.8 25.6 #> #> [[3]]$y #> [1] NA NA NA 23 28 #> #> ## The same bins are thus used for each sub-set."},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"Defines breaks binSize sized bins values ranging fromX toX.","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"","code":"breaks_on_binSize(fromX, toX, binSize)"},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"fromX numeric(1) specifying lowest value bins. toX numeric(1) specifying largest value bins. binSize numeric(1) defining size bin.","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"numeric vector defining lower upper bounds bins.","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"function creates breaks bins size binSize. function ensures full data range included bins, .e. last value (upper boundary last bin) always equal toX. however means size last bin always equal desired bin size. See examples details comparisom R's seq function.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"","code":"## Define breaks with a size of 0.13 for a data range from 1 to 10: breaks_on_binSize(1, 10, 0.13) #> [1] 1.00 1.13 1.26 1.39 1.52 1.65 1.78 1.91 2.04 2.17 2.30 2.43 #> [13] 2.56 2.69 2.82 2.95 3.08 3.21 3.34 3.47 3.60 3.73 3.86 3.99 #> [25] 4.12 4.25 4.38 4.51 4.64 4.77 4.90 5.03 5.16 5.29 5.42 5.55 #> [37] 5.68 5.81 5.94 6.07 6.20 6.33 6.46 6.59 6.72 6.85 6.98 7.11 #> [49] 7.24 7.37 7.50 7.63 7.76 7.89 8.02 8.15 8.28 8.41 8.54 8.67 #> [61] 8.80 8.93 9.06 9.19 9.32 9.45 9.58 9.71 9.84 10.00 ## The size of the last bin is however larger than 0.13: diff(breaks_on_binSize(1, 10, 0.13)) #> [1] 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 #> [16] 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 #> [31] 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 #> [46] 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 #> [61] 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.16 ## If we would use seq, the max value would not be included: seq(1, 10, by = 0.13) #> [1] 1.00 1.13 1.26 1.39 1.52 1.65 1.78 1.91 2.04 2.17 2.30 2.43 2.56 2.69 2.82 #> [16] 2.95 3.08 3.21 3.34 3.47 3.60 3.73 3.86 3.99 4.12 4.25 4.38 4.51 4.64 4.77 #> [31] 4.90 5.03 5.16 5.29 5.42 5.55 5.68 5.81 5.94 6.07 6.20 6.33 6.46 6.59 6.72 #> [46] 6.85 6.98 7.11 7.24 7.37 7.50 7.63 7.76 7.89 8.02 8.15 8.28 8.41 8.54 8.67 #> [61] 8.80 8.93 9.06 9.19 9.32 9.45 9.58 9.71 9.84 9.97 ## In the next example we use binSize that leads to an additional last bin with ## a smaller binSize: breaks_on_binSize(1, 10, 0.51) #> [1] 1.00 1.51 2.02 2.53 3.04 3.55 4.06 4.57 5.08 5.59 6.10 6.61 #> [13] 7.12 7.63 8.14 8.65 9.16 9.67 10.00 ## Again, the max value is included, but the size of the last bin is < 0.51. diff(breaks_on_binSize(1, 10, 0.51)) #> [1] 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 #> [16] 0.51 0.51 0.33 ## Using just seq would result in the following bin definition: seq(1, 10, by = 0.51) #> [1] 1.00 1.51 2.02 2.53 3.04 3.55 4.06 4.57 5.08 5.59 6.10 6.61 7.12 7.63 8.14 #> [16] 8.65 9.16 9.67 ## Thus it defines one bin (break) less."},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate breaks for binning — breaks_on_nBins","title":"Generate breaks for binning — breaks_on_nBins","text":"Calculate breaks -sized bins data values fromX toX.","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate breaks for binning — breaks_on_nBins","text":"","code":"breaks_on_nBins(fromX, toX, nBins, shiftByHalfBinSize = FALSE)"},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate breaks for binning — breaks_on_nBins","text":"fromX numeric(1) specifying lowest value bins. toX numeric(1) specifying largest value bins. nBins numeric(1) defining number bins. shiftByHalfBinSize Logical indicating whether bins shifted left half bin size. results centered bins, .e. first bin centered fromX last around toX.","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate breaks for binning — breaks_on_nBins","text":"numeric vector length nBins + 1 defining lower upper bounds bins.","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate breaks for binning — breaks_on_nBins","text":"generates bins call seq(fromX, toX, length.= nBins) . first second element result vector thus defines lower upper boundary first bin, second third value second bin .","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate breaks for binning — breaks_on_nBins","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate breaks for binning — breaks_on_nBins","text":"","code":"## Create breaks to bin values from 3 to 20 into 20 bins breaks_on_nBins(3, 20, nBins = 20) #> [1] 3.00 3.85 4.70 5.55 6.40 7.25 8.10 8.95 9.80 10.65 11.50 12.35 #> [13] 13.20 14.05 14.90 15.75 16.60 17.45 18.30 19.15 20.00 ## The same call but using shiftByHalfBinSize breaks_on_nBins(3, 20, nBins = 20, shiftByHalfBinSize = TRUE) #> [1] 2.552632 3.447368 4.342105 5.236842 6.131579 7.026316 7.921053 #> [8] 8.815789 9.710526 10.605263 11.500000 12.394737 13.289474 14.184211 #> [15] 15.078947 15.973684 16.868421 17.763158 18.657895 19.552632 20.447368"},{"path":"https://sneumann.github.io/xcms/reference/c.xcmsSet.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine xcmsSet objects — c-methods","title":"Combine xcmsSet objects — c-methods","text":"Combines samples peaks multiple xcmsSet objects single object. Group retention time correction data discarded. profinfo list set equal first object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/c.xcmsSet.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Combine xcmsSet objects — c-methods","text":"xs1 = \"xcmsRaw\" c(xs1, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/c.xcmsSet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine xcmsSet objects — c-methods","text":"xs1 xcmsSet object ... xcmsSet objects","code":""},{"path":"https://sneumann.github.io/xcms/reference/c.xcmsSet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine xcmsSet objects — c-methods","text":"xcmsSet object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/c.xcmsSet.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Combine xcmsSet objects — c-methods","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":null,"dir":"Reference","previous_headings":"","what":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"Calibrate peaks using mz values known masses/calibrants. mz values identified peaks adjusted based peaks close provided mz values. See details information. isCalibrated function returns TRUE chromatographic peaks XCMSnExp object x calibrated FALSE otherwise.","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"","code":"CalibrantMassParam( mz = list(), mzabs = 1e-04, mzppm = 5, neighbors = 3, method = \"linear\" ) isCalibrated(object) # S4 method for XCMSnExp calibrate(object, param)"},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"mz numeric list numeric vectors reference mz values. numeric vector provided, used sample XCMSnExp object. list provided, length equal number samples experiment. mzabs numeric(1) absolute error/deviation matching peaks calibrants (Da). mzppm numeric(1) relative error matching peaks calibrants ppm (parts per million). neighbors integer(1) maximal number peaks within permitted distance calibrants considered. Among mz value peak largest intensity used calibration function estimation. method character(1) defining method used estimate calibration function. Can \"shift\", \"linear\" (default) \"edgeshift\". object XCMSnExp object. param CalibrantMassParam object calibration settings.","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"CalibrantMassParam: CalibrantMassParam instance. calibrate: XCMSnExp object chromatographic peaks calibrated. aware actual raw mz values (yet) calibrated, identified chromatographic peaks. CalibrantMassParam function returns instance CalibrantMassParam class settings properties set. calibrate method returns XCMSnExp object chromatographic peaks calibrated. Note detected peaks calibrated, individual mz values spectrum.","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"method first identify peaks close provided mz values , given difference calibrants smaller user provided cut (based arguments mzabs mzppm), mz values replaced provided mz values. mz values peaks either globally shifted (method = \"shift\" estimated linear model calibrants. Peaks considered close calibrant mz difference calibrant mz <= mzabs + mz * mzppm /1e6. Adjustment methods: adjustment function/factor estimated using difference calibrant peak mz values peaks close enough calibrants. availabel methods : shift: shifts m/z peak global factor corresponds average difference peak mz calibrant mz. linear: fits linear model throught differences calibrant peak mz values adjusts mz values peaks using . edgeshift: performs adjustment linear peaks within mz range calibrants shift outside . information, details examples refer xcms-direct-injection vignette.","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"CalibrantMassParam classes exported getter setter methods.","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"Joachim Bargsten, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate.html","id":null,"dir":"Reference","previous_headings":"","what":"Calibrate peaks for correcting unprecise m/z values — calibrate-methods","title":"Calibrate peaks for correcting unprecise m/z values — calibrate-methods","text":"Calibrate peaks xcmsSet via set known masses","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Calibrate peaks for correcting unprecise m/z values — calibrate-methods","text":"object = \"xcmsSet\" calibrate(object, calibrants,method=\"linear\", mzabs=0.0001, mzppm=5, neighbours=3, plotres=FALSE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calibrate peaks for correcting unprecise m/z values — calibrate-methods","text":"object xcmsSet object uncalibrated mz calibrants vector list vectors reference m/z-values method used calibrating-method, see mzppm relative error used matching peaks ppm (parts per million) mzabs absolute error used matching peaks Da neighbours number neighbours wich one highest intensity used (instead nearest) plotres can set TRUE wanted result-plot showing found m/z distances regression","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calibrate peaks for correcting unprecise m/z values — calibrate-methods","text":"object xcmsSet one ore samples calibrants sample different calibrants can used, list m/z-vectors given. length list must number samples, alternatively single vector masses can given used samples. method \"shift\" shifting m/z, \"linear\" linear regression adds linear term m/z. \"edgeshift\" linear regression within range mz-calibrants shift outside.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/chromPeakChromatograms.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract an ion chromatogram for each chromatographic peak — chromPeakChromatograms","title":"Extract an ion chromatogram for each chromatographic peak — chromPeakChromatograms","text":"Extract ion chromatogram (EIC) chromatographic peak XcmsExperiment() object. result returned XChromatograms() length equal number chromatographic peaks (one column).","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromPeakChromatograms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract an ion chromatogram for each chromatographic peak — chromPeakChromatograms","text":"","code":"chromPeakChromatograms(object, ...) # S4 method for XcmsExperiment chromPeakChromatograms( object, expandRt = 0, expandMz = 0, aggregationFun = \"max\", peaks = character(), return.type = c(\"XChromatograms\", \"MChromatograms\"), ..., progressbar = TRUE )"},{"path":"https://sneumann.github.io/xcms/reference/chromPeakChromatograms.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract an ion chromatogram for each chromatographic peak — chromPeakChromatograms","text":"object XcmsExperiment() identified chromatographic peaks. ... currently ignored. expandRt numeric(1) eventually expand retention time range signal integrated. chromatogram contain signal chromPeaks[, \"rtmin\"] - expandRt chromPeaks[, \"rtmax\"] + expandRt. default expandRt = 0. expandMz numeric(1) eventually expand m/z range signal integrated. chromatogram contain signal chromPeaks[, \"mzmin\"] - expandMz chromPeaks[, \"mzmax\"] + expandMz. default expandMz = 0. aggregationFun character(1) defining function signals within m/z range spectrum (.e. discrete retention time) aggregated. default (aggregationFun = \"max\") reports largest signal spectrum. peaks optional character providing IDs chromatographic peaks (.e. row names peaks chromPeaks(object)) chromatograms returned. return.type character(1) specifying type returned object. Can either return.type = \"XChromatograms\" (default) return.type = \"MChromatograms\" return either chromatographic object without identified chromatographic peaks, respectively. progressbar logical(1) whether progress extraction process displayed.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/chromPeakChromatograms.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract an ion chromatogram for each chromatographic peak — chromPeakChromatograms","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromPeakChromatograms.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract an ion chromatogram for each chromatographic peak — chromPeakChromatograms","text":"","code":"## Load a test data set with detected peaks library(MSnbase) library(xcms) library(MsExperiment) faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Get EICs for every detected chromatographic peak chrs <- chromPeakChromatograms(faahko_sub) chrs #> XChromatograms with 248 rows and 1 column #> 1 #> #> [1,] peaks: 1 #> [2,] peaks: 1 #> ... ... #> [247,] peaks: 1 #> [248,] peaks: 1 #> phenoData with 2 variables #> featureData with 5 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave ## Order of EICs matches the order in chromPeaks chromPeaks(faahko_sub) |> head() #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP001 453.2 453.2 453.2 2506.073 2501.378 2527.982 1007409.0 1007380.8 38152 #> CP002 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> CP003 344.0 344.0 344.0 2679.783 2646.919 2709.517 5210015.9 5135916.9 152320 #> CP004 430.1 430.1 430.1 2681.348 2639.094 2712.647 2395840.3 2299899.6 65752 #> CP005 366.0 366.0 366.0 2679.783 2642.224 2718.907 3365174.0 3279468.3 79928 #> CP006 343.0 343.0 343.0 2678.218 2637.529 2712.647 24147443.2 23703761.7 672064 #> sn sample #> CP001 38151 1 #> CP002 46 1 #> CP003 68 1 #> CP004 42 1 #> CP005 49 1 #> CP006 87 1 ## variable \"sample_index\" provides the index of the sample the EIC was ## extracted from fData(chrs)$sample_index #> [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 #> [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 #> [75] 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 #> [112] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 #> [149] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 #> [186] 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 #> [223] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 ## Get the EIC for selected peaks only. pks <- rownames(chromPeaks(faahko_sub))[c(6, 12)] pks #> [1] \"CP006\" \"CP012\" ## Expand the data on retention time dimension by 15 seconds (on each side) res <- chromPeakChromatograms(faahko_sub, peaks = pks, expandRt = 5) plot(res[1, ])"},{"path":"https://sneumann.github.io/xcms/reference/chromPeakSpectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","title":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","text":"Extract (MS1 MS2) spectra XcmsExperiment XCMSnExp object identified chromatographic peaks. return spectra selected chromatographic peaks, peak ID (.e., row name chromPeaks matrix) can provided parameter peaks. msLevel = 1L (supported return.type = \"Spectra\" return.type = \"List\") MS1 spectra within retention time boundaries (file peak detected) returned. msLevel = 2L MS2 spectra returned chromatographic peak precursor m/z within retention time m/z range chromatographic peak. Parameter method allows define whether single spectrum returned: method = \"\": (default): return spectra chromatographic peak. method = \"closest_rt\": return spectrum retention time closest peak's retention time (apex). method = \"closest_mz\": return spectrum precursor m/z closest peaks's m/z (apex); supported msLevel > 1. method = \"largest_tic\": return spectrum largest total signal (sum peaks intensities). method = \"largest_bpi\": return spectrum largest peak intensity (maximal peak intensity). method = \"signal\": object XCMSnExp: return spectrum sum intensities similar peak's apex signal (\"maxo\"); supported msLevel = 2L. Parameter return.type allows specify type result object. return.type = \"Spectra\" (default) Spectra object matching spectra returned. spectra variable \"peak_id\" returned Spectra contains ID chromatographic peak (.e., rowname peak chromPeaks matrix) spectrum. return.type = \"Spectra\" List Spectra returned. length list equal number rows chromPeaks. element list contains thus Spectra spectra one chromatographic peak (Spectra length 0 spectrum found respective chromatographic peak). See also LC-MS/MS data analysis vignette details examples.","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromPeakSpectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","text":"","code":"chromPeakSpectra(object, ...) # S4 method for XcmsExperiment chromPeakSpectra( object, method = c(\"all\", \"closest_rt\", \"closest_mz\", \"largest_tic\", \"largest_bpi\"), msLevel = 2L, expandRt = 0, expandMz = 0, ppm = 0, skipFilled = FALSE, peaks = character(), return.type = c(\"Spectra\", \"List\"), BPPARAM = bpparam() ) # S4 method for XCMSnExp chromPeakSpectra( object, msLevel = 2L, expandRt = 0, expandMz = 0, ppm = 0, method = c(\"all\", \"closest_rt\", \"closest_mz\", \"signal\", \"largest_tic\", \"largest_bpi\"), skipFilled = FALSE, return.type = c(\"Spectra\", \"MSpectra\", \"List\", \"list\"), peaks = character() )"},{"path":"https://sneumann.github.io/xcms/reference/chromPeakSpectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","text":"object XcmsExperiment XCMSnExp object identified chromatographic peaks spectra returned. ... ignored. method character(1) specifying spectra include result. Defaults method = \"\". See function description details. msLevel integer(1) defining MS level spectra returned. expandRt numeric(1) expand retention time range peak constant value side. expandMz numeric(1) expand m/z range peak constant value side. ppm numeric(1) expand m/z range peak (side) value dependent peak's m/z. skipFilled logical(1) whether spectra filled-peaks reported . peaks character, logical integer allowing specify subset chromatographic peaks chromPeaks spectra returned (providing either ID, logical vector length nrow(chromPeaks(x)) index chromPeaks(x)). parameter overrides skipFilled. return.type character(1) defining type result object returned. BPPARAM parallel processing setup. Defaults bpparam().","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromPeakSpectra.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","text":"parameter return.type allow specify type returned object: return.type = \"Spectra\" (default): Spectra object (defined Spectra package). result contains spectra peaks. Metadata column \"peak_id\" provides ID respective peak (.e. rowname chromPeaks(). return.type = \"List\": List length equal number chromatographic peaks returned, element Spectra spectra one chromatographic peak. backward compatibility options \"MSpectra\" \"list\" also supported suggested. return.type = \"MSpectra\" (deprecated): MSpectra object elements Spectrum objects. result objects contains spectra peaks. Metadata column \"peak_id\" provides ID respective peak (.e. rowname chromPeaks()). return.type = \"list\": list lists either length 0 contain Spectrum2 object(s) within m/z-rt range. length list matches number peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromPeakSpectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromPeakSpectra.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","text":"","code":"## Read a file with DDA LC-MS/MS data library(MsExperiment) fl <- system.file(\"TripleTOF-SWATH/PestMix1_DDA.mzML\", package = \"msdata\") dda <- readMsExperiment(fl) ## Perform MS1 peak detection dda <- findChromPeaks(dda, CentWaveParam(peakwidth = c(5, 15), prefilter = c(5, 1000))) ## Return all MS2 spectro for each chromatographic peaks as a Spectra object ms2_sps <- chromPeakSpectra(dda) ms2_sps #> MSn data (Spectra) with 93 spectra in a MsBackendMzR backend: #> msLevel rtime scanIndex #> #> 1 2 237.460 1810 #> 2 2 237.869 1812 #> 3 2 240.759 1842 #> 4 2 241.299 1846 #> 5 2 318.444 2391 #> ... ... ... ... #> 89 2 552.147 4948 #> 90 2 570.506 5077 #> 91 2 574.435 5108 #> 92 2 574.725 5110 #> 93 2 575.255 5115 #> ... 34 more variables/columns. #> #> file(s): #> PestMix1_DDA.mzML #> Processing: #> Filter: select MS level(s) 2 [Wed Apr 3 11:59:40 2024] #> Merge 1 Spectra into one [Wed Apr 3 11:59:40 2024] ## spectra variable *peak_id* contain the row names of the peaks in the ## chromPeak matrix and allow thus to map chromatographic peaks to the ## returned MS2 spectra ms2_sps$peak_id #> [1] \"CP01\" \"CP01\" \"CP01\" \"CP01\" \"CP02\" \"CP03\" \"CP03\" \"CP03\" \"CP03\" \"CP04\" #> [11] \"CP04\" \"CP04\" \"CP04\" \"CP06\" \"CP06\" \"CP06\" \"CP06\" \"CP06\" \"CP06\" \"CP07\" #> [21] \"CP07\" \"CP07\" \"CP07\" \"CP07\" \"CP07\" \"CP07\" \"CP08\" \"CP08\" \"CP09\" \"CP09\" #> [31] \"CP10\" \"CP10\" \"CP11\" \"CP11\" \"CP11\" \"CP11\" \"CP11\" \"CP12\" \"CP12\" \"CP12\" #> [41] \"CP12\" \"CP12\" \"CP12\" \"CP13\" \"CP13\" \"CP13\" \"CP13\" \"CP13\" \"CP14\" \"CP14\" #> [51] \"CP14\" \"CP15\" \"CP15\" \"CP15\" \"CP15\" \"CP15\" \"CP15\" \"CP17\" \"CP17\" \"CP17\" #> [61] \"CP17\" \"CP17\" \"CP18\" \"CP18\" \"CP18\" \"CP18\" \"CP18\" \"CP19\" \"CP19\" \"CP19\" #> [71] \"CP19\" \"CP19\" \"CP19\" \"CP20\" \"CP20\" \"CP20\" \"CP21\" \"CP21\" \"CP21\" \"CP22\" #> [81] \"CP22\" \"CP22\" \"CP23\" \"CP23\" \"CP23\" \"CP23\" \"CP25\" \"CP25\" \"CP25\" \"CP27\" #> [91] \"CP27\" \"CP27\" \"CP27\" chromPeaks(dda) #> mz mzmin mzmax rt rtmin rtmax into intb #> CP01 219.0961 219.0933 219.0996 240.897 233.595 247.874 15236.49207 15222.54500 #> CP02 219.0947 219.0926 219.0963 319.236 311.979 324.874 76.97947 63.82131 #> CP03 227.9913 227.9902 227.9921 358.349 351.649 367.218 5511.96730 5496.32244 #> CP04 300.0312 300.0289 300.0321 366.568 360.029 375.738 12659.45398 12643.63044 #> CP05 302.0284 302.0273 302.0295 366.568 360.449 375.738 7953.70018 7938.19680 #> CP06 256.1102 256.1095 256.1109 388.167 379.097 397.326 7879.79234 7861.19876 #> CP07 224.0836 224.0831 224.0843 388.587 379.517 397.446 8904.69865 8886.41107 #> CP08 309.9980 309.9962 309.9987 405.715 399.527 415.525 5381.59741 5365.38152 #> CP09 378.0356 378.0341 378.0364 405.715 399.527 415.525 5117.90702 5101.66617 #> CP10 298.2751 298.2739 298.2781 345.711 339.830 354.979 39574.83769 39559.51278 #> CP11 308.0012 307.9983 308.0018 405.715 399.527 415.525 5630.65430 5614.25375 #> CP12 376.0385 376.0359 376.0391 405.715 399.527 415.525 5198.61440 5182.23188 #> CP13 292.1216 292.1204 292.1223 410.555 403.625 420.035 15783.11419 15766.32540 #> CP14 289.1217 289.1202 289.1229 425.434 415.525 433.478 10049.05516 10031.22736 #> CP15 304.1141 304.1119 304.1192 424.614 417.985 434.313 14704.14891 14687.51150 #> CP16 384.9700 384.9684 384.9706 440.533 433.893 449.312 8075.24022 8059.47631 #> CP17 382.9727 382.9715 382.9739 440.533 433.478 449.312 8307.76833 8291.81980 #> CP18 231.0144 231.0134 231.0151 450.992 444.342 460.691 5612.28545 5595.90874 #> CP19 306.1659 306.1624 306.1694 463.786 453.922 471.431 31273.95023 31256.40745 #> CP20 205.0970 205.0956 205.0976 459.421 453.092 466.461 5609.65542 5596.09130 #> CP21 230.9875 230.9862 230.9879 495.109 486.210 502.807 8036.59181 8019.64904 #> CP22 216.1414 216.1398 216.1418 508.678 502.680 516.408 4406.91863 4392.98419 #> CP23 330.2065 330.2008 330.2078 422.514 416.754 431.858 614.91821 599.73617 #> CP24 330.2059 330.2036 330.2081 474.408 460.261 479.107 248.31997 229.20853 #> CP25 330.2067 330.2054 330.2077 552.815 541.355 561.837 5890.30116 5869.52232 #> CP26 330.2057 330.2038 330.2076 505.738 495.519 515.868 315.87230 295.17246 #> CP27 373.0416 373.0406 373.0430 576.468 569.174 580.636 6184.87790 6173.40597 #> maxo sn sample #> CP01 4877.11621 4876 1 #> CP02 19.35541 18 1 #> CP03 1459.38428 1458 1 #> CP04 3156.89258 3156 1 #> CP05 1974.66846 1974 1 #> CP06 1836.12695 1835 1 #> CP07 2268.62915 2268 1 #> CP08 1345.32336 1344 1 #> CP09 1300.64075 1300 1 #> CP10 8060.13037 8059 1 #> CP11 1450.15808 1449 1 #> CP12 1350.63330 1350 1 #> CP13 3203.84229 3203 1 #> CP14 2972.63916 2972 1 #> CP15 5009.70654 5009 1 #> CP16 2224.37622 2223 1 #> CP17 2361.33594 2360 1 #> CP18 1671.33203 1670 1 #> CP19 6300.43652 6299 1 #> CP20 1717.72607 1717 1 #> CP21 2244.02979 2243 1 #> CP22 1576.85681 1576 1 #> CP23 135.81871 135 1 #> CP24 19.64630 19 1 #> CP25 2102.92871 2102 1 #> CP26 27.88095 27 1 #> CP27 2511.13501 2510 1 ## Alternatively, return the result as a List of Spectra objects. This list ## is parallel to chromPeaks hence the mapping between chromatographic peaks ## and MS2 spectra is easier. ms2_sps <- chromPeakSpectra(dda, return.type = \"List\") names(ms2_sps) #> [1] \"CP01\" \"CP02\" \"CP03\" \"CP04\" \"CP05\" \"CP06\" \"CP07\" \"CP08\" \"CP09\" \"CP10\" #> [11] \"CP11\" \"CP12\" \"CP13\" \"CP14\" \"CP15\" \"CP16\" \"CP17\" \"CP18\" \"CP19\" \"CP20\" #> [21] \"CP21\" \"CP22\" \"CP23\" \"CP24\" \"CP25\" \"CP26\" \"CP27\" rownames(chromPeaks(dda)) #> [1] \"CP01\" \"CP02\" \"CP03\" \"CP04\" \"CP05\" \"CP06\" \"CP07\" \"CP08\" \"CP09\" \"CP10\" #> [11] \"CP11\" \"CP12\" \"CP13\" \"CP14\" \"CP15\" \"CP16\" \"CP17\" \"CP18\" \"CP19\" \"CP20\" #> [21] \"CP21\" \"CP22\" \"CP23\" \"CP24\" \"CP25\" \"CP26\" \"CP27\" ms2_sps[[1L]] #> MSn data (Spectra) with 4 spectra in a MsBackendMzR backend: #> msLevel rtime scanIndex #> #> 1 2 237.460 1810 #> 2 2 237.869 1812 #> 3 2 240.759 1842 #> 4 2 241.299 1846 #> ... 34 more variables/columns. #> #> file(s): #> PestMix1_DDA.mzML #> Processing: #> Filter: select MS level(s) 2 [Wed Apr 3 11:59:40 2024] #> Merge 1 Spectra into one [Wed Apr 3 11:59:41 2024] ## Parameter `msLevel` allows to define from which MS level spectra should ## be returned. By default `msLevel = 2L` but with `msLevel = 1L` all ## MS1 spectra with a retention time within the retention time range of ## a chromatographic peak can be returned. Alternatively, selected ## spectra can be returned by specifying the selection criteria/method ## with the `method` parameter. Below we extract for each chromatographic ## peak the MS1 spectra with a retention time closest to the ## chromatographic peak's apex position. Alternatively it would also be ## possible to select the spectrum with the highest total signal or ## highest (maximal) intensity. ms1_sps <- chromPeakSpectra(dda, msLevel = 1L, method = \"closest_rt\") ms1_sps #> MSn data (Spectra) with 27 spectra in a MsBackendMzR backend: #> msLevel rtime scanIndex #> #> 1 1 240.897 1843 #> 2 1 319.236 2396 #> 3 1 358.349 2813 #> 4 1 366.568 2924 #> 5 1 366.568 2924 #> ... ... ... ... #> 23 1 422.514 3571 #> 24 1 474.408 4266 #> 25 1 552.815 4958 #> 26 1 505.738 4549 #> 27 1 576.468 5122 #> ... 34 more variables/columns. #> #> file(s): #> PestMix1_DDA.mzML #> Processing: #> Filter: select MS level(s) 1 [Wed Apr 3 11:59:41 2024] #> Merge 1 Spectra into one [Wed Apr 3 11:59:41 2024] ## Parameter peaks would allow to extract spectra for specific peaks only. ## Peaks can be defined with parameter `peaks` which can be either an ## `integer` with the index of the peak in the `chromPeaks` matrix or a ## `character` with its rowname in `chromPeaks`. chromPeakSpectra(dda, msLevel = 1L, method = \"closest_rt\", peaks = c(3, 5))"},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Extracting chromatograms — chromatogram,XCMSnExp-method","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"chromatogram: extract chromatographic data (extracted ion chromatogram, base peak chromatogram total ion chromatogram) OnDiskMSnExp XCMSnExp objects. See also help page chromatogram function MSnbase package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"","code":"# S4 method for XCMSnExp chromatogram( object, rt, mz, aggregationFun = \"sum\", missing = NA_real_, msLevel = 1L, BPPARAM = bpparam(), adjustedRtime = hasAdjustedRtime(object), filled = FALSE, include = c(\"apex_within\", \"any\", \"none\"), ... )"},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"object Either OnDiskMSnExp XCMSnExp object chromatograms extracted. rt numeric(2) two-column matrix defining lower upper boundary retention time range(s). specified, full retention time range original data used. mz numeric(2) two-column matrix defining lower upper mz value MS data slice(s). specified, chromatograms calculated full mz range. aggregationFun character(1) specifying function used aggregate intensity values across mz value range retention time. Allowed values \"sum\" (default), \"max\", \"mean\" \"min\". missing numeric(1) allowing specify intensity value used given retention time signal measured within mz range corresponding scan. Defaults NA_real_ (see also Details Notes sections ). Use missing = 0 resemble behaviour getEIC old user interface. msLevel integer(1) specifying MS level chromatogram extracted. Defaults msLevel = 1L. BPPARAM Parallelisation backend used, depend architecture. Default BiocParallel::bparam(). adjustedRtime chromatogram,XCMSnExp: whether adjusted (adjustedRtime = TRUE) raw retention times (adjustedRtime = FALSE) used filtering returned resulting MChromatograms object. Adjusted retention times used default available. filled logical(1) whether filled-peaks also returned. Defaults filled = FALSE, .e. returns detected chromatographic peaks result object. include character(1) defining chromatographic peaks returned. Supported include = \"apex_within\" (default) returns chromatographic peaks apex within mz rt range, include = \"\" return chromatographic peaks m/z rt ranges overlap mz rt include = \"none\" include chromatographic peaks. ... optional parameters - currently ignored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"chromatogram returns XChromatograms object number columns corresponding number files object number rows number specified ranges (.e. number rows matrices provided arguments mz /rt). chromatographic peaks apex position within m/z retention time range also retained well feature definitions peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"Arguments rt mz allow specify MS data slice (.e. m/z range retention time window) chromatogram extracted. parameters can either numeric length 2 lower upper limit, matrix two columns lower upper limits extract multiple EICs . parameter aggregationSum allows specify function used aggregate intensities across m/z range retention time. Setting aggregationFun = \"sum\" e.g. allow calculate total ion chromatogram (TIC), aggregationFun = \"max\" base peak chromatogram (BPC). given retention time intensity measured spectrum NA intensity value returned default. can changed parameter missing, setting missing = 0 result 0 intensity returned cases.","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"XCMSnExp objects, adjusted retention times available, chromatogram method default report use (subsetting based provided parameter rt). can changed setting adjustedRtime = FALSE.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"","code":"## Load a test data set with identified chromatographic peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) ## Extract the ion chromatogram for one chromatographic peak in the data. chrs <- chromatogram(faahko_sub, rt = c(2700, 2900), mz = 335) chrs #> XChromatograms with 1 row and 3 columns #> ko15.CDF ko16.CDF ko18.CDF #> #> [1,] peaks: 0 peaks: 1 peaks: 0 #> phenoData with 1 variables #> featureData with 5 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave ## Identified chromatographic peaks chromPeaks(chrs) #> mz mzmin mzmax rt rtmin rtmax into intb maxo sn sample #> CP095 335 335 335 2786.199 2764.29 2812.803 1496244 1451652 58736 55 2 #> row column #> CP095 1 2 ## Plot the chromatogram plot(chrs) ## Extract chromatograms for multiple ranges. mzr <- matrix(c(335, 335, 344, 344), ncol = 2, byrow = TRUE) rtr <- matrix(c(2700, 2900, 2600, 2750), ncol = 2, byrow = TRUE) chrs <- chromatogram(faahko_sub, mz = mzr, rt = rtr) chromPeaks(chrs) #> mz mzmin mzmax rt rtmin rtmax into intb maxo sn #> CP095 335 335 335 2786.199 2764.290 2812.803 1496244 1451652 58736 55 #> CP003 344 344 344 2679.783 2646.919 2709.517 5210016 5135917 152320 68 #> CP090 344 344 344 2686.042 2648.483 2714.211 5700652 5574745 151744 87 #> CP193 344 344 344 2682.914 2643.790 2731.427 5255689 4946143 125632 41 #> sample row column #> CP095 2 1 2 #> CP003 1 2 1 #> CP090 2 2 2 #> CP193 3 2 3 plot(chrs) ## Get access to all chromatograms for the second mz/rt range chrs[1, ] #> XChromatograms with 1 row and 3 columns #> ko15.CDF ko16.CDF ko18.CDF #> #> [1,] peaks: 0 peaks: 1 peaks: 0 #> phenoData with 1 variables #> featureData with 5 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave ## Plot just that one plot(chrs[1, , drop = FALSE])"},{"path":"https://sneumann.github.io/xcms/reference/colMax.html","id":null,"dir":"Reference","previous_headings":"","what":"Find row and column maximum values — colMax","title":"Find row and column maximum values — colMax","text":"Find row column maximum values numeric arrays.","code":""},{"path":"https://sneumann.github.io/xcms/reference/colMax.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find row and column maximum values — colMax","text":"","code":"colMax(x, na.rm = FALSE, dims = 1) rowMax(x, na.rm = FALSE, dims = 1) which.colMax(x, na.rm = FALSE, dims = 1) which.rowMax(x, na.rm = FALSE, dims = 1)"},{"path":"https://sneumann.github.io/xcms/reference/colMax.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find row and column maximum values — colMax","text":"x array two dimensions, containing numeric values na.rm logical. missing values (including 'NaN') omitted calculations? (currently implemented) dims dimensions regarded \"rows\" \"columns\" maximize. rowMax, maximum dimensions dims+1, ...; colMax dimensions 1:dims.","code":""},{"path":"https://sneumann.github.io/xcms/reference/colMax.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find row and column maximum values — colMax","text":"functions designed act like colSums series functions except currently handle real arrays remove NA values.","code":""},{"path":"https://sneumann.github.io/xcms/reference/colMax.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find row and column maximum values — colMax","text":"numeric array suitable size, vector result one-dimensional. dimnames (names vector result) taken original array. .* functions, integer array suitable size, vector result one-dimensional. indecies returned accessing x one-dimensionally (.e. x[index]). .colMax(), actual row indecies determined using (.colMax(x)-1) %% nrow(x) + 1. .rowMax(), actual column indecies may determined using ceiling(rowMax(x)/nrow(x)).","code":""},{"path":"https://sneumann.github.io/xcms/reference/colMax.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find row and column maximum values — colMax","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/collect-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Collect MS^n peaks into xcmsFragments — collect-methods","title":"Collect MS^n peaks into xcmsFragments — collect-methods","text":"Collecting Peaks xcmsFragmentss several MS-runs using xcmsSet xcmsRaw.","code":""},{"path":"https://sneumann.github.io/xcms/reference/collect-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Collect MS^n peaks into xcmsFragments — collect-methods","text":"object = \"xcmsFragments\" collect(object, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/collect-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collect MS^n peaks into xcmsFragments — collect-methods","text":"object (empty) xcmsFragments-class object xs xcmsSet-class object contains picked ms1-peaks several experiments compMethod (\"floor\", \"round\", \"none\"): compare-method used find parent peak MSnpeak comparing MZ-values MS1peaks MSnParentPeaks. snthresh, mzgap, uniq parameters getspec-peakpicker included xcmsRaw.","code":""},{"path":"https://sneumann.github.io/xcms/reference/collect-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Collect MS^n peaks into xcmsFragments — collect-methods","text":"running collect(xFragments,xSet) peak table xcmsFragments includes ms1Peaks experiments stored xcmsSet-object. contains relevant msN-peaks xcmsRaw-objects, created temporarily paths xcmsSet.","code":""},{"path":"https://sneumann.github.io/xcms/reference/collect-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collect MS^n peaks into xcmsFragments — collect-methods","text":"matrix columns: peakID unique identifier every peak MSnParentPeakID PeakID parent peak msLevel>1 - peak, 0 peak msLevel 1. msLevel msLevel peak. rt retention time peak midpoint mz mz-Value peak intensity intensity peak sample number sample xcmsSet GroupPeakMSn Used grouped xcmsSet groups CollisionEnergy collision energy fragment","code":""},{"path":"https://sneumann.github.io/xcms/reference/correlate-Chromatogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","title":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","text":"xcms >= 3.15.3 please use compareChromatograms() instead correlate Correlate intensities two chromatograms . two Chromatogram objects different retention times first aligned match data points first data points second chromatogram. See help alignRt MSnbase::Chromatogram() details. correlate called single MChromatograms() object pairwise correlation chromatogram performed matrix correlation coefficients returned. Note correlation two chromatograms depends also order, e.g. correlate(chr1, chr2) might identical correlate(chr2, chr1). lower upper triangular part correlation matrix might thus different.","code":""},{"path":"https://sneumann.github.io/xcms/reference/correlate-Chromatogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","text":"","code":"# S4 method for Chromatogram,Chromatogram correlate( x, y, use = \"pairwise.complete.obs\", method = c(\"pearson\", \"kendall\", \"spearman\"), align = c(\"closest\", \"approx\"), ... ) # S4 method for MChromatograms,missing correlate( x, y = NULL, use = \"pairwise.complete.obs\", method = c(\"pearson\", \"kendall\", \"spearman\"), align = c(\"closest\", \"approx\"), ... ) # S4 method for MChromatograms,MChromatograms correlate( x, y = NULL, use = \"pairwise.complete.obs\", method = c(\"pearson\", \"kendall\", \"spearman\"), align = c(\"closest\", \"approx\"), ... )"},{"path":"https://sneumann.github.io/xcms/reference/correlate-Chromatogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","text":"x Chromatogram() MChromatograms() object. y Chromatogram() MChromatograms() object. use character(1) passed cor function. See cor() details. method character(1) passed cor function. See cor() details. align character(1) defining alignment method used. See help alignRt MSnbase::Chromatogram() details. value parameter passed method parameter alignRt. ... optional parameters passed along alignRt method tolerance , set 0 requires retention times identical.","code":""},{"path":"https://sneumann.github.io/xcms/reference/correlate-Chromatogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","text":"numeric(1) matrix (called MChromatograms objects) correlation coefficient. matrix returned, rows represent chromatograms x columns chromatograms y.","code":""},{"path":"https://sneumann.github.io/xcms/reference/correlate-Chromatogram.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","text":"Michael Witting, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/correlate-Chromatogram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","text":"","code":"library(MSnbase) chr1 <- Chromatogram(rtime = 1:10 + rnorm(n = 10, sd = 0.3), intensity = c(5, 29, 50, NA, 100, 12, 3, 4, 1, 3)) chr2 <- Chromatogram(rtime = 1:10 + rnorm(n = 10, sd = 0.3), intensity = c(80, 50, 20, 10, 9, 4, 3, 4, 1, 3)) chr3 <- Chromatogram(rtime = 3:9 + rnorm(7, sd = 0.3), intensity = c(53, 80, 130, 15, 5, 3, 2)) chrs <- MChromatograms(list(chr1, chr2, chr3)) ## Using `compareChromatograms` instead of `correlate`. compareChromatograms(chr1, chr2) #> [1] -0.09306005 compareChromatograms(chr2, chr1) #> [1] -0.09306005 compareChromatograms(chrs, chrs) #> [,1] [,2] [,3] #> [1,] 1.00000000 -0.09306005 0.9887213 #> [2,] -0.09306005 1.00000000 0.5018044 #> [3,] 0.99355819 0.50180442 1.0000000"},{"path":"https://sneumann.github.io/xcms/reference/descendZero.html","id":null,"dir":"Reference","previous_headings":"","what":"Find start and end points of a peak — descendZero","title":"Find start and end points of a peak — descendZero","text":"Decends sides data peak finds either points greater equal zero intercept, intercept given value, bottom first valley side.","code":""},{"path":"https://sneumann.github.io/xcms/reference/descendZero.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find start and end points of a peak — descendZero","text":"","code":"descendZero(y, istart = which.max(y)) descendValue(y, value, istart = which.max(y)) descendMin(y, istart = which.max(y))"},{"path":"https://sneumann.github.io/xcms/reference/descendZero.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find start and end points of a peak — descendZero","text":"y numeric vector values istart starting point descent value numeric value descend ","code":""},{"path":"https://sneumann.github.io/xcms/reference/descendZero.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find start and end points of a peak — descendZero","text":"integer vector length 2 starting ending indicies peak start end points.","code":""},{"path":"https://sneumann.github.io/xcms/reference/descendZero.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find start and end points of a peak — descendZero","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/descendZero.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find start and end points of a peak — descendZero","text":"","code":"normdist <- dnorm(seq(-4, 4, .1)) - .1 xcms:::descendZero(normdist) #> ilower iupper #> 25 57 normdist[xcms:::descendZero(normdist)] #> [1] 0.01092083 0.01092083 xcms:::descendValue(normdist, .15) #> ilower iupper #> 32 50 normdist[xcms:::descendValue(normdist, .15)] #> [1] 0.1660852 0.1660852 xcms:::descendMin(normdist) #> ilower iupper #> 1 81"},{"path":"https://sneumann.github.io/xcms/reference/diffreport-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Create report of analyte differences — diffreport-methods","title":"Create report of analyte differences — diffreport-methods","text":"Create report showing significant differences two sets samples. Optionally create extracted ion chromatograms significant differences.","code":""},{"path":"https://sneumann.github.io/xcms/reference/diffreport-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Create report of analyte differences — diffreport-methods","text":"object = \"xcmsSet\" diffreport(object, class1 = levels(sampclass(object))[1], class2 = levels(sampclass(object))[2], filebase = character(), eicmax = 0, eicwidth = 200, sortpval = TRUE, classeic = c(class1,class2), value=c(\"\",\"maxo\",\"intb\"), metlin = FALSE, \t\t\t\t h=480,w=640, mzdec=2, missing = \t\t\t\t numeric(), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/diffreport-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create report of analyte differences — diffreport-methods","text":"object xcmsSet object class1 character vector first set sample classes compared class2 character vector second set sample classes compared filebase base file name save report, .tsv file _eic appended name tabular report EIC directory, respectively. blank nothing saved eicmax number significantly different analytes create EICs eicwidth width (seconds) EICs produced sortpval logical indicating whether reports sorted p-value classeic character vector sample classes include EICs value intensity values used diffreport. value=\"\", integrated peak intensities used. value=\"maxo\", maximum peak intensities used. value=\"intb\", baseline corrected integrated peak intensities used (available peak detection done findPeaks.centWave). metlin mass uncertainty use generating link Metlin metabolite database. sign uncertainty indicates negative positive mode data M+H M-H calculation. value FALSE 0 removes column h Numeric variable height eic boxplots printed . w Numeric variable width eic boxplots print made. mzdec Number decimal places title m/z values eic plot. missing numeric(1) defining optional value missing values. missing = 0 e.g. replace NA values feature matrix 0. Note also call fillPeaks results feature matrix NA values replaced 0. ... optional arguments passed mt.teststat multtest package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/diffreport-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create report of analyte differences — diffreport-methods","text":"method handles creation summary reports statistics analytes significantly different two sets samples. computes Welch's two-sample t-statistic analyte ranks p-value. returns summary report can optionally written tab-separated file. Additionally, heavy lifting involved creating superimposed extracted ion chromatograms given number analytes. reading raw data files associated samples interest one time. , prints name sample currently reading. Depending number size samples, process can take long time. base file name provided, report (see Value section) saved tab separated file. EICs generated, saved 640x480 PNG files newly created subdirectory. However parameter can changed commands arguments. numbered file names correspond rows report. Chromatographic traces EICs colored labeled sample class. Sample classes take color current palette. color sample class assigned dependent order xcmsSet object, order given class arguments. Thus levels(sampclass(object))[1] use color palette()[1] . way, sample classes maintain color across number different generated reports. multiple sample classes, xcms produce boxplots different classes generate single anova p-value statistic. Like eic's plot number corresponds row number report.","code":""},{"path":"https://sneumann.github.io/xcms/reference/diffreport-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create report of analyte differences — diffreport-methods","text":"data frame following columns: fold mean fold change (always greater 1, see tstat set sample classes higher) tstat Welch's two sample t-statistic, positive analytes greater intensity class2, negative analytes greater intensity class1 pvalue p-value t-statistic anova p-value anova statistic multiple classes mzmed median m/z peaks group mzmin minimum m/z peaks group mzmax maximum m/z peaks group rtmed median retention time peaks group rtmin minimum retention time peaks group rtmax maximum retention time peaks group npeaks number peaks assigned group Sample Classes number samples sample class represented group metlin URL metlin mass ... one column every sample class Sample Names integrated intensity value every sample ... one column every sample","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/dirname.html","id":null,"dir":"Reference","previous_headings":"","what":"Change the file path of an OnDiskMSnExp object — dirname","title":"Change the file path of an OnDiskMSnExp object — dirname","text":"dirname allows get set path directory containing source files OnDiskMSnExp (XCMSnExp) object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/dirname.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change the file path of an OnDiskMSnExp object — dirname","text":"","code":"# S4 method for OnDiskMSnExp dirname(path) # S4 method for OnDiskMSnExp dirname(path) <- value"},{"path":"https://sneumann.github.io/xcms/reference/dirname.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change the file path of an OnDiskMSnExp object — dirname","text":"path OnDiskMSnExp. value character length 1 length equal number files defining new path files.","code":""},{"path":"https://sneumann.github.io/xcms/reference/dirname.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Change the file path of an OnDiskMSnExp object — dirname","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":null,"dir":"Reference","previous_headings":"","what":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"function performs retention time correction assessing retention time deviation across samples using peak groups (features) containg chromatographic peaks present /samples. retention time deviation features sample described fitting either polynomial (smooth = \"loess\") linear (smooth = \"linear\") model data points. models subsequently used adjust retention time spectrum sample.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"","code":"do_adjustRtime_peakGroups( peaks, peakIndex, rtime = list(), minFraction = 0.9, extraPeaks = 1, smooth = c(\"loess\", \"linear\"), span = 0.2, family = c(\"gaussian\", \"symmetric\"), peakGroupsMatrix = matrix(ncol = 0, nrow = 0), subset = integer(), subsetAdjust = c(\"average\", \"previous\") )"},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"peaks matrix data.frame identified chromatographic peaks samples. peakIndex list indices provides grouping information chromatographic peaks (across within samples). rtime list numeric vectors retention times per file/sample. minFraction PeakGroupsParam: numeric(1) 0 1 defining minimum required proportion samples peaks peak group identified. Peak groups passing criteria aligned across samples retention times individual spectra adjusted based alignment. minFraction = 1 peak group contain peaks samples experiment. Note subset provided, specified fraction relative defined subset samples total number samples within experiment (.e., peak present specified proportion subset samples). extraPeaks PeakGroupsParam: numeric(1) defining maximal number additional peaks samples assigned peak group (feature) retention time correction. data set 6 samples, extraPeaks = 1 uses peak groups total peak count <= 6 + 1. total peak count total number peaks assigned peak group considers also multiple peaks within sample assigned group. smooth PeakGroupsParam: character(1) defining function used interpolate corrected retention times peak groups. Can either \"loess\" \"linear\". span PeakGroupsParam: numeric(1) defining degree smoothing (smooth = \"loess\"). parameter passed internal call loess(). family PeakGroupsParam: character(1) defining method loess smoothing. Allowed values \"gaussian\" \"symmetric\". See loess() information. peakGroupsMatrix optional matrix (raw) retention times peak groups alignment performed. column represents sample, row feature/peak group. provided, matrix determined depending parameters minFraction extraPeaks. provided, minFraction extraPeaks ignored. subset ObiwarpParam PeakGroupsParam: integer indices samples within experiment alignment models estimated. Samples part subset adjusted based closest subset sample. See Subset-based alignment section details. subsetAdjust ObiwarpParam PeakGroupsParam: character(1) specifying method non-subset samples adjusted. Supported options \"previous\" \"average\" (default). See Subset-based alignment section details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"list numeric vectors adjusted retention times grouped sample.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"alignment bases presence compounds can found /samples experiment. retention times individual spectra adjusted based alignment features corresponding house keeping compounds. paraneters minFraction extraPeaks can used fine tune features used alignment (.e. features likely correspond mentioned house keeping compounds). Parameter subset allows define subset samples within experiment aligned. samples part subset aligned based adjustment closest sample within subset. allows e.g. exclude blank samples alignment process retention times still adjusted based alignment results real samples.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"method ensures returned adjusted retention times increasingly ordered, just raw retention times.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"Colin . Smith, Elizabeth J. Want, Grace O'Maille, Ruben Abagyan Gary Siuzdak. \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 2006, 78:779-787.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"Colin Smith, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for centWave peak detection — do_findChromPeaks_centWave","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"function performs peak density wavelet based chromatographic peak detection high resolution LC/MS data centroid mode [Tautenhahn 2008].","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"","code":"do_findChromPeaks_centWave( mz, int, scantime, valsPerSpect, ppm = 25, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, roiList = list(), firstBaselineCheck = TRUE, roiScales = NULL, sleep = 0, extendLengthMSW = FALSE, verboseBetaColumns = FALSE )"},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"mz Numeric vector individual m/z values scans/ spectra one file/sample. int Numeric vector individual intensity values scans/spectra one file/sample. scantime Numeric vector length equal number spectra/scans data representing retention time scan. valsPerSpect Numeric vector number values spectrum. ppm numeric(1) defining maximal tolerated m/z deviation consecutive scans parts per million (ppm) initial ROI definition. peakwidth numeric(2) expected approximate peak width chromatographic space. Given range (min, max) seconds. snthresh numeric(1) defining signal noise ratio cutoff. prefilter numeric(2): c(k, ) specifying prefilter step first analysis step (ROI detection). Mass traces retained contain least k peaks intensity >= . mzCenterFun Name function calculate m/z center chromatographic peak. Allowed : \"wMean\": intensity weighted mean peak's m/z values, \"mean\": mean peak's m/z values, \"apex\": use m/z value peak apex, \"wMeanApex3\": intensity weighted mean m/z value peak apex m/z values left right \"meanApex3\": mean m/z value peak apex m/z values left right . integrate Integration method. integrate = 1 peak limits found descent mexican hat filtered data, integrate = 2 descent done real data. latter method accurate prone noise, former robust, less exact. mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. fitgauss logical(1) whether Gaussian fitted peak. affects mostly retention time position peak. noise numeric(1) allowing set minimum intensity required centroids considered first analysis step (centroids intensity < noise omitted ROI detection). verboseColumns logical(1) whether additional peak meta data columns returned. roiList optional list regions--interest (ROI) representing detected mass traces. ROIs submitted first analysis step omitted chromatographic peak detection performed submitted ROIs. ROI expected following elements specified: scmin (start scan index), scmax (end scan index), mzmin (minimum m/z), mzmax (maximum m/z), length (number scans), intensity (summed intensity). ROI represented list elements single row data.frame. firstBaselineCheck logical(1). TRUE continuous data within regions interest checked first baseline. detail, first rough estimate noise calculated peak detection performed regions multiple sequential signals higher first estimated baseline/noise level. roiScales Optional numeric vector length equal roiList defining scale region interest roiList used centWave-wavelets. sleep numeric(1) defining number seconds wait iterations. Defaults sleep = 0. > 0 plot generated visualizing identified chromatographic peak. Note: argument backward compatibility removed future. extendLengthMSW Option force centWave use scales running centWave rather truncating EIC length. Uses \"open\" method extend EIC integer base-2 length prior passed convolve rather default \"reflect\" method. See https://github.com/sneumann/xcms/issues/445 information. verboseBetaColumns Option calculate two additional metrics peak quality via comparison idealized bell curve. Adds beta_cor beta_snr chromPeaks output, corresponding Pearson correlation coefficient bell curve several degrees skew well estimate signal--noise using residuals best-fitting bell curve. See https://github.com/sneumann/xcms/pull/685 https://doi.org/10.1186/s12859-023-05533-4 information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"matrix, row representing identified chromatographic peak, columns: mz Intensity weighted mean m/z values peak across scans. mzmin Minimum m/z peak. mzmax Maximum m/z peak. rt Retention time peak's midpoint. rtmin Minimum retention time peak. rtmax Maximum retention time peak. Integrated (original) intensity peak. intb Per-peak baseline corrected integrated peak intensity. maxo Maximum intensity peak. sn Signal noise ratio, defined (maxo - baseline)/sd, sd standard deviation local chromatographic noise. egauss RMSE Gaussian fit. Additional columns verboseColumns = TRUE: mu Gaussian parameter mu. sigma Gaussian parameter sigma. h Gaussian parameter h. f Region number m/z ROI peak localized. dppm m/z deviation mass trace across scans ppm. scale Scale peak localized. scpos Peak position found wavelet analysis (scan number). scmin Left peak limit found wavelet analysis (scan number). scmax Right peak limit found wavelet analysis (scan numer). Additional columns verboseBetaColumns = TRUE: beta_cor Correlation \"ideal\" bell curve raw data beta_snr Signal--noise residuals calculated beta_cor fit","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"algorithm suitable high resolution LC/{TOF,OrbiTrap,FTICR}-MS data centroid mode. first phase method identifies regions interest (ROIs) representing mass traces characterized regions less ppm m/z deviation consecutive scans LC/MS map. detail, starting single m/z, ROI extended m/z can found next scan (spectrum) difference mean m/z ROI smaller user defined ppm m/z. mean m/z ROI updated considering also newly included m/z value. ROIs , cleanup, analyzed using continuous wavelet transform (CWT) locate chromatographic peaks different scales. first analysis step skipped, regions interest passed roiList parameter.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"centWave designed work centroided mode, thus expected data presented function. function exposes core chromatographic peak detection functionality centWave method. function can called directly, users generally call corresponding method data object instead.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"Ralf Tautenhahn, Christoph Böttcher, Steffen Neumann \"Highly sensitive feature detection high resolution LC/MS\" BMC Bioinformatics 2008, 9:504","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"Ralf Tautenhahn, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"","code":"## Load the test file faahko_sub <- loadXcmsData(\"faahko_sub\") ## Subset to one file and restrict to a certain retention time range data <- filterRt(filterFile(faahko_sub, 1), c(2500, 3000)) ## Get m/z and intensity values mzs <- mz(data) ints <- intensity(data) ## Define the values per spectrum: valsPerSpect <- lengths(mzs) ## Calling the function. We're using a large value for noise and prefilter ## to speed up the call in the example - in a real use case we would either ## set the value to a reasonable value or use the default value. res <- do_findChromPeaks_centWave(mz = unlist(mzs), int = unlist(ints), scantime = rtime(data), valsPerSpect = valsPerSpect, noise = 10000, prefilter = c(3, 10000)) #> Detecting mass traces at 25 ppm ... #> OK #> Detecting chromatographic peaks in 186 regions of interest ... #> OK: 47 found. head(res) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> [1,] 453.2 453.2 453.2 2506.073 2501.378 2527.982 1007409.0 1007380.8 38152 #> [2,] 307.0 307.0 307.0 2618.750 2592.145 2645.354 284782.4 268039.8 16872 #> [3,] 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> [4,] 360.0 360.0 360.0 2682.913 2668.828 2698.562 5641322.3 5420634.7 317568 #> [5,] 361.1 361.1 361.1 2684.478 2665.698 2698.562 1158340.2 1116522.0 72272 #> [6,] 416.1 416.1 416.1 2682.913 2635.964 2709.517 487698.6 446552.1 12036 #> sn #> [1,] 38151 #> [2,] 20 #> [3,] 46 #> [4,] 11 #> [5,] 11 #> [6,] 11"},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWaveWithPredIsoROIs.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","title":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","text":"do_findChromPeaks_centWaveWithPredIsoROIs performs two-step centWave based peak detection: chromatographic peaks identified using centWave followed prediction location identified peaks' isotopes mz-retention time space. locations fed regions interest (ROIs) subsequent centWave run. non overlapping peaks two peak detection runs reported final list identified peaks. do_findChromPeaks_centWaveAddPredIsoROIs performs centWave based peak detection based regions interest (ROIs) representing predicted isotopes peaks submitted argument peaks.. function returns matrix identified peaks consisting input peaks peaks representing predicted isotopes (found centWave algorithm).","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWaveWithPredIsoROIs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","text":"","code":"do_findChromPeaks_centWaveWithPredIsoROIs( mz, int, scantime, valsPerSpect, ppm = 25, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, roiList = list(), firstBaselineCheck = TRUE, roiScales = NULL, snthreshIsoROIs = 6.25, maxCharge = 3, maxIso = 5, mzIntervalExtension = TRUE, polarity = \"unknown\", extendLengthMSW = FALSE, verboseBetaColumns = FALSE ) do_findChromPeaks_addPredIsoROIs( mz, int, scantime, valsPerSpect, ppm = 25, peakwidth = c(20, 50), snthresh = 6.25, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, peaks. = NULL, maxCharge = 3, maxIso = 5, mzIntervalExtension = TRUE, polarity = \"unknown\" )"},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWaveWithPredIsoROIs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","text":"mz Numeric vector individual m/z values scans/ spectra one file/sample. int Numeric vector individual intensity values scans/spectra one file/sample. scantime Numeric vector length equal number spectra/scans data representing retention time scan. valsPerSpect Numeric vector number values spectrum. ppm numeric(1) defining maximal tolerated m/z deviation consecutive scans parts per million (ppm) initial ROI definition. peakwidth numeric(2) expected approximate peak width chromatographic space. Given range (min, max) seconds. snthresh do_findChromPeaks_addPredIsoROIs: numeric(1) defining signal noise threshold centWave algorithm. do_findChromPeaks_centWaveWithPredIsoROIs: numeric(1) defining signal noise threshold initial (first) centWave run. prefilter numeric(2): c(k, ) specifying prefilter step first analysis step (ROI detection). Mass traces retained contain least k peaks intensity >= . mzCenterFun Name function calculate m/z center chromatographic peak. Allowed : \"wMean\": intensity weighted mean peak's m/z values, \"mean\": mean peak's m/z values, \"apex\": use m/z value peak apex, \"wMeanApex3\": intensity weighted mean m/z value peak apex m/z values left right \"meanApex3\": mean m/z value peak apex m/z values left right . integrate Integration method. integrate = 1 peak limits found descent mexican hat filtered data, integrate = 2 descent done real data. latter method accurate prone noise, former robust, less exact. mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. fitgauss logical(1) whether Gaussian fitted peak. affects mostly retention time position peak. noise numeric(1) allowing set minimum intensity required centroids considered first analysis step (centroids intensity < noise omitted ROI detection). verboseColumns logical(1) whether additional peak meta data columns returned. roiList optional list regions--interest (ROI) representing detected mass traces. ROIs submitted first analysis step omitted chromatographic peak detection performed submitted ROIs. ROI expected following elements specified: scmin (start scan index), scmax (end scan index), mzmin (minimum m/z), mzmax (maximum m/z), length (number scans), intensity (summed intensity). ROI represented list elements single row data.frame. firstBaselineCheck logical(1). TRUE continuous data within regions interest checked first baseline. detail, first rough estimate noise calculated peak detection performed regions multiple sequential signals higher first estimated baseline/noise level. roiScales Optional numeric vector length equal roiList defining scale region interest roiList used centWave-wavelets. snthreshIsoROIs numeric(1) defining signal noise ratio cutoff used second centWave run identify peaks predicted isotope ROIs. maxCharge integer(1) defining maximal isotope charge. Isotopes defined charges 1:maxCharge. maxIso integer(1) defining number isotope peaks predicted peak identified first centWave run. mzIntervalExtension logical(1) whether mz range predicted isotope ROIs extended increase detection low intensity peaks. polarity character(1) specifying polarity data. Currently used, \"positive\", \"negative\" \"unknown\" provided. extendLengthMSW Option force centWave use scales running centWave rather truncating EIC length. Uses \"open\" method extend EIC integer base-2 length prior passed convolve rather default \"reflect\" method. See https://github.com/sneumann/xcms/issues/445 information. verboseBetaColumns Option calculate two additional metrics peak quality via comparison idealized bell curve. Adds beta_cor beta_snr chromPeaks output, corresponding Pearson correlation coefficient bell curve several degrees skew well estimate signal--noise using residuals best-fitting bell curve. See https://github.com/sneumann/xcms/pull/685 https://doi.org/10.1186/s12859-023-05533-4 information. peaks. matrix xcmsPeaks object one returned call link{do_findChromPeaks_centWave} link{findPeaks.centWave} (verboseColumns = TRUE) peaks isotopes predicted used additional peak detectoin using centWave method. Required columns : \"mz\", \"mzmin\", \"mzmax\", \"scmin\", \"scmax\", \"scale\" \"\".","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWaveWithPredIsoROIs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","text":"matrix, row representing identified chromatographic peak. non-overlapping peaks identified centWave runs reported. matrix columns : mz Intensity weighted mean m/z values peaks across scans. mzmin Minimum m/z peaks. mzmax Maximum m/z peaks. rt Retention time peak's midpoint. rtmin Minimum retention time peak. rtmax Maximum retention time peak. Integrated (original) intensity peak. intb Per-peak baseline corrected integrated peak intensity. maxo Maximum intensity peak. sn Signal noise ratio, defined (maxo - baseline)/sd, sd standard deviation local chromatographic noise. egauss RMSE Gaussian fit. Additional columns verboseColumns = TRUE: mu Gaussian parameter mu. sigma Gaussian parameter sigma. h Gaussian parameter h. f Region number m/z ROI peak localized. dppm m/z deviation mass trace across scans ppm. scale Scale peak localized. scpos Peak position found wavelet analysis (scan number). scmin Left peak limit found wavelet analysis (scan number). scmax Right peak limit found wavelet analysis (scan numer). Additional columns verboseBetaColumns = TRUE: beta_cor Correlation \"ideal\" bell curve raw data beta_snr Signal--noise residuals calculated beta_cor fit","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWaveWithPredIsoROIs.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","text":"details centWave algorithm see centWave.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWaveWithPredIsoROIs.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","text":"Hendrik Treutler, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"Massifquant Kalman filter (KF)-based chromatographic peak detection XC-MS data centroid mode. identified peaks can refined centWave method (see do_findChromPeaks_centWave details centWave) specifying withWave = TRUE.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"","code":"do_findChromPeaks_massifquant( mz, int, scantime, valsPerSpect, ppm = 10, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, criticalValue = 1.125, consecMissedLimit = 2, unions = 1, checkBack = 0, withWave = FALSE )"},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"mz Numeric vector individual m/z values scans/ spectra one file/sample. int Numeric vector individual intensity values scans/spectra one file/sample. scantime Numeric vector length equal number spectra/scans data representing retention time scan. valsPerSpect Numeric vector number values spectrum. ppm numeric(1) defining maximal tolerated m/z deviation consecutive scans parts per million (ppm) initial ROI definition. peakwidth numeric(2) expected approximate peak width chromatographic space. Given range (min, max) seconds. snthresh numeric(1) defining signal noise ratio cutoff. prefilter numeric(2): c(k, ) specifying prefilter step first analysis step (ROI detection). Mass traces retained contain least k peaks intensity >= . mzCenterFun Name function calculate m/z center chromatographic peak. Allowed : \"wMean\": intensity weighted mean peak's m/z values, \"mean\": mean peak's m/z values, \"apex\": use m/z value peak apex, \"wMeanApex3\": intensity weighted mean m/z value peak apex m/z values left right \"meanApex3\": mean m/z value peak apex m/z values left right . integrate Integration method. integrate = 1 peak limits found descent mexican hat filtered data, integrate = 2 descent done real data. latter method accurate prone noise, former robust, less exact. mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. fitgauss logical(1) whether Gaussian fitted peak. affects mostly retention time position peak. noise numeric(1) allowing set minimum intensity required centroids considered first analysis step (centroids intensity < noise omitted ROI detection). verboseColumns logical(1) whether additional peak meta data columns returned. criticalValue numeric(1). Suggested values: (0.1-3.0). setting helps determine Kalman Filter prediciton margin error. real centroid belonging bonafide peak must fall within KF prediction margin error. Much like construction confidence interval, criticalVal loosely translates multiplier standard error prediction reported Kalman Filter. peak XC-MS sample small mass deviance ppm error, smaller critical value might better vice versa. consecMissedLimit integer(1) Suggested values: (1,2,3). peak proces detected Kalman Filter, Kalman Filter may find predicted centroid every scan. 1 consecutive failed predictions, setting informs Massifquant stop Kalman Filter following candidate peak. unions integer(1) set 1 apply t-test union segmentation; set 0 t-test applied chromatographically continous peaks sharing m/z range. Explanation: data points, sometimes Kalman Filter stops tracking peak prematurely. Another Kalman Filter instantiated begins following rest signal. tracking done backwards forwards, algorithmic defect leaves real peak divided two segments . option turned , program identifies segmented peaks combines (merges ) one two sample t-test. potential danger option truly distinct peaks may merged. checkBack integer(1) set 1 turned ; set 0 turned . convergence Kalman Filter peak's precise m/z mapping fast, sometimes incorporates erroneous centroids part peak (especially early ). scanBack option attempt remove occasional outlier lies beyond converged bounds Kalman Filter. option directly affect identification peak postprocessing measure; shown extremely useful thus far default set turned . withWave logical(1) TRUE, peaks identified first Massifquant subsequently filtered second step centWave algorithm, includes wavelet estimation.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"matrix, row representing identified chromatographic peak, columns: mz Intensity weighted mean m/z values peaks across scans. mzmin Minumum m/z peak. mzmax Maximum m/z peak. rtmin Minimum retention time peak. rtmax Maximum retention time peak. rt Retention time peak's midpoint. Integrated (original) intensity peak. maxo Maximum intensity peak. withWave set TRUE, result returned do_findChromPeaks_centWave method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"algorithm's performance tested rigorously high resolution LC/(OrbiTrap, TOF)-MS data centroid mode. Simultaneous kalman filters identify peaks calculate area curve. default parameters set operate complex LC-MS Orbitrap sample. Users find useful simple exploratory data analysis find set minimum intensity, identify many scans average peak spans. consecMissedLimit parameter yielded good performance Orbitrap data set (2) TOF data found best (1). may change algorithm yet tested many samples. criticalValue parameter perhaps dificult dial appropriately visual inspection peak identification best suggested tool quick optimization. ppm checkBack parameters shown less influence parameters exist give users flexibility better accuracy.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"Conley CJ, Smith R, Torgrip RJ, Taylor RM, Tautenhahn R Prince JT \"Massifquant: open-source Kalman filter-based XC-MS isotope trace feature detection\" Bioinformatics 2014, 30(18):2636-43.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"Christopher Conley","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"","code":"## Load the test file faahko_sub <- loadXcmsData(\"faahko_sub\") ## Subset to one file and restrict to a certain retention time range data <- filterRt(filterFile(faahko_sub, 1), c(2500, 3000)) ## Get m/z and intensity values mzs <- mz(data) ints <- intensity(data) ## Define the values per spectrum: valsPerSpect <- lengths(mzs) ## Perform the peak detection using massifquant - setting prefilter to ## a high value to speed up the call for the example res <- do_findChromPeaks_massifquant(mz = unlist(mzs), int = unlist(ints), scantime = rtime(data), valsPerSpect = valsPerSpect, prefilter = c(3, 10000)) #> #> Massifquant, Copyright (C) 2013 Brigham Young University. #> Massifquant comes with ABSOLUTELY NO WARRANTY. See LICENSE for details. #> #> Detecting mass traces at 10ppm ... #> OK #> 69 Peaks. head(res) #> mz mzmin mzmax rtmin rtmax rt into maxo #> [1,] 426.1 426.1 426.1 2963.039 2999.033 2977.124 129958 29408 #> [2,] 590.3 590.3 590.3 2963.039 2999.033 2978.689 255317 19072 #> [3,] 454.1 454.1 454.1 2934.870 2975.559 2953.650 372685 20432 #> [4,] 309.1 309.1 309.1 2905.136 2967.734 2936.435 652140 38888 #> [5,] 475.2 475.2 475.2 2880.097 2999.033 2934.870 2415224 37160 #> [6,] 532.2 532.2 532.2 2853.493 2906.701 2878.532 232493 16480"},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"function identifies peaks chromatographic time domain described [Smith 2006]. intensity values binned cutting LC/MS data slices (bins) mass unit (binSize m/z) wide. Within bin maximal intensity selected. peak detection performed bin extending based steps parameter generate slices comprising bins current_bin - steps +1 current_bin + steps - 1. slices filtered matched filtration using second-derative Gaussian model peak shape. filtration peaks detected using signal--ration cut-. details illustrations see [Smith 2006].","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"","code":"do_findChromPeaks_matchedFilter( mz, int, scantime, valsPerSpect, binSize = 0.1, impute = \"none\", baseValue, distance, fwhm = 30, sigma = fwhm/2.3548, max = 5, snthresh = 10, steps = 2, mzdiff = 0.8 - binSize * steps, index = FALSE, sleep = 0 )"},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"mz Numeric vector individual m/z values scans/ spectra one file/sample. int Numeric vector individual intensity values scans/spectra one file/sample. scantime Numeric vector length equal number spectra/scans data representing retention time scan. valsPerSpect Numeric vector number values spectrum. binSize numeric(1) specifying width bins/slices m/z dimension. impute Character string specifying method used missing value imputation. Allowed values \"none\" (linear interpolation), \"lin\" (linear interpolation), \"linbase\" (linear interpolation within certain bin-neighborhood) \"intlin\". See imputeLinInterpol details. baseValue base value empty elements set. considered method = \"linbase\" corresponds profBinLinBase's baselevel argument. distance method = \"linbase\": number non-empty neighboring element empty element considered linear interpolation. See details section information. fwhm numeric(1) specifying full width half maximum matched filtration gaussian model peak. used calculate actual sigma, see . sigma numeric(1) specifying standard deviation (width) matched filtration model peak. max numeric(1) representing maximum number peaks expected/identified per slice. snthresh numeric(1) defining signal noise ratio cutoff. steps numeric(1) defining number bins merged filtration (.e. number neighboring bins joined slice filtration peak detection performed). mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. index logical(1) specifying whether indicies returned instead values m/z retention times. sleep numeric(1) defining number seconds wait iterations. Defaults sleep = 0. > 0 plot generated visualizing identified chromatographic peak. Note: argument backward compatibility removed future.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"matrix, row representing identified chromatographic peak, columns: mz Intensity weighted mean m/z values peak across scans. mzmin Minimum m/z peak. mzmax Maximum m/z peak. rt Retention time peak's midpoint. rtmin Minimum retention time peak. rtmax Maximum retention time peak. Integrated (original) intensity peak. intf Integrated intensity filtered peak. maxo Maximum intensity peak. maxf Maximum intensity filtered peak. Rank peak merged EIC (<= max). sn Signal noise ratio peak","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"intensities binned provided m/z values within spectrum (scan). Binning performed bins centered around m/z values (.e. first bin includes m/z values min(mz) - bin_size/2 min(mz) + bin_size/2). details binning missing value imputation see binYonX imputeLinInterpol methods.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"function exposes core peak detection functionality matchedFilter method. function can called directly, users generally call corresponding method data object instead (e.g. link{findPeaks.matchedFilter} method).","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"Colin . Smith, Elizabeth J. Want, Grace O'Maille, Ruben Abagyan Gary Siuzdak. \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 2006, 78:779-787.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"Colin Smith, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"","code":"## Load the test file faahko_sub <- loadXcmsData(\"faahko_sub\") ## Subset to one file and restrict to a certain retention time range data <- filterRt(filterFile(faahko_sub, 1), c(2500, 3000)) ## Get m/z and intensity values mzs <- mz(data) ints <- intensity(data) ## Define the values per spectrum: valsPerSpect <- lengths(mzs) res <- do_findChromPeaks_matchedFilter(mz = unlist(mzs), int = unlist(ints), scantime = rtime(data), valsPerSpect = valsPerSpect) head(res) #> mz mzmin mzmax rt rtmin rtmax into intf maxo #> [1,] 205.0000 205.0 205.0 2784.635 2770.550 2800.284 1778568.9 3610062.2 84280 #> [2,] 205.9819 205.9 206.0 2786.200 2772.115 2800.284 237993.6 448580.3 10681 #> [3,] 207.0821 207.0 207.1 2712.647 2698.562 2726.731 380873.0 730981.4 18800 #> [4,] 236.0956 236.0 236.1 2518.593 2504.508 2534.242 252282.0 458747.7 12957 #> [5,] 244.1000 244.1 244.1 2828.453 2814.369 2844.103 612169.9 1279308.9 31312 #> [6,] 266.0751 266.0 266.1 2828.453 2815.934 2844.103 113219.0 214886.8 5801 #> maxf i sn #> [1,] 195026.48 1 28.33394 #> [2,] 23860.11 1 16.53987 #> [3,] 40065.74 1 12.87314 #> [4,] 24536.55 1 14.99012 #> [5,] 69898.24 1 24.20989 #> [6,] 11773.56 1 10.83870"},{"path":"https://sneumann.github.io/xcms/reference/do_findPeaks_MSW.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","title":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","text":"function performs peak detection mass spectrometry direct injection spectrum using wavelet based algorithm.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findPeaks_MSW.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","text":"","code":"do_findPeaks_MSW( mz, int, snthresh = 3, verboseColumns = FALSE, scantime = numeric(), valsPerSpect = integer(), ... )"},{"path":"https://sneumann.github.io/xcms/reference/do_findPeaks_MSW.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","text":"mz Numeric vector individual m/z values scans/ spectra one file/sample. int Numeric vector individual intensity values scans/spectra one file/sample. snthresh numeric(1) defining signal noise ratio cutoff. verboseColumns logical(1) whether additional peak meta data columns returned. scantime ignored. valsPerSpect ignored. ... Additional parameters passed peakDetectionCWT function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findPeaks_MSW.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","text":"matrix, row representing identified peak, columns: mz m/z value peak centroid position. mzmin Minimum m/z peak. mzmax Maximum m/z peak. rt Always -1. rtmin Always -1. rtmax Always -1. Integrated (original) intensity peak. maxo Maximum intensity peak. intf Always NA. maxf Maximum MSW-filter response peak. sn Signal noise ratio.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findPeaks_MSW.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","text":"wrapper around peak picker Bioconductor's MassSpecWavelet package calling peakDetectionCWT tuneInPeakInfo functions. See xcmsDirect vignette information.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_findPeaks_MSW.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","text":"Joachim Kutzera, Steffen Neumann, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"do_groupChromPeaks_density function performs chromatographic peak grouping based density (distribution) peaks, found different samples, along retention time axis slices overlapping m/z ranges. default (parameter ppm = 0) m/z ranges (constant) size (depending parameter binSize). values ppm larger 0 m/z bins (ranges slices) increasing sizes depending m/z value. better models m/z-dependent measurement error/precision seen MS instruments.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"","code":"do_groupChromPeaks_density( peaks, sampleGroups, bw = 30, minFraction = 0.5, minSamples = 1, binSize = 0.25, maxFeatures = 50, sleep = 0, index = seq_len(nrow(peaks)), ppm = 0 )"},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"peaks matrix data.frame mz values retention times identified chromatographic peaks samples experiment. Required columns \"mz\", \"rt\" \"sample\". latter contain numeric values representing index sample peak found. sampleGroups PeakDensityParam: vector length samples defining sample group assignments (.e. samples belong sample group). parameter mandatory PeakDensityParam provided also sample grouping experiment (case samples assigned group). bw PeakDensityParam: numeric(1) defining bandwidth (standard deviation ot smoothing kernel) used. argument passed [density() method. minFraction PeakDensityParam: numeric(1) defining minimum fraction samples least one sample group peaks present considered peak group (feature). minSamples PeakDensityParam: numeric(1) minimum number samples least one sample group peaks detected considered peak group (feature). binSize PeakDensityParam: numeric(1) defining size overlapping slices m/z dimension. maxFeatures PeakDensityParam: numeric(1) maximum number peak groups identified single mz slice. sleep numeric(1) defining time sleep iterations plot result current iteration. index optional integer providing indices peaks original peak matrix. ppm MzClustParam: numeric(1) representing relative m/z error clustering/grouping (parts per million). PeakDensityParam: numeric(1) define m/z-dependent, increasing m/z bin sizes. ppm = 0 (default) m/z bins defined sequence values smallest larges m/z value constant bin size binSize. ppm > 0 size bin increased addition ppm (upper) m/z boundary bin. maximal bin size (used largest m/z values) binSize plus ppm parts-per-million largest m/z value peaks data set.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"data.frame, row representing (mz-rt) feature (.e. peak group) columns: \"mzmed\": median peaks' apex mz values. \"mzmin\": smallest mz value peaks' apex within feature. \"mzmax\":largest mz value peaks' apex within feature. \"rtmed\": median peaks' retention times. \"rtmin\": smallest retention time peaks group. \"rtmax\": largest retention time peaks group. \"npeaks\": total number peaks assigned feature. \"peakidx\": list indices peaks feature peaks input matrix. Note number can larger total number samples, since multiple peaks sample assigned feature.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"overlapping slices along mz dimension, function calculates density distribution identified peaks along retention time axis groups peaks different samples close . See (Smith 2006) details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"default settings might appropriate LC/GC-MS setups, especially bw binSize parameter adjusted accordingly.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"Colin . Smith, Elizabeth J. Want, Grace O'Maille, Ruben Abagyan Gary Siuzdak. \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 2006, 78:779-787.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"Colin Smith, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"","code":"## Load the test file library(xcms) library(MsExperiment) faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Extract the matrix with the identified peaks from the xcmsSet: pks <- chromPeaks(faahko_sub) ## Perform the peak grouping with default settings: res <- do_groupChromPeaks_density(pks, sampleGroups = rep(1, 3)) ## The feature definitions: head(res) #> mzmed mzmin mzmax rtmed rtmin rtmax npeaks 1 peakidx #> 1 279.0 279.0 279.0 2787.765 2787.765 2787.766 2 2 11, 199 #> 2 286.2 286.2 286.2 3254.904 3250.992 3258.815 2 2 115, 205 #> 3 300.2 300.2 300.2 3387.143 3379.317 3390.271 4 3 35, 125,.... #> 4 301.0 301.0 301.0 2787.766 2786.200 2792.459 3 3 10, 97, 198 #> 5 305.1 305.1 305.1 2994.338 2994.338 2994.339 2 2 15, 203 #> 6 305.1 305.1 305.1 2923.917 2923.916 2923.917 2 2 14, 202"},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_nearest.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for chromatic peak grouping using a nearest neighbor approach — do_groupChromPeaks_nearest","title":"Core API function for chromatic peak grouping using a nearest neighbor approach — do_groupChromPeaks_nearest","text":"do_groupChromPeaks_nearest function groups peaks across samples creating master peak list assigning corresponding peaks samples peak group (.e. feature). method inspired correspondence algorithm mzMine (Katajamaa 2006).","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_nearest.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for chromatic peak grouping using a nearest neighbor approach — do_groupChromPeaks_nearest","text":"","code":"do_groupChromPeaks_nearest( peaks, sampleGroups, mzVsRtBalance = 10, absMz = 0.2, absRt = 15, kNN = 10 )"},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_nearest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for chromatic peak grouping using a nearest neighbor approach — do_groupChromPeaks_nearest","text":"peaks matrix data.frame mz values retention times identified chromatographic peaks samples experiment. Required columns \"mz\", \"rt\" \"sample\". latter contain numeric values representing index sample peak found. sampleGroups PeakDensityParam: vector length samples defining sample group assignments (.e. samples belong sample group). parameter mandatory PeakDensityParam provided also sample grouping experiment (case samples assigned group). mzVsRtBalance NearestPeaksParam: numeric(1) representing factor m/z values multiplied calculating (euclician) distance two peaks. absMz NearestPeaksParam MzClustParam: numeric(1) maximum tolerated distance m/z values. absRt NearestPeaksParam: numeric(1) maximum tolerated distance retention times. kNN NearestPeaksParam: integer(1) representing number nearest neighbors check.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_nearest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for chromatic peak grouping using a nearest neighbor approach — do_groupChromPeaks_nearest","text":"list elements \"featureDefinitions\" \"peakIndex\". \"featureDefinitions\" matrix, row representing (mz-rt) feature (.e. peak group) columns: \"mzmed\": median peaks' apex mz values. \"mzmin\": smallest mz value peaks' apex within feature. \"mzmax\":largest mz value peaks' apex within feature. \"rtmed\": median peaks' retention times. \"rtmin\": smallest retention time peaks feature. \"rtmax\": largest retention time peaks feature. \"npeaks\": total number peaks assigned feature. \"peakIndex\" list indices peaks feature peaks input matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_nearest.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Core API function for chromatic peak grouping using a nearest neighbor approach — do_groupChromPeaks_nearest","text":"Katajamaa M, Miettinen J, Oresic M: MZmine: Toolbox processing visualization mass spectrometry based molecular profile data. Bioinformatics 2006, 22:634-636.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_groupPeaks_mzClust.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for peak grouping using mzClust — do_groupPeaks_mzClust","title":"Core API function for peak grouping using mzClust — do_groupPeaks_mzClust","text":"do_groupPeaks_mzClust function performs high resolution correspondence single spectra samples.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupPeaks_mzClust.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for peak grouping using mzClust — do_groupPeaks_mzClust","text":"","code":"do_groupPeaks_mzClust( peaks, sampleGroups, ppm = 20, absMz = 0, minFraction = 0.5, minSamples = 1 )"},{"path":"https://sneumann.github.io/xcms/reference/do_groupPeaks_mzClust.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for peak grouping using mzClust — do_groupPeaks_mzClust","text":"peaks matrix data.frame mz values retention times identified chromatographic peaks samples experiment. Required columns \"mz\", \"rt\" \"sample\". latter contain numeric values representing index sample peak found. sampleGroups PeakDensityParam: vector length samples defining sample group assignments (.e. samples belong sample group). parameter mandatory PeakDensityParam provided also sample grouping experiment (case samples assigned group). ppm MzClustParam: numeric(1) representing relative m/z error clustering/grouping (parts per million). PeakDensityParam: numeric(1) define m/z-dependent, increasing m/z bin sizes. ppm = 0 (default) m/z bins defined sequence values smallest larges m/z value constant bin size binSize. ppm > 0 size bin increased addition ppm (upper) m/z boundary bin. maximal bin size (used largest m/z values) binSize plus ppm parts-per-million largest m/z value peaks data set. absMz NearestPeaksParam MzClustParam: numeric(1) maximum tolerated distance m/z values. minFraction PeakDensityParam: numeric(1) defining minimum fraction samples least one sample group peaks present considered peak group (feature). minSamples PeakDensityParam: numeric(1) minimum number samples least one sample group peaks detected considered peak group (feature).","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupPeaks_mzClust.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for peak grouping using mzClust — do_groupPeaks_mzClust","text":"list elements \"featureDefinitions\" \"peakIndex\". \"featureDefinitions\" matrix, row representing (mz-rt) feature (.e. peak group) columns: \"mzmed\": median peaks' apex mz values. \"mzmin\": smallest mz value peaks' apex within feature. \"mzmax\": largest mz value peaks' apex within feature. \"rtmed\": always -1. \"rtmin\": always -1. \"rtmax\": always -1. \"npeaks\": total number peaks assigned feature. Note number can larger total number samples, since multiple peaks sample assigned group. \"peakIndex\" list indices peaks peak group peaks input matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupPeaks_mzClust.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Core API function for peak grouping using mzClust — do_groupPeaks_mzClust","text":"Saira . Kazmi, Samiran Ghosh, Dong-Guk Shin, Dennis W. Hill David F. GrantAlignment high resolution mass spectra: development heuristic approach metabolomics. Metabolomics, Vol. 2, . 2, 75-83 (2006)","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/doubleMatrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Allocate double, integer, or logical matricies — doubleMatrix","title":"Allocate double, integer, or logical matricies — doubleMatrix","text":"Allocate double, integer, logical matricies one step without copying memory around.","code":""},{"path":"https://sneumann.github.io/xcms/reference/doubleMatrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Allocate double, integer, or logical matricies — doubleMatrix","text":"","code":"doubleMatrix(nrow = 0, ncol = 0) integerMatrix(nrow = 0, ncol = 0) logicalMatrix(nrow = 0, ncol = 0)"},{"path":"https://sneumann.github.io/xcms/reference/doubleMatrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Allocate double, integer, or logical matricies — doubleMatrix","text":"nrow number matrix rows ncol number matrix columns","code":""},{"path":"https://sneumann.github.io/xcms/reference/doubleMatrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Allocate double, integer, or logical matricies — doubleMatrix","text":"Matrix double, integer, logical values. Memory zeroed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/doubleMatrix.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Allocate double, integer, or logical matricies — doubleMatrix","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/estimatePrecursorIntensity.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate precursor intensity for MS level 2 spectra — estimatePrecursorIntensity","title":"Estimate precursor intensity for MS level 2 spectra — estimatePrecursorIntensity","text":"estimatePrecursorIntensity determines precursor intensity MS 2 spectrum based intensity respective signal neighboring MS 1 spectra (.e. based peak m/z matching precursor m/z MS 2 spectrum). Based parameter method either intensity peak previous MS 1 scan used (method = \"previous\") interpolation intensity previous subsequent MS1 scan used (method = \"interpolation\", considers also retention times two MS1 scans retention time MS2 spectrum).","code":""},{"path":"https://sneumann.github.io/xcms/reference/estimatePrecursorIntensity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate precursor intensity for MS level 2 spectra — estimatePrecursorIntensity","text":"","code":"estimatePrecursorIntensity( x, ppm = 10, method = c(\"previous\", \"interpolation\"), BPPARAM = bpparam() )"},{"path":"https://sneumann.github.io/xcms/reference/estimatePrecursorIntensity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate precursor intensity for MS level 2 spectra — estimatePrecursorIntensity","text":"x OnDiskMSnExp XCMSnExp object. ppm numeric(1) defining maximal acceptable difference (ppm) precursor m/z m/z corresponding peak MS 1 scan. method character(1) defining method precursor intensity determined (see description details). Defaults method = \"previous\". BPPARAM parallel processing setup. See bpparam() details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/estimatePrecursorIntensity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate precursor intensity for MS level 2 spectra — estimatePrecursorIntensity","text":"numeric length equal number spectra x. NA returned MS 1 spectra matching peak MS 1 scan can found MS 2 spectrum","code":""},{"path":"https://sneumann.github.io/xcms/reference/estimatePrecursorIntensity.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Estimate precursor intensity for MS level 2 spectra — estimatePrecursorIntensity","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/etg.html","id":null,"dir":"Reference","previous_headings":"","what":"Empirically Transformed Gaussian function — etg","title":"Empirically Transformed Gaussian function — etg","text":"general function asymmetric chromatographic peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/etg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Empirically Transformed Gaussian function — etg","text":"","code":"etg(x, H, t1, tt, k1, kt, lambda1, lambdat, alpha, beta)"},{"path":"https://sneumann.github.io/xcms/reference/etg.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Empirically Transformed Gaussian function — etg","text":"x times evaluate function H peak height t1 time leading edge inflection point tt time trailing edge inflection point k1 leading edge parameter kt trailing edge parameter lambda1 leading edge parameter lambdat trailing edge parameter alpha leading edge parameter beta trailing edge parameter","code":""},{"path":"https://sneumann.github.io/xcms/reference/etg.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Empirically Transformed Gaussian function — etg","text":"function evaluated times x.","code":""},{"path":"https://sneumann.github.io/xcms/reference/etg.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Empirically Transformed Gaussian function — etg","text":"Jianwei Li. Development Evaluation Flexible Empirical Peak Functions Processing Chromatographic Peaks. Anal. Chem., 69 (21), 4452-4462, 1997. http://dx.doi.org/10.1021/ac970481d","code":""},{"path":"https://sneumann.github.io/xcms/reference/etg.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Empirically Transformed Gaussian function — etg","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/exportMetaboAnalyst.html","id":null,"dir":"Reference","previous_headings":"","what":"Export data for use in MetaboAnalyst — exportMetaboAnalyst","title":"Export data for use in MetaboAnalyst — exportMetaboAnalyst","text":"Export feature table analysis MetaboAnalyst software (MetaboAnalystR R package).","code":""},{"path":"https://sneumann.github.io/xcms/reference/exportMetaboAnalyst.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export data for use in MetaboAnalyst — exportMetaboAnalyst","text":"","code":"exportMetaboAnalyst( x, file = NULL, label, value = \"into\", digits = NULL, groupnames = FALSE, ... )"},{"path":"https://sneumann.github.io/xcms/reference/exportMetaboAnalyst.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export data for use in MetaboAnalyst — exportMetaboAnalyst","text":"x XCMSnExp object identified chromatographic peaks grouped across samples. file character(1) defining file name. specified, matrix content returned. label either character(1) specifying phenodata column x defining sample grouping vector length samples x defining group assignment samples. value character(1) specifying value returned feature. See featureValues() details. digits integer(1) defining number significant digits used numeric. default NULL uses getOption(\"digits\"). See format() information. groupnames logical(1) whether row names resulting matrix feature IDs (groupnames = FALSE; default) IDs composed m/z retention time features (format MT (groupnames = TRUE). See help groupnames function details. ... additional parameters passed featureValues() function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/exportMetaboAnalyst.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export data for use in MetaboAnalyst — exportMetaboAnalyst","text":"file specified, function returns matrix format supported MetaboAnalyst.","code":""},{"path":"https://sneumann.github.io/xcms/reference/exportMetaboAnalyst.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Export data for use in MetaboAnalyst — exportMetaboAnalyst","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/extractMsData-method.html","id":null,"dir":"Reference","previous_headings":"","what":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","title":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","text":"UPDATE: extractMsData plotMsData functions deprecated (x, \"data.frame\") plot(x, type = \"XIC\") (x OnDiskMSnExp XCMSnExp object) used instead. See examples . aware filtering raw object might however drop adjusted retention times. cases advisable use applyAdjustedRtime() function prior filtering. Extract data.frame retention time, mz intensity values file/sample provided rt-mz range (full data range rt mz defined).","code":""},{"path":"https://sneumann.github.io/xcms/reference/extractMsData-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","text":"","code":"# S4 method for OnDiskMSnExp extractMsData(object, rt, mz, msLevel = 1L) # S4 method for XCMSnExp extractMsData( object, rt, mz, msLevel = 1L, adjustedRtime = hasAdjustedRtime(object) )"},{"path":"https://sneumann.github.io/xcms/reference/extractMsData-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","text":"object XCMSnExp OnDiskMSnExp object. rt numeric(2) retention time range data extracted. mz numeric(2) mz range. msLevel integer defining MS level(s) data sub-setted prior extraction; defaults msLevel = 1L. adjustedRtime (extractMsData,XCMSnExp): logical(1) specifying adjusted raw retention times reported. Defaults adjusted retention times, present object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/extractMsData-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","text":"list length equal number samples/files object. element data.frame columns \"rt\", \"mz\" \"\" retention time, mz intensity tuples file. data available mz-rt range file data.frame 0 rows returned file.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/extractMsData-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/extractMsData-method.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","text":"","code":"## Load a test data set with detected peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) ## Extract the full MS data for a certain retention time range ## as a data.frame tmp <- filterRt(faahko_sub, rt = c(2800, 2900)) ms_all <- as(tmp, \"data.frame\") head(ms_all) #> file rt mz i #> 1 1 2800.284 200.1 968 #> 2 1 2800.284 201.0 1273 #> 3 1 2800.284 201.9 1729 #> 4 1 2800.284 203.0 859 #> 5 1 2800.284 205.0 24136 #> 6 1 2800.284 206.0 3913 nrow(ms_all) #> [1] 79960"},{"path":"https://sneumann.github.io/xcms/reference/feature-grouping.html","id":null,"dir":"Reference","previous_headings":"","what":"Compounding of LC-MS features — feature-grouping","title":"Compounding of LC-MS features — feature-grouping","text":"Feature compounding aims identifying grouping LC-MS features representing different ions adducts (including isotopes) originating compound. MsFeatures package provides general framework functionality group features based different properties. groupFeatures methods XcmsExperiment() XCMSnExp objects implemented xcms extend enable compounding LC-MS data considering also e.g. feature peak shaped. Note functions simply define feature groups actually aggregate combine features. See MsFeatures::groupFeatures() overview general feature grouping concept well details individual settings parameters. available options groupFeatures xcms preprocessing results (.e. XcmsExperiment XCMSnExp objects correspondence analysis groupChromPeaks()) : Grouping similar retention times: groupFeatures-similar-rtime(). Grouping similar feature values across samples: AbundanceSimilarityParam(). Grouping similar peak shape extracted ion chromatograms: EicSimilarityParam(). ideal workflow grouping features sequentially perform methods (listed order). Compounded feature groups can accessed featureGroups function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/feature-grouping.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compounding of LC-MS features — feature-grouping","text":"","code":"# S4 method for XcmsResult featureGroups(object) # S4 method for XcmsResult featureGroups(object) <- value"},{"path":"https://sneumann.github.io/xcms/reference/feature-grouping.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compounding of LC-MS features — feature-grouping","text":"object XcmsExperiment() XCMSnExp() object LC-MS pre-processing results. value featureGroups<-: replacement feature groups object. length 1 length equal number features object.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/feature-grouping.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compounding of LC-MS features — feature-grouping","text":"Johannes Rainer, Mar Garcia-Aloy, Vinicius Veri Hernandes","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract ion chromatograms for each feature — featureChromatograms","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"Extract ion chromatograms features XcmsExperiment XCMSnExp object. function returns feature extracted ion chromatograms (along associated chromatographic peaks) sample. chromatogram extracted m/z - rt region includes chromatographic peaks feature. default, region defined using range chromatographic peaks' m/z retention times (mzmin = min, mzmax = max, rtmin = min rtmax = max). features, depending data, m/z rt range can thus relatively large. boundaries m/z - rt region can also restricted changing parameters mzmin, mzmax, rtmin rtmax different functions, median. default chromatographic peaks associated feature included returned XChromatograms object. object XCMSnExp object parameter include allows also return chromatographic peaks apex position within selected region (include = \"apex_within\") chromatographic peak overlapping m/z retention time range (include = \"\").","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"","code":"featureChromatograms(object, ...) # S4 method for XcmsExperiment featureChromatograms( object, expandRt = 0, expandMz = 0, aggregationFun = \"max\", features = character(), return.type = \"XChromatograms\", chunkSize = 2L, mzmin = min, mzmax = max, rtmin = min, rtmax = max, ..., progressbar = TRUE, BPPARAM = bpparam() ) # S4 method for XCMSnExp featureChromatograms( object, expandRt = 0, aggregationFun = \"max\", features, include = c(\"feature_only\", \"apex_within\", \"any\", \"all\"), filled = FALSE, n = length(fileNames(object)), value = c(\"maxo\", \"into\"), expandMz = 0, ... )"},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"object XcmsExperiment XCMSnExp object grouped chromatographic peaks. ... optional arguments passed along chromatogram() function. expandRt numeric(1) expand retention time range chromatographic peak constant value side. expandMz numeric(1) expand m/z range chromatographic peak constant value side. aware extending m/z range extracted EIC might longer represent actual identified chromatographic peak intensities potential additional mass peaks within spectra aggregated final reported intensity value per spectrum (retention time). aggregationFun character(1) specifying name used aggregate intensity values across m/z value range retention time. default \"max\" returns base peak chromatogram. features integer, character logical defining subset features chromatograms returned. Can index features featureDefinitions, feature IDs (row names featureDefinitions) logical vector. return.type character(1) defining result returned. present return.type = \"XChromatograms\" supported results thus returned XChromatograms() object. chunkSize object XcmsExperiment: integer(1) defining number files data loaded time memory. Defaults chunkSize = 2L. mzmin function defining lower boundary m/z region EIC integrated defined. Defaults mzmin = min thus smallest \"mzmin\" value chromatographic peaks feature used. mzmax function defining upper boundary m/z region EIC integrated defined. Defaults mzmax = max thus largest \"mzmax\" value chromatographic peaks feature used. rtmin function defining lower boundary rt region EIC integrated defined. Defaults rtmin = min thus smallest \"rtmin\" value chromatographic peaks feature used. rtmax function defining upper boundary rt region EIC integrated defined. Defaults rtmax = max thus largest \"rtmax\" value chromatographic peaks feature used. progressbar logical(1) defining whether progress bar shown. BPPARAM object XcmsExperiment: parallel processing setup. Defaults BPPARAM = bpparam(). See bpparam() information. include object XCMSnExp: character(1) defining chromatographic peaks (related feature definitions) included returned XChromatograms(). Defaults \"feature_only\"; See description options details. filled object XCMSnExp: logical(1) whether filled-peaks included result object. default filled = FALSE, .e. detected peaks reported. n object XCMSnExp: integer(1) optionally specify number top n samples EIC extracted. value object XCMSnExp: character(1) specifying column used sort samples. Can either \"maxo\" (default) \"\" use maximal peak intensity integrated peak area, respectively.","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"XChromatograms() object. future, depending parameter return.type, data might returned different object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"EIC data feature extracted every sample using m/z - rt area. EIC sample thus exactly represent signal actually identified chromatographic peak sample. chromPeakChromatograms() function allow extract actual EIC chromatographic peak specific sample. See also examples . Parameters include, filled, n value supported object XCMSnExp. extracting EICs top n samples can happen one features specified features dropped detected peak top n samples. chance happen smaller x contains also filled-peaks (fillChromPeaks).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"","code":"## Load a test data set with detected peaks library(xcms) library(MsExperiment) faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Perform correspondence analysis xdata <- groupChromPeaks(faahko_sub, param = PeakDensityParam(minFraction = 0.8, sampleGroups = rep(1, 3))) ## Get the feature definitions featureDefinitions(xdata) #> mzmed mzmin mzmax rtmed rtmin rtmax npeaks 1 peakidx #> FT01 300.2 300.2 300.2 3387.143 3379.317 3390.271 4 3 35, 125,.... #> FT02 301.0 301.0 301.0 2787.766 2786.200 2792.459 3 3 10, 97, 198 #> FT03 326.2 326.2 326.2 3416.877 3415.311 3424.700 3 3 37, 128, 213 #> FT04 328.2 328.2 328.2 3626.581 3618.755 3631.274 3 3 64, 159, 231 #> FT05 329.2 329.2 329.2 3626.581 3618.755 3631.274 3 3 63, 156, 230 #> FT06 343.0 343.0 343.0 2684.479 2678.218 2686.042 3 3 6, 92, 195 #> FT07 344.0 344.0 344.0 2682.914 2679.783 2686.042 3 3 3, 90, 193 #> FT08 354.2 354.2 354.2 3614.061 3610.930 3621.884 3 3 56, 153, 228 #> FT09 356.2 356.2 356.2 3830.025 3819.069 3833.153 3 3 78, 180, 241 #> FT10 365.0 365.0 365.0 2684.479 2679.783 2686.042 3 3 7, 93, 196 #> FT11 438.3 438.3 438.3 4052.248 4047.552 4060.071 3 3 81, 186, 248 #> FT12 496.2 496.2 496.2 3335.498 3316.719 3340.194 3 3 47, 143, 220 #> FT13 496.2 496.2 496.2 3402.791 3384.012 3410.617 3 3 48, 144, 221 #> FT14 508.2 508.2 508.2 3524.859 3515.468 3529.552 3 3 67, 163, 232 #> FT15 509.2 509.2 509.2 3523.294 3512.338 3531.117 3 3 54, 160, 229 #> FT16 522.2 522.2 522.2 3387.142 3344.888 3434.091 6 3 52, 53, .... #> FT17 523.2 523.2 523.2 3387.142 3344.888 3434.091 6 3 38, 39, .... #> FT18 524.2 524.2 524.2 3676.658 3598.410 3704.828 4 3 74, 75, .... #> FT19 525.2 525.2 525.2 3690.742 3662.574 3706.393 3 3 72, 173, 238 #> FT20 532.2 532.2 532.2 3482.605 3476.344 3488.863 3 3 49, 137, 219 #> FT21 536.2 536.2 536.2 3712.653 3703.262 3718.912 3 3 73, 174, 237 #> ms_level #> FT01 1 #> FT02 1 #> FT03 1 #> FT04 1 #> FT05 1 #> FT06 1 #> FT07 1 #> FT08 1 #> FT09 1 #> FT10 1 #> FT11 1 #> FT12 1 #> FT13 1 #> FT14 1 #> FT15 1 #> FT16 1 #> FT17 1 #> FT18 1 #> FT19 1 #> FT20 1 #> FT21 1 ## Extract ion chromatograms for the first 3 features. Parameter ## `features` can be either the feature IDs or feature indices. chrs <- featureChromatograms(xdata, features = rownames(featureDefinitions)[1:3]) ## Plot the EIC for the first feature using different colors for each file. plot(chrs[1, ], col = c(\"red\", \"green\", \"blue\")) ## The EICs for all 3 samples use the same m/z and retention time range, ## which was defined using the `featureArea` function: featureArea(xdata, features = rownames(featureDefinitions(xdata))[1:3], mzmin = min, mzmax = max, rtmin = min, rtmax = max) #> mzmin mzmax rtmin rtmax #> FT01 300.2 300.2 3362.104 3413.746 #> FT02 301.0 301.0 2765.855 2820.630 #> FT03 326.2 326.2 3391.837 3449.740 ## To extract the actual (exact) EICs for each chromatographic peak of ## a feature in each sample, the `chromPeakChromatograms` function would ## need to be used instead. Below we extract the EICs for all ## chromatographic peaks of the first feature. We need to first get the ## IDs of all chromatographic peaks assigned to the first feature: peak_ids <- rownames(chromPeaks(xdata))[featureDefinitions(xdata)$peakidx[[1L]]] ## We can now pass these to the `chromPeakChromatograms` function with ## parameter `peaks`: eic_1 <- chromPeakChromatograms(xdata, peaks = peak_ids) ## To plot these into a single plot we need to use the ## `plotChromatogramsOverlay` function: plotChromatogramsOverlay(eic_1)"},{"path":"https://sneumann.github.io/xcms/reference/featureSpectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract spectra associated with features — featureSpectra","title":"Extract spectra associated with features — featureSpectra","text":"function returns spectra associated identified features input object. default, spectra returned features (MS levels), parameter features allows specify/select features result returned. Parameter msLevel allows define whether MS level 1 2 spectra returned. msLevel = 1L MS1 spectra within retention time range chromatographic peak (respective data file) associated feature returned. Note samples peak identified (even filled-) spectra returned. msLevel = 2L MS2 spectra retention time within retention time range precursor m/z within m/z range chromatographic peak feature returned. See also chromPeakSpectra() (used internally extract spectra chromatographic peak feature) additional information, specifically also parameter method. default (method = \"\") spectra associated chromatographic peaks feature returned. option method, single spectrum per chromatographic peak returned (hence multiple spectra per feature). ID chromatographic peak (.e. row name chromPeaks) feature (.e., row name featureDefinitions) available returned Spectra() spectra variables \"peak_id\" \"feature_id\", respectively.","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSpectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract spectra associated with features — featureSpectra","text":"","code":"featureSpectra(object, ...) # S4 method for XcmsExperiment featureSpectra( object, msLevel = 2L, expandRt = 0, expandMz = 0, ppm = 0, skipFilled = FALSE, return.type = c(\"Spectra\", \"List\"), features = character(), ... ) # S4 method for XCMSnExp featureSpectra( object, msLevel = 2L, expandRt = 0, expandMz = 0, ppm = 0, skipFilled = FALSE, return.type = c(\"MSpectra\", \"Spectra\", \"list\", \"List\"), features = character(), ... )"},{"path":"https://sneumann.github.io/xcms/reference/featureSpectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract spectra associated with features — featureSpectra","text":"object XcmsExperiment XCMSnExp object feature defitions. ... additional arguments passed along chromPeakSpectra(), method. msLevel integer(1) defining MS level spectra returned. expandRt numeric(1) expand retention time range peak constant value side. expandMz numeric(1) expand m/z range peak constant value side. ppm numeric(1) expand m/z range peak (side) value dependent peak's m/z. skipFilled logical(1) whether spectra filled-peaks reported . return.type character(1) defining type result object returned. features character, logical integer allowing specify subset features featureDefinitions spectra returned (providing either ID, logical vector length nrow(featureDefinitions(x)) index featureDefinitions(x)). parameter overrides skipFilled supported return.type either \"Spectra\" \"List\".","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSpectra.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract spectra associated with features — featureSpectra","text":"function returns either Spectra() (return.type = \"Spectra\") List Spectra (return.type = \"List\"). latter, order length matches parameter features (features defined order features featureDefinitions(object)). Spectra variables \"peak_id\" \"feature_id\" define chromatographic peak feature individual spectrum associated .","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSpectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract spectra associated with features — featureSpectra","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSummary.html","id":null,"dir":"Reference","previous_headings":"","what":"Simple feature summaries — featureSummary","title":"Simple feature summaries — featureSummary","text":"Simple function calculate feature summaries. include counts percentages samples chromatographic peak present feature counts percentages samples one chromatographic peak annotated feature. Also relative standard deviations (RSD) calculated integrated peak areas per feature across samples. `perSampleCounts = TRUE` also individual chromatographic peak counts per sample returned.","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSummary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simple feature summaries — featureSummary","text":"","code":"featureSummary( x, group, perSampleCounts = FALSE, method = \"maxint\", skipFilled = TRUE )"},{"path":"https://sneumann.github.io/xcms/reference/featureSummary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simple feature summaries — featureSummary","text":"x [XcmsExperiment()] [XCMSnExp()] object correspondence results. group `numeric`, `logical`, `character` `factor` length `x` samples aggregate counts groups defined `group`. perSampleCounts `logical(1)` whether feature wise individual peak counts per sample returned . method `character` passed [featureValues()] function. See respective help page information. skipFilled `logical(1)` whether filled-peaks excluded (default) included summary calculation.","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSummary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simple feature summaries — featureSummary","text":"`matrix` one row per feature columns: - `\"count\"`: total number samples peak found. - `\"perc\"`: percentage samples peak found. - `\"multi_count\"`: total number samples one peak assigned feature. - `\"multi_perc\"`: percentage samples peak found, also multiple peaks annotated feature. Example: feature, least one peak detected 50 samples. 5 2 peaks assigned feature. `\"multi_perc\"` case 10 - `\"rsd\"`: relative standard deviation (coefficient variation) integrated peak area feature's peaks. - 4 columns repeated unique element (level) `group` `group` provided. `perSampleCounts = TRUE` also one column sample returned peak counts per sample.","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSummary.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Simple feature summaries — featureSummary","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Gap Filling — fillChromPeaks","title":"Gap Filling — fillChromPeaks","text":"Gap filling integrate signal m/z-rt area feature (.e., chromatographic peak group) samples chromatographic peak feature identified add chromPeaks() matrix. filled-peaks indicated TRUE column \"is_filled\" result object's chromPeakData() data frame. method gap filling along settings can defined param argument. Two different approaches available: param = FillChromPeaksParam(): default original xcms code. Signal integrated m/z retention time range defined featureDefinitions() data frame, .e. \"rtmin\", \"rtmax\", \"mzmin\" \"mzmax\". method suggested underestimates actual peak area also available object XcmsExperiment object. See details information settings method. param = ChromPeakAreaParam(): area signal feature integrated defined based feature's chromatographic peak areas. m/z range default defined lower quartile chromatographic peaks' \"mzmin\" value upper quartile chromatographic peaks' \"mzmax\" values. retention time range area defined analogously. Alternatively, setting mzmin = median, mzmax = median, rtmin = median rtmax = median ChromPeakAreaParam, median \"mzmin\", \"mzmax\", \"rtmin\" \"rtmax\" values detected chromatographic peaks feature used instead. contrast FillChromPeaksParam approach method uses () identified chromatographic peaks feature define area signal integrated. expandMz,expandMz<-: getter setter expandMz slot object. expandRt,expandRt<-: getter setter expandRt slot object. ppm,ppm<-: getter setter ppm slot object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gap Filling — fillChromPeaks","text":"","code":"fillChromPeaks(object, param, ...) # S4 method for XcmsExperiment,ChromPeakAreaParam fillChromPeaks( object, param, msLevel = 1L, chunkSize = 2L, BPPARAM = bpparam() ) FillChromPeaksParam( expandMz = 0, expandRt = 0, ppm = 0, fixedMz = 0, fixedRt = 0 ) fixedRt(object) fixedMz(object) ChromPeakAreaParam( mzmin = function(z) quantile(z, probs = 0.25, names = FALSE), mzmax = function(z) quantile(z, probs = 0.75, names = FALSE), rtmin = function(z) quantile(z, probs = 0.25, names = FALSE), rtmax = function(z) quantile(z, probs = 0.75, names = FALSE) ) # S4 method for FillChromPeaksParam expandMz(object) # S4 method for FillChromPeaksParam expandMz(object) <- value # S4 method for FillChromPeaksParam expandRt(object) # S4 method for FillChromPeaksParam expandRt(object) <- value # S4 method for FillChromPeaksParam ppm(object) # S4 method for FillChromPeaksParam ppm(object) <- value # S4 method for XCMSnExp,FillChromPeaksParam fillChromPeaks(object, param, msLevel = 1L, BPPARAM = bpparam()) # S4 method for XCMSnExp,ChromPeakAreaParam fillChromPeaks(object, param, msLevel = 1L, BPPARAM = bpparam()) # S4 method for XCMSnExp,missing fillChromPeaks(object, param, BPPARAM = bpparam(), msLevel = 1L)"},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gap Filling — fillChromPeaks","text":"object XcmsExperiment XCMSnExp object identified grouped chromatographic peaks. param ChromPeakAreaParam FillChromPeaksParam object defining approach used (see details section). ... currently ignored. msLevel integer(1) defining MS level peak filling performed (defaults msLevel = 1L). peak filling one MS level time supported, fill peaks MS level 1 2 run first using msLevel = 1 (returned result object) msLevel = 2. chunkSize fillChromPeaks object XcmsExperiment: integer(1) defining number files (samples) loaded memory processed time. setting thus allows balance memory demand speed (due parallel processing). parallel processing can performed subset data currently loaded memory iteration, value chunkSize match defined parallel setting setup. Using parallel processing setup using 4 CPUs (separate processes) using chunkSize = 1will perform parallel processing, data one sample loaded memory time. hand, settingchunkSize` total number samples experiment load full MS data memory thus settings cause --memory error. BPPARAM Parallel processing settings. expandMz FillChromPeaksParam: numeric(1) defining value mz width peaks expanded. peak expanded mz direction expandMz * original m/z width. value 0 means expansion, value 1 grows peak 1 * m/z width peak resulting peaks twice original size m/z direction (expansion half m/z width sides). expandRt FillChromPeaksParam: numeric(1), expandMz retention time width. ppm FillChromPeaksParam: numeric(1) optionally specifying ppm m/z width peak region expanded. peaks m/z width smaller mean(c(mzmin, mzmax)) * ppm / 1e6, mzmin replaced mean(c(mzmin, mzmax)) - (mean(c(mzmin, mzmax)) * ppm / 2 / 1e6) mzmax mean(c(mzmin, mzmax)) + (mean(c(mzmin, mzmax)) * ppm / 2 / 1e6). applied eventually expanding m/z width using expandMz parameter. fixedMz FillChromPeaksParam: numeric(1) defining constant factor m/z width feature expanded. m/z width expanded sides fixedMz (.e. fixedMz subtracted lower m/z added upper m/z). expansion applied expandMz ppm. fixedRt FillChromPeaksParam: numeric(1) defining constant factor retention time width factor expanded. rt width expanded sides fixedRt (.e. fixedRt subtracted lower rt added upper rt). expansion applied expandRt. mzmin function applied values \"mzmin\" column chromatographic peaks feature define lower m/z value area signal feature integrated. Defaults mzmin = function(z) quantile(z, probs = 0.25) hence using 25% quantile values. mzmax function applied values \"mzmax\" column chromatographic peaks feature define upper m/z value area signal feature integrated. Defaults mzmax = function(z) quantile(z, probs = 0.75) hence using 75% quantile values. rtmin function applied values \"rtmin\" column chromatographic peaks feature define lower rt value area signal feature integrated. Defaults rtmin = function(z) quantile(z, probs = 0.25) hence using 25% quantile values. rtmax function applied values \"rtmax\" column chromatographic peaks feature define upper rt value area signal feature integrated. Defaults rtmax = function(z) quantile(z, probs = 0.75) hence using 75% quantile values. value value slot.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gap Filling — fillChromPeaks","text":"XcmsExperiment XCMSnExp object previously missing chromatographic peaks features filled chromPeaks() matrix. FillChromPeaksParam function returns FillChromPeaksParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gap Filling — fillChromPeaks","text":"correspondence (.e. grouping chromatographic peaks across samples) always features (peak groups) include peaks every sample. fillChromPeaks method defines intensity values features missing samples integrating signal m/z-rt region feature. Two different approaches define region available: ChromPeakAreaParam region defined based detected chromatographic peaks feature, FillChromPeaksParam region defined based m/z retention times feature (represent m/z retentention times apex position associated chromatographic peaks). latter approach various parameters available increase area signal integrated, either constant value (fixedMz fixedRt) feature-relative amount (expandMz expandRt). Adjusted retention times used available. Based peak finding algorithm used identify (chromatographic) peaks, different internal functions used guarantee integrated peak signal matches much possible peak signal integration used peak detection. peaks identified matchedFilter() method, signal integration performed profile matrix generated settings used also peak finding (using bin size example). direct injection data peaks identified MSW algorithm signal integrated along mz dimension. methods complete (raw) signal within area used.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Gap Filling — fillChromPeaks","text":"expandMz,expandRt,ppm,fixedMz,fixedRt See corresponding parameter . rtmin,rtmax,mzmin,mzmax See corresponding parameter .","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Gap Filling — fillChromPeaks","text":"reported \"mzmin\", \"mzmax\", \"rtmin\" \"rtmax\" filled peaks represents actual MS area signal integrated. peak filled signal present file/sample respective mz-rt area. samples still show NA matrix returned featureValues() method.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Gap Filling — fillChromPeaks","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Gap Filling — fillChromPeaks","text":"","code":"## Load a test data set with identified chromatographic peaks library(xcms) library(MsExperiment) res <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Perform the correspondence. We assign all samples to the same group. res <- groupChromPeaks(res, param = PeakDensityParam(sampleGroups = rep(1, length(res)))) ## For how many features do we lack an integrated peak signal? sum(is.na(featureValues(res))) #> [1] 26 ## Filling missing peak data using the peak area from identified ## chromatographic peaks. res <- fillChromPeaks(res, param = ChromPeakAreaParam()) ## How many missing values do we have after peak filling? sum(is.na(featureValues(res))) #> [1] 2 ## Get the peaks that have been filled in: fp <- chromPeaks(res)[chromPeakData(res)$is_filled, ] head(fp) #> mz mzmin mzmax rt rtmin rtmax into intb maxo sn #> CP249 286.2 286.2 286.2 3252.556 3236.907 3274.857 1288521 NA 78048 NA #> CP250 380.1 380.1 380.1 3193.087 3132.054 3216.561 2094879 NA 35928 NA #> CP251 447.2 447.2 447.2 3858.193 3828.068 3914.140 2156784 NA 61256 NA #> CP252 497.2 497.2 497.2 3382.447 3347.236 3438.785 10344783 NA 310912 NA #> CP253 510.2 510.2 510.2 3750.211 3741.213 3799.898 1927180 NA 61368 NA #> CP254 531.2 531.2 531.2 3340.193 3328.848 3383.620 7589092 NA 254464 NA #> sample #> CP249 1 #> CP250 1 #> CP251 1 #> CP252 1 #> CP253 1 #> CP254 1 ## Get the process history step along with the parameters used to perform ## The peak filling: ph <- processHistory(res, type = \"Missing peak filling\")[[1]] ph #> Object of class \"XProcessHistory\" #> type: Missing peak filling #> date: Wed Apr 3 11:59:53 2024 #> info: #> fileIndex: 1,2,3 #> Parameter class: ChromPeakAreaParam #> MS level(s) 1 ## The parameter class: ph@param #> Object of class: ChromPeakAreaParam #> Parameters: #> - rtmin: function (z) #> quantile(z, probs = 0.25, names = FALSE) #> #> - rtmax: function (z) #> quantile(z, probs = 0.75, names = FALSE) #> #> - mzmin: function (z) #> quantile(z, probs = 0.25, names = FALSE) #> #> - mzmax: function (z) #> quantile(z, probs = 0.75, names = FALSE) #> ## It is also possible to remove filled-in peaks: res <- dropFilledChromPeaks(res) sum(is.na(featureValues(res))) #> [1] 26"},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Integrate areas of missing peaks — fillPeaks-methods","title":"Integrate areas of missing peaks — fillPeaks-methods","text":"sample, identify peak groups sample represented. peak groups, integrate signal region peak group create new peak.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Integrate areas of missing peaks — fillPeaks-methods","text":"object = \"xcmsSet\" fillPeaks(object, method=\"\")","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Integrate areas of missing peaks — fillPeaks-methods","text":"object xcmsSet object method filling method","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Integrate areas of missing peaks — fillPeaks-methods","text":"peak grouping, always peak groups include peaks every sample. method produces intensity values missing samples integrating raw data peak group region. According type raw-data 2 different methods available. filling gcms/lcms data method \"chrom\" integrates raw-data chromatographic domain, whereas \"MSW\" used peaklists without retention-time information like direct-infusion spectra.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Integrate areas of missing peaks — fillPeaks-methods","text":"xcmsSet objects filled peak groups.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.MSW-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","title":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","text":"sample, identify peak groups sample represented. peak groups, integrate signal region peak group create new peak.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.MSW-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","text":"object = \"xcmsSet\" fillPeaks.MSW(object)","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.MSW-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","text":"object xcmsSet object","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.MSW-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","text":"peak grouping, always peak groups include peaks every sample. method produces intensity values missing samples integrating raw data peak group region. given group, start ending m/z values integration defined median start end points detected peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.MSW-methods.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","text":"contrast fillPeaks.chrom method maximum intensity reported column \"maxo\" maximum intensity measured expected peak area (defined columns \"mzmin\" \"mzmax\"), largest intensity mz value(s) closest \"mzmed\" feature.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.MSW-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","text":"xcmsSet objects filled peak groups.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.chrom-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Integrate areas of missing peaks — fillPeaks.chrom-methods","title":"Integrate areas of missing peaks — fillPeaks.chrom-methods","text":"sample, identify peak groups sample represented. peak groups, integrate signal region peak group create new peak.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.chrom-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Integrate areas of missing peaks — fillPeaks.chrom-methods","text":"object = \"xcmsSet\" fillPeaks.chrom(object, nSlaves=0,expand.mz=1,expand.rt=1, BPPARAM = bpparam())","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.chrom-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Integrate areas of missing peaks — fillPeaks.chrom-methods","text":"object xcmsSet object nSlaves (DEPRECATED): number slaves/cores used parallel peak filling. MPI used installed, otherwise snow package employed multicore support. none two packages available uses parallel package parallel processing multiple CPUs current machine. Users advised use BPPARAM parameter instead. expand.mz Expansion factor m/z range used integration. expand.rt Expansion factor rentention time range used integration. BPPARAM allows define specific parallel processing setup current task (see bpparam BiocParallel package help information). default uses globally defined parallel setup.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.chrom-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Integrate areas of missing peaks — fillPeaks.chrom-methods","text":"peak grouping, always peak groups include peaks every sample. method produces intensity values missing samples integrating raw data peak group region. given group, start ending retention time points integration defined median start end points detected peaks. start end m/z values similarly determined. Intensities can still zero, rather unusual intensity peak. case e.g. raw data threshholded, integration area contains actual raw intensities, one sample miscalibrated, thet raw data points (just) outside integration area. Importantly, retention time correction data available, alignment information used precisely integrate propper region raw data. corrected retention time beyond end raw data, value --number (NaN).","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.chrom-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Integrate areas of missing peaks — fillPeaks.chrom-methods","text":"xcmsSet objects filled peak groups (maxo).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/filter-MChromatograms.html","id":null,"dir":"Reference","previous_headings":"","what":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","title":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","text":"functions allow filter (subset) MChromatograms() XChromatograms() objects, .e. sets chromatographic data, without changing data (intensity retention times) within individual chromatograms (Chromatogram() objects). filterColumnsIntensityAbove: subsets MChromatograms objects keeping columns (samples) value larger provided threshold rows (.e. = \"\" column kept chromatograms column value larger threshold = \"\" chromatograms column fulfill criteria). Parameter value allows define value comparison performed, value = \"bpi\" maximum intensity chromatogram compared threshold, value = \"tic\" total sum intensities chromatogram compared threshold. XChromatogramsobject,value = \"maxo\"andvalue = \"\"supported compares largest intensity identified chromatographic peaks chromatogram withthreshold`, integrated peak area, respectively. filterColumnsKeepTop: subsets MChromatograms object keeping top n columns sorted value specified sortBy. detail, column value defined sortBy extracted chromatogram aggregated using aggregationFun. Thus, default, chromatogram maximum intensity determined (sortBy = \"bpi\") values summed chromatograms column (aggregationFun = sum). columns sorted values top n columns retained returned MChromatograms. Similar filterColumnsIntensityAbove function, function allows use XChromatograms objects sort columns column sortBy = \"maxo\" sortBy = \"\" chromPeaks matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/filter-MChromatograms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","text":"","code":"# S4 method for MChromatograms filterColumnsIntensityAbove( object, threshold = 0, value = c(\"bpi\", \"tic\"), which = c(\"any\", \"all\") ) # S4 method for MChromatograms filterColumnsKeepTop( object, n = 1L, sortBy = c(\"bpi\", \"tic\"), aggregationFun = sum ) # S4 method for XChromatograms filterColumnsIntensityAbove( object, threshold = 0, value = c(\"bpi\", \"tic\", \"maxo\", \"into\"), which = c(\"any\", \"all\") ) # S4 method for XChromatograms filterColumnsKeepTop( object, n = 1L, sortBy = c(\"bpi\", \"tic\", \"maxo\", \"into\"), aggregationFun = sum )"},{"path":"https://sneumann.github.io/xcms/reference/filter-MChromatograms.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","text":"object MChromatograms() XChromatograms() object. threshold filterColumnsIntensityAbove: numeric(1) threshold value compare . value character(1) defining value used comparison sorting. Can value = \"bpi\" (default) use maximum intensity per chromatogram value = \"tic\" use sum intensities per chromatogram. XChromatograms() objects also value = \"maxo\" value = \"\" supported use maximum intensity integrated area identified chromatographic peaks chromatogram. filterColumnsIntensityAbove: character(1) defining whether (= \"\", default) (= \"\") chromatograms column fulfill criteria column kept. n filterColumnsKeepTop: integer(1) specifying number columns returned. n rounded closest (larger) integer value. sortBy filterColumnsKeepTop: value columns ordered determine top n columns. Can either sortBy = \"bpi\" (default), case maximum intensity column's chromatograms used, sortBy = \"tic\" use total intensity sum chromatograms. XChromatograms() objects also value = \"maxo\" value = \"\" supported use maximum intensity integrated area identified chromatographic peaks chromatogram. aggregationFun filterColumnsKeepTop: function used aggregate (combine) values chromatograms column. Defaults aggregationFun = sum case sum values used rank columns. Alternatively mean, median similar function can used.","code":""},{"path":"https://sneumann.github.io/xcms/reference/filter-MChromatograms.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","text":"filtered MChromatograms (XChromatograms) object number rows (EICs) eventually lower number columns (samples).","code":""},{"path":"https://sneumann.github.io/xcms/reference/filter-MChromatograms.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/filter-MChromatograms.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","text":"","code":"library(MSnbase) chr1 <- Chromatogram(rtime = 1:10 + rnorm(n = 10, sd = 0.3), intensity = c(5, 29, 50, NA, 100, 12, 3, 4, 1, 3)) chr2 <- Chromatogram(rtime = 1:10 + rnorm(n = 10, sd = 0.3), intensity = c(80, 50, 20, 10, 9, 4, 3, 4, 1, 3)) chr3 <- Chromatogram(rtime = 3:9 + rnorm(7, sd = 0.3), intensity = c(53, 80, 130, 15, 5, 3, 2)) chrs <- MChromatograms(list(chr1, chr2, chr1, chr3, chr2, chr3), ncol = 3, byrow = FALSE) chrs #> MChromatograms with 2 rows and 3 columns #> 1 2 3 #> #> [1,] length: 10 length: 10 length: 10 #> [2,] length: 10 length: 7 length: 7 #> phenoData with 0 variables #> featureData with 0 variables #### filterColumnsIntensityAbove ## ## Keep all columns with for which the maximum intensity of any of its ## chromatograms is larger 90 filterColumnsIntensityAbove(chrs, threshold = 90) #> MChromatograms with 2 rows and 3 columns #> 1 2 3 #> #> [1,] length: 10 length: 10 length: 10 #> [2,] length: 10 length: 7 length: 7 #> phenoData with 0 variables #> featureData with 0 variables ## Require that ALL chromatograms in a column have a value larger 90 filterColumnsIntensityAbove(chrs, threshold = 90, which = \"all\") #> MChromatograms with 2 rows and 1 column #> 2 #> #> [1,] length: 10 #> [2,] length: 7 #> phenoData with 0 variables #> featureData with 0 variables ## If none of the columns fulfills the criteria no columns are returned filterColumnsIntensityAbove(chrs, threshold = 900) #> MChromatograms with 2 rows and 0 columns #> phenoData with 0 variables #> featureData with 0 variables ## Filtering XChromatograms allow in addition to filter on the columns ## \"maxo\" or \"into\" of the identified chromatographic peaks within each ## chromatogram. #### filterColumnsKeepTop ## ## Keep the 2 columns with the highest sum of maximal intensities in their ## chromatograms filterColumnsKeepTop(chrs, n = 1) #> MChromatograms with 2 rows and 1 column #> 2 #> #> [1,] length: 10 #> [2,] length: 7 #> phenoData with 0 variables #> featureData with 0 variables ## Keep the 50 percent of columns with the highest total sum of signal. Note ## that n will be rounded to the next larger integer value filterColumnsKeepTop(chrs, n = 0.5 * ncol(chrs), sortBy = \"tic\") #> MChromatograms with 2 rows and 2 columns #> 2 3 #> #> [1,] length: 10 length: 10 #> [2,] length: 7 length: 7 #> phenoData with 0 variables #> featureData with 0 variables"},{"path":"https://sneumann.github.io/xcms/reference/filterFeatures.html","id":null,"dir":"Reference","previous_headings":"","what":"Filtering of features based on conventional quality assessment — filterFeatures","title":"Filtering of features based on conventional quality assessment — filterFeatures","text":"dealing metabolomics results, often necessary filter features based certain criteria. criteria typically derived statistical formulas applied full rows data, row represents feature abundance signal samples. filterFeatures function filters features based conventional quality assessment criteria. Multiple types filtering implemented can defined filter argument. Supported filter arguments : RsdFilter: Calculates relative standard deviation (.e. coefficient variation) abundance feature QC (Quality Control) samples filters input object according provided threshold. DratioFilter: Computes D-ratio dispersion ratio, defined standard deviation abundance QC samples divided standard deviation biological test samples, feature filters according provided threshold. PercentMissingFilter: Determines percentage missing values feature various sample groups filters according provided threshold. BlankFlag: Identifies features mean abundance test samples lower specified multiple mean abundance blank samples. can used flag features result contamination solvent samples. new column possible_contaminants added featureDefinitions (XcmsExperiment object) rowData (SummarizedExperiment object) reflecting . specific examples, see help pages individual parameter classes listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/filterFeatures.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filtering of features based on conventional quality assessment — filterFeatures","text":"object XcmsExperiment SummarizedExperiment. XcmsExperiment object, featureValues(object) evaluated, Summarizedesxperiment assay(object, assay). object filtered. filter parameter object selecting configuring type filtering. can one following classes: RsdFilter, DratioFilter, PercentMissingFilter BlankFlag. assay filtering SummarizedExperiment objects . Indicates assay filtering based . Note features entire object removed, computations performed single assay. Default 1, means first assay object evaluated. ... Optional parameters. object XcmsExperiment: parameters featureValues() call.","code":""},{"path":"https://sneumann.github.io/xcms/reference/filterFeatures.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Filtering of features based on conventional quality assessment — filterFeatures","text":"Broadhurst D, Goodacre R, Reinke SN, Kuligowski J, Wilson ID, Lewis MR, Dunn WB. Guidelines considerations use system suitability quality control samples mass spectrometry assays applied untargeted clinical metabolomic studies. Metabolomics. 2018;14(6):72. doi: 10.1007/s11306-018-1367-3. Epub 2018 May 18. PMID: 29805336; PMCID: PMC5960010.","code":""},{"path":"https://sneumann.github.io/xcms/reference/filterFeatures.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filtering of features based on conventional quality assessment — filterFeatures","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/filterFeatures.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filtering of features based on conventional quality assessment — filterFeatures","text":"","code":"## See the vignettes for more detailed examples library(MsExperiment) ## Load a test data set with features defined. test_xcms <- loadXcmsData() ## Set up parameter to filter based on coefficient of variation. By setting ## the filter such as below, features that have a coefficient of variation ## superior to 0.3 in QC samples will be removed from the object `test_xcms` ## when calling the `filterFeatures` function. rsd_filter <- RsdFilter(threshold = 0.3, qcIndex = sampleData(test_xcms)$sample_type == \"QC\") filtered_data_rsd <- filterFeatures(object = test_xcms, filter = rsd_filter) #> 255 features were removed ## Set up parameter to filter based on D-ratio. By setting the filter such ## as below, features that have a D-ratio computed based on their abundance ## between QC and study samples superior to 0.5 will be removed from the ## object `test_xcms`. dratio_filter <- DratioFilter(threshold = 0.5, qcIndex = sampleData(test_xcms)$sample_type == \"QC\", studyIndex = sampleData(test_xcms)$sample_type == \"study\") filtered_data_dratio <- filterFeatures(object = test_xcms, filter = dratio_filter) #> 237 features were removed ## Set up parameter to filter based on the percent of missing data. ## Parameter f should represent the sample group of samples, for which the ## percentage of missing values will be evaluated. As the setting is defined ## bellow, if a feature as less (or equal) to 30% missing values in one ## sample group, it will be kept in the `test_xcms` object. missing_data_filter <- PercentMissingFilter(threshold = 30, f = sampleData(test_xcms)$sample_type) filtered_data_missing <- filterFeatures(object = test_xcms, filter = missing_data_filter) #> 2 features were removed ## Set up parameter to flag possible contaminants based on blank samples' ## abundance. By setting the filter such as below, features that have mean ## abundance ratio between blank(here use study as an example) and QC ## samples less than 2 will be marked as `TRUE` in an extra column named ## `possible_contaminants` in the `featureDefinitions` table of the object ## `test_xcms`. filter <- BlankFlag(threshold = 2, qcIndex = sampleData(test_xcms)$sample_type == \"QC\", blankIndex = sampleData(test_xcms)$sample_type == \"study\") filtered_xmse <- filterFeatures(test_xcms, filter) #> -10 features were flagged"},{"path":"https://sneumann.github.io/xcms/reference/filtfft.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply an convolution filter using an FFT — filtfft","title":"Apply an convolution filter using an FFT — filtfft","text":"Expands vector length filter convolutes using two successive FFTs.","code":""},{"path":"https://sneumann.github.io/xcms/reference/filtfft.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply an convolution filter using an FFT — filtfft","text":"","code":"filtfft(y, filt)"},{"path":"https://sneumann.github.io/xcms/reference/filtfft.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply an convolution filter using an FFT — filtfft","text":"y numeric vector data filtered filt filter length nextn(length(y))","code":""},{"path":"https://sneumann.github.io/xcms/reference/filtfft.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply an convolution filter using an FFT — filtfft","text":"numeric vector length y.","code":""},{"path":"https://sneumann.github.io/xcms/reference/filtfft.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Apply an convolution filter using an FFT — filtfft","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-CentWaveParam.html","id":null,"dir":"Reference","previous_headings":"","what":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","title":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","text":"findChromPeaks Chromatogram MChromatograms object CentWaveParam parameter object performs centWave-based peak detection purely chromatographic data. See centWave details method CentWaveParam details parameter class. Note settings CentWaveParam used. See peaksWithCentWave() arguments used peak detection purely chromatographic data. chromatographic peak detection, identified peaks can also refined refineChromPeaks() method, can help reduce peak detection artifacts.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-CentWaveParam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","text":"","code":"# S4 method for Chromatogram,CentWaveParam findChromPeaks(object, param, ...) # S4 method for MChromatograms,CentWaveParam findChromPeaks(object, param, BPPARAM = bpparam(), ...) # S4 method for MChromatograms,MatchedFilterParam findChromPeaks(object, param, BPPARAM = BPPARAM, ...)"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-CentWaveParam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","text":"object Chromatogram MChromatograms object. param CentWaveParam object specifying settings peak detection. See peaksWithCentWave() description arguments used peak detection. ... currently ignored. BPPARAM parameter class specifying parallel processing performed (XChromatograms objects). defaults bpparam(). See bpparam() information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-CentWaveParam.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","text":"called Chromatogram object, method returns XChromatogram object identified peaks. See peaksWithCentWave() details peak matrix content.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-CentWaveParam.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-CentWaveParam.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","text":"","code":"library(MSnbase) ## Loading a test data set with identified chromatographic peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") faahko_sub <- filterRt(faahko_sub, c(2500, 3700)) #> Filter spectra ## od <- as(filterFile(faahko_sub, 1L), \"MsExperiment\") ## Extract chromatographic data for a small m/z range chr <- chromatogram(od, mz = c(272.1, 272.3))[1, 1] ## Identify peaks with default settings xchr <- findChromPeaks(chr, CentWaveParam()) xchr #> Object of class: XChromatogram #> Intensity values aggregated using: sum #> length of object: 766 #> from file: 1 #> mz range: [272.1, 272.3] #> rt range: [2501.378, 3698.567] #> MS level: 1 #> Identified chromatographic peaks (3): #> rt\trtmin\trtmax\tinto\tmaxo\tsn (1 more column(s)) #> 2734.556\t2709.517\t2770.55\t286653.221615386\t8907\t15 #> 3117.97\t3097.625\t3139.879\t372049.599925925\t16496\t33 #> 3487.299\t3457.565\t3509.208\t93049.7314242425\t2651\t15 ## Plot data and identified peaks. plot(xchr) library(MsExperiment) library(xcms) ## Perform peak detection on an MChromatograms object fls <- c(system.file(\"cdf/KO/ko15.CDF\", package = \"faahKO\"), system.file(\"cdf/KO/ko16.CDF\", package = \"faahKO\"), system.file(\"cdf/KO/ko18.CDF\", package = \"faahKO\")) od3 <- readMsExperiment(fls) ## Disable parallel processing for this example register(SerialParam()) ## Extract chromatograms for a m/z - retention time slice chrs <- chromatogram(od3, mz = 344, rt = c(2500, 3500)) ## Perform peak detection using CentWave xchrs <- findChromPeaks(chrs, param = CentWaveParam()) xchrs #> XChromatograms with 1 row and 3 columns #> 1 2 3 #> #> [1,] peaks: 2 peaks: 2 peaks: 1 #> phenoData with 2 variables #> featureData with 4 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave ## Extract the identified chromatographic peaks chromPeaks(xchrs) #> rt rtmin rtmax into intb maxo sn row column #> [1,] 2589.015 2571.801 2612.490 592297.3 554533.9 27600 14 1 1 #> [2,] 2679.783 2646.919 2709.517 5210015.9 5071346.6 152320 30 1 1 #> [3,] 2593.710 2559.281 2637.529 722415.3 640838.6 30640 14 1 2 #> [4,] 2686.042 2648.483 2714.211 5700652.0 5587464.2 151744 45 1 2 #> [5,] 2682.914 2643.790 2731.427 5255689.5 4983388.9 125632 28 1 3 ## plot the result plot(xchrs)"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-MatchedFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","title":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","text":"findChromPeaks Chromatogram MChromatograms object MatchedFilterParam parameter object performs matchedFilter-based peak detection purely chromatographic data. See matchedFilter details method MatchedFilterParam details parameter class. Note settings MatchedFilterParam used. See peaksWithMatchedFilter() arguments used peak detection purely chromatographic data.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-MatchedFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","text":"","code":"# S4 method for Chromatogram,MatchedFilterParam findChromPeaks(object, param, ...)"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-MatchedFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","text":"object Chromatogram MChromatograms object. param MatchedFilterParam object specifying settings peak detection. See peaksWithMatchedFilter() description arguments used peak detection. ... currently ignored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-MatchedFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","text":"called Chromatogram object, method returns matrix identified peaks. See peaksWithMatchedFilter() details matrix content.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-MatchedFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-MatchedFilter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","text":"","code":"## Loading a test data set with identified chromatographic peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") faahko_sub <- filterRt(faahko_sub, c(2500, 3700)) #> Filter spectra ## od <- as(filterFile(faahko_sub, 1L), \"MsExperiment\") ## Extract chromatographic data for a small m/z range chr <- chromatogram(od, mz = c(272.1, 272.3))[1, 1] ## Identify peaks with default settings xchr <- findChromPeaks(chr, MatchedFilterParam()) ## Plot the identified peaks plot(xchr)"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":null,"dir":"Reference","previous_headings":"","what":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"centWave algorithm perform peak density wavelet based chromatographic peak detection high resolution LC/MS data centroid mode [Tautenhahn 2008]. CentWaveParam class allows specify settings chromatographic peak detection using centWave method. Instances created CentWaveParam constructor. findChromPeaks,OnDiskMSnExp,CentWaveParam method performs chromatographic peak detection using centWave algorithm samples OnDiskMSnExp object. OnDiskMSnExp objects encapsule experiment specific data load spectra data (mz intensity values) fly original files applying also eventual data manipulations. ppm,ppm<-: getter setter ppm slot object. peakwidth,peakwidth<-: getter setter peakwidth slot object. snthresh,snthresh<-: getter setter snthresh slot object. prefilter,prefilter<-: getter setter prefilter slot object. mzCenterFun,mzCenterFun<-: getter setter mzCenterFun slot object. integrate,integrate<-: getter setter integrate slot object. mzdiff,mzdiff<-: getter setter mzdiff slot object. fitgauss,fitgauss<-: getter setter fitgauss slot object. noise,noise<-: getter setter noise slot object. verboseColumns,verboseColumns<-: getter setter verboseColumns slot object. roiList,roiList<-: getter setter roiList slot object. fistBaselineCheck,firstBaselineCheck<-: getter setter firstBaselineCheck slot object. roiScales,roiScales<-: getter setter roiScales slot object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"","code":"CentWaveParam( ppm = 25, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1L, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, roiList = list(), firstBaselineCheck = TRUE, roiScales = numeric(), extendLengthMSW = FALSE, verboseBetaColumns = FALSE ) # S4 method for OnDiskMSnExp,CentWaveParam findChromPeaks( object, param, BPPARAM = bpparam(), return.type = \"XCMSnExp\", msLevel = 1L, ... ) # S4 method for CentWaveParam ppm(object) # S4 method for CentWaveParam ppm(object) <- value # S4 method for CentWaveParam peakwidth(object) # S4 method for CentWaveParam peakwidth(object) <- value # S4 method for CentWaveParam snthresh(object) # S4 method for CentWaveParam snthresh(object) <- value # S4 method for CentWaveParam prefilter(object) # S4 method for CentWaveParam prefilter(object) <- value # S4 method for CentWaveParam mzCenterFun(object) # S4 method for CentWaveParam mzCenterFun(object) <- value # S4 method for CentWaveParam integrate(f) # S4 method for CentWaveParam integrate(object) <- value # S4 method for CentWaveParam mzdiff(object) # S4 method for CentWaveParam mzdiff(object) <- value # S4 method for CentWaveParam fitgauss(object) # S4 method for CentWaveParam fitgauss(object) <- value # S4 method for CentWaveParam noise(object) # S4 method for CentWaveParam noise(object) <- value # S4 method for CentWaveParam verboseColumns(object) # S4 method for CentWaveParam verboseColumns(object) <- value # S4 method for CentWaveParam roiList(object) # S4 method for CentWaveParam roiList(object) <- value # S4 method for CentWaveParam firstBaselineCheck(object) # S4 method for CentWaveParam firstBaselineCheck(object) <- value # S4 method for CentWaveParam roiScales(object) # S4 method for CentWaveParam roiScales(object) <- value # S4 method for CentWaveParam as.list(x, ...)"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"ppm numeric(1) defining maximal tolerated m/z deviation consecutive scans parts per million (ppm) initial ROI definition. peakwidth numeric(2) expected approximate peak width chromatographic space. Given range (min, max) seconds. snthresh numeric(1) defining signal noise ratio cutoff. prefilter numeric(2): c(k, ) specifying prefilter step first analysis step (ROI detection). Mass traces retained contain least k peaks intensity >= . mzCenterFun Name function calculate m/z center chromatographic peak. Allowed : \"wMean\": intensity weighted mean peak's m/z values, \"mean\": mean peak's m/z values, \"apex\": use m/z value peak apex, \"wMeanApex3\": intensity weighted mean m/z value peak apex m/z values left right \"meanApex3\": mean m/z value peak apex m/z values left right . integrate Integration method. integrate = 1 peak limits found descent mexican hat filtered data, integrate = 2 descent done real data. latter method accurate prone noise, former robust, less exact. mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. fitgauss logical(1) whether Gaussian fitted peak. affects mostly retention time position peak. noise numeric(1) allowing set minimum intensity required centroids considered first analysis step (centroids intensity < noise omitted ROI detection). verboseColumns logical(1) whether additional peak meta data columns returned. roiList optional list regions--interest (ROI) representing detected mass traces. ROIs submitted first analysis step omitted chromatographic peak detection performed submitted ROIs. ROI expected following elements specified: scmin (start scan index), scmax (end scan index), mzmin (minimum m/z), mzmax (maximum m/z), length (number scans), intensity (summed intensity). ROI represented list elements single row data.frame. firstBaselineCheck logical(1). TRUE continuous data within regions interest checked first baseline. detail, first rough estimate noise calculated peak detection performed regions multiple sequential signals higher first estimated baseline/noise level. roiScales Optional numeric vector length equal roiList defining scale region interest roiList used centWave-wavelets. extendLengthMSW Option force centWave use scales running centWave rather truncating EIC length. Uses \"open\" method extend EIC integer base-2 length prior passed convolve rather default \"reflect\" method. See https://github.com/sneumann/xcms/issues/445 information. verboseBetaColumns Option calculate two additional metrics peak quality via comparison idealized bell curve. Adds beta_cor beta_snr chromPeaks output, corresponding Pearson correlation coefficient bell curve several degrees skew well estimate signal--noise using residuals best-fitting bell curve. See https://github.com/sneumann/xcms/pull/685 https://doi.org/10.1186/s12859-023-05533-4 information. object findChromPeaks: OnDiskMSnExp object containing MS- experiment-relevant data. methods: parameter object. param CentWaveParam object containing settings centWave algorithm. BPPARAM parameter class specifying parallel processing performed. defaults bpparam. See documentation BiocParallel details. parallel processing enabled, peak detection performed parallel several input samples. return.type Character specifying type object method return. Can either \"XCMSnExp\" (default), \"list\" \"xcmsSet\". msLevel integer(1) defining MS level peak detection performed. Defaults msLevel = 1. ... ignored. value value slot. f integrate: CentWaveParam object. x parameter object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"CentWaveParam function returns CentWaveParam class instance settings specified chromatographic peak detection centWave method. findChromPeaks: return.type = \"XCMSnExp\" XCMSnExp object results peak detection. return.type = \"list\" list length equal number samples matrices specifying identified peaks. return.type = \"xcmsSet\" xcmsSet object results peak detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"centWave algorithm suitable high resolution LC/{TOF,OrbiTrap,FTICR}-MS data centroid mode. first phase method identifies regions interest (ROIs) representing mass traces characterized regions less ppm m/z deviation consecutive scans LC/MS map. detail, starting single m/z, ROI extended m/z can found next scan (spectrum) difference mean m/z ROI smaller user defined ppm m/z. mean m/z ROI updated considering also newly included m/z value. ROIs , cleanup, analyzed using continuous wavelet transform (CWT) locate chromatographic peaks different scales. first analysis step skipped, regions interest passed via param parameter. Parallel processing (one process per sample) supported can configured either BPPARAM parameter globally defining parallel processing mode using register method BiocParallel package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"ppm,peakwidth,snthresh,prefilter,mzCenterFun,integrate,mzdiff,fitgauss,noise,verboseColumns,roiList,firstBaselineCheck,roiScales,extendLengthMSW,verboseBetaColumns See corresponding parameter . Slots values exclusively accessed via corresponding getter setter methods listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"methods classes part updated modernized xcms user interface eventually replace findPeaks methods. supports peak detection OnDiskMSnExp objects (defined MSnbase package). settings centWave algorithm can passed CentWaveParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"Ralf Tautenhahn, Christoph Böttcher, Steffen Neumann \"Highly sensitive feature detection high resolution LC/MS\" BMC Bioinformatics 2008, 9:504","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"Ralf Tautenhahn, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"","code":"## Create a CentWaveParam object. Note that the noise is set to 10000 to ## speed up the execution of the example - in a real use case the default ## value should be used, or it should be set to a reasonable value. cwp <- CentWaveParam(ppm = 20, noise = 10000, prefilter = c(3, 10000)) ## Change snthresh parameter snthresh(cwp) <- 25 cwp #> Object of class: CentWaveParam #> Parameters: #> - ppm: [1] 20 #> - peakwidth: [1] 20 50 #> - snthresh: [1] 25 #> - prefilter: [1] 3 10000 #> - mzCenterFun: [1] \"wMean\" #> - integrate: [1] 1 #> - mzdiff: [1] -0.001 #> - fitgauss: [1] FALSE #> - noise: [1] 10000 #> - verboseColumns: [1] FALSE #> - roiList: list() #> - firstBaselineCheck: [1] TRUE #> - roiScales: numeric(0) #> - extendLengthMSW: [1] FALSE #> - verboseBetaColumns: [1] FALSE ## Perform the peak detection using centWave on some of the files from the ## faahKO package. Files are read using the `readMsExperiment` function ## from the MsExperiment package library(faahKO) library(xcms) library(MsExperiment) fls <- dir(system.file(\"cdf/KO\", package = \"faahKO\"), recursive = TRUE, full.names = TRUE) raw_data <- readMsExperiment(fls[1]) ## Perform the peak detection using the settings defined above. res <- findChromPeaks(raw_data, param = cwp) head(chromPeaks(res)) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP001 453.2 453.2 453.2 2506.073 2501.378 2527.982 1007409.0 1007380.8 38152 #> CP002 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> CP003 344.0 344.0 344.0 2679.783 2646.919 2709.517 5210015.9 5135916.9 152320 #> CP004 381.0 381.0 381.0 2678.218 2637.529 2720.472 2180565.2 2023571.9 52504 #> CP005 430.1 430.1 430.1 2681.348 2639.094 2712.647 2395840.3 2299899.6 65752 #> CP006 366.0 366.0 366.0 2679.783 2642.224 2718.907 3365174.0 3279468.3 79928 #> sn sample #> CP001 38151 1 #> CP002 46 1 #> CP003 68 1 #> CP004 37 1 #> CP005 42 1 #> CP006 49 1"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":null,"dir":"Reference","previous_headings":"","what":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"method performs two-step centWave-based chromatographic peak detection: first centWave run peaks identified location potential isotopes mz-retention time predicted. second centWave run performed regions interest (ROIs). final list chromatographic peaks comprises non-overlapping peaks centWave runs. CentWavePredIsoParam class allows specify settings two-step centWave-based peak detection considering also predicted isotopes peaks identified first centWave run. Instances created CentWavePredIsoParam constructor. See also documentation CentWaveParam methods arguments class inherits. findChromPeaks,OnDiskMSnExp,CentWavePredIsoParam method performs two-step centWave-based chromatographic peak detection samples OnDiskMSnExp object. OnDiskMSnExp objects encapsule experiment specific data load spectra data (mz intensity values) fly original files applying also eventual data manipulations. snthreshIsoROIs,snthreshIsoROIs<-: getter setter snthreshIsoROIs slot object. maxCharge,maxCharge<-: getter setter maxCharge slot object. maxIso,maxIso<-: getter setter maxIso slot object. mzIntervalExtension,mzIntervalExtension<-: getter setter mzIntervalExtension slot object. polarity,polarity<-: getter setter polarity slot object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"","code":"CentWavePredIsoParam( ppm = 25, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1L, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, roiList = list(), firstBaselineCheck = TRUE, roiScales = numeric(), extendLengthMSW = FALSE, verboseBetaColumns = FALSE, snthreshIsoROIs = 6.25, maxCharge = 3, maxIso = 5, mzIntervalExtension = TRUE, polarity = \"unknown\" ) # S4 method for OnDiskMSnExp,CentWavePredIsoParam findChromPeaks( object, param, BPPARAM = bpparam(), return.type = \"XCMSnExp\", msLevel = 1L, ... ) # S4 method for CentWavePredIsoParam snthreshIsoROIs(object) # S4 method for CentWavePredIsoParam snthreshIsoROIs(object) <- value # S4 method for CentWavePredIsoParam maxCharge(object) # S4 method for CentWavePredIsoParam maxCharge(object) <- value # S4 method for CentWavePredIsoParam maxIso(object) # S4 method for CentWavePredIsoParam maxIso(object) <- value # S4 method for CentWavePredIsoParam mzIntervalExtension(object) # S4 method for CentWavePredIsoParam mzIntervalExtension(object) <- value # S4 method for CentWavePredIsoParam polarity(object) # S4 method for CentWavePredIsoParam polarity(object) <- value"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"ppm numeric(1) defining maximal tolerated m/z deviation consecutive scans parts per million (ppm) initial ROI definition. peakwidth numeric(2) expected approximate peak width chromatographic space. Given range (min, max) seconds. snthresh numeric(1) defining signal noise ratio cutoff. prefilter numeric(2): c(k, ) specifying prefilter step first analysis step (ROI detection). Mass traces retained contain least k peaks intensity >= . mzCenterFun Name function calculate m/z center chromatographic peak. Allowed : \"wMean\": intensity weighted mean peak's m/z values, \"mean\": mean peak's m/z values, \"apex\": use m/z value peak apex, \"wMeanApex3\": intensity weighted mean m/z value peak apex m/z values left right \"meanApex3\": mean m/z value peak apex m/z values left right . integrate Integration method. integrate = 1 peak limits found descent mexican hat filtered data, integrate = 2 descent done real data. latter method accurate prone noise, former robust, less exact. mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. fitgauss logical(1) whether Gaussian fitted peak. affects mostly retention time position peak. noise numeric(1) allowing set minimum intensity required centroids considered first analysis step (centroids intensity < noise omitted ROI detection). verboseColumns logical(1) whether additional peak meta data columns returned. roiList optional list regions--interest (ROI) representing detected mass traces. ROIs submitted first analysis step omitted chromatographic peak detection performed submitted ROIs. ROI expected following elements specified: scmin (start scan index), scmax (end scan index), mzmin (minimum m/z), mzmax (maximum m/z), length (number scans), intensity (summed intensity). ROI represented list elements single row data.frame. firstBaselineCheck logical(1). TRUE continuous data within regions interest checked first baseline. detail, first rough estimate noise calculated peak detection performed regions multiple sequential signals higher first estimated baseline/noise level. roiScales Optional numeric vector length equal roiList defining scale region interest roiList used centWave-wavelets. extendLengthMSW Option force centWave use scales running centWave rather truncating EIC length. Uses \"open\" method extend EIC integer base-2 length prior passed convolve rather default \"reflect\" method. See https://github.com/sneumann/xcms/issues/445 information. verboseBetaColumns Option calculate two additional metrics peak quality via comparison idealized bell curve. Adds beta_cor beta_snr chromPeaks output, corresponding Pearson correlation coefficient bell curve several degrees skew well estimate signal--noise using residuals best-fitting bell curve. See https://github.com/sneumann/xcms/pull/685 https://doi.org/10.1186/s12859-023-05533-4 information. snthreshIsoROIs numeric(1) defining signal noise ratio cutoff used second centWave run identify peaks predicted isotope ROIs. maxCharge integer(1) defining maximal isotope charge. Isotopes defined charges 1:maxCharge. maxIso integer(1) defining number isotope peaks predicted peak identified first centWave run. mzIntervalExtension logical(1) whether mz range predicted isotope ROIs extended increase detection low intensity peaks. polarity character(1) specifying polarity data. Currently used, \"positive\", \"negative\" \"unknown\" provided. object findChromPeaks: OnDiskMSnExp object containing MS- experiment-relevant data. methods: parameter object. param CentWavePredIsoParam object settings chromatographic peak detection algorithm. BPPARAM parameter class specifying parallel processing performed. defaults bpparam. See documentation BiocParallel details. parallel processing enabled, peak detection performed parallel several input samples. return.type Character specifying type object method return. Can either \"XCMSnExp\" (default), \"list\" \"xcmsSet\". msLevel integer(1) defining MS level peak detection performed. Defaults msLevel = 1. ... ignored. value value slot.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"CentWavePredIsoParam function returns CentWavePredIsoParam class instance settings specified two-step centWave-based peak detection considering also isotopes. findChromPeaks: return.type = \"XCMSnExp\" XCMSnExp object results peak detection. return.type = \"list\" list length equal number samples matrices specifying identified peaks. return.type = \"xcmsSet\" xcmsSet object results peak detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"See centWave details centWave method. Parallel processing (one process per sample) supported can configured either BPPARAM parameter globally defining parallel processing mode using register method BiocParallel package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"ppm,peakwidth,snthresh,prefilter,mzCenterFun,integrate,mzdiff,fitgauss,noise,verboseColumns,roiList,firstBaselineCheck,roiScales,extendLengthMSW,verboseBetaColumns,snthreshIsoROIs,maxCharge,maxIso,mzIntervalExtension,polarity See corresponding parameter .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"methods classes part updated modernized xcms user interface eventually replace findPeaks methods. supports chromatographic peak detection OnDiskMSnExp objects (defined MSnbase package). settings algorithm can passed CentWavePredIsoParam object.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"Hendrik Treutler, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"","code":"## Create a param object p <- CentWavePredIsoParam(maxCharge = 4) ## Change snthresh parameter snthresh(p) <- 25 p #> Object of class: CentWavePredIsoParam #> Parameters: #> - snthreshIsoROIs: [1] 6.25 #> - maxCharge: [1] 4 #> - maxIso: [1] 5 #> - mzIntervalExtension: [1] TRUE #> - polarity: [1] \"unknown\" #> - ppm: [1] 25 #> - peakwidth: [1] 20 50 #> - snthresh: [1] 25 #> - prefilter: [1] 3 100 #> - mzCenterFun: [1] \"wMean\" #> - integrate: [1] 1 #> - mzdiff: [1] -0.001 #> - fitgauss: [1] FALSE #> - noise: [1] 0 #> - verboseColumns: [1] FALSE #> - roiList: list() #> - firstBaselineCheck: [1] TRUE #> - roiScales: numeric(0) #> - extendLengthMSW: [1] FALSE #> - verboseBetaColumns: [1] FALSE"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":null,"dir":"Reference","previous_headings":"","what":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"Massifquant Kalman filter (KF)-based chromatographic peak detection XC-MS data centroid mode. identified peaks can refined centWave method (see findChromPeaks-centWave details centWave) specifying withWave = TRUE. MassifquantParam class allows specify settings chromatographic peak detection using massifquant method eventually combination centWave algorithm. Instances created MassifquantParam constructor. findChromPeaks,OnDiskMSnExp,MassifquantParam method performs chromatographic peak detection using massifquant algorithm samples OnDiskMSnExp object. OnDiskMSnExp objects encapsule experiment specific data load spectra data (mz intensity values) fly original files applying also eventual data manipulations. ppm,ppm<-: getter setter ppm slot object. peakwidth,peakwidth<-: getter setter peakwidth slot object. snthresh,snthresh<-: getter setter snthresh slot object. prefilter,prefilter<-: getter setter prefilter slot object. mzCenterFun,mzCenterFun<-: getter setter mzCenterFun slot object. integrate,integrate<-: getter setter integrate slot object. mzdiff,mzdiff<-: getter setter mzdiff slot object. fitgauss,fitgauss<-: getter setter fitgauss slot object. noise,noise<-: getter setter noise slot object. verboseColumns,verboseColumns<-: getter setter verboseColumns slot object. criticalValue,criticalValue<-: getter setter criticalValue slot object. consecMissedLimit,consecMissedLimit<-: getter setter consecMissedLimit slot object. unions,unions<-: getter setter unions slot object. checkBack,checkBack<-: getter setter checkBack slot object. withWave,withWave<-: getter setter withWave slot object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"","code":"MassifquantParam( ppm = 25, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1L, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, criticalValue = 1.125, consecMissedLimit = 2, unions = 1, checkBack = 0, withWave = FALSE ) # S4 method for OnDiskMSnExp,MassifquantParam findChromPeaks( object, param, BPPARAM = bpparam(), return.type = \"XCMSnExp\", msLevel = 1L, ... ) # S4 method for MassifquantParam ppm(object) # S4 method for MassifquantParam ppm(object) <- value # S4 method for MassifquantParam peakwidth(object) # S4 method for MassifquantParam peakwidth(object) <- value # S4 method for MassifquantParam snthresh(object) # S4 method for MassifquantParam snthresh(object) <- value # S4 method for MassifquantParam prefilter(object) # S4 method for MassifquantParam prefilter(object) <- value # S4 method for MassifquantParam mzCenterFun(object) # S4 method for MassifquantParam mzCenterFun(object) <- value # S4 method for MassifquantParam integrate(f) # S4 method for MassifquantParam integrate(object) <- value # S4 method for MassifquantParam mzdiff(object) # S4 method for MassifquantParam mzdiff(object) <- value # S4 method for MassifquantParam fitgauss(object) # S4 method for MassifquantParam fitgauss(object) <- value # S4 method for MassifquantParam noise(object) # S4 method for MassifquantParam noise(object) <- value # S4 method for MassifquantParam verboseColumns(object) # S4 method for MassifquantParam verboseColumns(object) <- value # S4 method for MassifquantParam criticalValue(object) # S4 method for MassifquantParam criticalValue(object) <- value # S4 method for MassifquantParam consecMissedLimit(object) # S4 method for MassifquantParam consecMissedLimit(object) <- value # S4 method for MassifquantParam unions(object) # S4 method for MassifquantParam unions(object) <- value # S4 method for MassifquantParam checkBack(object) # S4 method for MassifquantParam checkBack(object) <- value # S4 method for MassifquantParam withWave(object) # S4 method for MassifquantParam withWave(object) <- value"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"ppm numeric(1) defining maximal tolerated m/z deviation consecutive scans parts per million (ppm) initial ROI definition. peakwidth numeric(2). first element used massifquant, specifices minimum peak length time scans. withWave = TRUE second argument represents maximum peak length subject greater mininum peak length (see also documentation do_findChromPeaks_centWave). snthresh numeric(1) defining signal noise ratio cutoff. prefilter numeric(2). first argument used (withWave = TRUE); see findChromPeaks-centWave details. second argument specifies minimum threshold maximum intensity chromatographic peak must met. mzCenterFun Name function calculate m/z center chromatographic peak. Allowed : \"wMean\": intensity weighted mean peak's m/z values, \"mean\": mean peak's m/z values, \"apex\": use m/z value peak apex, \"wMeanApex3\": intensity weighted mean m/z value peak apex m/z values left right \"meanApex3\": mean m/z value peak apex m/z values left right . integrate Integration method. integrate = 1 peak limits found descent mexican hat filtered data, integrate = 2 descent done real data. latter method accurate prone noise, former robust, less exact. mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. fitgauss logical(1) whether Gaussian fitted peak. affects mostly retention time position peak. noise numeric(1) allowing set minimum intensity required centroids considered first analysis step (centroids intensity < noise omitted ROI detection). verboseColumns logical(1) whether additional peak meta data columns returned. criticalValue numeric(1). Suggested values: (0.1-3.0). setting helps determine Kalman Filter prediciton margin error. real centroid belonging bonafide peak must fall within KF prediction margin error. Much like construction confidence interval, criticalVal loosely translates multiplier standard error prediction reported Kalman Filter. peak XC-MS sample small mass deviance ppm error, smaller critical value might better vice versa. consecMissedLimit integer(1) Suggested values: (1,2,3). peak proces detected Kalman Filter, Kalman Filter may find predicted centroid every scan. 1 consecutive failed predictions, setting informs Massifquant stop Kalman Filter following candidate peak. unions integer(1) set 1 apply t-test union segmentation; set 0 t-test applied chromatographically continous peaks sharing m/z range. Explanation: data points, sometimes Kalman Filter stops tracking peak prematurely. Another Kalman Filter instantiated begins following rest signal. tracking done backwards forwards, algorithmic defect leaves real peak divided two segments . option turned , program identifies segmented peaks combines (merges ) one two sample t-test. potential danger option truly distinct peaks may merged. checkBack integer(1) set 1 turned ; set 0 turned . convergence Kalman Filter peak's precise m/z mapping fast, sometimes incorporates erroneous centroids part peak (especially early ). scanBack option attempt remove occasional outlier lies beyond converged bounds Kalman Filter. option directly affect identification peak postprocessing measure; shown extremely useful thus far default set turned . withWave logical(1) TRUE, peaks identified first Massifquant subsequently filtered second step centWave algorithm, includes wavelet estimation. object findChromPeaks: OnDiskMSnExp object containing MS- experiment-relevant data. methods: parameter object. param MassifquantParam object containing settings massifquant algorithm. BPPARAM parameter class specifying parallel processing performed. defaults bpparam. See documentation BiocParallel details. parallel processing enabled, peak detection performed parallel several input samples. return.type Character specifying type object method return. Can either \"XCMSnExp\" (default), \"list\" \"xcmsSet\". msLevel integer(1) defining MS level peak detection performed. Defaults msLevel = 1. ... ignored. value value slot. f integrate: MassifquantParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"MassifquantParam function returns MassifquantParam class instance settings specified chromatographic peak detection massifquant method. findChromPeaks: return.type = \"XCMSnExp\" XCMSnExp object results peak detection. return.type = \"list\" list length equal number samples matrices specifying identified peaks. return.type = \"xcmsSet\" xcmsSet object results peak detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"algorithm's performance tested rigorously high resolution LC/(OrbiTrap, TOF)-MS data centroid mode. Simultaneous kalman filters identify chromatographic peaks calculate area curve. default parameters set operate complex LC-MS Orbitrap sample. Users find useful simple exploratory data analysis find set minimum intensity, identify many scans average peak spans. consecMissedLimit parameter yielded good performance Orbitrap data set (2) TOF data found best (1). may change algorithm yet tested many samples. criticalValue parameter perhaps dificult dial appropriately visual inspection peak identification best suggested tool quick optimization. ppm checkBack parameters shown less influence parameters exist give users flexibility better accuracy. Parallel processing (one process per sample) supported can configured either BPPARAM parameter globally defining parallel processing mode using register method BiocParallel package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"ppm,peakwidth,snthresh,prefilter,mzCenterFun,integrate,mzdiff,fitgauss,noise,verboseColumns,criticalValue,consecMissedLimit,unions,checkBack,withWave See corresponding parameter . Slots values exclusively accessed via corresponding getter setter methods listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"methods classes part updated modernized xcms user interface eventually replace findPeaks methods. supports chromatographic peak detection OnDiskMSnExp objects (defined MSnbase package). settings massifquant centWave algorithm can passed MassifquantParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"Conley CJ, Smith R, Torgrip RJ, Taylor RM, Tautenhahn R Prince JT \"Massifquant: open-source Kalman filter-based XC-MS isotope trace feature detection\" Bioinformatics 2014, 30(18):2636-43.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"Christopher Conley, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"","code":"## Create a MassifquantParam object. mqp <- MassifquantParam() ## Change snthresh prefilter parameters snthresh(mqp) <- 30 prefilter(mqp) <- c(6, 10000) mqp #> Object of class: MassifquantParam #> Parameters: #> - ppm: [1] 25 #> - peakwidth: [1] 20 50 #> - snthresh: [1] 30 #> - prefilter: [1] 6 10000 #> - mzCenterFun: [1] \"wMean\" #> - integrate: [1] 1 #> - mzdiff: [1] -0.001 #> - fitgauss: [1] FALSE #> - noise: [1] 0 #> - verboseColumns: [1] FALSE #> - criticalValue: [1] 1.125 #> - consecMissedLimit: [1] 2 #> - unions: [1] 1 #> - checkBack: [1] 0 #> - withWave: [1] FALSE ## Perform the peak detection using massifquant on the files from the ## faahKO package. Files are read using the readMSData from the MSnbase ## package library(faahKO) library(MSnbase) fls <- dir(system.file(\"cdf/KO\", package = \"faahKO\"), recursive = TRUE, full.names = TRUE) raw_data <- readMSData(fls[1], mode = \"onDisk\") #> Polarity can not be extracted from netCDF files, please set manually the polarity with the 'polarity' method. ## Perform the peak detection using the settings defined above. res <- findChromPeaks(raw_data, param = mqp) #> #> Massifquant, Copyright (C) 2013 Brigham Young University. #> Massifquant comes with ABSOLUTELY NO WARRANTY. See LICENSE for details. #> #> Detecting mass traces at 25ppm ... #> OK #> 334 Peaks. head(chromPeaks(res)) #> mz mzmin mzmax rtmin rtmax rt into maxo sample #> CP001 578.4 578.4 578.4 4103.890 4141.449 4119.540 1748295 187328 1 #> CP002 577.3 577.3 577.3 4100.760 4130.495 4114.845 3854210 457024 1 #> CP003 367.2 367.2 367.2 4099.196 4164.924 4122.670 140753 11330 1 #> CP004 459.1 459.1 459.1 4099.196 4128.930 4113.280 144739 15874 1 #> CP005 401.2 401.2 401.2 4083.546 4221.262 4147.709 472407 11783 1 #> CP006 412.3 412.3 412.3 4072.591 4111.715 4089.806 2192350 183936 1"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"matchedFilter algorithm identifies peaks chromatographic time domain described [Smith 2006]. intensity values binned cutting LC/MS data slices (bins) mass unit (binSize m/z) wide. Within bin maximal intensity selected. chromatographic peak detection performed bin extending based steps parameter generate slices comprising bins current_bin - steps +1 current_bin + steps - 1. slices filtered matched filtration using second-derative Gaussian model peak shape. filtration peaks detected using signal--ratio cut-. details illustrations see [Smith 2006]. MatchedFilterParam class allows specify settings chromatographic peak detection using matchedFilter method. Instances created MatchedFilterParam constructor. findChromPeaks,OnDiskMSnExp,MatchedFilterParam method performs peak detection using matchedFilter algorithm samples OnDiskMSnExp object. OnDiskMSnExp objects encapsule experiment specific data load spectra data (mz intensity values) fly original files applying also eventual data manipulations. binSize,binSize<-: getter setter binSize slot object. impute,impute<-: getter setter impute slot object. baseValue,baseValue<-: getter setter baseValue slot object. distance,distance<-: getter setter distance slot object. fwhm,fwhm<-: getter setter fwhm slot object. sigma,sigma<-: getter setter sigma slot object. max,max<-: getter setter max slot object. snthresh,snthresh<-: getter setter snthresh slot object. steps,steps<-: getter setter steps slot object. mzdiff,mzdiff<-: getter setter mzdiff slot object. index,index<-: getter setter index slot object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"","code":"MatchedFilterParam( binSize = 0.1, impute = \"none\", baseValue = numeric(), distance = numeric(), fwhm = 30, sigma = fwhm/2.3548, max = 5, snthresh = 10, steps = 2, mzdiff = 0.8 - binSize * steps, index = FALSE ) # S4 method for OnDiskMSnExp,MatchedFilterParam findChromPeaks( object, param, BPPARAM = bpparam(), return.type = \"XCMSnExp\", msLevel = 1L, ... ) # S4 method for MatchedFilterParam binSize(object) # S4 method for MatchedFilterParam binSize(object) <- value # S4 method for MatchedFilterParam impute(object) # S4 method for MatchedFilterParam impute(object) <- value # S4 method for MatchedFilterParam baseValue(object) # S4 method for MatchedFilterParam baseValue(object) <- value # S4 method for MatchedFilterParam distance(object) # S4 method for MatchedFilterParam distance(object) <- value # S4 method for MatchedFilterParam fwhm(object) # S4 method for MatchedFilterParam fwhm(object) <- value # S4 method for MatchedFilterParam sigma(object) # S4 method for MatchedFilterParam sigma(object) <- value # S4 method for MatchedFilterParam max(x) # S4 method for MatchedFilterParam max(object) <- value # S4 method for MatchedFilterParam snthresh(object) # S4 method for MatchedFilterParam snthresh(object) <- value # S4 method for MatchedFilterParam steps(object) # S4 method for MatchedFilterParam steps(object) <- value # S4 method for MatchedFilterParam mzdiff(object) # S4 method for MatchedFilterParam mzdiff(object) <- value # S4 method for MatchedFilterParam index(object) # S4 method for MatchedFilterParam index(object) <- value"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"binSize numeric(1) specifying width bins/slices m/z dimension. impute Character string specifying method used missing value imputation. Allowed values \"none\" (linear interpolation), \"lin\" (linear interpolation), \"linbase\" (linear interpolation within certain bin-neighborhood) \"intlin\". See imputeLinInterpol details. baseValue base value empty elements set. considered method = \"linbase\" corresponds profBinLinBase's baselevel argument. distance method = \"linbase\": number non-empty neighboring element empty element considered linear interpolation. See details section information. fwhm numeric(1) specifying full width half maximum matched filtration gaussian model peak. used calculate actual sigma, see . sigma numeric(1) specifying standard deviation (width) matched filtration model peak. max numeric(1) representing maximum number peaks expected/identified per slice. snthresh numeric(1) defining signal noise cutoff used chromatographic peak detection step. steps numeric(1) defining number bins merged filtration (.e. number neighboring bins joined slice filtration peak detection performed). mzdiff numeric(1) defining minimum difference m/z peaks overlapping retention times index logical(1) specifying whether indicies returned instead values m/z retention times. object findChromPeaks: OnDiskMSnExp object containing MS- experiment-relevant data. methods: parameter object. param MatchedFilterParam object containing settings matchedFilter algorithm. BPPARAM parameter class specifying parallel processing performed. defaults bpparam. See documentation BiocParallel details. parallel processing enabled, peak detection performed parallel several input samples. return.type Character specifying type object method return. Can either \"XCMSnExp\" (default), \"list\" \"xcmsSet\". msLevel integer(1) defining MS level peak detection performed. Defaults msLevel = 1. ... ignored. value value slot. x max: MatchedFilterParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"MatchedFilterParam function returns MatchedFilterParam class instance settings specified chromatographic detection matchedFilter method. findChromPeaks: return.type = \"XCMSnExp\" XCMSnExp object results peak detection. return.type = \"list\" list length equal number samples matrices specifying identified peaks. return.type = \"xcmsSet\" xcmsSet object results peak detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"intensities binned provided m/z values within spectrum (scan). Binning performed bins centered around m/z values (.e. first bin includes m/z values min(mz) - bin_size/2 min(mz) + bin_size/2). details binning missing value imputation see binYonX imputeLinInterpol methods. Parallel processing (one process per sample) supported can configured either BPPARAM parameter globally defining parallel processing mode using register method BiocParallel package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"binSize,impute,baseValue,distance,fwhm,sigma,max,snthresh,steps,mzdiff,index See corresponding parameter . Slots values exclusively accessed via corresponding getter setter methods listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"methods classes part updated modernized xcms user interface eventually replace findPeaks methods. supports chromatographic peak detection OnDiskMSnExp objects (defined MSnbase package). settings matchedFilter algorithm can passed MatchedFilterParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"Colin . Smith, Elizabeth J. Want, Grace O'Maille, Ruben Abagyan Gary Siuzdak. \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 2006, 78:779-787.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"Colin Smith, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"","code":"## Create a MatchedFilterParam object. Note that we use a unnecessarily large ## binSize parameter to reduce the run-time of the example. mfp <- MatchedFilterParam(binSize = 5) ## Change snthresh parameter snthresh(mfp) <- 15 mfp #> Object of class: MatchedFilterParam #> Parameters: #> - binSize: [1] 5 #> - impute: [1] \"none\" #> - baseValue: numeric(0) #> - distance: numeric(0) #> - fwhm: [1] 30 #> - sigma: [1] 12.73994 #> - max: [1] 5 #> - snthresh: [1] 15 #> - steps: [1] 2 #> - mzdiff: [1] -9.2 #> - index: [1] FALSE ## Perform the peak detection using matchecFilter on the files from the ## faahKO package. Files are read using the readMSData from the MSnbase ## package library(faahKO) library(MSnbase) fls <- dir(system.file(\"cdf/KO\", package = \"faahKO\"), recursive = TRUE, full.names = TRUE) raw_data <- readMSData(fls[1], mode = \"onDisk\") #> Polarity can not be extracted from netCDF files, please set manually the polarity with the 'polarity' method. ## Perform the chromatographic peak detection using the settings defined ## above. Note that we are also disabling parallel processing in this ## example by registering a \"SerialParam\" res <- findChromPeaks(raw_data, param = mfp) head(chromPeaks(res)) #> mz mzmin mzmax rt rtmin rtmax into intf maxo #> CP001 205.0000 205.0 205.0 2784.635 2770.550 2800.284 1778568.9 3580020 84280 #> CP002 205.0000 205.0 205.0 2784.635 2770.550 2800.284 1778568.9 3577971 84280 #> CP003 241.1460 241.1 241.2 3662.574 3646.924 3682.918 1465988.7 2234510 49728 #> CP004 241.1460 241.1 241.2 3662.574 3646.924 3682.918 1465988.7 2234510 49728 #> CP005 244.1000 244.1 244.1 2828.453 2814.369 2842.538 598990.3 1145078 31312 #> CP006 249.1591 249.1 249.2 3659.444 3643.794 3678.223 1435000.7 2367467 49040 #> maxf i sn sample #> CP001 194233.12 1 63.28090 1 #> CP002 194213.46 1 66.00099 1 #> CP003 96022.23 1 25.42409 1 #> CP004 96022.23 1 25.42643 1 #> CP005 64181.64 2 16.99513 1 #> CP006 104291.09 1 36.83500 1"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Chromatographic Peak Detection — findChromPeaks","title":"Chromatographic Peak Detection — findChromPeaks","text":"findChromPeaks method performs chromatographic peak detection LC/GC-MS data. peak detection algorithm can selected, configured, using param argument. Supported param objects : CentWaveParam(): chromatographic peak detection using centWave algorithm. CentWavePredIsoParam(): centWave predicted isotopes. Peak detection uses two-step centWave-based approach considering also feature isotopes. MatchedFilterParam(): peak detection using matched filter algorithm. MassifquantParam(): peak detection using Kalman filter-based massifquant method. MSWParam(): single-spectrum non-chromatography MS data peak detection. specific examples see help pages individual parameter classes listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Chromatographic Peak Detection — findChromPeaks","text":"","code":"findChromPeaks(object, param, ...) # S4 method for MsExperiment,Param findChromPeaks( object, param, msLevel = 1L, chunkSize = 2L, ..., BPPARAM = bpparam() ) # S4 method for XcmsExperiment,Param findChromPeaks( object, param, msLevel = 1L, chunkSize = 2L, add = FALSE, ..., BPPARAM = bpparam() )"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Chromatographic Peak Detection — findChromPeaks","text":"object data object perform peak detection. Can OnDiskMSnExp(), XCMSnExp(), MChromatograms() MsExperiment() object. param parameter object selecting configuring algorithm. ... Optional parameters. msLevel integer(1) defining MS level chromatographic peak detection performed. chunkSize integer(1) object MsExperiment XcmsExperiment(): defines number files (samples) full peaks data (m/z intensity values) loaded memory time. Peak detection performed parallel (per sample) subset loaded data. setting thus allows balance memory demand speed (due parallel processing) peak detection. parallel processing can performed subset data loaded currently memory (iteration), value chunkSize match defined parallel setting setup. Using parallel processing setup using 4 CPUs (separate processes) using chunkSize = 1will perform parallel processing, data one sample loaded memory time. hand, settingchunkSizeto total number samples experiment load full MS data memory thus settings cause --memory error. settingchunkSize = -1the peak detection performed separately, parallel, sample. however work allSpectra` backends (see eventually Spectra() details). BPPARAM Parallel processing setup. Uses default system-wide default setup. See bpparam() details. add logical(1) (object contains already chromatographic peaks, .e. either XCMSnExp XcmsExperiment) whether chromatographic peak detection results added existing results. default (add = FALSE) additional findChromPeaks call result object remove previous results.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Chromatographic Peak Detection — findChromPeaks","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaksIsolationWindow.html","id":null,"dir":"Reference","previous_headings":"","what":"Data independent acquisition (DIA): peak detection in isolation windows — findChromPeaksIsolationWindow","title":"Data independent acquisition (DIA): peak detection in isolation windows — findChromPeaksIsolationWindow","text":"findChromPeaksIsolationWindow function allows perform chromatographic peak detection MS level > 1 spectra certain isolation windows (e.g. SWATH pockets). function performs peak detection, separately spectra belonging isolation window adds chromPeaks() matrix result object. Information isolation window detected added chromPeakData() data frame. Note peak detection method remove previously identified chromatographic peaks (e.g. MS1 level using findChromPeaks() function adds newly identified peaks existing chromPeaks() matrix. Isolation windows can defined isolationWindow parameter, default uses definition isolationWindowTargetMz(), .e. chromatographic peak detection performed spectra isolation window target m/z (seprarately file). parameter param allows define configure peak detection algorithm (see findChromPeaks() information).","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaksIsolationWindow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Data independent acquisition (DIA): peak detection in isolation windows — findChromPeaksIsolationWindow","text":"","code":"findChromPeaksIsolationWindow(object, ...) # S4 method for MsExperiment findChromPeaksIsolationWindow( object, param, msLevel = 2L, isolationWindow = isolationWindowTargetMz(spectra(object)), chunkSize = 2L, ..., BPPARAM = bpparam() ) # S4 method for OnDiskMSnExp findChromPeaksIsolationWindow( object, param, msLevel = 2L, isolationWindow = isolationWindowTargetMz(object), ... )"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaksIsolationWindow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Data independent acquisition (DIA): peak detection in isolation windows — findChromPeaksIsolationWindow","text":"object MsExperiment, XcmsExperiment, OnDiskMSnExp XCMSnExp object DIA data. ... currently used. param Peak detection parameter object, CentWaveParam object defining configuring chromographic peak detection algorithm. See also findChromPeaks() details. msLevel integer(1) specifying MS level peak detection performed. default msLevel = 2L. isolationWindow factor similar defining isolation windows peak detection performed length equal number spectra object. chunkSize object MsExperiment XcmsExperiment: integer(1) defining number files (samples) loaded memory processed time. See findChromPeaks() information. BPPARAM object MsExperiment XcmsExperiment: parallel processing setup. See bpparam() information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaksIsolationWindow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Data independent acquisition (DIA): peak detection in isolation windows — findChromPeaksIsolationWindow","text":"XcmsExperiment XCMSnExp object chromatographic peaks identified spectra isolation window file added chromPeaks matrix. Isolation window definition identified peak stored additional columns chromPeakData().","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaksIsolationWindow.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Data independent acquisition (DIA): peak detection in isolation windows — findChromPeaksIsolationWindow","text":"Johannes Rainer, Michael Witting","code":""},{"path":"https://sneumann.github.io/xcms/reference/findEqualGreater.html","id":null,"dir":"Reference","previous_headings":"","what":"Find values in sorted vectors — findEqualGreater","title":"Find values in sorted vectors — findEqualGreater","text":"Find values sorted vectors.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findEqualGreater.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find values in sorted vectors — findEqualGreater","text":"","code":"findEqualGreater(x, value) findEqualLess(x, value) findEqualGreaterM(x, values) findRange(x, values, NAOK = FALSE)"},{"path":"https://sneumann.github.io/xcms/reference/findEqualGreater.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find values in sorted vectors — findEqualGreater","text":"x numeric vector sorted increasing order value value find x values numeric values find x NAOK check NA values x","code":""},{"path":"https://sneumann.github.io/xcms/reference/findEqualGreater.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find values in sorted vectors — findEqualGreater","text":"findEqualGreater finds index first value x equal greater value. findEqualLess except finds equal less. findEqualGreaterM creates index vector finding specified values. findRange locates start stop indicides range two x values. things save time point findeEqualGreaterM (length values approaches lenght x) findRange (NAOK set TRUE). run log(N) N time, respectively.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findEqualGreater.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find values in sorted vectors — findEqualGreater","text":"integer vector position(s) values(s).","code":""},{"path":"https://sneumann.github.io/xcms/reference/findEqualGreater.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find values in sorted vectors — findEqualGreater","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":null,"dir":"Reference","previous_headings":"","what":"Find fragment ions in xcmsFragment objects — findMZ","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"method find fragment mass ppm window xcmsFragment object","code":""},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"","code":"findMZ(object, find, ppmE=25, print=TRUE)"},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"object xcmsFragment object type find fragment ion found ppmE ppm error window searching print print nice little report","code":""},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"method simply searches given fragment ion xcmsFragment object type given certain ppm error window","code":""},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"data frame following columns: PrecursorMz precursor m/z fragment MSnParentPeakID index ID location precursor peak xcmsFragment object msLevel level found fragment ion rt Retention time found ion mz actual m/z found fragment ion intensity intensity fragment ion sample sample fragment ion came GroupPeakMSn ID peaks grouped xcmsSet grouping CollisionEnergy collision energy precursor scan","code":""},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"H. Paul Benton, D.M. Wong, S..Strauger, G. Siuzdak \"XC\\(MS^2\\)\" Analytical Chemistry 2008","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"H. Paul Benton, hpaul.beonton08@imperial.ac.uk","code":""},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"","code":"if (FALSE) { library(msdata) mzMLpath <- system.file(\"iontrap\", package = \"msdata\") mzMLfiles<-list.files(mzMLpath, pattern = \"extracted.mzML\", recursive = TRUE, full.names = TRUE) xs <- xcmsSet(mzMLfiles, method = \"MS1\") ##takes only one file from the file set xfrag <- xcmsFragments(xs) found<-findMZ(xfrag, 657.3433, 50) }"},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":null,"dir":"Reference","previous_headings":"","what":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"Perform peak detection mass spectrometry direct injection spectrum using wavelet based algorithm. MSWParam class allows specify settings peak detection using MSW method. Instances created MSWParam constructor. findChromPeaks,OnDiskMSnExp,MSWParam method performs peak detection single-spectrum non-chromatography MS data using functionality MassSpecWavelet package samples OnDiskMSnExp object. OnDiskMSnExp objects encapsule experiment specific data load spectra data (mz intensity values) fly original files applying also eventual data manipulations. snthresh,snthresh<-: getter setter snthresh slot object. verboseColumns,verboseColumns<-: getter setter verboseColumns slot object. scales,scales<-: getter setter scales slot object. nearbyPeak,nearbyPeak<-: getter setter nearbyPeak slot object. peakScaleRange,peakScaleRange<-: getter setter peakScaleRange slot object. ampTh,ampTh<-: getter setter ampTh slot object. minNoiseLevel,minNoiseLevel<-: getter setter minNoiseLevel slot object. ridgeLength,ridgeLength<-: getter setter ridgeLength slot object. peakThr,peakThr<-: getter setter peakThr slot object. tuneIn,tuneIn<-: getter setter tuneIn slot object. addParams,addParams<-: getter setter addParams slot object. slot stores optional additional parameters passed identifyMajorPeaks peakDetectionCWT functions MassSpecWavelet package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"","code":"MSWParam( snthresh = 3, verboseColumns = FALSE, scales = c(1, seq(2, 30, 2), seq(32, 64, 4)), nearbyPeak = TRUE, peakScaleRange = 5, ampTh = 0.01, minNoiseLevel = ampTh/snthresh, ridgeLength = 24, peakThr = NULL, tuneIn = FALSE, ... ) # S4 method for OnDiskMSnExp,MSWParam findChromPeaks( object, param, BPPARAM = bpparam(), return.type = \"XCMSnExp\", msLevel = 1L, ... ) # S4 method for MSWParam snthresh(object) # S4 method for MSWParam snthresh(object) <- value # S4 method for MSWParam verboseColumns(object) # S4 method for MSWParam verboseColumns(object) <- value # S4 method for MSWParam scales(object) # S4 method for MSWParam scales(object) <- value # S4 method for MSWParam nearbyPeak(object) # S4 method for MSWParam nearbyPeak(object) <- value # S4 method for MSWParam peakScaleRange(object) # S4 method for MSWParam peakScaleRange(object) <- value # S4 method for MSWParam ampTh(object) # S4 method for MSWParam ampTh(object) <- value # S4 method for MSWParam minNoiseLevel(object) # S4 method for MSWParam minNoiseLevel(object) <- value # S4 method for MSWParam ridgeLength(object) # S4 method for MSWParam ridgeLength(object) <- value # S4 method for MSWParam peakThr(object) # S4 method for MSWParam peakThr(object) <- value # S4 method for MSWParam tuneIn(object) # S4 method for MSWParam tuneIn(object) <- value # S4 method for MSWParam addParams(object) # S4 method for MSWParam addParams(object) <- value"},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"snthresh numeric(1) defining signal noise ratio cutoff. verboseColumns logical(1) whether additional peak meta data columns returned. scales Numeric defining scales continuous wavelet transform (CWT). nearbyPeak logical(1) whether include nearby peaks major peaks. peakScaleRange numeric(1) defining scale range peak (larger 5 default). ampTh numeric(1) defining minimum required relative amplitude peak (ratio maximum CWT coefficients). minNoiseLevel numeric(1) defining minimum noise level used computing SNR. ridgeLength numeric(1) defining minimum highest scale peak 2-D CWT coefficient matrix. peakThr numeric(1) minimum absolute intensity (baseline) peaks picked. provided, smoothing Savitzky-Golay filter used (MassSpecWavelet) package estimate local intensity. tuneIn logical(1) whther tune parameter estimation detected peaks. ... Additional parameters passed peakDetectionCWT identifyMajorPeaks functions MassSpecWavelet package. object findChromPeaks: OnDiskMSnExp object containing MS- experiment-relevant data. methods: parameter object. param MSWParam object containing settings algorithm. BPPARAM parameter class specifying parallel processing performed. defaults bpparam. See documentation BiocParallel details. parallel processing enabled, peak detection performed parallel several input samples. return.type Character specifying type object method return. Can either \"XCMSnExp\" (default), \"list\" \"xcmsSet\". msLevel integer(1) defining MS level peak detection performed. Defaults msLevel = 1. value value slot.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"MSWParam function returns MSWParam class instance settings specified peak detection MSW method. findChromPeaks: return.type = \"XCMSnExp\" XCMSnExp object results peak detection. return.type = \"list\" list length equal number samples matrices specifying identified peaks. return.type = \"xcmsSet\" xcmsSet object results detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"wrapper peak picker Bioconductor's MassSpecWavelet package calling peakDetectionCWT tuneInPeakInfo functions. See xcmsDirect vignette information. Parallel processing (one process per sample) supported can configured either BPPARAM parameter globally defining parallel processing mode using register method BiocParallel package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"snthresh,verboseColumns,scales,nearbyPeak,peakScaleRange,ampTh,minNoiseLevel,ridgeLength,peakThr,tuneIn,addParams See corresponding parameter .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"methods classes part updated modernized xcms user interface eventually replace findPeaks methods. supports peak detection OnDiskMSnExp objects (defined MSnbase package). settings algorithm can passed MSWParam object.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"Joachim Kutzera, Steffen Neumann, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"","code":"library(MSnbase) ## Create a MSWParam object mp <- MSWParam() ## Change snthresh parameter snthresh(mp) <- 15 mp #> Object of class: MSWParam #> Parameters: #> - snthresh: [1] 15 #> - verboseColumns: [1] FALSE #> - scales: [1] 1 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 36 40 44 48 52 56 60 64 #> - nearbyPeak: [1] TRUE #> - peakScaleRange: [1] 5 #> - amp.Th: [1] 0.01 #> - minNoiseLevel: [1] 0.003333333 #> - ridgeLength: [1] 24 #> - peakThr: numeric(0) #> - tuneIn: [1] FALSE ## Loading a small subset of direct injection, single spectrum files library(msdata) fticrf <- list.files(system.file(\"fticr-mzML\", package = \"msdata\"), recursive = TRUE, full.names = TRUE) fticr <- readMSData(fticrf[1], msLevel. = 1, mode = \"onDisk\") ## Perform the MSW peak detection on these: p <- MSWParam(scales = c(1, 7), peakThr = 80000, ampTh = 0.005, SNR.method = \"data.mean\", winSize.noise = 500) fticr <- findChromPeaks(fticr, param = p) head(chromPeaks(fticr)) #> mz mzmin mzmax rt rtmin rtmax into maxo sn intf #> CP01 403.2367 403.2279 403.2447 -1 -1 -1 4735258 372259.4 22.975342 NA #> CP02 409.1845 409.1755 409.1936 -1 -1 -1 4158404 310572.1 20.597978 NA #> CP03 413.2677 413.2585 413.2769 -1 -1 -1 6099006 435462.6 27.217229 NA #> CP04 414.2719 414.2652 414.2786 -1 -1 -1 1916658 157613.1 8.777433 NA #> CP05 423.2363 423.2266 423.2459 -1 -1 -1 2708391 174252.7 14.745275 NA #> CP06 427.2681 427.2583 427.2779 -1 -1 -1 6302089 461385.6 32.468892 NA #> maxf sample #> CP01 814693.1 1 #> CP02 731557.2 1 #> CP03 1018994.8 1 #> CP04 280826.9 1 #> CP05 435858.5 1 #> CP06 1124549.4 1"},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Feature detection for GC/MS and LC/MS Data - methods — findPeaks-methods","title":"Feature detection for GC/MS and LC/MS Data - methods — findPeaks-methods","text":"number peak pickers exist XCMS. findPeaks generic method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Feature detection for GC/MS and LC/MS Data - methods — findPeaks-methods","text":"object = \"xcmsRaw\" findPeaks(object, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Feature detection for GC/MS and LC/MS Data - methods — findPeaks-methods","text":"object xcmsRaw-class object method Method use peak detection. See details. ... Optional arguments passed along","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Feature detection for GC/MS and LC/MS Data - methods — findPeaks-methods","text":"Different algorithms can used specifying method argument. example use matched filter approach described Smith et al (2006) one use: findPeaks(object, method=\"matchedFilter\"). also default. arguments given ... passed function implementing method. character vector nicknames algorithms available returned getOption(\"BioC\")$xcms$findPeaks.methods. nickname method called \"centWave\", help page specific method can accessed ?findPeaks.centWave.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Feature detection for GC/MS and LC/MS Data - methods — findPeaks-methods","text":"matrix columns: mz weighted (intensity) mean peak m/z across scans mzmin m/z minimum step mzmax m/z maximum step rt retention time peak midpoint rtmin leading edge peak retention time rtmax trailing edge peak retention time integrated area original (raw) peak maxo maximum intensity original (raw) peak additional columns depending choosen method.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MS1-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","title":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","text":"Collecting Tandem MS MS$^n$ Mass Spectrometry precursor peaks annotated XML raw file","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MS1-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","text":"object = \"xcmsRaw\" findPeaks.MS1(object)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MS1-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","text":"mass spectrometers can acquire MS1 MS2 (MS$^n$ scans) quasi simultaneously, e.g. data dependent tandem MS DDIT mode. Since xcmsFragments attaches MS$^n$ peaks MS1 peaks xcmsSet, important findPeaks xcmsSet miss MS1 precursor peak. sure MS1 precursor peaks xcmsSet, findPeaks.MS1 actual peak picking, simply uses annotation stored mzXML, mzData mzML raw files. relies following XML tags: mzData: \t <\/spectrumInstrument> <\/precursor> <\/spectrum> mzXML: 220.1828003<\/precursorMz> <\/scan> Several mzXML mzData converters known create incomplete files, either without intensities (set 0) without precursor retention time (reasonably close rt chosen. NYI).","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MS1-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","text":"object xcmsRaw object","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MS1-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","text":"matrix columns: mz, mzmin, mzmax annotated MS1 precursor selection mass rt, rtmin, rtmax annotated MS1 precursor retention time , maxo, sn annotated MS1 precursor intensity","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MS1-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","text":"Steffen Neumann, sneumann@ipb-halle.de","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MSW-xcmsRaw-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","title":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","text":"method performs peak detection mass spectrometry direct injection spectrum using wavelet based algorithm.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MSW-xcmsRaw-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","text":"","code":"# S4 method for xcmsRaw findPeaks.MSW(object, snthresh = 3, verbose.columns = FALSE, ...)"},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MSW-xcmsRaw-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","text":"object xcmsRaw object peak detection performed. snthresh numeric(1) defining signal noise ratio cutoff. verbose.columns Logical whether additional peak meta data columns returned. ... Additional parameters passed peakDetectionCWT identifyMajorPeaks functions MassSpecWavelet package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MSW-xcmsRaw-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","text":"matrix, row representing intentified peak, columns: mz m/z value peak centroid position. mzmin Minimum m/z peak. mzmax Maximum m/z peak. rt Always -1. rtmin Always -1. rtmax Always -1. Integrated (original) intensity peak. maxo Maximum intensity peak. intf Always NA. maxf Maximum MSW-filter response peak. sn Signal noise ratio.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MSW-xcmsRaw-method.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","text":"wrapper around peak picker Bioconductor's MassSpecWavelet package calling peakDetectionCWT tuneInPeakInfo functions.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MSW-xcmsRaw-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","text":"Joachim Kutzera, Steffen Neumann, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"Peak density wavelet based feature detection aiming isotope peaks high resolution LC/MS data centroid mode","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"object = \"xcmsRaw\" findPeaks.centWave(object, ppm=25, peakwidth=c(20,50), prefilter=c(3,100), mzCenterFun=\"wMean\", integrate=1, mzdiff=-0.001, fitgauss=FALSE, scanrange= numeric(), noise=0, sleep=0, verbose.columns=FALSE, xcmsPeaks, snthresh=6.25, maxcharge=3, maxiso=5, mzIntervalExtension=TRUE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"algorithm suitable high resolution LC/{TOF,OrbiTrap,FTICR}-MS data centroid mode. first phase method isotope ROIs (regions interest) LC/MS map predicted. second phase mass traces analysed. Continuous wavelet transform (CWT) used locate chromatographic peaks different scales. resulting peak list given peak list (xcmsPeaks) merged redundant peaks removed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"object xcmsSet object ppm maxmial tolerated m/z deviation consecutive scans, ppm (parts per million) peakwidth Chromatographic peak width, given range (min,max) seconds prefilter prefilter=c(k,). Prefilter step first phase. Mass traces retained contain least k peaks intensity >= . mzCenterFun Function calculate m/z center feature: wMean intensity weighted mean feature m/z values, mean mean feature m/z values, apex use m/z value peak apex, wMeanApex3 intensity weighted mean m/z value peak apex m/z value left right , meanApex3 mean m/z value peak apex m/z value left right . integrate Integration method. =1 peak limits found descent mexican hat filtered data, =2 descent done real data. Method 2 accurate prone noise, method 1 robust noise less exact. mzdiff minimum difference m/z peaks overlapping retention times, can negative allow overlap fitgauss logical, TRUE Gaussian fitted peak scanrange scan range process noise optional argument useful data centroided without intensity threshold, centroids intensity < noise omitted ROI detection sleep number seconds pause plotting peak finding cycles verbose.columns logical, TRUE additional peak meta data columns returned xcmsPeaks peak list picked using centWave algorithm parameter verbose.columns set TRUE (columns scmin scmax needed) snthresh signal noise ratio cutoff, definition see . maxcharge max. number isotope charge. maxiso max. number isotope peaks predict detected feature. mzIntervalExtension logical, TRUE predicted isotope ROIs (regions interest) extended m/z dimension increase detection low intensity hence noisy peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"matrix columns: mz weighted (intensity) mean peak m/z across scans mzmin m/z peak minimum mzmax m/z peak maximum rt retention time peak midpoint rtmin leading edge peak retention time rtmax trailing edge peak retention time integrated peak intensity intb baseline corrected integrated peak intensity maxo maximum peak intensity sn Signal/Noise ratio, defined (maxo - baseline)/sd, maxo maximum peak intensity, baseline estimated baseline value sd standard deviation local chromatographic noise. egauss RMSE Gaussian fit verbose.columns TRUE additionally : mu Gaussian parameter mu sigma Gaussian parameter sigma h Gaussian parameter h f Region number m/z ROI peak localised dppm m/z deviation mass trace across scans ppm scale Scale peak localised scpos Peak position found wavelet analysis scmin Left peak limit found wavelet analysis (scan number) scmax Right peak limit found wavelet analysis (scan number)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"Ralf Tautenhahn","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"Ralf Tautenhahn, Christoph Böttcher, Steffen Neumann \"Highly sensitive feature detection high resolution LC/MS\" BMC Bioinformatics 2008, 9:504\\ Hendrik Treutler Steffen Neumann. \"Prediction, detection, validation isotope clusters mass spectrometry data\" Submitted Metabolites 2016, Special Issue \"Bioinformatics Data Analysis\"","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"Peak density wavelet based feature detection high resolution LC/MS data centroid mode","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"object = \"xcmsRaw\" findPeaks.centWave(object, ppm=25, peakwidth=c(20,50), snthresh=10, prefilter=c(3,100), mzCenterFun=\"wMean\", integrate=1, mzdiff=-0.001, fitgauss=FALSE, scanrange= numeric(), noise=0, sleep=0, verbose.columns=FALSE, ROI.list=list()), firstBaselineCheck=TRUE, roiScales=NULL","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"algorithm suitable high resolution LC/{TOF,OrbiTrap,FTICR}-MS data centroid mode. first phase method mass traces (characterised regions less ppm m/z deviation consecutive scans) LC/MS map located. second phase mass traces analysed. Continuous wavelet transform (CWT) used locate chromatographic peaks different scales.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"object xcmsSet object ppm maxmial tolerated m/z deviation consecutive scans, ppm (parts per million) peakwidth Chromatographic peak width, given range (min,max) seconds snthresh signal noise ratio cutoff, definition see . prefilter prefilter=c(k,). Prefilter step first phase. Mass traces retained contain least k peaks intensity >= . mzCenterFun Function calculate m/z center feature: wMean intensity weighted mean feature m/z values, mean mean feature m/z values, apex use m/z value peak apex, wMeanApex3 intensity weighted mean m/z value peak apex m/z value left right , meanApex3 mean m/z value peak apex m/z value left right . integrate Integration method. =1 peak limits found descent mexican hat filtered data, =2 descent done real data. Method 2 accurate prone noise, method 1 robust noise less exact. mzdiff minimum difference m/z peaks overlapping retention times, can negative allow overlap fitgauss logical, TRUE Gaussian fitted peak scanrange scan range process noise optional argument useful data centroided without intensity threshold, centroids intensity < noise omitted ROI detection sleep number seconds pause plotting peak finding cycles verbose.columns logical, TRUE additional peak meta data columns returned ROI.list optional list ROIs represents detected mass traces (ROIs). list empty (default) centWave detects mass trace ROIs, otherwise step skipped supplied ROIs used peak detection phase. ROI object list following slots: scmin start scan index, scmax end scan index, mzmin minimum m/z, mzmax maximum m/z, length number scans, intensity summed intensity. firstBaselineCheck logical, TRUE continuous data within ROI checked 1st baseline roiScales numeric, optional vector scales ROI ROI.list used centWave-wavelets","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"matrix columns: mz weighted (intensity) mean peak m/z across scans mzmin m/z peak minimum mzmax m/z peak maximum rt retention time peak midpoint rtmin leading edge peak retention time rtmax trailing edge peak retention time integrated peak intensity intb baseline corrected integrated peak intensity maxo maximum peak intensity sn Signal/Noise ratio, defined (maxo - baseline)/sd, maxo maximum peak intensity, baseline estimated baseline value sd standard deviation local chromatographic noise. egauss RMSE Gaussian fit verbose.columns TRUE additionally : mu Gaussian parameter mu sigma Gaussian parameter sigma h Gaussian parameter h f Region number m/z ROI peak localised dppm m/z deviation mass trace across scans ppm scale Scale peak localised scpos Peak position found wavelet analysis scmin Left peak limit found wavelet analysis (scan number) scmax Right peak limit found wavelet analysis (scan number)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"Ralf Tautenhahn","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"Ralf Tautenhahn, Christoph Böttcher, Steffen Neumann \"Highly sensitive feature detection high resolution LC/MS\" BMC Bioinformatics 2008, 9:504","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"Peak density wavelet based feature detection high resolution LC/MS data centroid mode additional peak picking isotope features basis isotope peak predictions","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"object = \"xcmsRaw\" findPeaks.centWaveWithPredictedIsotopeROIs(object, ppm=25, peakwidth=c(20,50), snthresh=10, prefilter=c(3,100), mzCenterFun=\"wMean\", integrate=1, mzdiff=-0.001, fitgauss=FALSE, scanrange= numeric(), noise=0, sleep=0, verbose.columns=FALSE, ROI.list=list(), firstBaselineCheck=TRUE, roiScales=NULL, snthreshIsoROIs=6.25, maxcharge=3, maxiso=5, mzIntervalExtension=TRUE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"algorithm suitable high resolution LC/{TOF,OrbiTrap,FTICR}-MS data centroid mode. centWave algorithm applied two peak picking steps follows. first peak picking step ROIs (regions interest, characterised regions less ppm m/z deviation consecutive scans) LC/MS map located analysed using continuous wavelet transform (CWT) localization chromatographic peaks different scales. second peak picking step isotope ROIs LC/MS map predicted analysed using continuous wavelet transform (CWT) localization chromatographic peaks different scales. peak lists resulting peak picking steps merged redundant peaks removed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"object xcmsSet object ppm maxmial tolerated m/z deviation consecutive scans, ppm (parts per million) peakwidth Chromatographic peak width, given range (min,max) seconds snthresh signal noise ratio cutoff, definition see . prefilter prefilter=c(k,). Prefilter step first phase. Mass traces retained contain least k peaks intensity >= . mzCenterFun Function calculate m/z center feature: wMean intensity weighted mean feature m/z values, mean mean feature m/z values, apex use m/z value peak apex, wMeanApex3 intensity weighted mean m/z value peak apex m/z value left right , meanApex3 mean m/z value peak apex m/z value left right . integrate Integration method. =1 peak limits found descent mexican hat filtered data, =2 descent done real data. Method 2 accurate prone noise, method 1 robust noise less exact. mzdiff minimum difference m/z peaks overlapping retention times, can negative allow overlap fitgauss logical, TRUE Gaussian fitted peak scanrange scan range process noise optional argument useful data centroided without intensity threshold, centroids intensity < noise omitted ROI detection sleep number seconds pause plotting peak finding cycles verbose.columns logical, TRUE additional peak meta data columns returned ROI.list optional list ROIs represents detected mass traces (ROIs). list empty (default) centWave detects mass trace ROIs, otherwise step skipped supplied ROIs used peak detection phase. ROI object list following slots: scmin start scan index, scmax end scan index, mzmin minimum m/z, mzmax maximum m/z, length number scans, intensity summed intensity. firstBaselineCheck logical, TRUE continuous data within ROI checked 1st baseline roiScales numeric, optional vector scales ROI ROI.list used centWave-wavelets snthreshIsoROIs signal noise ratio cutoff predicted isotope ROIs, definition see . maxcharge max. number isotope charge. maxiso max. number isotope peaks predict detected feature. mzIntervalExtension logical, TRUE predicted isotope ROIs (regions interest) extended m/z dimension increase detection low intensity hence noisy peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"matrix columns: mz weighted (intensity) mean peak m/z across scans mzmin m/z peak minimum mzmax m/z peak maximum rt retention time peak midpoint rtmin leading edge peak retention time rtmax trailing edge peak retention time integrated peak intensity intb baseline corrected integrated peak intensity maxo maximum peak intensity sn Signal/Noise ratio, defined (maxo - baseline)/sd, maxo maximum peak intensity, baseline estimated baseline value sd standard deviation local chromatographic noise. egauss RMSE Gaussian fit verbose.columns TRUE additionally : mu Gaussian parameter mu sigma Gaussian parameter sigma h Gaussian parameter h f Region number m/z ROI peak localised dppm m/z deviation mass trace across scans ppm scale Scale peak localised scpos Peak position found wavelet analysis scmin Left peak limit found wavelet analysis (scan number) scmax Right peak limit found wavelet analysis (scan number)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"Ralf Tautenhahn","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"Ralf Tautenhahn, Christoph Böttcher, Steffen Neumann \"Highly sensitive feature detection high resolution LC/MS\" BMC Bioinformatics 2008, 9:504\\ Hendrik Treutler Steffen Neumann. \"Prediction, detection, validation isotope clusters mass spectrometry data\" Submitted Metabolites 2016, Special Issue \"Bioinformatics Data Analysis\"","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"Massifquant Kalman filter (KF) based feature detection XC-MS data centroid mode (currently experimental stage). Optionally allows calling method \"centWave\" features discovered Massifquant refine feature detection; , supply additional parameters specific centWave (even experimental). method may conveniently called xcmsSet(...) method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"object = \"xcmsRaw\" findPeaks.massifquant(object, ppm=10, peakwidth=c(20,50), snthresh=10, prefilter=c(3,100), mzCenterFun=\"wMean\", integrate=1, mzdiff=-0.001, fitgauss=FALSE, scanrange= numeric(), noise=0, sleep=0, verbose.columns=FALSE, criticalValue = 1.125, consecMissedLimit = 2, unions = 1, checkBack = 0, withWave = 0)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"algorithm's performance tested rigorously high resolution LC/{OrbiTrap, TOF}-MS data centroid mode. Simultaneous kalman filters identify features calculate area curve. default parameters set operate complex LC-MS Orbitrap sample. Users find useful simple exploratory data analysis find set minimum intensity, identify many scans average feature spans. \"consecMissedLimit\" parameter yielded good performance Orbitrap data set (2) TOF data found best (1). may change algorithm yet tested many samples. \"criticalValue\" parameter perhaps dificult dial appropriately visual inspection peak identification best suggested tool quick optimization. \"ppm\" \"checkBack\" parameters shown less influence parameters exist give users flexibility better accuracy.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"following arguments specific Massifquant. additional arguments supplied must correspond specified method findPeaks.centWave. object xcmsRaw object. criticalValue Numeric: Suggested values: (0.1-3.0). setting helps determine Kalman Filter prediciton margin error. real centroid belonging bonafide feature must fall within KF prediction margin error. Much like construction confidence interval, criticalVal loosely translates multiplier standard error prediction reported Kalman Filter. features XC-MS sample small mass deviance ppm error, smaller critical value might better vice versa. consecMissedLimit Integer: Suggested values:(1,2,3). feature proces detected Kalman Filter, Kalman Filter may find predicted centroid every scan. 1 consecutive failed predictions, setting informs Massifquant stop Kalman Filter following candidate feature. prefilter Numeric Vector: (Positive Integer, Positive Numeric): first argument used (withWave = 1); see centWave details. second argument specifies minimum threshold maximum intensity feature must met. peakwidth Integer Vector: (Positive Integer, Positive Integer): first argument used Massifquant, specifices minimum feature length time scans. centWave used, second argument maximum feature length subject greater mininum feature length. ppm minimum estimated parts per million mass resolution feature must possess. unions Integer: set 1 apply t-test union segmentation; set 0 t-test applied chromatographically continous features sharing m/z range. Explanation: data points, sometimes Kalman Filter stops tracking feature prematurely. Another Kalman Filter instantiated begins following rest signal. tracking done backwards forwards, algorithmic defect leaves real feature divided two segments . option turned , program identifies segmented features combines (merges ) one two sample t-test. potential danger option truly distinct features may merged. withWave Integer: set 1 turned ; set 0 turned . Allows user find features first Massifquant filter features second phase centWave, includes wavelet estimation. checkBack Integer: set 1 turned ; set 0 turned . convergence Kalman Filter feature's precise m/z mapping fast, sometimes incorporates erroneous centroids part feature (especially early ). \"scanBack\" option attempt remove occasional outlier lies beyond converged bounds Kalman Filter. option directly affect identification feature postprocessing measure; shown extremely useful thus far default set turned .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"method findPeaks.massifquant(...) used, matrix returned rows corresponding features, properties features listed following column names. Otherwise, centWave feature used also (withWave = 1), Massifquant called xcmsSet(...) method, corresponding return values used. mz weighted m/z mean (weighted intensity) feature mzmin m/z lower boundary feature mzmax m/z upper boundary feature rtmin starting scan time feature rtmax starting scan time feature raw quantitation (area curve) feature. area feature area normalized scan rate.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"Christopher Conley","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"Submitted review. Christopher Conley, Ralf J .O Torgrip. Ryan Taylor, John T. Prince. \"Massifquant: open-source Kalman filter based XC-MS feature detection\". August 2013.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"","code":"library(faahKO) library(xcms) #load all the wild type and Knock out samples cdfpath <- system.file(\"cdf\", package = \"faahKO\") ## Subset to only the first 2 files. cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE)[1:2] ## Run the massifquant analysis. Setting the noise level to 10000 to speed up ## execution of the examples - in a real use case it should be set to a reasoable ## value. xset <- xcmsSet(cdffiles, method = \"massifquant\", consecMissedLimit = 1, snthresh = 10, criticalValue = 1.73, ppm = 10, peakwidth= c(30, 60), prefilter= c(1,3000), noise = 10000, withWave = 0) #> #> Massifquant, Copyright (C) 2013 Brigham Young University. #> Massifquant comes with ABSOLUTELY NO WARRANTY. See LICENSE for details. #> #> Detecting mass traces at 10ppm ... #> OK #> 242 Peaks. #> #> Massifquant, Copyright (C) 2013 Brigham Young University. #> Massifquant comes with ABSOLUTELY NO WARRANTY. See LICENSE for details. #> #> Detecting mass traces at 10ppm ... #> OK #> 350 Peaks."},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.matchedFilter-xcmsRaw-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","title":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","text":"Find peaks chromatographic time domain profile matrix. details see do_findChromPeaks_matchedFilter.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.matchedFilter-xcmsRaw-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","text":"","code":"# S4 method for xcmsRaw findPeaks.matchedFilter( object, fwhm = 30, sigma = fwhm/2.3548, max = 5, snthresh = 10, step = 0.1, steps = 2, mzdiff = 0.8 - step * steps, index = FALSE, sleep = 0, scanrange = numeric() )"},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.matchedFilter-xcmsRaw-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","text":"object xcmsRaw object peak detection performed. fwhm numeric(1) specifying full width half maximum matched filtration gaussian model peak. used calculate actual sigma, see . sigma numeric(1) specifying standard deviation (width) matched filtration model peak. max numeric(1) representing maximum number peaks expected/identified per slice. snthresh numeric(1) defining signal noise cutoff used chromatographic peak detection step. step numeric(1) specifying width bins/slices m/z dimension. steps numeric(1) defining number bins merged filtration (.e. number neighboring bins joined slice filtration peak detection performed). mzdiff numeric(1) defining minimum difference m/z peaks overlapping retention times index logical(1) specifying whether indicies returned instead values m/z retention times. sleep (DEPRECATED). use parameter highly discouraged, cause problems parallel processing mode. scanrange Numeric vector defining range scans original object sub-setted peak detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.matchedFilter-xcmsRaw-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","text":"matrix, row representing intentified chromatographic peak, columns: mz Intensity weighted mean m/z values peak across scans. mzmin Minimum m/z peak. mzmax Maximum m/z peak. rt Retention time peak's midpoint. rtmin Minimum retention time peak. rtmax Maximum retention time peak. Integrated (original) intensity peak. intf Integrated intensity filtered peak. maxo Maximum intensity peak. maxf Maximum intensity filtered peak. Rank peak merged EIC (<= max). sn Signal noise ratio peak.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.matchedFilter-xcmsRaw-method.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","text":"Colin . Smith, Elizabeth J. Want, Grace O'Maille, Ruben Abagyan Gary Siuzdak. \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 2006, 78:779-787. @family Old peak detection methods","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.matchedFilter-xcmsRaw-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","text":"Colin . Smith","code":""},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":null,"dir":"Reference","previous_headings":"","what":"Find neutral losses in xcmsFragment objects — findneutral","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"method find neutral loss ppm window xcmsFragment object","code":""},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"","code":"findneutral(object, find, ppmE=25, print=TRUE)"},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"object xcmsFragment object type find neutral loss found ppmE ppm error window searching print print nice little report","code":""},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"method searches given neutral loss xcmsFragment object type given certain ppm error window. neutral losses generated neighbouring ions. resulting data frame shows whole scan neutral loss found.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"data frame following columns: PrecursorMz precursor m/z neutral losses MSnParentPeakID index ID location precursor peak xcmsFragment object msLevel level found fragment ion rt Retention time found ion mz actual m/z found fragment ion intensity intensity fragment ion sample sample fragment ion came GroupPeakMSn ID peaks grouped xcmsSet grouping CollisionEnergy collision energy precursor scan","code":""},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"H. Paul Benton, D.M. Wong, S..Strauger, G. Siuzdak \"XC\\(MS^2\\)\" Analytical Chemistry 2008","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"H. Paul Benton, hpbenton@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"","code":"if (FALSE) { library(msdata) mzMLpath <- system.file(\"iontrap\", package = \"msdata\") mzMLfiles<-list.files(mzMLpath, pattern = \"extracted.mzML\", recursive = TRUE, full.names = TRUE) xs <- xcmsSet(mzMLfiles, method = \"MS1\") ##takes only one file from the file set xfrag <- xcmsFragments(xs) found<-findneutral(xfrag, 58.1455, 50) }"},{"path":"https://sneumann.github.io/xcms/reference/getEIC-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get extracted ion chromatograms for specified m/z ranges — getEIC-methods","title":"Get extracted ion chromatograms for specified m/z ranges — getEIC-methods","text":"Generate multiple extracted ion chromatograms m/z values interest. xcmsSet objects, reread original raw data apply precomputed retention time correction, applicable. Note method always return profile, raw data (profile data binned data along M/Z). See details information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getEIC-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get extracted ion chromatograms for specified m/z ranges — getEIC-methods","text":"object = \"xcmsRaw\" getEIC(object, mzrange, rtrange = NULL, step = 0.1) object = \"xcmsSet\" getEIC(object, mzrange, rtrange = 200, groupidx, sampleidx = sampnames(object), rt = c(\"corrected\", \"raw\"))","code":""},{"path":"https://sneumann.github.io/xcms/reference/getEIC-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get extracted ion chromatograms for specified m/z ranges — getEIC-methods","text":"object xcmsRaw xcmsSet object mzrange Either two column matrix minimum maximum m/z matrix dimensions containing columns mzmin mzmax. specified, method xcmsRaw returns base peak chromatogram (BPC, .e. intense signal RT across m/z). xcmsSet objects group data used mzrange provided. rtrange two column matrix size mzrange minimum maximum retention times return EIC data points. specified, method returns chromatogram full RT range. xcmsSet objects, may also single number specifying time window around peak return EIC data points step step (bin) size use profile generation. Note value step = 0 supported. groupidx either character vector names integer vector indicies peak groups get EICs sampleidx either character vector names integer vector indicies samples get EICs rt \"corrected\" using corrected retention times, \"raw\" using raw retention times","code":""},{"path":"https://sneumann.github.io/xcms/reference/getEIC-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get extracted ion chromatograms for specified m/z ranges — getEIC-methods","text":"contrast rawEIC method, extracts actual raw values, method extracts object's profile matrix (provided step argument match profStep object profile matrix calculated fly values returned).","code":""},{"path":"https://sneumann.github.io/xcms/reference/getEIC-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get extracted ion chromatograms for specified m/z ranges — getEIC-methods","text":"xcmsSet xcmsRaw objects, xcmsEIC object.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/getPeaks-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get peak intensities for specified regions — getPeaks-methods","title":"Get peak intensities for specified regions — getPeaks-methods","text":"Integrate extracted ion chromatograms pre-defined defined regions. Return output similar findPeaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getPeaks-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get peak intensities for specified regions — getPeaks-methods","text":"object = \"xcmsRaw\" getPeaks(object, peakrange, step = 0.1)","code":""},{"path":"https://sneumann.github.io/xcms/reference/getPeaks-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get peak intensities for specified regions — getPeaks-methods","text":"object xcmsSet object peakrange matrix data frame 4 columns: mzmin, mzmax, rtmin, rtmax (must order named) step step size use profile generation","code":""},{"path":"https://sneumann.github.io/xcms/reference/getPeaks-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get peak intensities for specified regions — getPeaks-methods","text":"matrix columns: rank peak identified merged EIC (<= max), always NA mz weighted (intensity) mean peak m/z across scans mzmin m/z minimum step mzmax m/z maximum step ret retention time peak midpoint retmin leading edge peak retention time retmax trailing edge peak retention time integrated area original (raw) peak intf integrated area filtered peak, always NA maxo maximum intensity original (raw) peak maxf maximum intensity filtered peak, always NA","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/getScan-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get m/z and intensity values for a single mass scan — getScan-methods","title":"Get m/z and intensity values for a single mass scan — getScan-methods","text":"Return data single mass scan using numeric index scan reference.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getScan-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get m/z and intensity values for a single mass scan — getScan-methods","text":"object = \"xcmsRaw\" getScan(object, scan, mzrange = numeric()) getMsnScan(object, scan, mzrange = numeric())","code":""},{"path":"https://sneumann.github.io/xcms/reference/getScan-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get m/z and intensity values for a single mass scan — getScan-methods","text":"object xcmsRaw object scan integer index scan. negative, index numbered end mzrange limit data points returned range, range(mzrange)","code":""},{"path":"https://sneumann.github.io/xcms/reference/getScan-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get m/z and intensity values for a single mass scan — getScan-methods","text":"matrix two columns: mz m/z values intensity intensity values","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/getSpec-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get average m/z and intensity values for multiple mass scans — getSpec-methods","title":"Get average m/z and intensity values for multiple mass scans — getSpec-methods","text":"Return full-resolution averaged data multiple mass scans.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getSpec-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get average m/z and intensity values for multiple mass scans — getSpec-methods","text":"object = \"xcmsRaw\" getSpec(object, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/getSpec-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get average m/z and intensity values for multiple mass scans — getSpec-methods","text":"object xcmsRaw object ... arguments passed profRange used sepecify spectral segments interest averaging","code":""},{"path":"https://sneumann.github.io/xcms/reference/getSpec-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get average m/z and intensity values for multiple mass scans — getSpec-methods","text":"Based mass points spectra selected, master unique list masses generated. Every spectra interpolated masses averaged.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getSpec-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get average m/z and intensity values for multiple mass scans — getSpec-methods","text":"matrix two columns: mz m/z values intensity intensity values","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/getXcmsRaw-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Load the raw data for one or more files in the xcmsSet — getXcmsRaw-methods","title":"Load the raw data for one or more files in the xcmsSet — getXcmsRaw-methods","text":"Reads raw data applies evential retention time corrections waters Lock mass correction returns xcmsRaw object (list xcmsRaw objects) one files xcmsSet object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getXcmsRaw-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Load the raw data for one or more files in the xcmsSet — getXcmsRaw-methods","text":"object = \"xcmsSet\" getXcmsRaw(object, sampleidx=1, profmethod=profinfo(object)$method, profstep=profinfo(object)$step, rt=c(\"corrected\", \"raw\"), ... )","code":""},{"path":"https://sneumann.github.io/xcms/reference/getXcmsRaw-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Load the raw data for one or more files in the xcmsSet — getXcmsRaw-methods","text":"object xcmsSet object sampleidx index sample raw data returned. Can single number numeric vector indices. Alternatively, file name can specified. profmethod profile method. profstep profile step. rt Whether corrected raw retention times returned. ... Additional arguments submitted xcmsRaw function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getXcmsRaw-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Load the raw data for one or more files in the xcmsSet — getXcmsRaw-methods","text":"single xcmsRaw object list xcmsRaw objects.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getXcmsRaw-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Load the raw data for one or more files in the xcmsSet — getXcmsRaw-methods","text":"Johannes Rainer, johannes.rainer@eurac.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/group-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Group peaks from different samples together — group-methods","title":"Group peaks from different samples together — group-methods","text":"number grouping (alignment) methods exist XCMS. group generic method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/group-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Group peaks from different samples together — group-methods","text":"object = \"xcmsSet\" group(object, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/group-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group peaks from different samples together — group-methods","text":"object xcmsSet-class object method Method use grouping. See details. ... Optional arguments passed along","code":""},{"path":"https://sneumann.github.io/xcms/reference/group-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Group peaks from different samples together — group-methods","text":"Different algorithms can used specifying method argument. example use density-based approach described Smith et al (2006) one use: group(object, method=\"density\"). also default. arguments given ... passed function implementing method. character vector nicknames algorithms available returned getOption(\"BioC\")$xcms$group.methods. nickname method called \"mzClust\", help page specific method can accessed ?group.mzClust.","code":""},{"path":"https://sneumann.github.io/xcms/reference/group-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Group peaks from different samples together — group-methods","text":"xcmsSet object peak group assignments statistics.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/group.density.html","id":null,"dir":"Reference","previous_headings":"","what":"Group peaks from different samples together — group.density","title":"Group peaks from different samples together — group.density","text":"Group peaks together across samples using overlapping m/z bins calculation smoothed peak distributions chromatographic time.","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.density.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Group peaks from different samples together — group.density","text":"object = \"xcmsSet\" group(object, bw = 30, minfrac = 0.5, minsamp = 1, mzwid = 0.25, max = 50, sleep = 0)","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.density.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group peaks from different samples together — group.density","text":"object xcmsSet object minfrac minimum fraction samples necessary least one sample groups valid group minsamp minimum number samples necessary least one sample groups valid group bw bandwidth (standard deviation half width half maximum) gaussian smoothing kernel apply peak density chromatogram mzwid width overlapping m/z slices use creating peak density chromatograms grouping peaks across samples max maximum number groups identify single m/z slice sleep seconds pause plotting successive steps peak grouping algorithm. peaks plotted points showing relative intensity. identified groups flanked dotted vertical lines.","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.density.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Group peaks from different samples together — group.density","text":"xcmsSet object peak group assignments statistics.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/group.mzClust.html","id":null,"dir":"Reference","previous_headings":"","what":"Group Peaks via High Resolution Alignment — group.mzClust","title":"Group Peaks via High Resolution Alignment — group.mzClust","text":"Runs high resolution alignment single spectra samples stored \tgiven xcmsSet.","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.mzClust.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Group Peaks via High Resolution Alignment — group.mzClust","text":"object = \"xcmsSet\" group(object, method=\"mzClust\", mzppm = 20, mzabs = 0, minsamp = 1, minfrac=0)","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.mzClust.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group Peaks via High Resolution Alignment — group.mzClust","text":"object xcmsSet peaks mzppm relative error used clustering/grouping ppm (parts per million) mzabs absolute error used clustering/grouping minsamp set minimum number samples one bin minfrac set minimum fraction class one bin","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.mzClust.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Group Peaks via High Resolution Alignment — group.mzClust","text":"Returns xcmsSet slots groups groupindex set.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/group.mzClust.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Group Peaks via High Resolution Alignment — group.mzClust","text":"Saira . Kazmi, Samiran Ghosh, Dong-Guk Shin, \tDennis W. Hill David F. GrantAlignment high resolution mass spectra: development heuristic \tapproach metabolomics. \tMetabolomics, Vol. 2, . 2, 75-83 (2006)","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.mzClust.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Group Peaks via High Resolution Alignment — group.mzClust","text":"","code":"if (FALSE) { library(msdata) mzMLpath <- system.file(\"fticr-mzML\", package = \"msdata\") mzMLfiles <- list.files(mzMLpath, recursive = TRUE, full.names = TRUE) xs <- xcmsSet(method=\"MSW\", files=mzMLfiles, scales=c(1,7), SNR.method='data.mean' , winSize.noise=500, peakThr=80000, amp.Th=0.005) xsg <- group(xs, method=\"mzClust\") }"},{"path":"https://sneumann.github.io/xcms/reference/group.nearest.html","id":null,"dir":"Reference","previous_headings":"","what":"Group peaks from different samples together — group.nearest","title":"Group peaks from different samples together — group.nearest","text":"Group peaks together across samples creating master peak list assigning corresponding peaks samples. inspired alignment algorithm mzMine. details check http://mzmine.sourceforge.net/ Katajamaa M, Miettinen J, Oresic M: MZmine: Toolbox processing visualization mass spectrometry based molecular profile data. Bioinformatics (Oxford, England) 2006, 22:634?636. Currently, equivalent minfrac minsamp.","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.nearest.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Group peaks from different samples together — group.nearest","text":"object = \"xcmsSet\" group(object, mzVsRTbalance=10, mzCheck=0.2, rtCheck=15, kNN=10)","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.nearest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group peaks from different samples together — group.nearest","text":"object xcmsSet object mzVsRTbalance Multiplicator mz value calculating (euclidean) distance two peaks. mzCheck Maximum tolerated distance mz. rtCheck Maximum tolerated distance RT. kNN Number nearest Neighbours check","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.nearest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Group peaks from different samples together — group.nearest","text":"xcmsSet object peak group assignments statistics.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/group.nearest.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Group peaks from different samples together — group.nearest","text":"","code":"if (FALSE) library(xcms) library(faahKO) ## These files do not have this problem to correct for ## but just for an example cdfpath <- system.file(\"cdf\", package = \"faahKO\") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE) xset<-xcmsSet(cdffiles) gxset<-group(xset, method=\"nearest\") #> Processing sample number 8 ... #> OK #> Processing sample number 1 ... #> OK #> Processing sample number 7 ... #> OK #> Processing sample number 3 ... #> OK #> Processing sample number 12 ... #> OK #> Processing sample number 9 ... #> OK #> Processing sample number 6 ... #> OK #> Processing sample number 5 ... #> OK #> Processing sample number 4 ... #> OK #> Processing sample number 11 ... #> OK #> Processing sample number 10 ... #> OK nrow(gxset@groups) == 1096 ## the number of features before minFrac #> [1] FALSE post.minFrac<-function(object, minFrac=0.5){ ix.minFrac<-sapply(1:length(unique(sampclass(object))), function(x, object, mf){ meta<-groups(object) minFrac.idx<-numeric(length=nrow(meta)) idx<-which( meta[,levels(sampclass(object))[x]] >= mf*length(which(levels(sampclass(object))[x] == sampclass(object)) )) minFrac.idx[idx]<-1 return(minFrac.idx) }, object, minFrac) ix.minFrac<-as.logical(apply(ix.minFrac, 1, sum)) ix<-which(ix.minFrac == TRUE) return(ix) } ## using the above function we can get a post processing minFrac idx<-post.minFrac(gxset) gxset.post<-gxset ## copy the xcmsSet object gxset.post@groupidx<-gxset@groupidx[idx] gxset.post@groups<-gxset@groups[idx,] nrow(gxset.post@groups) == 465 ## number of features after minFrac #> [1] FALSE"},{"path":"https://sneumann.github.io/xcms/reference/groupChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","title":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","text":"groupChromPeaks method performs correspondence analysis .e., groups chromatographic peaks across samples define LC-MS features. correspondence algorithm can selected, configured, using param argument. See documentation XcmsExperiment() XCMSnExp() information access extract correspondence results. correspondence analysis can performed chromatographic peaks MS level (present chromatographic peak detection performed MS level) defining features combining peaks. MS level can selected parameter msLevel. default, calling groupChromPeaks remove previous correspondence results. can disabled add = TRUE, add newly defined features already present feature definitions. Supported param objects : PeakDensityParam: correspondence using peak density method (Smith 2006) groups chromatographic peaks along retention time axis within slices (partially overlapping) m/z ranges. default, m/z ranges (bins) constant size. setting ppm value larger 0, m/z dependent bin sizes can used instead (better representing m/z dependent measurement error MS instruments). peaks (different samples) apex position close retention time axis grouped LC-MS feature. See addition do_groupChromPeaks_density() core API function. NearestPeaksParam: performs peak grouping based proximity chromatographic peaks different samples m/z - rt space similar correspondence method mzMine (Katajamaa 2006). method creates first master peak list consisting chromatographic peaks sample detected peaks iteratively calculates distances peaks sample next number peaks grouping peaks together distance smaller provided thresholds. See addition do_groupChromPeaks_nearest() core API function. MzClustParam: performs high resolution peak grouping single spectrum metabolomics data (Kazmi 2006). method used data retention time considered correspondence analysis. See addition do_groupPeaks_mzClust() core API function. specific examples description method settings see help pages individual parameter classes listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","text":"","code":"groupChromPeaks(object, param, ...) # S4 method for XcmsExperiment,Param groupChromPeaks(object, param, msLevel = 1L, add = FALSE) PeakDensityParam( sampleGroups = numeric(), bw = 30, minFraction = 0.5, minSamples = 1, binSize = 0.25, ppm = 0, maxFeatures = 50 ) MzClustParam( sampleGroups = numeric(), ppm = 20, absMz = 0, minFraction = 0.5, minSamples = 1 ) NearestPeaksParam( sampleGroups = numeric(), mzVsRtBalance = 10, absMz = 0.2, absRt = 15, kNN = 10 ) # S4 method for PeakDensityParam sampleGroups(object) # S4 method for PeakDensityParam sampleGroups(object) <- value # S4 method for PeakDensityParam bw(object) # S4 method for PeakDensityParam bw(object) <- value # S4 method for PeakDensityParam minFraction(object) # S4 method for PeakDensityParam minFraction(object) <- value # S4 method for PeakDensityParam minSamples(object) # S4 method for PeakDensityParam minSamples(object) <- value # S4 method for PeakDensityParam binSize(object) # S4 method for PeakDensityParam binSize(object) <- value # S4 method for PeakDensityParam maxFeatures(object) # S4 method for PeakDensityParam maxFeatures(object) <- value # S4 method for PeakDensityParam ppm(object) # S4 method for MzClustParam sampleGroups(object) # S4 method for MzClustParam sampleGroups(object) <- value # S4 method for MzClustParam ppm(object) # S4 method for MzClustParam ppm(object) <- value # S4 method for MzClustParam absMz(object) # S4 method for MzClustParam absMz(object) <- value # S4 method for MzClustParam minFraction(object) # S4 method for MzClustParam minFraction(object) <- value # S4 method for MzClustParam minSamples(object) # S4 method for MzClustParam minSamples(object) <- value # S4 method for NearestPeaksParam sampleGroups(object) # S4 method for NearestPeaksParam sampleGroups(object) <- value # S4 method for NearestPeaksParam mzVsRtBalance(object) # S4 method for NearestPeaksParam mzVsRtBalance(object) <- value # S4 method for NearestPeaksParam absMz(object) # S4 method for NearestPeaksParam absMz(object) <- value # S4 method for NearestPeaksParam absRt(object) # S4 method for NearestPeaksParam absRt(object) <- value # S4 method for NearestPeaksParam kNN(object) # S4 method for NearestPeaksParam kNN(object) <- value # S4 method for PeakDensityParam as.list(x, ...) # S4 method for XCMSnExp,PeakDensityParam groupChromPeaks(object, param, msLevel = 1L, add = FALSE) # S4 method for XCMSnExp,MzClustParam groupChromPeaks(object, param, msLevel = 1L) # S4 method for XCMSnExp,NearestPeaksParam groupChromPeaks(object, param, msLevel = 1L, add = FALSE)"},{"path":"https://sneumann.github.io/xcms/reference/groupChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","text":"object data object correspondence analysis performed. Can XCMSnExp(), XcmsExperiment() object. param parameter object selecting configuring algorithm. ... Optional parameters. msLevel integer(1) defining MS level chromatographic peak detection performed. add logical(1) (object contains already chromatographic peaks, .e. either XCMSnExp XcmsExperiment) whether chromatographic peak detection results added existing results. default (add = FALSE) additional findChromPeaks call result object remove previous results. sampleGroups PeakDensityParam: vector length samples defining sample group assignments (.e. samples belong sample group). parameter mandatory PeakDensityParam provided also sample grouping experiment (case samples assigned group). bw PeakDensityParam: numeric(1) defining bandwidth (standard deviation ot smoothing kernel) used. argument passed [density() method. minFraction PeakDensityParam: numeric(1) defining minimum fraction samples least one sample group peaks present considered peak group (feature). minSamples PeakDensityParam: numeric(1) minimum number samples least one sample group peaks detected considered peak group (feature). binSize PeakDensityParam: numeric(1) defining size overlapping slices m/z dimension. ppm MzClustParam: numeric(1) representing relative m/z error clustering/grouping (parts per million). PeakDensityParam: numeric(1) define m/z-dependent, increasing m/z bin sizes. ppm = 0 (default) m/z bins defined sequence values smallest larges m/z value constant bin size binSize. ppm > 0 size bin increased addition ppm (upper) m/z boundary bin. maximal bin size (used largest m/z values) binSize plus ppm parts-per-million largest m/z value peaks data set. maxFeatures PeakDensityParam: numeric(1) maximum number peak groups identified single mz slice. absMz NearestPeaksParam MzClustParam: numeric(1) maximum tolerated distance m/z values. mzVsRtBalance NearestPeaksParam: numeric(1) representing factor m/z values multiplied calculating (euclician) distance two peaks. absRt NearestPeaksParam: numeric(1) maximum tolerated distance retention times. kNN NearestPeaksParam: integer(1) representing number nearest neighbors check. value value slot. x parameter object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupChromPeaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","text":"groupChromPeaks: either XcmsExperiment() XCMSnExp() object correspondence result.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupChromPeaks.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","text":"Smith, C.., Want E.J., O'Maille G., Abagyan R., Siuzdak G. (2006) \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 78:779-787. Katajamaa, M., Miettinen, J., Oresic, M. (2006) \"MZmine: Toolbox processing visualization mass spectrometry based molecular profile data\". Bioinformatics, 22:634-636. Kazmi S. ., Ghosh, S., Shin, D., Hill, D.W., Grant, D.F. (2006) \"Alignment high resolution mass spectra: development heuristic approach metabolomics. Metabolomics Vol. 2, . 2, 75-83.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","text":"Colin Smith, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-abundance-correlation.html","id":null,"dir":"Reference","previous_headings":"","what":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","title":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","text":"Features originating compound expected similar intensities across samples. method thus groups features based similarity abundances (.e. feature values) across samples data set. See also AbundanceSimilarityParam() additional information details. help page lists parameters specific xcms result objects (.e. XcmsExperiment() XCMSnExp() objects). Documentation parameters similarity calculation available AbundanceSimilarityParam() help page MsFeatures package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-abundance-correlation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","text":"","code":"# S4 method for XcmsResult,AbundanceSimilarityParam groupFeatures( object, param, msLevel = 1L, method = c(\"medret\", \"maxint\", \"sum\"), value = \"into\", intensity = \"into\", filled = TRUE, ... )"},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-abundance-correlation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","text":"object XcmsExperiment() XCMSnExp() object containing LC-MS pre-processing results. param AbudanceSimilarityParam object settings method. See AbundanceSimilarityParam() details grouping method parameters. msLevel integer(1) defining MS level features grouped. method character(1) passed featureValues call. See featureValues() details. Defaults method = \"medret\". value character(1) passed featureValues call. See featureValues() details. Defaults value = \"\". intensity character(1) passed featureValues call. See featureValues() details. Defaults intensity = \"\". filled logical(1) whether filled-values included correlation analysis. Defaults filled = TRUE. ... additional parameters passed groupFeatures method matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-abundance-correlation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","text":"input object feature group definitions added (updated ) column \"feature_group\" featureDefinitions data frame.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-abundance-correlation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-abundance-correlation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","text":"","code":"library(MsFeatures) library(MsExperiment) ## Load a test data set with detected peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Group chromatographic peaks across samples xodg <- groupChromPeaks(faahko_sub, param = PeakDensityParam(sampleGroups = rep(1, 3))) ## Group features based on correlation of feature values (integrated ## peak area) across samples. Note that there are many missing values ## in the feature value which influence grouping of features in the present ## data set. xodg_grp <- groupFeatures(xodg, param = AbundanceSimilarityParam(threshold = 0.8)) table(featureDefinitions(xodg_grp)$feature_group) #> #> FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 #> 8 8 8 6 12 3 1 1 ## Group based on the maximal peak intensity per feature xodg_grp <- groupFeatures(xodg, param = AbundanceSimilarityParam(threshold = 0.8, value = \"maxo\")) table(featureDefinitions(xodg_grp)$feature_group) #> #> FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 #> 8 8 8 6 12 3 1 1"},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":null,"dir":"Reference","previous_headings":"","what":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"Features originating compound expected share elution pattern (.e. chromatographic peak shape) . Thus, methods allows group features based similarity extracted ion chromatograms (EICs). similarity calculation performed separately sample similarity score aggregated across samples final generation similarity matrix grouping (considering parameter threshold) performed. compareChromatograms() function used similarity calculation default calculates Pearson's correlation coefficient. settings compareChromatograms can specified parameters ALIGNFUN, ALIGNFUNARGS, FUN FUNARGS. ALIGNFUN defaults alignRt() function used align chromatograms comparison. ALIGNFUNARGS allows specify additional arguments ALIGNFUN function. defaults ALIGNFUNARGS = list(tolerance = 0, method = \"closest\") ensures data points spectrum (scan, .e. retention time) compared EICs sample. Parameter FUN defines function calculate similarity score defaults FUN = cor FUNARGS allows pass additional arguments function (defaults FUNARGS = list(use = \"pairwise.complete.obs\"). See also compareChromatograms() information. grouping features based EIC similarity matrix performed function specified parameter groupFun defaults groupFun = groupSimilarityMatrix groups rows (features) similarity matrix similarity score larger threshold cluster. creates clusters features features similarity score >= threshold feature cluster. See groupSimilarityMatrix() details. Additional parameters function can passed ... argument. feature grouping called initial feature grouping retention time (see SimilarRtimeParam()). feature groups defined columns \"feature_group\" featureDefinitions(object) (features matching msLevel) used refined method. Features value NA featureDefinitions(object)$feature_group skipped/considered feature grouping.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"","code":"EicSimilarityParam( threshold = 0.9, n = 1, onlyPeak = TRUE, value = c(\"maxo\", \"into\"), groupFun = groupSimilarityMatrix, ALIGNFUN = alignRt, ALIGNFUNARGS = list(tolerance = 0, method = \"closest\"), FUN = cor, FUNARGS = list(use = \"pairwise.complete.obs\"), ... ) # S4 method for XcmsResult,EicSimilarityParam groupFeatures(object, param, msLevel = 1L)"},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"threshold numeric(1) minimal required similarity score group featues. passed groupFun function. n numeric(1) defining total number samples per feature group similarity calculation performed. value rounded next larger integer value. onlyPeak logical(1) whether correlation performed signals within identified chromatographic peaks (onlyPeak = TRUE, default) signal extracted ion chromatogram. value character(1) defining whether samples grouped based sum maximal peak intensity (value = \"maxo\", default) integrated peak area (value = \"\") feature. groupFun function defining function used group rows based pairwise similarity matrix. Defaults groupSimilarityMatrix(). ALIGNFUN function defining function used align chromatograms prior similarity calculation. Defaults ALIGNFUN = alignRt. See alignRt() compareChromatograms() information. ALIGNFUNARGS named list arguments ALIGNFUN. Defaults ALIGNFUNARGS = list(tolerance = 0, method = \"closest\"). FUN function defining function used calculate similarity (aligned) chromatograms. Defaults FUN = cor. See cor() compareChromatograms() information. FUNARGS named list arguments FUN. Defaults FUN = list(use = \"pairwise.complete.obs\"). ... EicSimilarityParam: additional arguments passed groupFun featureChromatograms (expandRt expand retention time range feature). object XcmsExperiment() XCMSnExp() object LC-MS pre-processing results. param EicSimilarityParam object settings method. msLevel integer(1) defining MS level features grouped.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"input object feature groups added (.e. column \"feature_group\" featureDefinitions data frame.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"present featureChromatograms() function used extract EICs feature, however use one m/z rt range feature EICs thus exactly represent identified chromatographic peaks sample (.e. specific m/z retention time ranges). possible performed full data set without prior feature grouping, suggested following reasons: ) selection top n samples highest signal feature group biased abundant compounds performed full data set (.e. samples highest overall intensities used correlation features) II) computationally much expensive pairwise correlation features performed. also suggested perform correlation subset samples per feature highest intensities peaks (feature) although also possible run correlation samples setting n equal total number samples data set. EIC correlation however performed ideally samples original compound highly abundant avoid correlation missing values noisy peak shapes much possible. default also signal outside identified chromatographic peaks excluded correlation.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"","code":"library(MsFeatures) library(MsExperiment) ## Load a test data set with detected peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Group chromatographic peaks across samples xodg <- groupChromPeaks(faahko_sub, param = PeakDensityParam(sampleGroups = rep(1, 3))) ## Performing a feature grouping based on EIC similarities on a single ## sample xodg_grp <- groupFeatures(xodg, param = EicSimilarityParam(n = 1)) table(featureDefinitions(xodg_grp)$feature_group) #> #> FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 FG.009 FG.010 FG.011 #> 2 2 2 3 4 2 3 2 1 1 1 #> FG.012 FG.013 FG.014 FG.015 FG.016 FG.017 FG.018 FG.019 FG.020 FG.021 FG.022 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.023 FG.024 FG.025 FG.026 FG.027 FG.028 FG.029 FG.030 FG.031 FG.032 FG.033 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.034 FG.035 #> 1 1 ## Usually it is better to perform this correlation on pre-grouped features ## e.g. based on similar retention time. xodg_grp <- groupFeatures(xodg, param = SimilarRtimeParam(diffRt = 4)) xodg_grp <- groupFeatures(xodg_grp, param = EicSimilarityParam(n = 1)) table(featureDefinitions(xodg_grp)$feature_group) #> #> FG.001.001 FG.002.001 FG.003.001 FG.003.002 FG.004.001 FG.004.002 FG.005.001 #> 2 2 2 1 3 1 3 #> FG.006.001 FG.006.002 FG.007.001 FG.008.001 FG.009.001 FG.009.002 FG.010.001 #> 1 1 2 2 1 1 2 #> FG.011.001 FG.012.001 FG.013.001 FG.014.001 FG.015.001 FG.016.001 FG.017.001 #> 1 1 1 1 1 1 1 #> FG.018.001 FG.019.001 FG.020.001 FG.021.001 FG.022.001 FG.023.001 FG.024.001 #> 1 1 1 1 1 1 1 #> FG.025.001 FG.026.001 FG.027.001 FG.028.001 FG.029.001 FG.030.001 FG.031.001 #> 1 1 1 1 1 1 1 #> FG.032.001 FG.033.001 #> 1 1"},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-similar-rtime.html","id":null,"dir":"Reference","previous_headings":"","what":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","title":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","text":"Group features based similar retention time. method supposed used initial crude grouping features based median retention time chromatographic peaks. features difference retention time <= parameter diffRt parameter object grouped together. column \"feature_group\" found featureDefinitions() sub-grouped method. See MsFeatures::SimilarRtimeParam() MsFeatures details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-similar-rtime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","text":"","code":"# S4 method for XcmsResult,SimilarRtimeParam groupFeatures(object, param, msLevel = 1L, ...)"},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-similar-rtime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","text":"object XcmsExperiment() XCMSnExp() object containing also correspondence results. param SimilarRtimeParam object settings method. See MsFeatures::SimilarRtimeParam() details options. msLevel integer(1) defining MS level features grouped. ... passed groupFeatures function numeric values.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-similar-rtime.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","text":"input object feature groups added (.e. column \"feature_group\" featureDefinitions data frame.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-similar-rtime.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-similar-rtime.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","text":"","code":"library(MsFeatures) library(MsExperiment) ## Load a test data set with detected peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Group chromatographic peaks across samples xodg <- groupChromPeaks(faahko_sub, param = PeakDensityParam(sampleGroups = rep(1, 3))) ## Group features based on similar retention time (i.e. difference <= 2 seconds) xodg_grp <- groupFeatures(xodg, param = SimilarRtimeParam(diffRt = 2)) ## Feature grouping get added to the featureDefinitions in column \"feature_group\" head(featureDefinitions(xodg_grp)$feature_group) #> [1] \"FG.004\" \"FG.009\" \"FG.003\" \"FG.004\" \"FG.010\" \"FG.011\" table(featureDefinitions(xodg_grp)$feature_group) #> #> FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 FG.009 FG.010 FG.011 #> 2 2 3 3 3 2 2 2 1 1 1 #> FG.012 FG.013 FG.014 FG.015 FG.016 FG.017 FG.018 FG.019 FG.020 FG.021 FG.022 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.023 FG.024 FG.025 FG.026 FG.027 FG.028 FG.029 FG.030 FG.031 FG.032 FG.033 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.034 FG.035 FG.036 #> 1 1 1 length(unique(featureDefinitions(xodg_grp)$feature_group)) #> [1] 36 ## Using an alternative groupiing method that creates larger groups xodg_grp <- groupFeatures(xodg, param = SimilarRtimeParam(diffRt = 2, groupFun = MsCoreUtils::group)) length(unique(featureDefinitions(xodg_grp)$feature_group)) #> [1] 35"},{"path":"https://sneumann.github.io/xcms/reference/groupOverlaps.html","id":null,"dir":"Reference","previous_headings":"","what":"Group overlapping ranges — groupOverlaps","title":"Group overlapping ranges — groupOverlaps","text":"groupOverlaps identifies overlapping ranges input data groups returning indices xmin xmax.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupOverlaps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Group overlapping ranges — groupOverlaps","text":"","code":"groupOverlaps(xmin, xmax)"},{"path":"https://sneumann.github.io/xcms/reference/groupOverlaps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group overlapping ranges — groupOverlaps","text":"xmin numeric (length xmax) lower boundary range. xmax numeric (length xmin) upper boundary range.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupOverlaps.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Group overlapping ranges — groupOverlaps","text":"list indices grouped elements.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupOverlaps.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Group overlapping ranges — groupOverlaps","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupOverlaps.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Group overlapping ranges — groupOverlaps","text":"","code":"x <- c(2, 12, 34.2, 12.4) y <- c(3, 16, 35, 36) groupOverlaps(x, y) #> [[1]] #> [1] 1 #> #> [[2]] #> [1] 2 3 4 #>"},{"path":"https://sneumann.github.io/xcms/reference/groupnames-XCMSnExp.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate unique group (feature) names based on mass and retention time — groupnames,XCMSnExp-method","title":"Generate unique group (feature) names based on mass and retention time — groupnames,XCMSnExp-method","text":"groupnames generates names identified features correspondence analysis based mass retention time. generates feature names equivalent group names old user interface (aka xcms1).","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupnames-XCMSnExp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate unique group (feature) names based on mass and retention time — groupnames,XCMSnExp-method","text":"","code":"# S4 method for XCMSnExp groupnames(object, mzdec = 0, rtdec = 0, template = NULL)"},{"path":"https://sneumann.github.io/xcms/reference/groupnames-XCMSnExp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate unique group (feature) names based on mass and retention time — groupnames,XCMSnExp-method","text":"object XCMSnExp object containing correspondence results. mzdec integer(1) number decimal places use m/z ( defaults 0). rtdec integer(1) number decimal places use retention time (defaults 0). template character existing group names whose format emulated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupnames-XCMSnExp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate unique group (feature) names based on mass and retention time — groupnames,XCMSnExp-method","text":"character unique names feature object. format M(m/z)T(time seconds).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/groupnames-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate unque names for peak groups — groupnames-methods","title":"Generate unque names for peak groups — groupnames-methods","text":"Allow linking peak group data classes using unique group names remain long re-grouping occurs.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupnames-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Generate unque names for peak groups — groupnames-methods","text":"object = \"xcmsSet\" (object, mzdec = 0, rtdec = 0, template = NULL) object = \"xcmsEIC\" (object)","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupnames-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate unque names for peak groups — groupnames-methods","text":"object xcmsSet xcmsEIC object mzdec number decimal places use m/z rtdec number decimal places use retention time template character vector existing group names whose format emulated","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupnames-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate unque names for peak groups — groupnames-methods","text":"character vector unique names peak group object. format M[m/z]T[time seconds].","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/groupval-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract a matrix of peak values for each group — groupval-methods","title":"Extract a matrix of peak values for each group — groupval-methods","text":"Generate matrix peak values rows every group columns every sample. value included matrix can columns xcmsSet peaks slot matrix. Collisions one peak single sample group get resolved one several user-selectable methods.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupval-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Extract a matrix of peak values for each group — groupval-methods","text":"object = \"xcmsSet\" groupval(object, method = c(\"medret\", \"maxint\"), value = \"index\", intensity = \"\")","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupval-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract a matrix of peak values for each group — groupval-methods","text":"object xcmsSet object method conflict resolution method, \"medret\" use peak closest median retention time \"maxint\" use peak highest intensity value name peak column enter returned matrix, \"index\" index corresponding row peaks slot matrix intensity method == \"maxint\", name peak column use intensity","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupval-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract a matrix of peak values for each group — groupval-methods","text":"matrix rows every group columns every sample. Missing peaks NA values.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/highlightChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Add definition of chromatographic peaks to an extracted chromatogram plot — highlightChromPeaks","title":"Add definition of chromatographic peaks to an extracted chromatogram plot — highlightChromPeaks","text":"highlightChromPeaks function adds chromatographic peak definitions existing plot, one created plot method Chromatogram MChromatograms object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/highlightChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add definition of chromatographic peaks to an extracted chromatogram plot — highlightChromPeaks","text":"","code":"highlightChromPeaks( x, rt, mz, peakIds = character(), border = rep(\"00000040\", length(fileNames(x))), lwd = 1, col = NA, type = c(\"rect\", \"point\", \"polygon\"), whichPeaks = c(\"any\", \"within\", \"apex_within\"), ... )"},{"path":"https://sneumann.github.io/xcms/reference/highlightChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add definition of chromatographic peaks to an extracted chromatogram plot — highlightChromPeaks","text":"x highlightChromPeaks: XCMSnExp object detected peaks. rt highlightChromPeaks: numeric(2) retention time range peaks extracted plotted. mz numeric(2) mz range peaks extracted plotted. peakIds character defining IDs (.e. rownames peak chromPeaks table) chromatographic peaks highlighted plot. border colors used color border rectangles/peaks. equal number samples x. lwd numeric(1) defining width line/border. col highlightChromPeaks: color used fill rectangle (type = \"rect\") peak (type = \"polygon\"). type plotting type. See plot base grapics details. highlightChromPeaks: character(1) defining peak highlighted: type = \"rect\" draws rectangle representing peak definition, type = \"point\" indicates chromatographic peak single point position peak's \"rt\" \"maxo\" type = \"polygon\" highlight peak shape. type = \"polygon\" color border area can defined parameters \"border\" \"col\", respectively. whichPeaks character(1) specifying peaks called located within region defined mz rt. Can one \"\", \"within\", \"apex_within\" peaks even partially overlapping region, peaks completely within region, peaks apex within region. parameter passed type argument chromPeaks function. See related documentation information examples. ... additional parameters matplot plot function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/highlightChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add definition of chromatographic peaks to an extracted chromatogram plot — highlightChromPeaks","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/highlightChromPeaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add definition of chromatographic peaks to an extracted chromatogram plot — highlightChromPeaks","text":"","code":"## Load a test data set with detected peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) ## Extract the ion chromatogram for one chromatographic peak in the data. chrs <- chromatogram(faahko_sub, rt = c(2700, 2900), mz = 335) plot(chrs) ## Extract chromatographic peaks for the mz/rt range (if any). chromPeaks(faahko_sub, rt = c(2700, 2900), mz = 335) #> mz mzmin mzmax rt rtmin rtmax into intb maxo sn sample #> CP095 335 335 335 2786.199 2764.29 2812.803 1496244 1451652 58736 55 2 ## Highlight the chromatographic peaks in the area ## Show the peak definition with a rectangle highlightChromPeaks(faahko_sub, rt = c(2700, 2900), mz = 335) ## Color the actual peak highlightChromPeaks(faahko_sub, rt = c(2700, 2900), mz = 335, col = c(\"#ff000020\", \"#00ff0020\"), type = \"polygon\")"},{"path":"https://sneumann.github.io/xcms/reference/image.xcmsRaw.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot log intensity image of a xcmsRaw object — image-methods","title":"Plot log intensity image of a xcmsRaw object — image-methods","text":"Create log intensity false-color image xcmsRaw object plotted m/z retention time axes","code":""},{"path":"https://sneumann.github.io/xcms/reference/image.xcmsRaw.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot log intensity image of a xcmsRaw object — image-methods","text":"x = \"xcmsRaw\" image(x, col = rainbow(256), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/image.xcmsRaw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot log intensity image of a xcmsRaw object — image-methods","text":"x xcmsRaw object col vector colors use image ... arguments profRange","code":""},{"path":"https://sneumann.github.io/xcms/reference/image.xcmsRaw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot log intensity image of a xcmsRaw object — image-methods","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"function provides missing value imputation based linear interpolation resembles functionality profBinLin profBinLinBase functions deprecated version 1.51 .","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"","code":"imputeLinInterpol( x, baseValue, method = \"lin\", distance = 1L, noInterpolAtEnds = FALSE )"},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"x numeric vector eventual missing (NA) values. baseValue base value empty elements set. considered method = \"linbase\" corresponds profBinLinBase's baselevel argument. method One \"none\", \"lin\" \"linbase\". distance method = \"linbase\": number non-empty neighboring element empty element considered linear interpolation. See details section information. noInterpolAtEnds method = \"lin\": Logical indicating whether linear interpolation also performed ends data vector (.e. missing values present beginning end vector).","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"numeric vector empty values imputed based selected method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"Values NAs input vector x can imputed using methods \"lin\" \"linbase\": impute = \"lin\" uses simple linear imputation derive value empty element input vector x neighboring non-empty elements. method equivalent linear interpolation profBinLin method. Whether interpolation performed missing values present beginning end x can set argument noInterpolAtEnds. default interpolation also performed ends interpolating 0 beginning towards 0 end. noInterpolAtEnds = TRUE interpolation performed ends replacing missing values beginning /end x 0. impute = \"linbase\" uses linear interpolation impute values empty elements within user-definable proximity non-empty elements setting element's value baseValue otherwise. default baseValue half smallest value x (NAs removed). Whether linear interpolation based imputation performed missing value depends distance argument. Interpolation performed one next distance closest neighbors current empty element value NA. interpolation takes place distance = 0, distance = 1 means value empty element interpolated directly adjacent non-empty elements , next neighbors current empty element also NA, vale set baseValue. corresponds linear interpolation performed profBinLinBase method. details see examples .","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"","code":"####### ## Impute missing values by linearly interpolating from neighboring ## non-empty elements x <- c(3, NA, 1, 2, NA, NA, 4, NA, NA, NA, 3, NA, NA, NA, NA, 2) imputeLinInterpol(x, method = \"lin\") #> [1] 3.000000 2.000000 1.000000 2.000000 2.666667 3.333333 4.000000 3.750000 #> [9] 3.500000 3.250000 3.000000 2.800000 2.600000 2.400000 2.200000 2.000000 ## visualize the interpolation: plot(x = 1:length(x), y = x) points(x = 1:length(x), y = imputeLinInterpol(x, method = \"lin\"), type = \"l\", col = \"grey\") ## If the first or last elements are NA, interpolation is performed from 0 ## to the first non-empty element. x <- c(NA, 2, 1, 4, NA) imputeLinInterpol(x, method = \"lin\") #> [1] 1 2 1 4 2 ## visualize the interpolation: plot(x = 1:length(x), y = x) points(x = 1:length(x), y = imputeLinInterpol(x, method = \"lin\"), type = \"l\", col = \"grey\") ## If noInterpolAtEnds is TRUE no interpolation is performed at both ends imputeLinInterpol(x, method = \"lin\", noInterpolAtEnds = TRUE) #> [1] 0 2 1 4 0 ###### ## method = \"linbase\" ## \"linbase\" performs imputation by interpolation for empty elements based on ## 'distance' adjacent non-empty elements, setting all remaining empty elements ## to the baseValue x <- c(3, NA, 1, 2, NA, NA, 4, NA, NA, NA, 3, NA, NA, NA, NA, 2) ## Setting distance = 0 skips imputation by linear interpolation imputeLinInterpol(x, method = \"linbase\", distance = 0) #> [1] 3.0 0.5 1.0 2.0 0.5 0.5 4.0 0.5 0.5 0.5 3.0 0.5 0.5 0.5 0.5 2.0 ## With distance = 1 for all empty elements next to a non-empty element the value ## is imputed by linear interpolation. xInt <- imputeLinInterpol(x, method = \"linbase\", distance = 1L) xInt #> [1] 3.000000 2.000000 1.000000 2.000000 2.666667 3.333333 4.000000 2.250000 #> [9] 0.500000 1.750000 3.000000 1.750000 0.500000 0.500000 1.250000 2.000000 plot(x = 1:length(x), y = x, ylim = c(0, max(x, na.rm = TRUE))) points(x = 1:length(x), y = xInt, type = \"l\", col = \"grey\") ## Setting distance = 2L would cause that for all empty elements for which the ## distance to the next non-empty element is <= 2 the value is imputed by ## linear interpolation: xInt <- imputeLinInterpol(x, method = \"linbase\", distance = 2L) xInt #> [1] 3.000000 2.000000 1.000000 2.000000 2.666667 3.333333 4.000000 3.750000 #> [9] 3.500000 3.250000 3.000000 2.800000 2.600000 2.400000 2.200000 2.000000 plot(x = 1:length(x), y = x, ylim = c(0, max(x, na.rm = TRUE))) points(x = 1:length(x), y = xInt, type = \"l\", col = \"grey\")"},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMin.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace missing values with a proportion of the row minimum — imputeRowMin","title":"Replace missing values with a proportion of the row minimum — imputeRowMin","text":"imputeRowMin imputes missing values x replacing NAs row proportion minimal value row (.e. min_fraction * min(x[, ])).","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace missing values with a proportion of the row minimum — imputeRowMin","text":"","code":"imputeRowMin(x, min_fraction = 1/2)"},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace missing values with a proportion of the row minimum — imputeRowMin","text":"x matrix abundances, rows features/metabolites columns samples. min_fraction numeric(1) fraction row minimum used replace NA values row.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMin.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Replace missing values with a proportion of the row minimum — imputeRowMin","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace missing values with a proportion of the row minimum — imputeRowMin","text":"","code":"library(MSnbase) library(faahKO) data(\"faahko\") xset <- group(faahko) mat <- groupval(xset, value = \"into\") mat_imp <- imputeRowMin(mat) head(mat) #> ko15 ko16 ko18 ko19 ko21 ko22 #> 200.1/2926 147887.5 451600.7 65290.38 NA 91635.45 162012.4 #> 205/2791 1778568.9 1567038.1 1482796.38 1039129.8 1223132.35 1072037.7 #> 206/2790 237993.6 269714.0 201393.42 150107.3 176989.65 156797.0 #> 207.1/2719 380873.0 460629.7 351750.14 219288.0 286848.56 235022.6 #> 219.1/2525 235544.9 173623.4 NA NA 185792.43 174458.8 #> 231/2517 NA NA 222609.07 286232.1 435094.49 NA #> wt15 wt16 wt18 wt19 wt21 wt22 #> 200.1/2926 175177.1 82619.48 NA 69198.22 153273.5 98144.28 #> 205/2791 1950287.5 1466780.60 1572679.16 1275312.76 1356014.3 1231442.16 #> 206/2790 276541.8 222366.15 211717.71 186850.88 188285.9 172348.76 #> 207.1/2719 417169.6 324892.46 277990.70 220972.35 252874.0 236728.16 #> 219.1/2525 244584.5 161184.05 72029.38 NA 238194.4 173829.95 #> 231/2517 NA NA NA 240261.21 201316.2 179437.72 head(mat_imp) #> ko15 ko16 ko18 ko19 ko21 ko22 #> 200.1/2926 147887.53 451600.71 65290.38 32645.19 91635.45 162012.44 #> 205/2791 1778568.94 1567038.14 1482796.38 1039129.82 1223132.35 1072037.70 #> 206/2790 237993.62 269713.98 201393.42 150107.31 176989.65 156797.04 #> 207.1/2719 380873.05 460629.74 351750.14 219287.97 286848.56 235022.63 #> 219.1/2525 235544.92 173623.38 36014.69 36014.69 185792.43 174458.77 #> 231/2517 89718.86 89718.86 222609.07 286232.15 435094.49 89718.86 #> wt15 wt16 wt18 wt19 wt21 wt22 #> 200.1/2926 175177.08 82619.48 32645.19 69198.22 153273.5 98144.28 #> 205/2791 1950287.49 1466780.60 1572679.16 1275312.76 1356014.3 1231442.16 #> 206/2790 276541.85 222366.15 211717.71 186850.88 188285.9 172348.76 #> 207.1/2719 417169.58 324892.46 277990.70 220972.35 252874.0 236728.16 #> 219.1/2525 244584.47 161184.05 72029.38 36014.69 238194.4 173829.95 #> 231/2517 89718.86 89718.86 89718.86 240261.21 201316.2 179437.72 ## Replace with 1/8 of the row mimimum head(imputeRowMin(mat, min_fraction = 1/8)) #> ko15 ko16 ko18 ko19 ko21 ko22 #> 200.1/2926 147887.53 451600.71 65290.385 8161.298 91635.45 162012.44 #> 205/2791 1778568.94 1567038.14 1482796.385 1039129.818 1223132.35 1072037.70 #> 206/2790 237993.62 269713.98 201393.415 150107.310 176989.65 156797.04 #> 207.1/2719 380873.05 460629.74 351750.138 219287.968 286848.56 235022.63 #> 219.1/2525 235544.92 173623.38 9003.672 9003.672 185792.43 174458.77 #> 231/2517 22429.72 22429.72 222609.068 286232.146 435094.49 22429.72 #> wt15 wt16 wt18 wt19 wt21 wt22 #> 200.1/2926 175177.08 82619.48 8161.298 69198.222 153273.5 98144.28 #> 205/2791 1950287.49 1466780.60 1572679.161 1275312.758 1356014.3 1231442.16 #> 206/2790 276541.85 222366.15 211717.713 186850.878 188285.9 172348.76 #> 207.1/2719 417169.58 324892.46 277990.701 220972.352 252874.0 236728.16 #> 219.1/2525 244584.47 161184.05 72029.378 9003.672 238194.4 173829.95 #> 231/2517 22429.72 22429.72 22429.715 240261.212 201316.2 179437.72"},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMinRand.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","title":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","text":"Replace missing values random numbers. using method = \"mean_sd\", random numbers generated normal distribution based (fraction ) row min standard deviation estimated linear relationship row standard deviation mean full data set. Parameter sd_fraction allows reduce estimated standard deviation. using method method = \"from_to\", random numbers 2 specific values generated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMinRand.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","text":"","code":"imputeRowMinRand( x, method = c(\"mean_sd\", \"from_to\"), min_fraction = 1/2, min_fraction_from = 1/1000, sd_fraction = 1, abs = TRUE )"},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMinRand.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","text":"x matrix abundances, rows features/metabolites columns samples. method method character(1) defining imputation method. See description details. Defaults method = \"mean_sd\". min_fraction numeric(1) fraction row minimum used replace NA values row case mean_sd method specified. using from_to method, value one used calculate maximum value replace NA values row. min_fraction_from numeric(1) fraction row minimum used calculate minimum value replace NA values row. parameter used case from_to method specified. sd_fraction numeric(1) factor reduce estimated standard deviation. parameter used case mean_sd method specified. abs logical(1) force imputed values strictly positive.","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMinRand.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","text":"method mean_sd, imputed values taken normal distribution mean user defined fraction row minimum standard deviation estimated mean based linear relationship row standard deviations row means full matrix x. largely avoid imputed values negative larger real values, standard deviation random number generation estimated ignoring intercept linear model estimating relationship standard deviation mean. abs = TRUE NA values replaced absolute value random values. method from_to, imputed values taken 2 user defined fractions row minimum.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMinRand.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","text":"Johannes Rainer, Mar Garcia-Aloy","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMinRand.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","text":"","code":"library(faahKO) library(MSnbase) data(\"faahko\") xset <- group(faahko) mat <- groupval(xset, value = \"into\") ## Estimate the relationship between row sd and mean. The standard deviation ## of the random distribution is estimated on this relationship. mns <- rowMeans(mat, na.rm = TRUE) sds <- apply(mat, MARGIN = 1, sd, na.rm = TRUE) plot(mns, sds) abline(lm(sds ~ mns)) mat_imp_meansd <- imputeRowMinRand(mat, method = \"mean_sd\") mat_imp_fromto <- imputeRowMinRand(mat, method = \"from_to\") head(mat) #> ko15 ko16 ko18 ko19 ko21 ko22 #> 200.1/2926 147887.5 451600.7 65290.38 NA 91635.45 162012.4 #> 205/2791 1778568.9 1567038.1 1482796.38 1039129.8 1223132.35 1072037.7 #> 206/2790 237993.6 269714.0 201393.42 150107.3 176989.65 156797.0 #> 207.1/2719 380873.0 460629.7 351750.14 219288.0 286848.56 235022.6 #> 219.1/2525 235544.9 173623.4 NA NA 185792.43 174458.8 #> 231/2517 NA NA 222609.07 286232.1 435094.49 NA #> wt15 wt16 wt18 wt19 wt21 wt22 #> 200.1/2926 175177.1 82619.48 NA 69198.22 153273.5 98144.28 #> 205/2791 1950287.5 1466780.60 1572679.16 1275312.76 1356014.3 1231442.16 #> 206/2790 276541.8 222366.15 211717.71 186850.88 188285.9 172348.76 #> 207.1/2719 417169.6 324892.46 277990.70 220972.35 252874.0 236728.16 #> 219.1/2525 244584.5 161184.05 72029.38 NA 238194.4 173829.95 #> 231/2517 NA NA NA 240261.21 201316.2 179437.72 head(mat_imp_meansd) #> ko15 ko16 ko18 ko19 ko21 ko22 #> 200.1/2926 147887.5 451600.71 65290.38 25418.38 91635.45 162012.44 #> 205/2791 1778568.9 1567038.14 1482796.38 1039129.82 1223132.35 1072037.70 #> 206/2790 237993.6 269713.98 201393.42 150107.31 176989.65 156797.04 #> 207.1/2719 380873.0 460629.74 351750.14 219287.97 286848.56 235022.63 #> 219.1/2525 235544.9 173623.38 24880.01 32149.76 185792.43 174458.77 #> 231/2517 101238.9 76327.08 222609.07 286232.15 435094.49 85929.56 #> wt15 wt16 wt18 wt19 wt21 wt22 #> 200.1/2926 175177.1 82619.48 22707.20 69198.22 153273.5 98144.28 #> 205/2791 1950287.5 1466780.60 1572679.16 1275312.76 1356014.3 1231442.16 #> 206/2790 276541.8 222366.15 211717.71 186850.88 188285.9 172348.76 #> 207.1/2719 417169.6 324892.46 277990.70 220972.35 252874.0 236728.16 #> 219.1/2525 244584.5 161184.05 72029.38 49169.00 238194.4 173829.95 #> 231/2517 124602.4 99186.90 79848.59 240261.21 201316.2 179437.72 head(mat_imp_fromto) #> ko15 ko16 ko18 ko19 ko21 ko22 #> 200.1/2926 147887.53 451600.7 65290.38 7359.863 91635.45 162012.44 #> 205/2791 1778568.94 1567038.1 1482796.38 1039129.818 1223132.35 1072037.70 #> 206/2790 237993.62 269714.0 201393.42 150107.310 176989.65 156797.04 #> 207.1/2719 380873.05 460629.7 351750.14 219287.968 286848.56 235022.63 #> 219.1/2525 235544.92 173623.4 11044.23 27016.589 185792.43 174458.77 #> 231/2517 44911.84 49671.3 222609.07 286232.146 435094.49 11386.76 #> wt15 wt16 wt18 wt19 wt21 wt22 #> 200.1/2926 175177.08 82619.48 4396.818 69198.22 153273.5 98144.28 #> 205/2791 1950287.49 1466780.60 1572679.161 1275312.76 1356014.3 1231442.16 #> 206/2790 276541.85 222366.15 211717.713 186850.88 188285.9 172348.76 #> 207.1/2719 417169.58 324892.46 277990.701 220972.35 252874.0 236728.16 #> 219.1/2525 244584.47 161184.05 72029.378 15814.95 238194.4 173829.95 #> 231/2517 14954.11 74724.08 9623.735 240261.21 201316.2 179437.72"},{"path":"https://sneumann.github.io/xcms/reference/isolationWindowTargetMz-OnDiskMSnExp-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract isolation window target m/z definition — isolationWindowTargetMz,OnDiskMSnExp-method","title":"Extract isolation window target m/z definition — isolationWindowTargetMz,OnDiskMSnExp-method","text":"isolationWindowTargetMz extracts isolation window target m/z definition spectrum object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/isolationWindowTargetMz-OnDiskMSnExp-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract isolation window target m/z definition — isolationWindowTargetMz,OnDiskMSnExp-method","text":"","code":"# S4 method for OnDiskMSnExp isolationWindowTargetMz(object)"},{"path":"https://sneumann.github.io/xcms/reference/isolationWindowTargetMz-OnDiskMSnExp-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract isolation window target m/z definition — isolationWindowTargetMz,OnDiskMSnExp-method","text":"object OnDiskMSnExp object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/isolationWindowTargetMz-OnDiskMSnExp-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract isolation window target m/z definition — isolationWindowTargetMz,OnDiskMSnExp-method","text":"numeric length equal number spectra object isolation window target m/z NA specified/available.","code":""},{"path":"https://sneumann.github.io/xcms/reference/isolationWindowTargetMz-OnDiskMSnExp-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract isolation window target m/z definition — isolationWindowTargetMz,OnDiskMSnExp-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/levelplot.xcmsRaw.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot log intensity image of a xcmsRaw object — levelplot-methods","title":"Plot log intensity image of a xcmsRaw object — levelplot-methods","text":"Create image raw (profile) data m/z retention time, intensity color coded.","code":""},{"path":"https://sneumann.github.io/xcms/reference/levelplot.xcmsRaw.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot log intensity image of a xcmsRaw object — levelplot-methods","text":"x = \"xcmsRaw\" levelplot(x, log=TRUE, col.regions=colorRampPalette(brewer.pal(9, \"YlOrRd\"))(256), ...) x = \"xcmsSet\" levelplot(x, log=TRUE, col.regions=colorRampPalette(brewer.pal(9, \"YlOrRd\"))(256), rt=\"raw\", ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/levelplot.xcmsRaw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot log intensity image of a xcmsRaw object — levelplot-methods","text":"x xcmsRaw object. log Whether intensity log transformed. col.regions color ramp used encoding intensity. rt wheter original (rt=\"raw\") corrected (rt=\"corrected\") retention times used. ... Arguments profRange.","code":""},{"path":"https://sneumann.github.io/xcms/reference/levelplot.xcmsRaw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot log intensity image of a xcmsRaw object — levelplot-methods","text":"Johannes Rainer, johannes.rainer@eurac.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/loadRaw-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Read binary data from a source — loadRaw-methods","title":"Read binary data from a source — loadRaw-methods","text":"function extracts raw data used xcmsRaw object. processing data done xcmsRaw constructor.","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadRaw-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Read binary data from a source — loadRaw-methods","text":"signature(object = \"xcmsSource\") Uses loadRaw,xcmsSource-method extract raw data. Subclasses xcmsSource can provide different ways fetching data.","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadRaw-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read binary data from a source — loadRaw-methods","text":"object Specification data source (file name database query)","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadRaw-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read binary data from a source — loadRaw-methods","text":"implementing methods decide gather data.","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadRaw-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read binary data from a source — loadRaw-methods","text":"list containing elements describing data source. rt, scanindex, tic, acquisitionNum components one entry per scan. parallel sense rt[1], scanindex[1], acquisitionNum[1] refer scan. list containst following components: rt Numeric vector acquisition time (seconds) scan tic Numeric vector Total Ion Count scan scanindex Integer vector starting positions scan mz intensity components. exclusive offset, scanindex[] offset mz intensity beginning scan . means mz (respectively intensity) values scan scanindex[] + 1 scanindex[+ 1] mz Concatenated vector m/z values scans intensity Concatenated vector intensity values scans","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadRaw-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read binary data from a source — loadRaw-methods","text":"Daniel Hackney, dan@haxney.org","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/loadXcmsData.html","id":null,"dir":"Reference","previous_headings":"","what":"LC-MS preprocessing result test data sets — loadXcmsData","title":"LC-MS preprocessing result test data sets — loadXcmsData","text":"Data sets `xcms` preprocessing results provided within `xcms` package can loaded `loadXcmsData` function. available Test data sets : - `xdata`: [XCMSnExp()] object results `xcms`-based pre-processing LC-MS untargeted metabolomics data set. raw data files provided `faahKO` R package. - `xmse`: [XcmsExperiment()] object results `xcms`-based pre-processing LC-MS untargeted metabolomics data set (original data set pre-processing settings `xdata` data set). pre-processing data set described detail *xcms* vignette `xcms` package. - `faahko_sub`: [XCMSnExp()] object identified chromatographic peaks 3 samples data files `faahKO` R package. - `faahko_sub2`: [XcmsExperiment()] object identified chromatographic peaks 3 samples data files `faahKO` R package. Data sets can also loaded using `data`, however require update objects point location raw data files. `loadXcmsData` loads data ensures paths updated accordingly.","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadXcmsData.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"LC-MS preprocessing result test data sets — loadXcmsData","text":"","code":"loadXcmsData(x = c(\"xmse\", \"xdata\", \"faahko_sub\", \"faahko_sub2\"))"},{"path":"https://sneumann.github.io/xcms/reference/loadXcmsData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"LC-MS preprocessing result test data sets — loadXcmsData","text":"x `loadXcmsData`: `character(1)` name data file (object) load.","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadXcmsData.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"LC-MS preprocessing result test data sets — loadXcmsData","text":"","code":"library(xcms) xdata <- loadXcmsData()"},{"path":"https://sneumann.github.io/xcms/reference/manualChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Manual peak integration and feature definition — manualChromPeaks","title":"Manual peak integration and feature definition — manualChromPeaks","text":"manualChromPeaks function allows manually define chromatographic peaks, integrate intensities within specified peak area add object's chromPeaks matrix. peak added sample signal found respective data file. chromatographic peaks added eventually previously identified peaks, suggested run refineChromPeaks() MergeNeighboringPeaksParam() approach merge potentially overlapping peaks. manualFeatures function allows manually group identified chromatographic peaks features providing index object's chromPeaks matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/manualChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manual peak integration and feature definition — manualChromPeaks","text":"","code":"manualChromPeaks(object, ...) manualFeatures(object, ...) # S4 method for MsExperiment manualChromPeaks( object, chromPeaks = matrix(numeric()), samples = seq_along(object), msLevel = 1L, chunkSize = 2L, BPPARAM = bpparam() ) # S4 method for XcmsExperiment manualChromPeaks( object, chromPeaks = matrix(numeric()), samples = seq_along(object), msLevel = 1L, chunkSize = 2L, BPPARAM = bpparam() ) # S4 method for XcmsExperiment manualFeatures(object, peakIdx = list(), msLevel = 1L) # S4 method for OnDiskMSnExp manualChromPeaks( object, chromPeaks = matrix(), samples = seq_along(fileNames(object)), msLevel = 1L, BPPARAM = bpparam() ) # S4 method for XCMSnExp manualChromPeaks( object, chromPeaks = matrix(), samples = seq_along(fileNames(object)), msLevel = 1L, BPPARAM = bpparam() ) # S4 method for XCMSnExp manualFeatures(object, peakIdx = list(), msLevel = 1L)"},{"path":"https://sneumann.github.io/xcms/reference/manualChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manual peak integration and feature definition — manualChromPeaks","text":"object XcmsExperiment, XCMSnExp OnDiskMSnExp object. ... ignored. chromPeaks manualChromPeaks: matrix defining boundaries chromatographic peaks one row per chromatographic peak columns \"mzmin\", \"mzmax\", \"rtmin\" \"rtmax\" defining m/z retention time region peak. samples manualChromPeaks: optional integer defining individual samples peak integration performed. Defaults samples. msLevel integer(1) defining MS level peak integration performed. single MS level time supported. Defaults msLevel = 1L. chunkSize integer(1) defining number files (samples) loaded memory processed time. Peak integration performed parallel (per sample) subset data. setting thus allows balance memory demand speed (due parallel processing). parallel processing can performed subset data currently loaded memory iteration, value chunkSize match defined parallel setting setup. Using parallel processing setup using 4 CPUs (separate processes) using chunkSize = 1will perform parallel processing, data one sample loaded memory time. hand, settingchunkSize` total number samples experiment load full MS data memory thus settings cause --memory error. BPPARAM parallel processing settings (see bpparam() details). peakIdx manualFeatures: list integer vectors indices chromatographic peaks object's chromPeaks matrix grouped features.","code":""},{"path":"https://sneumann.github.io/xcms/reference/manualChromPeaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Manual peak integration and feature definition — manualChromPeaks","text":"XcmsExperiment XCMSnExp manually added chromatographic peaks features.","code":""},{"path":"https://sneumann.github.io/xcms/reference/manualChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Manual peak integration and feature definition — manualChromPeaks","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/manualChromPeaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Manual peak integration and feature definition — manualChromPeaks","text":"","code":"## Read a test dataset. fls <- c(system.file(\"microtofq/MM14.mzML\", package = \"msdata\"), system.file(\"microtofq/MM8.mzML\", package = \"msdata\")) ## Define a data frame with some sample annotations ann <- data.frame( injection_index = 1:2, sample_id = c(\"MM14\", \"MM8\")) ## Import the data library(MsExperiment) mse <- readMsExperiment(fls) ## Define some arbitrary peak areas pks <- cbind( mzmin = c(512, 234.3), mzmax = c(513, 235), rtmin = c(10, 33), rtmax = c(19, 50) ) pks #> mzmin mzmax rtmin rtmax #> [1,] 512.0 513 10 19 #> [2,] 234.3 235 33 50 res <- manualChromPeaks(mse, pks) chromPeaks(res) #> mz mzmin mzmax rt rtmin rtmax into sample maxo sn #> CP1 512.6294 512.0 513 18.66000 10 19 848.4231 2 85 NA #> CP2 234.8539 234.3 235 41.54298 33 50 2690.4200 2 245 NA ## Peaks were only found in the second file."},{"path":"https://sneumann.github.io/xcms/reference/medianFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply a median filter to a matrix — medianFilter","title":"Apply a median filter to a matrix — medianFilter","text":"element matix, replace median values around .","code":""},{"path":"https://sneumann.github.io/xcms/reference/medianFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply a median filter to a matrix — medianFilter","text":"","code":"medianFilter(x, mrad, nrad)"},{"path":"https://sneumann.github.io/xcms/reference/medianFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply a median filter to a matrix — medianFilter","text":"x numeric matrix median filter mrad number rows either side value use median calculation nrad number rows either side value use median calculation","code":""},{"path":"https://sneumann.github.io/xcms/reference/medianFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply a median filter to a matrix — medianFilter","text":"matrix whose values median filtered","code":""},{"path":"https://sneumann.github.io/xcms/reference/medianFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Apply a median filter to a matrix — medianFilter","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/medianFilter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Apply a median filter to a matrix — medianFilter","text":"","code":"mat <- matrix(1:25, nrow=5) mat #> [,1] [,2] [,3] [,4] [,5] #> [1,] 1 6 11 16 21 #> [2,] 2 7 12 17 22 #> [3,] 3 8 13 18 23 #> [4,] 4 9 14 19 24 #> [5,] 5 10 15 20 25 medianFilter(mat, 1, 1) #> [,1] [,2] [,3] [,4] [,5] #> [1,] 4.0 6.5 11.5 16.5 19.0 #> [2,] 4.5 7.0 12.0 17.0 19.5 #> [3,] 5.5 8.0 13.0 18.0 20.5 #> [4,] 6.5 9.0 14.0 19.0 21.5 #> [5,] 7.0 9.5 14.5 19.5 22.0"},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":null,"dir":"Reference","previous_headings":"","what":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"MS2 MSn data stored separate slots, can directly used e.g. findPeaks(). msn2xcmsRaw() copy MSn spectra \"normal\" xcmsRaw slots.","code":""},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"","code":"msn2xcmsRaw(xmsn)"},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"xmsn object class xcmsRaw contains spectra read includeMSn=TRUE","code":""},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"default gap value determined 90th percentile pair-wise differences adjacent mass values.","code":""},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"xcmsRaw object","code":""},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"Steffen Neumann sneumann@ipb-halle.de","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"","code":"msnfile <- system.file(\"microtofq/MSMSpos20_6.mzML\", package = \"msdata\") xrmsn <- xcmsRaw(msnfile, includeMSn=TRUE) #> Create profile matrix with method 'bin' and step 1 ... #> OK xr <- msn2xcmsRaw(xrmsn) p <- findPeaks(xr, method=\"centWave\") #> Detecting mass traces at 25 ppm ... #> OK #> Detecting chromatographic peaks in 10 regions of interest ... #> OK: 10 found."},{"path":"https://sneumann.github.io/xcms/reference/na.flatfill.html","id":null,"dir":"Reference","previous_headings":"","what":"Fill in NA values at the extremes of a vector — na.flatfill","title":"Fill in NA values at the extremes of a vector — na.flatfill","text":"Extend first last real values vector fill NA values present.","code":""},{"path":"https://sneumann.github.io/xcms/reference/na.flatfill.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fill in NA values at the extremes of a vector — na.flatfill","text":"","code":"na.flatfill(x)"},{"path":"https://sneumann.github.io/xcms/reference/na.flatfill.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fill in NA values at the extremes of a vector — na.flatfill","text":"x numeric vector NA values","code":""},{"path":"https://sneumann.github.io/xcms/reference/na.flatfill.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fill in NA values at the extremes of a vector — na.flatfill","text":"Modified vector.","code":""},{"path":"https://sneumann.github.io/xcms/reference/na.flatfill.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fill in NA values at the extremes of a vector — na.flatfill","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/overlappingFeatures.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify overlapping features — overlappingFeatures","title":"Identify overlapping features — overlappingFeatures","text":"overlappingFeatures identifies features overlapping close m/z - rt space.","code":""},{"path":"https://sneumann.github.io/xcms/reference/overlappingFeatures.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify overlapping features — overlappingFeatures","text":"","code":"overlappingFeatures(x, expandMz = 0, expandRt = 0, ppm = 0)"},{"path":"https://sneumann.github.io/xcms/reference/overlappingFeatures.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify overlapping features — overlappingFeatures","text":"x XcmsExperiment() XCMSnExp() object features. expandMz numeric(1) value expand feature (side) m/z dimension identifying overlapping features. resulting \"mzmin\" feature thus mzmin - expandMz \"mzmax\" mzmax + expandMz. expandRt numeric(1) value expand feature (side) retention time dimension identifying overlapping features. resulting \"rtmin\" feature thus rtmin - expandRt \"rtmax\" rtmax + expandRt. ppm numeric(1) grow m/z width feature relative value: mzmin - mzmin * ppm / 2e6, mzmax + mzmax * ppm / 2e6. feature thus expanded m/z dimension ppm/2 side identifying overlapping features.","code":""},{"path":"https://sneumann.github.io/xcms/reference/overlappingFeatures.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify overlapping features — overlappingFeatures","text":"list indices features (featureDefinitions()) overlapping.","code":""},{"path":"https://sneumann.github.io/xcms/reference/overlappingFeatures.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify overlapping features — overlappingFeatures","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/overlappingFeatures.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify overlapping features — overlappingFeatures","text":"","code":"## Load a test data set with detected peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) ## Correspondence analysis xdata <- groupChromPeaks(faahko_sub, param = PeakDensityParam(sampleGroups = c(1, 1, 1))) ## Identify overlapping features overlappingFeatures(xdata) #> list() ## Identify features that are separated on retention time by less than ## 2 minutes overlappingFeatures(xdata, expandRt = 60) #> [[1]] #> [1] 5 6 #> #> [[2]] #> [1] 31 32 #>"},{"path":"https://sneumann.github.io/xcms/reference/panel.cor.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlation coefficient panel for pairs function — panel.cor","title":"Correlation coefficient panel for pairs function — panel.cor","text":"Correlation coefficient panel pairs function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/panel.cor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlation coefficient panel for pairs function — panel.cor","text":"","code":"panel.cor(x, y, digits = 2, prefix = \"\", cex.cor)"},{"path":"https://sneumann.github.io/xcms/reference/panel.cor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correlation coefficient panel for pairs function — panel.cor","text":"x first data series y second data series digits number digits plot prefix text prefix coefficients cex.cor character expansion factor","code":""},{"path":"https://sneumann.github.io/xcms/reference/panel.cor.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correlation coefficient panel for pairs function — panel.cor","text":"Colin . Smith, csmith@scripps.edu, based pairs example code","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/peakPlots-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot a grid of a large number of peaks — peakPlots-methods","title":"Plot a grid of a large number of peaks — peakPlots-methods","text":"Plot extracted ion chromatograms many peaks simultaneously, indicating peak integration start end points vertical grey lines.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakPlots-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot a grid of a large number of peaks — peakPlots-methods","text":"signature(object = \"xcmsSet\") plotPeaks(object, peaks, figs, width = 200)","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakPlots-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot a grid of a large number of peaks — peakPlots-methods","text":"object xcmsRaw object peaks matrix peak information produced findPeaks figs two-element vector describing number rows number columns peaks plot, missing approximately square grid fit number peaks supplied width width chromatogram retention time plot peak","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakPlots-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot a grid of a large number of peaks — peakPlots-methods","text":"function intended help graphically analyze results peak picking. can help estimate number false positives improper integration start end points. output compact tries waste little space possible. plot labeled rounded m/z retention time separated space.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/peakTable-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Create report of aligned peak intensities — peakTable-methods","title":"Create report of aligned peak intensities — peakTable-methods","text":"Create report showing aligned peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakTable-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Create report of aligned peak intensities — peakTable-methods","text":"object = \"xcmsSet\" peakTable(object, filebase = character(), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakTable-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create report of aligned peak intensities — peakTable-methods","text":"object xcmsSet object filebase base file name save report, .tsv file _eic appended name tabular report EIC directory, respectively. blank nothing saved ... arguments passed groupval, provides actual intensities.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakTable-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create report of aligned peak intensities — peakTable-methods","text":"method handles creation summary reports similar diffreport. returns summary report can optionally written tab-separated file. base file name provided, report (see Value section) saved tab separated file.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakTable-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create report of aligned peak intensities — peakTable-methods","text":"data frame following columns: mz median m/z peaks group mzmin minimum m/z peaks group mzmax maximum m/z peaks group rt median retention time peaks group rtmin minimum retention time peaks group rtmax maximum retention time peaks group npeaks number peaks assigned group Sample Classes number samples sample class represented group ... one column every sample class Sample Names integrated intensity value every sample ... one column every sample","code":""},{"path":[]},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"peaksWithCentWave identifies (chromatographic) peaks purely chromatographic data, .e. based intensity retention time values without m/z values.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"","code":"peaksWithCentWave( int, rt, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), integrate = 1, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, firstBaselineCheck = TRUE, extendLengthMSW = FALSE, ... )"},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"int numeric intensity values. rt numeric retention time intensities. Length equal length(int). peakwidth numeric(2) lower upper bound expected peak width. snthresh numeric(1) defining signal noise ratio cutoff. Peaks signal noise ratio < snthresh omitted. prefilter numeric(2) (c(k, )): regions interest least k centroids signal >= returned first step. integrate numeric(1), integration method. integrate = 1 peak limits found descending mexican hat filtered data, integrate = 2 descend done real data. latter method accurate prone noise, former robust, less exact. fitgauss logical(1) whether Gaussian fitted peak. noise numeric(1) defining minimum required intensity centroids considered first analysis step (definition regions interest). verboseColumns logical(1): whether additional peak meta data columns returned. firstBaselineCheck logical(1). TRUE continuous data within regions interest checked first baseline. detail, first rough estimate noise calculated peak detection performed regions multiple sequential signals higher first estimated baseline/noise level. extendLengthMSW logical(1). TRUE \"open\" method EIC extension used, rather default \"reflect\" method. ... currently ignored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"matrix, row representing identified chromatographic peak, columns: \"rt\": retention time peak's midpoint (time maximum signal). \"rtmin\": minimum retention time peak. \"rtmax\": maximum retention time peak. \"\": integrated (original) intensity peak. \"intb\": per-peak baseline corrected integrated peak intensity. \"maxo\": maximum (original) intensity peak. \"sn\": signal noise ratio peak defined (maxo - baseline)/sd sd standard deviation local chromatographic noise. Additional columns verboseColumns = TRUE: \"mu\": gaussian parameter mu. \"sigma\": gaussian parameter sigma. \"h\": gaussian parameter h. \"f\": region number m/z ROI peak localized. \"dppm\": m/z deviation mass trace across scans ppm (always NA). \"scale\": scale peak localized. \"scpos\": peak position found wavelet analysis (index int). \"scmin\": left peak limit found wavelet analysis (index int). \"scmax\": right peak limit found wavelet analysis (index int).","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"method uses algorithm peak detection centWave, employs however different approach identify initial regions peak detection performed (.e. regions interest ROI). method first identifies local maxima chromatographic data defines corresponding positions +/- peakwidth[2] ROIs. Noise estimation bases also ROIs can thus different centWave resulting different signal noise ratios.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"","code":"## Reading a file library(MsExperiment) library(xcms) od <- readMsExperiment(system.file(\"cdf/KO/ko15.CDF\", package = \"faahKO\")) ## Extract chromatographic data for a small m/z range mzr <- c(272.1, 272.2) chr <- chromatogram(od, mz = mzr, rt = c(3000, 3300))[1, 1] int <- intensity(chr) rt <- rtime(chr) ## Plot the region plot(chr, type = \"h\") ## Identify peaks in the chromatographic data pks <- peaksWithCentWave(intensity(chr), rtime(chr)) pks #> rt rtmin rtmax into intb maxo sn #> [1,] 3119.535 3097.625 3127.359 247211.6 227217.9 16496 24 ## Highlight the peaks rect(xleft = pks[, \"rtmin\"], xright = pks[, \"rtmax\"], ybottom = rep(0, nrow(pks)), ytop = pks[, \"maxo\"], col = \"#ff000040\", border = \"#00000040\")"},{"path":"https://sneumann.github.io/xcms/reference/peaksWithMatchedFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","title":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","text":"function performs peak detection using matchedFilter algorithm chromatographic data (.e. intensities retention time).","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithMatchedFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","text":"","code":"peaksWithMatchedFilter( int, rt, fwhm = 30, sigma = fwhm/2.3548, max = 20, snthresh = 10, ... )"},{"path":"https://sneumann.github.io/xcms/reference/peaksWithMatchedFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","text":"int numeric intensity values. rt numeric retention time intensities. Length equal length(int). fwhm numeric(1) specifying full width half maximum matched filtration gaussian model peak. used calculate actual sigma, see . sigma numeric(1) specifying standard deviation (width) matched filtration model peak. max numeric(1) maximal number peaks expected/ bbe detected data snthresh numeric(1) defining signal noise cut-used peak detection step. ... currently ignored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithMatchedFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","text":"matrix, row representing identified chromatographic peak, columns: \"rt\": retention time peak's midpoint (time maximum signal). \"rtmin\": minimum retention time peak. \"rtmax\": maximum retention time peak. \"\": integrated (original) intensity peak. \"intf\": integrated intensity filtered peak. \"maxo\": maximum (original) intensity peak. \"maxf\"\" maximum intensity filtered peak. \"sn\": signal noise ratio peak.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/peaksWithMatchedFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithMatchedFilter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","text":"","code":"## Load the test file faahko_sub <- loadXcmsData(\"faahko_sub\") ## Subset to one file and drop identified chromatographic peaks data <- dropChromPeaks(filterFile(faahko_sub, 1)) ## Extract chromatographic data for a small m/z range chr <- chromatogram(data, mz = c(272.1, 272.3), rt = c(3000, 3200))[1, 1] pks <- peaksWithMatchedFilter(intensity(chr), rtime(chr)) pks #> rt rtmin rtmax into intf maxo maxf sn #> [1,] 3119.535 3105.45 3133.619 332583.6 668444.6 16496 36129.39 12.33813 ## Plotting the data plot(rtime(chr), intensity(chr), type = \"h\") rect(xleft = pks[, \"rtmin\"], xright = pks[, \"rtmax\"], ybottom = c(0, 0), ytop = pks[, \"maxo\"], border = \"red\")"},{"path":"https://sneumann.github.io/xcms/reference/phenoDataFromPaths.html","id":null,"dir":"Reference","previous_headings":"","what":"Derive experimental design from file paths — phenoDataFromPaths","title":"Derive experimental design from file paths — phenoDataFromPaths","text":"phenoDataFromPaths function builds data.frame representing experimental design folder structure files experiment located.","code":""},{"path":"https://sneumann.github.io/xcms/reference/phenoDataFromPaths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Derive experimental design from file paths — phenoDataFromPaths","text":"","code":"phenoDataFromPaths(paths)"},{"path":"https://sneumann.github.io/xcms/reference/phenoDataFromPaths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Derive experimental design from file paths — phenoDataFromPaths","text":"paths character representing file names (including full path) experiment's files.","code":""},{"path":"https://sneumann.github.io/xcms/reference/phenoDataFromPaths.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Derive experimental design from file paths — phenoDataFromPaths","text":"function used old xcmsSet function guess experimental design (.e. group assignment files) folders files experiment can found.","code":""},{"path":"https://sneumann.github.io/xcms/reference/phenoDataFromPaths.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Derive experimental design from file paths — phenoDataFromPaths","text":"","code":"## List the files available in the faahKO package base_dir <- system.file(\"cdf\", package = \"faahKO\") cdf_files <- list.files(base_dir, recursive = TRUE, full.names = TRUE)"},{"path":"https://sneumann.github.io/xcms/reference/plot.xcmsEIC.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot extracted ion chromatograms from multiple files — plot.xcmsEIC","title":"Plot extracted ion chromatograms from multiple files — plot.xcmsEIC","text":"Batch plot list extracted ion chromatograms current graphics device.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plot.xcmsEIC.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot extracted ion chromatograms from multiple files — plot.xcmsEIC","text":"x = \"xcmsEIC\" plot.xcmsEIC(x, y, groupidx = groupnames(x), sampleidx = sampnames(x), rtrange = x@rtrange, col = rep(1, length(sampleidx)), legtext = NULL, peakint = TRUE, sleep = 0, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plot.xcmsEIC.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot extracted ion chromatograms from multiple files — plot.xcmsEIC","text":"xcmsSet object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plot.xcmsEIC.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot extracted ion chromatograms from multiple files — plot.xcmsEIC","text":"x xcmsEIC object y optional xcmsSet object peak integration data groupidx either character vector names integer vector indicies peak groups plot EICs sampleidx either character vector names integer vector indicies samples plot EICs rtrange two column matrix minimum maximum retention times return EIC data points number rows number groups xcmsEIC object, sampleidx used subset . otherwise, repeated length sampleidx may also single number specifying time window around peak plot EIC data col color use plotting extracted ion chromatograms. missing y specified, colors taken unclass(sampclass(y)) default palette length number groups xcmsEIC object, sampleidx used subset . otherwise, repeated length sampleidx legtext text use legend. NULL y specified, legend text taken sample class information found xcmsSet peakint logical, plot integrated peak area darkened lines (requires y also specified) sleep seconds pause plotting EICs ... graphical parameters","code":""},{"path":"https://sneumann.github.io/xcms/reference/plot.xcmsEIC.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot extracted ion chromatograms from multiple files — plot.xcmsEIC","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotAdjustedRtime.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualization of Alignment Results — plotAdjustedRtime","title":"Visualization of Alignment Results — plotAdjustedRtime","text":"`plotAdjustedRtime` function plots difference adjusted *raw* retention times y-axis raw retention times x-axis. line represents results one sample (file). alignment performed using *peak groups* method (see [adjustRtime()] infromation) also peak groups used alignment visualized.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotAdjustedRtime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualization of Alignment Results — plotAdjustedRtime","text":"","code":"plotAdjustedRtime( object, col = \"#00000080\", lty = 1, lwd = 1, type = \"l\", adjustedRtime = TRUE, xlab = ifelse(adjustedRtime, yes = expression(rt[adj]), no = expression(rt[raw])), ylab = expression(rt[adj] - rt[raw]), peakGroupsCol = \"#00000060\", peakGroupsPch = 16, peakGroupsLty = 3, ylim, ... )"},{"path":"https://sneumann.github.io/xcms/reference/plotAdjustedRtime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualization of Alignment Results — plotAdjustedRtime","text":"object [XcmsExperiment()] [XCMSnExp()] object alignment results. col color(s) individual lines. length 1 equal number samples. lty line type lines individual samples. lwd line width lines individual samples. type plot *type* (see [par()] options; defaults `type = \"l\"`). adjustedRtime `logical(1)` whether adjusted raw retention times shown x-axis. xlab label x-axis. ylab label y-axis. peakGroupsCol color used peak groups (alignment performed using *peak groups* method. peakGroupsPch point character (`pch`) used peak groups (alignment performed using *peak groups* method. peakGroupsLty line type (`lty`) used connect points peak groups (alignment performed using *peak groups* method. ylim optional `numeric(2)` upper lower limits y-axis.b ... Additional arguments passed `plot` function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotAdjustedRtime.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Visualization of Alignment Results — plotAdjustedRtime","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotAdjustedRtime.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualization of Alignment Results — plotAdjustedRtime","text":"","code":"## Load a test data set with detected peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Performing the peak grouping using the \"peak density\" method. p <- PeakDensityParam(sampleGroups = c(1, 1, 1)) res <- groupChromPeaks(faahko_sub, param = p) ## Perform the retention time adjustment using peak groups found in both ## files. fgp <- PeakGroupsParam(minFraction = 1) res <- adjustRtime(res, param = fgp) #> Performing retention time correction using 19 peak groups. #> Warning: Span too small for 'loess' and the available number of peak groups, resetting to 0.21 #> Warning: Adjusted retention times had to be re-adjusted for some files to ensure them being in the same order than the raw retention times. A call to 'dropAdjustedRtime' might thus fail to restore retention times of chromatographic peaks to their original values. Eventually consider to increase the value of the 'span' parameter. ## Visualize the impact of the alignment. plotAdjustedRtime(res, adjusted = FALSE) grid()"},{"path":"https://sneumann.github.io/xcms/reference/plotChrom-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot extracted ion chromatograms from the profile matrix — plotChrom-methods","title":"Plot extracted ion chromatograms from the profile matrix — plotChrom-methods","text":"Uses pre-generated profile mode matrix plot averaged base peak extracted ion chromatograms specified mass range.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChrom-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot extracted ion chromatograms from the profile matrix — plotChrom-methods","text":"object = \"xcmsRaw\" plotChrom(object, base = FALSE, ident = FALSE, fitgauss = FALSE, vline = numeric(0), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChrom-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot extracted ion chromatograms from the profile matrix — plotChrom-methods","text":"object xcmsRaw object base logical, plot base-peak chromatogram ident logical, use mouse identify label peaks fitgauss logical, fit gaussian largest peak vline numeric vector locations vertical lines ... arguments passed profRange","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChrom-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot extracted ion chromatograms from the profile matrix — plotChrom-methods","text":"ident == TRUE, integer vector indecies points identified. fitgauss == TRUE, nls model fitted gaussian. Otherwise two-column matrix plotted points.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"Plot density chromatographic peaks along retention time axis indicate peaks () grouped feature based using peak density correspondence method. Settings peak density method can passed PeakDensityParam object parameter param. object contains correspondence results correspondence performed peak groups method, results correspondence can visualized setting simulate = FALSE.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"","code":"# S4 method for XCMSnExp plotChromPeakDensity( object, mz, rt, param, simulate = TRUE, col = \"#00000080\", xlab = \"retention time\", ylab = \"sample\", xlim = range(rt), main = NULL, type = c(\"any\", \"within\", \"apex_within\"), ... )"},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"object XCMSnExp object identified chromatographic peaks. mz numeric(2) defining mz range peak density plotted. rt numeric(2) defining optional rt range peak density plotted. Defaults absolute retention time range object. param PeakDensityParam parameters peak density correspondence algorithm can extracted. provided object contains feature definitions correspondence/ peak grouping performed peak density method, corresponding parameter class stored object used. simulate logical(1) defining whether correspondence simulated within specified m/z / rt region (simulate = FALSE) whether results already performed correspondence shown. col Color used individual samples. Length 1 equal number samples object. xlab character(1) label x-axis. ylab character(1) label y-axis. xlim numeric(2) representing limits x-axis. Defaults range rt parameter. main character(1) defining title plot. default (main = NULL) mz-range used. type character(1) specifying peaks called located within region defined mz rt. Can one \"\", \"within\", \"apex_within\" peaks even partially overlapping region, peaks completely within region, peaks apex within region. parameter passed chromPeaks function. See related documentation information examples. ... Additional parameters passed plot function. Data point specific parameters bg pch length 1 equal number samples.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"function called side effect, .e. create plot.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"plotChromPeakDensity function allows evaluate different settings peak density mz slice interest (e.g. containing chromatographic peaks corresponding known metabolite). plot shows individual peaks detected within specified mz slice retention time (x-axis) sample detected (y-axis). density function plotted black line. Parameters density function taken param object. Grey rectangles indicate chromatographic peaks grouped feature peak density correspondence method. Parameters algorithm also taken param. See groupChromPeaks() information algorithm supported settings.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"","code":"## Load a test data set with detected peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Plot the chromatographic peak density for a specific mz range to evaluate ## different peak density correspondence settings. mzr <- c(305.05, 305.15) plotChromPeakDensity(faahko_sub, mz = mzr, pch = 16, param = PeakDensityParam(sampleGroups = rep(1, length(fileNames(faahko_sub))))) #> Warning: Use of 'plotChromPeakDensity' on 'XCMSnExp' isdiscouraged. Please extract chromatographic data first and call 'plotChromPeakDensity' directly on the 'XChromatograms' object. See ?XChromatograms, section 'Correspondence analysis' for more details."},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"General visualizations of peak detection results — plotChromPeaks","title":"General visualizations of peak detection results — plotChromPeaks","text":"`plotChromPeaks` plots identified chromatographic peaks one file plane spanned retention time (x-axis) m/z (y-axis) dimension. chromatographic peak plotted rectangle representing width RT m/z dimension. `plotChromPeakImage` plots number detected peaks sample along retention time axis *image* plot, .e. number peaks detected bin along retention time represented color respective cell.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"General visualizations of peak detection results — plotChromPeaks","text":"","code":"plotChromPeaks( x, file = 1, xlim = NULL, ylim = NULL, add = FALSE, border = \"#00000060\", col = NA, xlab = \"retention time\", ylab = \"mz\", main = NULL, msLevel = 1L, ... ) plotChromPeakImage( x, binSize = 30, xlim = NULL, log = FALSE, xlab = \"retention time\", yaxt = par(\"yaxt\"), main = \"Chromatographic peak counts\", msLevel = 1L, ... )"},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"General visualizations of peak detection results — plotChromPeaks","text":"x [XcmsExperiment()] [XCMSnExp()] object. file `plotChromPeaks`: `integer(1)` specifying index file within `x` plot created. Defaults `file = 1`. xlim `numeric(2)` specifying x-axis limits (retention time dimension). Defaults `xlim = NULL` case full retention time range file used. ylim `plotChromPeaks`: `numeric(2)` specifying y-axis limits (m/z dimension). Defaults `ylim = NULL` case full m/z range file used. add `plotChromPeaks`: `logical(1)` whether plot added existing plot new plot created. border `plotChromPeaks`: color rectangles' border. col `plotChromPeaks`: color used fill rectangles. xlab `character(1)` defining x-axis label. ylab `plotChromPeaks`: `character(1)` defining y-axis label. main `character(1)` defining plot title. default (.e. `main = NULL`) name file used title. msLevel `integer(1)` defining MS level peaks visualized. ... Additional arguments passed `plot` (`plotChromPeaks`) `image` (`plotChromPeakImage`) functions. Ignored `add = TRUE`. binSize `plotChromPeakImage`: `numeric(1)` defining size bins along x-axis (retention time). Defaults `binSize = 30`, peaks within 30 seconds thus counted plotted. log `plotChromPeakImage`: `logical(1)` whether peak counts log2 transformed plotting. yaxt `plotChromPeakImage`: `character(1)` defining whether y-axis labels added. disable y-axis use `yaxt = \"n\"`. value `yaxt` axis drawn. See [par()] help page details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"General visualizations of peak detection results — plotChromPeaks","text":"width line type rectangles indicating detected chromatographic peaks `plotChromPeaks` function can specified using `par` function, .e. `par(lwd = 3)` `par(lty = 2)`, respectively.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"General visualizations of peak detection results — plotChromPeaks","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"General visualizations of peak detection results — plotChromPeaks","text":"","code":"## Load a test data set with detected peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## plotChromPeakImage: plot an image for the identified peaks per file plotChromPeakImage(faahko_sub) ## Show all detected chromatographic peaks from the first file plotChromPeaks(faahko_sub) ## Plot all detected peaks from the second file and restrict the plot to a ## mz-rt slice plotChromPeaks(faahko_sub, file = 2, xlim = c(3500, 3600), ylim = c(400, 600))"},{"path":"https://sneumann.github.io/xcms/reference/plotChromatogramsOverlay.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","title":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","text":"plotOverlay draws chromatographic peak data multiple (different) extracted ion chromatograms (EICs) plot. allows directly compare peak shape EICs sample. contrast plot function MChromatograms() object, draws data EIC across multiple samples plot, function draws different EICs sample plot. plotChromatogramsOverlay called XChromatograms object present chromatographic peaks also highlighted/drawn depending parameters peakType, peakCol, peakBg peakPch (see also help plot function XChromatogram() object details).","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromatogramsOverlay.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","text":"","code":"# S4 method for MChromatograms plotChromatogramsOverlay( object, col = \"#00000060\", type = \"l\", main = NULL, xlab = \"rtime\", ylab = \"intensity\", xlim = numeric(), ylim = numeric(), stacked = 0, transform = identity, ... ) # S4 method for XChromatograms plotChromatogramsOverlay( object, col = \"#00000060\", type = \"l\", main = NULL, xlab = \"rtime\", ylab = \"intensity\", xlim = numeric(), ylim = numeric(), peakType = c(\"polygon\", \"point\", \"rectangle\", \"none\"), peakBg = NULL, peakCol = NULL, peakPch = 1, stacked = 0, transform = identity, ... )"},{"path":"https://sneumann.github.io/xcms/reference/plotChromatogramsOverlay.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","text":"object MChromatograms() XChromatograms() object. col definition color chromatograms drawn. Can length 1 equal nrow(object) plot overlayed chromatogram different color. type character(1) defing type plot. default (type = \"l\") chromatogram drawn line. main optional title plot. defined, range m/z values used. xlab character(1) defining x-axis label. ylab character(1) defining y-axis label. xlim optional numeric(2) defining x-axis limits. ylim optional numeric(2) defining y-axis limits. stacked numeric(1) defining part (proportion) y-axis use stack EICs depending m/z values. stacked = 0 (default) stacking performed. stacked = 1 half y-axis used stacking half intensity y-axis (.e. ratio stacking intensity y-axis 1:1). Note stacking different 0 y-axis label drawn. transform function transform intensity values plotting. Defaults transform = identity plots data . transform = log10 intensity values log10 transformed plotting. ... optional arguments passed plotting functions (see help base R plot function. peakType object XChromatograms object: chromatographic peaks drawn: peakType = \"polygon\" (default): label full chromatographic peak area, peakType = \"rectangle\": indicate chromatographic peak rectangle peakType = \"point\": label chromatographic peaks' apex position point. peakBg object XChromatograms object: definition background color(s) chromatographic peak. either length 1 equal number peaks object. specified, peak drawn color defined col. peakCol object XChromatograms object: definition color(s) chromatographic peak. either length 1 equal number peaks object. specified, peak drawn color defined col. peakPch object XChromatograms object: point character used label apex position chromatographic peak peakType = \"point\".","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromatogramsOverlay.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","text":"silently returns list (length equal ncol(object) numeric (length equal nrow(object)) y position EIC.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromatogramsOverlay.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromatogramsOverlay.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","text":"","code":"## Load preprocessed data and extract EICs for some features. library(xcms) library(MSnbase) xdata <- loadXcmsData() data(xdata) ## Update the path to the files for the local system dirname(xdata) <- c(rep(system.file(\"cdf\", \"KO\", package = \"faahKO\"), 4), rep(system.file(\"cdf\", \"WT\", package = \"faahKO\"), 4)) #> Error: unable to find an inherited method for function ‘path’ for signature ‘object = \"XcmsExperiment\"’ ## Subset to the first 3 files. xdata <- filterFile(xdata, 1:3, keepFeatures = TRUE) ## Define features for which to extract EICs fts <- c(\"FT097\", \"FT163\", \"FT165\") chrs <- featureChromatograms(xdata, features = fts) plotChromatogramsOverlay(chrs) ## plot the overlay of EICs in the first sample plotChromatogramsOverlay(chrs[, 1]) ## Define a different color for each feature (row in chrs). By default, also ## all chromatographic peaks of a feature is labeled in the same color. plotChromatogramsOverlay(chrs[, 1], col = c(\"#ff000040\", \"#00ff0040\", \"#0000ff40\")) ## Alternatively, we can define a color for each individual chromatographic ## peak and provide this with the `peakBg` and `peakCol` parameters. chromPeaks(chrs[, 1]) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP2975 354.1357 354.1 354.2 2790.288 2755.843 2826.772 298657.9 NA 9700 #> CP0312 413.1000 413.1 413.1 3643.850 3620.732 3672.298 879851.5 852195.3 30920 #> CP0089 414.2000 414.2 414.2 3066.209 3038.494 3089.233 234308.5 218923.4 9669 #> sn sample row column #> CP2975 NA 1 1 1 #> CP0312 34 1 2 1 #> CP0089 15 1 3 1 ## Use a color for each of the two identified peaks in that sample plotChromatogramsOverlay(chrs[, 1], col = c(\"#ff000040\", \"#00ff0040\", \"#0000ff40\"), peakBg = c(\"#ffff0020\", \"#00ffff20\")) ## Plotting the data in all samples. plotChromatogramsOverlay(chrs, col = c(\"#ff000040\", \"#00ff0040\", \"#0000ff40\")) ## Creating a \"stacked\" EIC plot: the EICs are placed along the y-axis ## relative to their m/z value. With `stacked = 1` the y-axis is split in ## half, the lower half being used for the stacking of the EICs, the upper ## half being used for the *original* intensity axis. res <- plotChromatogramsOverlay(chrs[, 1], stacked = 1, col = c(\"#ff000040\", \"#00ff0040\", \"#0000ff40\")) ## add horizontal lines for the m/z values of each EIC abline(h = res[[1]], col = \"grey\", lty = 2) ## Note that this type of visualization is different than the conventional ## plot function for chromatographic data, which will draw the EICs for ## multiple samples into the same plot plot(chrs) ## Converting the object to a MChromatograms without detected peaks chrs <- as(chrs, \"MChromatograms\") plotChromatogramsOverlay(chrs, col = c(\"#ff000040\", \"#00ff0040\", \"#0000ff40\"))"},{"path":"https://sneumann.github.io/xcms/reference/plotEIC-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot extracted ion chromatograms for specified m/z range — plotEIC-methods","title":"Plot extracted ion chromatograms for specified m/z range — plotEIC-methods","text":"Plot extracted ion chromatogram m/z values interest. raw data used contrast plotChrom uses data profile matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotEIC-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot extracted ion chromatograms for specified m/z range — plotEIC-methods","text":"object = \"xcmsRaw\" plotEIC(object, mzrange = numeric(), rtrange = numeric(), scanrange = numeric(), mzdec=2, type=\"l\", add=FALSE, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotEIC-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot extracted ion chromatograms for specified m/z range — plotEIC-methods","text":"object xcmsRaw object mzrange m/z range EIC. Uses full m/z range default. rtrange retention time range EIC. Uses full retention time range default. scanrange scan range EIC mzdec Number decimal places title m/z values eic plot. type Speficies data plotted (default line). add EIC added existing plot. ... Additional parameters passed plotting function (e.g. col etc).","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotEIC-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot extracted ion chromatograms for specified m/z range — plotEIC-methods","text":"two-column matrix plotted points.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotEIC-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot extracted ion chromatograms for specified m/z range — plotEIC-methods","text":"Ralf Tautenhahn","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotFeatureGroups.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot feature groups in the m/z-retention time space — plotFeatureGroups","title":"Plot feature groups in the m/z-retention time space — plotFeatureGroups","text":"plotFeatureGroups visualizes defined feature groups m/z retention time space. Features indicated points features feature group connected line. See featureGroups() details options feature grouping.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotFeatureGroups.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot feature groups in the m/z-retention time space — plotFeatureGroups","text":"","code":"plotFeatureGroups( x, xlim = numeric(), ylim = numeric(), xlab = \"retention time\", ylab = \"m/z\", pch = 4, col = \"#00000060\", type = \"o\", main = \"Feature groups\", featureGroups = character(), ... )"},{"path":"https://sneumann.github.io/xcms/reference/plotFeatureGroups.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot feature groups in the m/z-retention time space — plotFeatureGroups","text":"x XcmsExperiment XCMSnExp() object grouped features (.e. calling groupFeatures(). xlim numeric(2) lower upper limit x-axis. ylim numeric(2) lower upper limit y-axis. xlab character(1) label x-axis. ylab character(1) label y-axis. pch plotting character. Defaults pch = 4 .e. plotting features crosses. See par() information. col color used draw features. present single color supported. type plotting type (see par()). Defaults type = \"o\" draws feature point connecting features feature group line. main character(1) title plot. featureGroups optional character feature group IDs draw specified feature group(s). provided, feature groups drawn. ... additional parameters passed lines function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotFeatureGroups.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot feature groups in the m/z-retention time space — plotFeatureGroups","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotMsData.html","id":null,"dir":"Reference","previous_headings":"","what":"DEPRECATED: Create a plot that combines a XIC and a mz/rt 2D plot for one sample — plotMsData","title":"DEPRECATED: Create a plot that combines a XIC and a mz/rt 2D plot for one sample — plotMsData","text":"UPDATE: please use plot() MsExperiment plot(x, type = \"XIC\") MSnbase package instead. See examples vignette information. plotMsData creates plot combines (base peak ) extracted ion chromatogram top (rt intensity) plot rt m/z values bottom.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotMsData.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"DEPRECATED: Create a plot that combines a XIC and a mz/rt 2D plot for one sample — plotMsData","text":"","code":"plotMsData( x, main = \"\", cex = 1, mfrow = c(2, 1), grid.color = \"lightgrey\", colramp = colorRampPalette(rev(brewer.pal(9, \"YlGnBu\"))) )"},{"path":"https://sneumann.github.io/xcms/reference/plotMsData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"DEPRECATED: Create a plot that combines a XIC and a mz/rt 2D plot for one sample — plotMsData","text":"x data.frame returned extractMsData() function. single data.frame supported. main character(1) specifying title. cex numeric(1) defining size points. Passed directly plot function. mfrow numeric(2) defining plot layout. passed directly par(mfrow = mfrow). See par information. Setting mfrow = NULL avoids calling par(mfrow = mfrow) hence allowing pre-define plot layout. grid.color color definition grid line (NA skip creating ). colramp color ramp palette used color data points based intensity. See argument col.regions lattice::level.colors documentation.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotMsData.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"DEPRECATED: Create a plot that combines a XIC and a mz/rt 2D plot for one sample — plotMsData","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotPeaks-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot a grid of a large number of peaks — plotPeaks-methods","title":"Plot a grid of a large number of peaks — plotPeaks-methods","text":"Plot extracted ion chromatograms many peaks simultaneously, indicating peak integration start end points vertical grey lines.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotPeaks-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot a grid of a large number of peaks — plotPeaks-methods","text":"object = \"xcmsRaw\" plotPeaks(object, peaks, figs, width = 200)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotPeaks-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot a grid of a large number of peaks — plotPeaks-methods","text":"object xcmsRaw object peaks matrix peak information produced findPeaks figs two-element vector describing number rows number columns peaks plot, missing approximately square grid fit number peaks supplied width width chromatogram retention time plot peak","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotPeaks-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot a grid of a large number of peaks — plotPeaks-methods","text":"function intended help graphically analyze results peak picking. can help estimate number false positives improper integration start end points. output compact tries waste little space possible. plot labeled rounded m/z retention time separated space.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"Use \"democracy\" determine average m/z RT deviations grouped xcmsSet, dependency sample absolute m/z","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"","code":"plotQC(object, sampNames, sampColors, sampOrder, what)"},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"object grouped xcmsSet sampNames Override sample names (e.g. simplified names) sampColors Provide set colors (default: monochrome ?) sampOrder Override order samples, e.g. bring order measurement detect time drift vector QC plots generate. \"mzdevhist\": histogram mz deviations. gaussian shaped. multimodal, peaks seem systematically higher m/z deviation \"rtdevhist\": histogram RT deviations. gaussian shaped. multimodal, peaks seem systematically higher RT deviation \"mzdevmass\": Shows whether m/z deviations absolute m/z dependent, indicate miscalibration \"mzdevtime\": Shows whether m/z deviations RT dependent, indicate instrument drift \"mzdevsample\": median mz deviation sample, indicates outliers \"rtdevsample\": median RT deviation sample, indicates outliers","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"List four matrices, dimension features * samples: \"mz\": median mz deviation sample \"mzdev\": median mz deviation sample \"rt\": median RT deviation sample \"rtdev\": median RT deviation sample","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"plotQC() warpper create set diagnostic plots. m/z deviations, median m/z withon one group assumed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"Michael Wenk, Michael Wenk ","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"","code":"library(faahKO) xsg <- group(faahko) plotQC(xsg, what=\"mzdevhist\") plotQC(xsg, what=\"rtdevhist\") plotQC(xsg, what=\"mzdevmass\") plotQC(xsg, what=\"mzdevtime\") plotQC(xsg, what=\"mzdevsample\") plotQC(xsg, what=\"rtdevsample\")"},{"path":"https://sneumann.github.io/xcms/reference/plotRaw-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Scatterplot of raw data points — plotRaw-methods","title":"Scatterplot of raw data points — plotRaw-methods","text":"Produce scatterplot showing raw data point location retention time m/z. plot useful centroided data continuum data.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotRaw-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Scatterplot of raw data points — plotRaw-methods","text":"object = \"xcmsRaw\" plotRaw(object, mzrange = numeric(), rtrange = numeric(), scanrange = numeric(), log=FALSE, title='Raw Data')","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotRaw-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scatterplot of raw data points — plotRaw-methods","text":"object xcmsRaw object mzrange numeric vector length >= 2 whose range used select masses plot rtrange numeric vector length >= 2 whose range used select retention times plot scanrange numeric vector length >= 2 whose range used select scans plot log logical, log transform intensity title main title plot","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotRaw-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scatterplot of raw data points — plotRaw-methods","text":"matrix points plotted.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotScan-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot a single mass scan — plotScan-methods","title":"Plot a single mass scan — plotScan-methods","text":"Plot single mass scan using impulse representation. useful centroided data.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotScan-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot a single mass scan — plotScan-methods","text":"object = \"xcmsRaw\" plotScan(object, scan, mzrange = numeric(), ident = FALSE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotScan-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot a single mass scan — plotScan-methods","text":"object xcmsRaw object scan integer number scan plot mzrange numeric vector length >= 2 whose range used select masses plot ident logical, use mouse interactively identify label individual masses","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotSpec-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot mass spectra from the profile matrix — plotSpec-methods","title":"Plot mass spectra from the profile matrix — plotSpec-methods","text":"Uses pre-generated profile mode matrix plot mass spectra specified retention time range.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotSpec-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot mass spectra from the profile matrix — plotSpec-methods","text":"object = \"xcmsRaw\" plotSpec(object, ident = FALSE, vline = numeric(0), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotSpec-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot mass spectra from the profile matrix — plotSpec-methods","text":"object xcmsRaw object ident logical, use mouse identify label peaks vline numeric vector locations vertical lines ... arguments passed profRange","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotSpec-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot mass spectra from the profile matrix — plotSpec-methods","text":"ident == TRUE, integer vector indecies points identified. Otherwise two-column matrix plotted points.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotSurf-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot profile matrix 3D surface using OpenGL — plotSurf-methods","title":"Plot profile matrix 3D surface using OpenGL — plotSurf-methods","text":"method uses rgl package create interactive three dimensonal representations profile matrix. uses terrain color scheme.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotSurf-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot profile matrix 3D surface using OpenGL — plotSurf-methods","text":"object = \"xcmsRaw\" plotSurf(object, log = FALSE, aspect = c(1, 1, .5), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotSurf-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot profile matrix 3D surface using OpenGL — plotSurf-methods","text":"object xcmsRaw object log logical, log transform intensity aspect numeric vector aspect ratio m/z, retention time intensity components plot ... arguments passed profRange","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotSurf-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot profile matrix 3D surface using OpenGL — plotSurf-methods","text":"rgl package still development imposes limitations output format. bug axis label code means axis labels go 0 aspect ratio constant axis. Additionally axes labeled . important plot small portion profile matrix. Large portions can quickly overwhelm CPU memory.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotTIC-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot total ion count — plotTIC-methods","title":"Plot total ion count — plotTIC-methods","text":"Plot chromatogram total ion count. Optionally allow identification target peaks viewing/identification individual spectra.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotTIC-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot total ion count — plotTIC-methods","text":"object = \"xcmsRaw\" plotTIC(object, ident = FALSE, msident = FALSE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotTIC-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot total ion count — plotTIC-methods","text":"object xcmsRaw object ident logical, use mouse identify label chromatographic peaks msident logical, use mouse identify label spectral peaks","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotTIC-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot total ion count — plotTIC-methods","text":"ident == TRUE, integer vector indecies points identified. Otherwise two-column matrix plotted points.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotrt-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot retention time deviation profiles — plotrt-methods","title":"Plot retention time deviation profiles — plotrt-methods","text":"Use corrected retention times sample calculate retention time deviation profiles plot graph.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotrt-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot retention time deviation profiles — plotrt-methods","text":"object = \"xcmsSet\" plotrt(object, col = NULL, ty = NULL, leg = TRUE, densplit = FALSE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotrt-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot retention time deviation profiles — plotrt-methods","text":"object xcmsSet object col vector colors plotting sample ty vector line point types plotting sample leg logical plot legend sample labels densplit logical, also plot peak overall peak density","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":null,"dir":"Reference","previous_headings":"","what":"Generation of profile data — profGenerate","title":"Generation of profile data — profGenerate","text":"Generates profile (binned) data given range indexed pair vectors.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generation of profile data — profGenerate","text":"","code":"profBin(x, y, num, xstart = min(x), xend = max(x), param = list()) profBinM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list()) profBinLin(x, y, num, xstart = min(x), xend = max(x), param = list()) profBinLinM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list()) profBinLinBase(x, y, num, xstart = min(x), xend = max(x), param = list()) profBinLinBaseM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list()) profIntLin(x, y, num, xstart = min(x), xend = max(x), param = list()) profIntLinM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list()) profMaxIdx(x, y, num, xstart = min(x), xend = max(x), param = list()) profMaxIdxM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list())"},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generation of profile data — profGenerate","text":"x numeric vector value positions y numeric vector values bin zidx starting position new segment num number equally spaced x bins xstart starting x value xend ending x value NAOK allow NA values (faster) param parameters profile generation","code":""},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generation of profile data — profGenerate","text":"functions take vector unequally spaced y values transform either vector matrix, depending whether index . point vector matrix represents data point centered corresponding x value, plus minus half x step size (xend-xstart/(num-1)). Bin functions set matrix vector value maximal point gets binned . BinLin functions except linearly interpolate values nothing binned. BinLinBase functions except populate empty parts spectra base value. take two parameters: 1) baselevel, intensity level fill empty parts spectra. defaluts half minimum intensity. 2) basespace, m/z length signal drop base level. Linear interpolation used consecuitive data points falling within 2*basespace eachother. defaluts 0.075. IntLin functions set matrix vector value integral linearly interpolated data plus minus half step size. MaxIdx functions work similarly Bin functions execpt return integer index x,y pair placed particular cell.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Generation of profile data — profGenerate","text":"issues profBinLin method, see https://github.com/sneumann/xcms/issues/46 https://github.com/sneumann/xcms/issues/49. Thus suggested use functions binYonX combination imputeLinInterpol instead.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generation of profile data — profGenerate","text":"prof*, numeric vector length num. prof*M, matrix dimensions num length(zidx). MaxIdx, data type integer, others double.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generation of profile data — profGenerate","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generation of profile data — profGenerate","text":"","code":"if (FALSE) { library(faahKO) cdfpath <- system.file(\"cdf\", package = \"faahKO\") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE) xraw <- xcmsRaw(cdffiles[1]) image(xraw) ## not how with intLin the intensity's blur profMethod(xraw) <- \"bin\" image(xraw) ## now with 'bin' there is no blurring good for centroid data ##try binlinbase for profile data }"},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":null,"dir":"Reference","previous_headings":"","what":"The profile matrix — profMat,MsExperiment-method","title":"The profile matrix — profMat,MsExperiment-method","text":"profile matrix n x m matrix, n (rows) representing equally spaced m/z values (bins) m (columns) retention time corresponding scans. cell contains maximum intensity measured specific scan m/z values falling within m/z bin.","code":"The `profMat` method creates a new profile matrix or returns the profile matrix within the object's `@env` slot, if available. Settings for the profile matrix generation, such as `step` (the bin size), `method` or additional settings are extracted from the respective slots of the `xcmsRaw` object. Alternatively it is possible to specify all of the settings as additional parameters. For [MsExperiment()] or [XcmsExperiment()] objects, the method returns a `list` of profile matrices, one for each sample in `object`. Using parameter `fileIndex` it is also possible to create a profile matrix only for selected samples (files)."},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The profile matrix — profMat,MsExperiment-method","text":"","code":"# S4 method for MsExperiment profMat( object, method = \"bin\", step = 0.1, baselevel = NULL, basespace = NULL, mzrange. = NULL, fileIndex = seq_along(object), chunkSize = 1L, msLevel = 1L, BPPARAM = bpparam(), ... ) # S4 method for xcmsRaw profMat(object, method, step, baselevel, basespace, mzrange.)"},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"The profile matrix — profMat,MsExperiment-method","text":"object xcmsRaw, OnDiskMSnExp, XCMSnExp, MsExperiment XcmsExperiment object. method character(1) defining profile matrix generation method. Allowed \"bin\", \"binlin\", \"binlinbase\" \"intlin\". See details section information. step numeric(1) representing m/z bin size. baselevel numeric(1) representing base value empty elements (.e. m/z bins without measured intensity) set. considered method = \"binlinbase\". See baseValue parameter imputeLinInterpol() details. basespace numeric(1) representing m/z length signal drop base level. Linear interpolation used consecutive data points falling within 2 * basespace . considered method = \"binlinbase\". specified, defaults 0.075. Internally parameter translated distance parameter imputeLinInterpol() function distance = floor(basespace / step). See distance parameter imputeLinInterpol() details. mzrange. Optional numeric(2) manually specifying mz value range used binnind. provided, whole m/z value range used. fileIndex MsExperiment XcmsExperiment: integer defining idex (indices) sample(s) profile matrix created. chunkSize MsExperiment XcmsExperiment: integer(1) defining number files data loaded processed one iteration. default one file time processed chunkSize = 1L requires less memory. parallel processing, chunkSize >= number parallel processes used. msLevel MsExperiment XcmsExperiment: integer(1) defining MS level profile matrix generated. BPPARAM MsExperiment XcmsExperiment: parallel processing setup. See bpparam() details. Defaults BPPARAM = bpparam(). ... ignored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The profile matrix — profMat,MsExperiment-method","text":"profMat returns profile matrix (rows representing scans, columns equally spaced m/z values). object MsExperiment XcmsExperiment, method returns list profile matrices, one file (sample).","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The profile matrix — profMat,MsExperiment-method","text":"Profile matrix generation methods: \"bin\": default profile matrix generation method simple binning, .e. aggregating intensity values falling within m/z bin. \"binlin\": Binning followed linear interpolation impute missing values. value m/z bins without measured intensity inferred linear interpolation neighboring bins measured intensity. \"binlinbase\": Binning followed linear interpolation impute values empty elements (m/z bins) within user-definable proximity non-empty elements stetting element's value baselevel otherwise. See impute = \"linbase\" parameter imputeLinInterpol() details. \"intlin\": Set elements' values integral linearly interpolated data plus minus half step size.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"The profile matrix — profMat,MsExperiment-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"The profile matrix — profMat,MsExperiment-method","text":"","code":"file <- system.file('cdf/KO/ko15.CDF', package = \"faahKO\") ## Load the data without generating the profile matrix (profstep = 0) xraw <- xcmsRaw(file, profstep = 0) ## Extract the profile matrix profmat <- profMat(xraw, step = 0.3) #> Create profile matrix with method 'bin' and step 0.3 ... #> OK dim(profmat) #> [1] 1335 1278 ## If not otherwise specified, the settings from the xraw object are used: profinfo(xraw) #> $method #> [1] \"bin\" #> #> $step #> [1] 0 #> ## To extract a profile matrix with linear interpolation use profmat <- profMat(xraw, step = 0.3, method = \"binlin\") #> Create profile matrix with method 'binlin' and step 0.3 ... #> OK ## Alternatively, the profMethod of the xraw objects could be changed profMethod(xraw) <- \"binlin\" profmat_2 <- profMat(xraw, step = 0.3) #> Create profile matrix with method 'binlin' and step 0.3 ... #> OK all.equal(profmat, profmat_2) #> [1] TRUE"},{"path":"https://sneumann.github.io/xcms/reference/profMedFilt-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Median filtering of the profile matrix — profMedFilt-methods","title":"Median filtering of the profile matrix — profMedFilt-methods","text":"Apply median filter given size profile matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMedFilt-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Median filtering of the profile matrix — profMedFilt-methods","text":"object = \"xcmsRaw\" profMedFilt(object, massrad = 0, scanrad = 0)","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMedFilt-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Median filtering of the profile matrix — profMedFilt-methods","text":"object xcmsRaw object massrad number m/z grid points either side use median calculation scanrad number scan grid points either side use median calculation","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/profMethod-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get and set method for generating profile data — profMethod-methods","title":"Get and set method for generating profile data — profMethod-methods","text":"methods get set method generating profile (matrix) data raw mass spectral data. can currently bin, binlin, binlinbase, intlin.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMethod-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get and set method for generating profile data — profMethod-methods","text":"object = \"xcmsRaw\" profMethod(object)","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/profRange-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Specify a subset of profile mode data — profRange-methods","title":"Specify a subset of profile mode data — profRange-methods","text":"Specify subset profile mode matrix given mass, time, scan range. Allow flexible user entry functions.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profRange-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Specify a subset of profile mode data — profRange-methods","text":"object = \"xcmsRaw\" profRange(object, mzrange = numeric(), rtrange = numeric(), scanrange = numeric(), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/profRange-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Specify a subset of profile mode data — profRange-methods","text":"object xcmsRaw object mzrange single numeric mass vector masses rtrange single numeric time (seconds) vector times scanrange single integer scan index vector indecies ... arguments functions","code":""},{"path":"https://sneumann.github.io/xcms/reference/profRange-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Specify a subset of profile mode data — profRange-methods","text":"function handles selection mass/time subsets profile matrix functions. allows user specify subsets variety flexible ways minimal typing. R partial argument matching, mzrange, scanrange, rtrange can specified short form using m=, s=, t=, respectively. scanrange rtrange specified, rtrange specification takes precedence. specifying ranges, may either enter single number numeric vector. single number entered, closest single scan mass value selected. vector entered, range set range() values entered. allows specification ranges using shortened, slightly non-standard syntax. example, one specify 400 500 seconds using following: t=c(400,500), t=c(500,400), t=400:500. Use sequence operator (:) can save several keystrokes specifying ranges. However, sequence operator works well specifying integer ranges, fractional ranges always work well.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profRange-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Specify a subset of profile mode data — profRange-methods","text":"list folloing items: mzrange numeric vector start end mass masslab textual label mass range massidx integer vector mass indecies scanrange integer vector stat ane end scans scanlab textual label scan range scanidx integer vector scan range rtrange numeric vector start end times timelab textual label time range","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/profStep-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get and set m/z step for generating profile data — profStep-methods","title":"Get and set m/z step for generating profile data — profStep-methods","text":"methods get set m/z step generating profile (matrix) data raw mass spectral data. Smaller steps yield precision cost greater memory usage.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profStep-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get and set m/z step for generating profile data — profStep-methods","text":"object = \"xcmsRaw\" profStep(object)","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/profStep-methods.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get and set m/z step for generating profile data — profStep-methods","text":"","code":"if (FALSE) { library(faahKO) cdfpath <- system.file(\"cdf\", package = \"faahKO\") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE) xset <- xcmsRaw(cdffiles[1]) xset plotSurf(xset, mass=c(200,500)) profStep(xset)<-0.1 ## decrease the bin size to get better resolution plotSurf(xset, mass=c(200, 500)) ##works nicer on high resolution data. }"},{"path":"https://sneumann.github.io/xcms/reference/pval.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate p-values for a vector of t-statistics — pval","title":"Generate p-values for a vector of t-statistics — pval","text":"Generate p-values vector Welch's two-sample t-statistics based t distribution.","code":""},{"path":"https://sneumann.github.io/xcms/reference/pval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate p-values for a vector of t-statistics — pval","text":"","code":"pval(X, classlabel, teststat)"},{"path":"https://sneumann.github.io/xcms/reference/pval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate p-values for a vector of t-statistics — pval","text":"X original data matrix classlabel integer vector classlabel teststat numeric vector Welch's two-sample t-statistics","code":""},{"path":"https://sneumann.github.io/xcms/reference/pval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate p-values for a vector of t-statistics — pval","text":"numeric vector p-values.","code":""},{"path":"https://sneumann.github.io/xcms/reference/pval.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate p-values for a vector of t-statistics — pval","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawEIC-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get extracted ion chromatograms for specified m/z range — rawEIC-methods","title":"Get extracted ion chromatograms for specified m/z range — rawEIC-methods","text":"Generate extracted ion chromatogram m/z values interest. raw data used contrast getEIC uses data profile matrix (.e. values binned along M/Z dimension).","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawEIC-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get extracted ion chromatograms for specified m/z range — rawEIC-methods","text":"object = \"xcmsRaw\" rawEIC(object, mzrange = numeric(), rtrange = numeric(), scanrange = numeric())","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawEIC-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get extracted ion chromatograms for specified m/z range — rawEIC-methods","text":"object xcmsRaw object mzrange m/z range EIC rtrange retention time range EIC scanrange scan range EIC","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawEIC-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get extracted ion chromatograms for specified m/z range — rawEIC-methods","text":"list : scan scan number intensity added intensity values","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawEIC-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get extracted ion chromatograms for specified m/z range — rawEIC-methods","text":"Ralf Tautenhahn","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/rawMat-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a raw data matrix — rawMat-methods","title":"Get a raw data matrix — rawMat-methods","text":"Returns matrix columns time, m/z, intensity represents raw data chromatography mass spectrometry experiment.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawMat-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get a raw data matrix — rawMat-methods","text":"object = \"xcmsRaw\" rawMat(object, mzrange = numeric(), rtrange = numeric(), scanrange = numeric(), log=FALSE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawMat-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a raw data matrix — rawMat-methods","text":"object container raw data mzrange Subset m/z range rtrange Subset retention time range scanrange Subset scan index range log Whether log transform intensities","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawMat-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a raw data matrix — rawMat-methods","text":"numeric matrix three columns: time, mz intensity.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/rawMat-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get a raw data matrix — rawMat-methods","text":"Michael Lawrence","code":""},{"path":"https://sneumann.github.io/xcms/reference/reconstructChromPeakSpectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","title":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","text":"Reconstructs MS2 spectra MS1 chromatographic peak (possible) data independent acquisition (DIA) data (SWATH). See LC-MS/MS analysis vignette details examples.","code":""},{"path":"https://sneumann.github.io/xcms/reference/reconstructChromPeakSpectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","text":"","code":"reconstructChromPeakSpectra(object, ...) # S4 method for XcmsExperiment reconstructChromPeakSpectra( object, expandRt = 0, diffRt = 2, minCor = 0.8, intensity = \"maxo\", peakId = rownames(chromPeaks(object, msLevel = 1L)), BPPARAM = bpparam() ) # S4 method for XCMSnExp reconstructChromPeakSpectra( object, expandRt = 0, diffRt = 2, minCor = 0.8, intensity = \"maxo\", peakId = rownames(chromPeaks(object, msLevel = 1L)), BPPARAM = bpparam(), return.type = c(\"Spectra\", \"MSpectra\") )"},{"path":"https://sneumann.github.io/xcms/reference/reconstructChromPeakSpectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","text":"object XCMSnExp identified chromatographic peaks. ... ignored. expandRt numeric(1) allowing expand retention time range extracted ion chromatograms constant value (peak shape correlation). Defaults expandRt = 0 hence correlates signal included identified chromatographic peaks. diffRt numeric(1) defining maximal allowed difference retention time chromatographic peak (apex) retention times MS2 chromatographic peaks (apex) consider representing candidate fragments original ion. minCor numeric(1) defining minimal required correlation coefficient MS2 chromatographic peaks considered MS2 spectrum reconstruction. intensity character(1) defining column chromPeaks matrix used intensities reconstructed spectra's peaks. value MS1 chromatographic peaks used precursorIntensity resulting spectra. peakId optional character vector peak IDs (.e. rownames chromPeaks) MS1 peaks MS2 spectra reconstructed. default reconstructed MS1 chromatographic peaks. BPPARAM parallel processing setup. See bpparam() information. return.type character(1) defining type returned object. return.type = \"Spectra\" supported, return.type = \"MSpectra\" deprecated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/reconstructChromPeakSpectra.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","text":"Spectra() object (defined Spectra package) reconstructed MS2 spectra MS1 peaks object. Contains empty spectra (.e. without m/z intensity values) MS1 peaks reconstruction possible (either MS2 signal recorded correlation MS2 chromatographic peaks MS1 chromatographic peak threshold minCor. Spectra variables \"ms2_peak_id\" \"ms2_peak_cor\" (type CharacterList() NumericList() length equal number peaks per reconstructed MS2 spectrum) providing IDs correlation MS2 chromatographic peaks MS2 spectrum reconstructed. retention time median retention times MS2 chromatographic peaks used spectrum reconstruction reported. MS1 chromatographic peak intensity reported reconstructed spectrum's precursorIntensity value (see parameter intensity ).","code":""},{"path":"https://sneumann.github.io/xcms/reference/reconstructChromPeakSpectra.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","text":"detail, function performs MS1 chromatographic peak: Identify MS2 chromatographic peaks isolation window containing m/z ion (.e. MS1 chromatographic peak) approximately retention time MS1 peak (accepted rt shift can specified diffRt parameter). Correlate peak shapes candidate MS2 chromatographic peaks peak shape MS1 peak retaining MS2 chromatographic peaks correlation > minCor. Reconstruct MS2 spectrum using m/z selected MS2 chromatographic peaks intensity (either \"maxo\" \"\"). MS2 chromatographic peak selected MS1 peak thus represent one mass peak reconstructed spectrum. resulting Spectra() object provides also peak IDs MS2 chromatographic peaks spectrum well correlation value spectra variables ms2_peak_id ms2_peak_cor.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/reconstructChromPeakSpectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","text":"Johannes Rainer, Michael Witting","code":""},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"Given matrix rectangular areas, function determines subset rectangles overlap. Rectangles preserved first come, first served basis, user control order rectangles processed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"","code":"rectUnique(m, order = seq(length = nrow(m)), xdiff = 0, ydiff = 0)"},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"m four column matrix defining rectangular areas order order matrix columns scanned xdiff maximum space overlapping rectangles x dimension ydiff maximum space overlapping rectangles y dimension","code":""},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"m matrix must contain four colums defining position rectangle sides folloing order: left, right, bottom, top. function currently implemented C using algorithm quadratic running time.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"logical vector indicating rows kept.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"","code":"m <- rbind(c(0,4,0,3), c(1,3,2,6), c(3,6,4,6)) plot(0, 0, type = \"n\", xlim=range(m[,1:2]), ylim=range(m[,3:4])) rect(m[,1], m[,3], m[,2], m[,4]) xcms:::rectUnique(m) #> [1] TRUE FALSE TRUE # Changing order of processing xcms:::rectUnique(m, c(2,1,3)) #> [1] FALSE TRUE FALSE # Requiring border spacing xcms:::rectUnique(m, ydiff = 1) #> [1] TRUE FALSE FALSE # Allowing adjacent boxes xcms:::rectUnique(m, c(2,1,3), xdiff = -0.00001) #> [1] FALSE TRUE TRUE # Allowing interpenetration xcms:::rectUnique(m, xdiff = -1.00001, ydiff = -1.00001) #> [1] TRUE TRUE TRUE"},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Refine Identified Chromatographic Peaks — refineChromPeaks","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"refineChromPeaks method performs post-processing chromatographic peak detection step eventually clean improve results. function can applied XcmsExperiment() XCMSnExp() object peak detection findChromPeaks(). type peak refinement cleaning can defined, along settings, using one following parameter objects: CleanPeaksParam: remove chromatographic peaks retention time range larger provided maximal acceptable width (maxPeakwidth). FilterIntensityParam: remove chromatographic peaks intensities specified threshold. default (nValues = 1) values chromPeaks matrix evaluated: peaks value column defined parameter value >= threshold (defined parameter threshold) retained. nValues larger 1, individual peak intensities raw MS files evaluated: chromatographic peaks least nValues mass peaks >= threshold retained. MergeNeighboringPeaksParam: peak detection sometimes fails identify chromatographic peak correctly, especially broad peaks peak shape irregular (mostly HILIC data). cases several smaller peaks reported. Also, peak detection centWave can result partially completely overlapping peaks. method aims reduce peak detection artifacts merging chromatographic peaks overlapping close RT m/z dimension (considering also measured signal ). See section Details MergeNeighboringPeaksParam details comprehensive description approach. refineChromPeaks methods always remove feature definitions, call method can change remove identified chromatographic peaks, may part features.","code":""},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"","code":"refineChromPeaks(object, param, ...) # S4 method for XcmsExperiment,CleanPeaksParam refineChromPeaks(object, param = CleanPeaksParam(), msLevel = 1L) # S4 method for XcmsExperiment,MergeNeighboringPeaksParam refineChromPeaks( object, param, msLevel = 1L, chunkSize = 2L, BPPARAM = bpparam() ) # S4 method for XcmsExperiment,FilterIntensityParam refineChromPeaks( object, param, msLevel = 1L, chunkSize = 2L, BPPARAM = bpparam() ) CleanPeaksParam(maxPeakwidth = 10) MergeNeighboringPeaksParam( expandRt = 2, expandMz = 0, ppm = 10, minProp = 0.75 ) FilterIntensityParam(threshold = 0, nValues = 1L, value = \"maxo\") # S4 method for XCMSnExp,CleanPeaksParam refineChromPeaks(object, param = CleanPeaksParam(), msLevel = 1L) # S4 method for XCMSnExp,MergeNeighboringPeaksParam refineChromPeaks( object, param = MergeNeighboringPeaksParam(), msLevel = 1L, BPPARAM = bpparam() ) # S4 method for XCMSnExp,FilterIntensityParam refineChromPeaks( object, param = FilterIntensityParam(), msLevel = 1L, BPPARAM = bpparam() )"},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"object XCMSnExp XcmsExperiment object identified chromatographic peaks. param Object defining refinement method settings. ... ignored. msLevel integer defining MS level(s) chromatographic peaks cleaned. chunkSize refineChromPeaks object either XcmsExperiment: integer(1) defining number files (samples) loaded memory processed time. Peak refinement performed parallel (per sample) subset data. setting thus allows balance memory demand speed (due parallel processing). parallel processing can performed subset data currently loaded memory iteration, value chunkSize match defined parallel setting setup. Using parallel processing setup using 4 CPUs (separate processes) using chunkSize = 1will perform parallel processing, data one sample loaded memory time. hand, settingchunkSize` total number samples experiment load full MS data memory thus settings cause --memory error. BPPARAM parameter object set parallel processing. Uses default parallel processing setup returned bpparam(). See bpparam() details examples. maxPeakwidth CleanPeaksParam: numeric(1) defining maximal allowed peak width (retention time). expandRt MergeNeighboringPeaksParam: numeric(1) defining many seconds retention time window expanded sides check overlapping peaks. expandMz MergeNeighboringPeaksParam: numeric(1) constant value m/z range chromatographic peak expanded (sides!) check overlapping peaks. ppm MergeNeighboringPeaksParam: numeric(1) defining m/z relative value (parts per million) m/z range chromatographic peak expanded (side) check overlapping peaks. minProp MergeNeighboringPeaksParam: numeric(1) 0 1 representing proporion intensity required peaks joined. See description details. default (minProp = 0.75) peaks joined signal half way larger 75% smallest two peak's \"maxo\" (maximal intensity peak apex). threshold FilterIntensityParam: numeric(1) defining threshold peaks removed. nValues FilterIntensityParam: integer(1) defining number data points (chromatographic peak) >= threshold. Defaults nValues = 1. value FilterIntensityParam: character(1) defining name column chromPeaks contains values used filtering.","code":""},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"XCMSnExp XcmsExperiment object refined chomatographic peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":"details-for-mergeneighboringpeaksparam","dir":"Reference","previous_headings":"","what":"Details for MergeNeighboringPeaksParam","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"peak refinement using MergeNeighboringPeaksParam, chromatographic peaks first expanded m/z retention time dimension (based parameters expandMz, ppm expandRt) subsequently grouped sets merge candidates (expansion) overlapping m/z rt (within sample). Note peak gets expanded expandRt expandMz, thus peaks differing less 2 * expandMz (2 * expandRt) evaluated merging. Peak merging performed along retention time axis, .e., peaks first ordered \"rtmin\" merge candidates defined iteratively starting first peak. Candidate peaks merged average intensity 3 data points middle position (.e., half distance \"rtmax\" first \"rtmin\" second peak) larger certain proportion (minProp) smaller (\"maxo\") intensity peaks. cases calculated mid point located apexes two peaks (e.g., peaks largely overlapping) average signal intensity half way apexes used instead. Candidate peaks merged 3 data points NA intensities. Merged peaks get \"mz\", \"rt\", \"sn\" \"maxo\" values peak largest signal (\"maxo\") well row metadata peak (chromPeakData). \"rtmin\" \"rtmax\" merged peaks updated \"\" recalculated based signal \"rtmin\" \"rtmax\" newly defined \"mzmin\" \"mzmax\" (range \"mzmin\" \"mzmax\" merged peaks expanding expandMz ppm). reported \"mzmin\" \"mzmax\" merged peak represents m/z range non-NA intensities used calculation peak signal (\"\").","code":""},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"Johannes Rainer, Mar Garcia-Aloy","code":""},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"","code":"## Load a test data set with detected peaks library(xcms) library(MsExperiment) faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) #### ## CleanPeaksParam: ## Distribution of chromatographic peak widths quantile(chromPeaks(faahko_sub)[, \"rtmax\"] - chromPeaks(faahko_sub)[, \"rtmin\"]) #> 0% 25% 50% 75% 100% #> 6.259 29.734 43.819 57.903 173.710 ## Remove all chromatographic peaks with a width larger 60 seconds data <- refineChromPeaks(faahko_sub, param = CleanPeaksParam(60)) #> Removed 54 of 248 chromatographic peaks. quantile(chromPeaks(data)[, \"rtmax\"] - chromPeaks(data)[, \"rtmin\"]) #> 0% 25% 50% 75% 100% #> 6.259 23.475 39.906 46.949 59.469 #### ## FilterIntensityParam: ## Remove all peaks with a maximal intensity below 50000 res <- refineChromPeaks(faahko_sub, param = FilterIntensityParam(threshold = 50000)) #> Reduced from 248 to 155 chromatographic peaks. nrow(chromPeaks(faahko_sub)) #> [1] 248 nrow(chromPeaks(res)) #> [1] 155 #### ## MergeNeighboringPeaksParam: ## Subset to a single file xd <- filterFile(faahko_sub, file = 1) ## Example of a split peak that will be merged mzr <- 305.1 + c(-0.01, 0.01) chr <- chromatogram(xd, mz = mzr, rt = c(2700, 3700)) #> Processing chromatographic peaks plot(chr) ## Combine the peaks res <- refineChromPeaks(xd, param = MergeNeighboringPeaksParam(expandRt = 4)) #> Reduced from 87 to 70 chromatographic peaks. chr_res <- chromatogram(res, mz = mzr, rt = c(2700, 3700)) #> Processing chromatographic peaks plot(chr_res) ## Example of a peak that was not merged, because the signal between them ## is lower than the cut-off minProp mzr <- 496.2 + c(-0.01, 0.01) chr <- chromatogram(xd, mz = mzr, rt = c(3200, 3500)) #> Processing chromatographic peaks plot(chr) chr_res <- chromatogram(res, mz = mzr, rt = c(3200, 3500)) #> Processing chromatographic peaks plot(chr_res)"},{"path":"https://sneumann.github.io/xcms/reference/removeIntensity-Chromatogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","title":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","text":"removeIntensities allows remove intensities chromatographic data matching certain conditions (depending parameter ). intensities actually removed replaced NA_real_. actually remove intensities (associated retention times) use clean() afterwards. Parameter allows specify intensities replaced NA_real_. default (= \"below_threshod\" intensities threshold removed. x XChromatogram XChromatograms object (hence provides also chromatographic peak definitions within object) = \"outside_chromPeak\" can selected removes intensity outside boundaries identified chromatographic peak(s) chromatographic data. Note filterIntensity() might better approach subset/filter chromatographic data.","code":""},{"path":"https://sneumann.github.io/xcms/reference/removeIntensity-Chromatogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","text":"","code":"# S4 method for Chromatogram removeIntensity(object, which = \"below_threshold\", threshold = 0) # S4 method for MChromatograms removeIntensity(object, which = \"below_threshold\", threshold = 0) # S4 method for XChromatogram removeIntensity( object, which = c(\"below_threshold\", \"outside_chromPeak\"), threshold = 0 )"},{"path":"https://sneumann.github.io/xcms/reference/removeIntensity-Chromatogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","text":"object object representing chromatographic data. Can Chromatogram(), MChromatograms(), XChromatogram() XChromatograms() object. character(1) defining condition remove intensities. See description details options. threshold numeric(1) defining threshold intensities removed (= \"below_threshold\").","code":""},{"path":"https://sneumann.github.io/xcms/reference/removeIntensity-Chromatogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","text":"input object matching intensities replaced NA.","code":""},{"path":"https://sneumann.github.io/xcms/reference/removeIntensity-Chromatogram.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/removeIntensity-Chromatogram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","text":"","code":"library(MSnbase) chr <- Chromatogram(rtime = 1:10 + rnorm(n = 10, sd = 0.3), intensity = c(5, 29, 50, NA, 100, 12, 3, 4, 1, 3)) ## Remove all intensities below 20 res <- removeIntensity(chr, threshold = 20) intensity(res) #> [1] NA 29 50 NA 100 NA NA NA NA NA"},{"path":"https://sneumann.github.io/xcms/reference/retcor-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Correct retention time from different samples — retcor-methods","title":"Correct retention time from different samples — retcor-methods","text":"correct differences retention times different samples, number methods exist XCMS. retcor generic method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Correct retention time from different samples — retcor-methods","text":"object = \"xcmsSet\" retcor(object, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correct retention time from different samples — retcor-methods","text":"object xcmsSet-class object method Method use retention time correction. See details. ... Optional arguments passed along","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correct retention time from different samples — retcor-methods","text":"Different algorithms can used specifying method argument. example use approach described Smith et al (2006) one use: retcor(object, method=\"loess\"). also default. arguments given ... passed function implementing method. character vector nicknames algorithms available returned getOption(\"BioC\")$xcms$retcor.methods. nickname method called \"loess\", help page specific method can accessed ?retcor.loess.","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correct retention time from different samples — retcor-methods","text":"xcmsSet object corrected retntion times.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/retcor.obiwarp-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Align retention times across samples with Obiwarp — retcor.obiwarp","title":"Align retention times across samples with Obiwarp — retcor.obiwarp","text":"Calculate retention time deviations sample. based code http://obi-warp.sourceforge.net/. However, function able align multiple samples, center-star strategy. original publication see Chromatographic Alignment ESI-LC-MS Proteomics Data Sets Ordered Bijective Interpolated Warping John T. Prince , Edward M. Marcotte Analytical Chemistry 2006 78 (17), 6140-6152","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor.obiwarp-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Align retention times across samples with Obiwarp — retcor.obiwarp","text":"object = \"xcmsSet\" retcor(object, method=\"obiwarp\", plottype = c(\"none\", \"deviation\"), profStep=1, center=NULL, col = NULL, ty = NULL, response=1, distFunc=\"cor_opt\", gapInit=NULL, gapExtend=NULL, factorDiag=2, factorGap=1, localAlignment=0, initPenalty=0)","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor.obiwarp-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Align retention times across samples with Obiwarp — retcor.obiwarp","text":"object xcmsSet object plottype deviation plot retention time deviation profStep step size (m/z) use profile generation raw data files center index sample others aligned . center==NULL, sample peaks chosen default. col vector colors plotting sample ty vector line point types plotting sample response Responsiveness warping. 0 give linear warp based start end points. 100 use bijective anchors distFunc DistFunc function: cor (Pearson's R) cor_opt (default, calculate 10% diagonal band distance matrix, better runtime), cov (covariance), prd (product), euc (Euclidean distance) gapInit Penalty Gap opening, see gapExtend Penalty Gap enlargement, see factorDiag Local weighting applied diagonal moves alignment. factorGap Local weighting applied gap moves alignment. localAlignment Local rather global alignment initPenalty Penalty initiating alignment (local alignment ) Default: 0 Default gap penalties: (gapInit, gapExtend) [distFunc type]: 'cor' = '0.3,2.4' 'cov' = '0,11.7' 'prd' = '0,7.8' 'euc' = '0.9,1.8'","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor.obiwarp-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Align retention times across samples with Obiwarp — retcor.obiwarp","text":"xcmsSet object","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/retcor.peakgroups-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Align retention times across samples — retcor.peakgroups-methods","title":"Align retention times across samples — retcor.peakgroups-methods","text":"two methods use ``well behaved'' peak groups calculate retention time deviations every time point sample. Use smoothed deviations align retention times.","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor.peakgroups-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Align retention times across samples — retcor.peakgroups-methods","text":"object = \"xcmsSet\" retcor(object, missing = 1, extra = 1, smooth = c(\"loess\", \"linear\"), span = .2, family = c(\"gaussian\", \"symmetric\"), plottype = c(\"none\", \"deviation\", \"mdevden\"), col = NULL, ty = NULL)","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor.peakgroups-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Align retention times across samples — retcor.peakgroups-methods","text":"object xcmsSet object missing number missing samples allow retention time correction groups extra number extra peaks allow retention time correction correction groups smooth either \"loess\" non-linear alignment \"linear\" linear alignment span degree smoothing local polynomial regression fitting family gaussian fitting least-squares outlier removal, symmetric re-descending M estimator used Tukey's biweight function, allowing outlier removal plottype deviation plot retention time deviation points regression fit, mdevden also plot peak overall peak density retention time correction peak density col vector colors plotting sample ty vector line point types plotting sample","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor.peakgroups-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Align retention times across samples — retcor.peakgroups-methods","text":"xcmsSet object","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/retexp.html","id":null,"dir":"Reference","previous_headings":"","what":"Set retention time window to a specified width — retexp","title":"Set retention time window to a specified width — retexp","text":"Expands (contracts) retention time window row matrix defined retmin retmax columns.","code":""},{"path":"https://sneumann.github.io/xcms/reference/retexp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set retention time window to a specified width — retexp","text":"","code":"retexp(peakrange, width = 200)"},{"path":"https://sneumann.github.io/xcms/reference/retexp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set retention time window to a specified width — retexp","text":"peakrange maxtrix columns retmin retmax width new width window","code":""},{"path":"https://sneumann.github.io/xcms/reference/retexp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set retention time window to a specified width — retexp","text":"altered matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/retexp.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Set retention time window to a specified width — retexp","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate relative log abundances — rla","title":"Calculate relative log abundances — rla","text":"rla calculates relative log abundances (RLA, see reference) numeric vector.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate relative log abundances — rla","text":"","code":"rla(x, group, log.transform = TRUE) rowRla(x, group, log.transform = TRUE)"},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate relative log abundances — rla","text":"x numeric (rla) matrix (rowRla) abundances (natural scale) RLA calculated. group factor, numeric character length x groups values x. omitted values considered group. log.transform logical(1) whether x log2 transformed. Set log.transform = FALSE x already log scale.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate relative log abundances — rla","text":"numeric length x (rla) matrix dimensions x (rowRla).","code":""},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate relative log abundances — rla","text":"RLA defines (log) abundance analyte relative median across abundances group.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate relative log abundances — rla","text":"De Livera , Dias DA, De Souza D, Rupasinghe T, Pyke J, Tull D, Roessner U, McConville M, Speed TP. Normalizing integrating metabolomics data. Anal Chem 2012 Dec 18;84(24):10768-76.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate relative log abundances — rla","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate relative log abundances — rla","text":"","code":"x <- c(3, 4, 5, 1, 2, 3, 7, 8, 9) grp <- c(1, 1, 1, 2, 2, 2, 3, 3, 3) rla(x, grp) #> 1 1 1 2 2 2 3 #> -0.4150375 0.0000000 0.3219281 -1.0000000 0.0000000 0.5849625 -0.1926451 #> 3 3 #> 0.0000000 0.1699250"},{"path":"https://sneumann.github.io/xcms/reference/sampnames-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get sample names — sampnames-methods","title":"Get sample names — sampnames-methods","text":"Return sample names object","code":""},{"path":"https://sneumann.github.io/xcms/reference/sampnames-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get sample names — sampnames-methods","text":"object = \"xcmsEIC\" sampnames(object) object = \"xcmsSet\" sampnames(object)","code":""},{"path":"https://sneumann.github.io/xcms/reference/sampnames-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get sample names — sampnames-methods","text":"character vector sample names.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/showError-xcmsSet-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract processing errors — showError,xcmsSet-method","title":"Extract processing errors — showError,xcmsSet-method","text":"peak detection performed findPeaks setting argument stopOnError = FALSE eventual errors process cause stop processing recorded inside resulting xcmsSet object. errors can accessed showError method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/showError-xcmsSet-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract processing errors — showError,xcmsSet-method","text":"","code":"# S4 method for xcmsSet showError(object, message. = TRUE, ...)"},{"path":"https://sneumann.github.io/xcms/reference/showError-xcmsSet-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract processing errors — showError,xcmsSet-method","text":"object xcmsSet object. message. Logical indicating whether error message, error returned. ... Additional arguments.","code":""},{"path":"https://sneumann.github.io/xcms/reference/showError-xcmsSet-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract processing errors — showError,xcmsSet-method","text":"list error messages (message. = TRUE) errors empty list errors present.","code":""},{"path":"https://sneumann.github.io/xcms/reference/showError-xcmsSet-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract processing errors — showError,xcmsSet-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","title":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","text":"several methods calculating distance two sets peaks xcms. specDist generic method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","text":"object = \"xcmsSet\" specDist(object, peakIDs1, peakIDs2,...) object = \"xsAnnotate\" specDist(object, PSpec1, PSpec2,...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","text":"object xcmsSet xcmsRaw. method Method use distance calculation. See details. ... mzabs, mzppm parameters distance function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","text":"Different algorithms can used specifying method argument. example use \"meanMZmatch\" approach xcmsSet one use: specDist(object, peakIDs1, peakIDs2, method=\"meanMZmatch\"). also default. arguments given ... passed function implementing method. character vector nicknames algorithms available returned getOption(\"BioC\")$xcms$specDist.methods. nickname method called \"meanMZmatch\", help page specific method can accessed ?specDist.meanMZmatch.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","text":"mzabs maximum absolute deviation two matching peaks mzppm relative deviations ppm two matching peaks symmetric use symmetric pairwise m/z-matches , match","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","text":"Joachim Kutzera, jkutzer@ipb-halle.de","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.cosine-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"a Distance function based on matching peaks — specDist.cosine","title":"a Distance function based on matching peaks — specDist.cosine","text":"method calculates distance two sets peaks using cosine-distance.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.cosine-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"a Distance function based on matching peaks — specDist.cosine","text":"","code":"specDist.cosine(peakTable1, peakTable2, mzabs=0.001, mzppm=10, mzExp=0.6, intExp=3, nPdiff=2, nPmin=8, symmetric=FALSE)"},{"path":"https://sneumann.github.io/xcms/reference/specDist.cosine-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"a Distance function based on matching peaks — specDist.cosine","text":"peakTable1 = \"matrix\", peakTable2 = \"matrix\" specDist.cosine(peakTable1, peakTable2, mzabs = 0.001, mzppm = 10, mzExp = 0.6, intExp = 3, nPdiff = 2, nPmin = 8, symmetric = FALSE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.cosine-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"a Distance function based on matching peaks — specDist.cosine","text":"result cosine-distance product weighted factors mz intensity matching peaks two peaktables. factors calculated wFact = mz^mzExp * int^intExp. distance calculated (example matching peaks found) return-value NA.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.cosine-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"a Distance function based on matching peaks — specDist.cosine","text":"peakTable1 Matrix containing least m/z-values, \trow must called \"mz\" peakTable2 matrix mz-values mzabs maximum absolute deviation two matching peaks mzppm relative deviations ppm two matching peaks symmetric use symmetric pairwise m/z-matches , match mzExp exponent used mz intExp exponent used intensity nPdiff maximum nrow-difference two peaktables nPmin minimum absolute sum peaks praktables","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.cosine-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"a Distance function based on matching peaks — specDist.cosine","text":"Joachim Kutzera, jkutzer@ipb-halle.de","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.meanMZmatch-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"a Distance function based on matching peaks — specDist.meanMZmatch","title":"a Distance function based on matching peaks — specDist.meanMZmatch","text":"method calculates distance two sets peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.meanMZmatch-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"a Distance function based on matching peaks — specDist.meanMZmatch","text":"","code":"specDist.meanMZmatch(peakTable1, peakTable2, matchdist=1, matchrate=1, mzabs=0.001, mzppm=10, symmetric=TRUE)"},{"path":"https://sneumann.github.io/xcms/reference/specDist.meanMZmatch-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"a Distance function based on matching peaks — specDist.meanMZmatch","text":"peakTable1 = \"matrix\", peakTable2 = \"matrix\" specDist.meanMZmatch(peakTable1, peakTable2, matchdist=1, matchrate=1, mzabs=0.001, mzppm=10, symmetric=TRUE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.meanMZmatch-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"a Distance function based on matching peaks — specDist.meanMZmatch","text":"result calculation weighted sum two values. Value one mean absolute difference matching peaks, value two relation matching peaks non matching peaks. distance calculated (example matching peaks found) return-value NA.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.meanMZmatch-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"a Distance function based on matching peaks — specDist.meanMZmatch","text":"peakTable1 Matrix containing least m/z-values, \trow must called \"mz\" peakTable2 matrix mz-values mzabs maximum absolute deviation two matching peaks mzppm relative deviations ppm two matching peaks symmetric use symmetric pairwise m/z-matches , match matchdist weight value one (see details) matchrate weight value two","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.meanMZmatch-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"a Distance function based on matching peaks — specDist.meanMZmatch","text":"Joachim Kutzera, jkutzer@ipb-halle.de","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.peakCount-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"a Distance function based on matching peaks — specDist.peakCount-methods","title":"a Distance function based on matching peaks — specDist.peakCount-methods","text":"method calculates distance two sets peaks just returning number matching peaks (m/z-values).","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.peakCount-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"a Distance function based on matching peaks — specDist.peakCount-methods","text":"","code":"specDist.peakCount(peakTable1, peakTable2, mzabs=0.001, mzppm=10, symmetric=FALSE)"},{"path":"https://sneumann.github.io/xcms/reference/specDist.peakCount-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"a Distance function based on matching peaks — specDist.peakCount-methods","text":"peakTable1 = \"matrix\", peakTable2 = \"matrix\" specDist.peakCount(peakTable1, peakTable2, mzppm=10,symmetric=FALSE )","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.peakCount-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"a Distance function based on matching peaks — specDist.peakCount-methods","text":"peakTable1 Matrix containing least m/z-values, \trow must called \"mz\" peakTable2 matrix mz-values mzabs maximum absolute deviation two matching peaks mzppm relative deviations ppm two matching peaks symmetric use symmetric pairwise m/z-matches , match","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.peakCount-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"a Distance function based on matching peaks — specDist.peakCount-methods","text":"Joachim Kutzera, jkutzer@ipb-halle.de","code":""},{"path":"https://sneumann.github.io/xcms/reference/specNoise.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate noise for a sparse continuum mass spectrum — specNoise","title":"Calculate noise for a sparse continuum mass spectrum — specNoise","text":"Given sparse continuum mass spectrum, determine regions signal present, substituting half minimum intensity regions. Calculate noise level weighted mean regions signal regions without signal. one raw peak, return zero.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specNoise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate noise for a sparse continuum mass spectrum — specNoise","text":"","code":"specNoise(spec, gap = quantile(diff(spec[, \"mz\"]), 0.9))"},{"path":"https://sneumann.github.io/xcms/reference/specNoise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate noise for a sparse continuum mass spectrum — specNoise","text":"spec matrix named columns mz intensity gap threshold data points considerd separated blank region bridged interpolating line","code":""},{"path":"https://sneumann.github.io/xcms/reference/specNoise.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate noise for a sparse continuum mass spectrum — specNoise","text":"default gap value determined 90th percentile pair-wise differences adjacent mass values.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specNoise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate noise for a sparse continuum mass spectrum — specNoise","text":"numeric noise level","code":""},{"path":"https://sneumann.github.io/xcms/reference/specNoise.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate noise for a sparse continuum mass spectrum — specNoise","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/specPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify peaks in a sparse continuum mode spectrum — specPeaks","title":"Identify peaks in a sparse continuum mode spectrum — specPeaks","text":"Given spectrum, identify list significant peaks determined several criteria.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify peaks in a sparse continuum mode spectrum — specPeaks","text":"","code":"specPeaks(spec, sn = 20, mzgap = 0.2)"},{"path":"https://sneumann.github.io/xcms/reference/specPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify peaks in a sparse continuum mode spectrum — specPeaks","text":"spec matrix named columns mz intensity sn minimum signal noise ratio mzgap minimal distance adjacent peaks, smaller peaks excluded","code":""},{"path":"https://sneumann.github.io/xcms/reference/specPeaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Identify peaks in a sparse continuum mode spectrum — specPeaks","text":"Peaks must meet two criteria considered peaks: 1) s/n ratio must exceed certain threshold. 2) must within given distance greater intensity peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specPeaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify peaks in a sparse continuum mode spectrum — specPeaks","text":"matrix columns: mz m/z maximum peak intensity intensity maximum intensity peak fwhm full width half max peak","code":""},{"path":"https://sneumann.github.io/xcms/reference/specPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify peaks in a sparse continuum mode spectrum — specPeaks","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsRaw.html","id":null,"dir":"Reference","previous_headings":"","what":"Divide an xcmsRaw object — split.xcmsRaw","title":"Divide an xcmsRaw object — split.xcmsRaw","text":"Divides scans xcmsRaw object list multiple objects. MS$^n$ data discarded.","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsRaw.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Divide an xcmsRaw object — split.xcmsRaw","text":"xr = \"xcmsRaw\" split(x, f, drop = TRUE, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsRaw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Divide an xcmsRaw object — split.xcmsRaw","text":"x xcmsRaw object f factor factor(f) defines scans go new xcmsRaw objects drop logical indicating levels occur dropped ('f' 'factor' list). ... potential arguments passed methods.","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsRaw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Divide an xcmsRaw object — split.xcmsRaw","text":"list xcmsRaw objects.","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsRaw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Divide an xcmsRaw object — split.xcmsRaw","text":"Steffen Neumann, sneumann@ipb-halle.de","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsSet.html","id":null,"dir":"Reference","previous_headings":"","what":"Divide an xcmsSet object — split.xcmsSet","title":"Divide an xcmsSet object — split.xcmsSet","text":"Divides samples peaks xcmsSet object list multiple objects. Group data discarded.","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsSet.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Divide an xcmsSet object — split.xcmsSet","text":"xs = \"xcmsSet\" split(x, f, drop = TRUE, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsSet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Divide an xcmsSet object — split.xcmsSet","text":"xs xcmsSet object f factor factor(f) defines grouping drop logical indicating levels occur dropped ('f' 'factor' list). ... potential arguments passed methods.","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsSet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Divide an xcmsSet object — split.xcmsSet","text":"list xcmsSet objects.","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsSet.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Divide an xcmsSet object — split.xcmsSet","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Correct gaps in data — stitch-methods","title":"Correct gaps in data — stitch-methods","text":"Fixes gaps data due calibration scans lock mass. Automatically detects file type calls relevant method. mzXML file keeps data length time overwrites lock mass scans. netCDF version adds scans back data thereby increasing length data correcting unseen gap.","code":""},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Correct gaps in data — stitch-methods","text":"object = \"xcmsRaw\" stitch(object, lockMass=numeric()) object = \"xcmsRaw\" makeacqNum(object, freq=numeric(), start=1)","code":""},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correct gaps in data — stitch-methods","text":"object xcmsRaw-class object lockMass dataframe locations gaps freq intervals lock mass scans start starting lock mass scan location, default 1","code":""},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correct gaps in data — stitch-methods","text":"makeacqNum takes locates gap using starting lock mass scan intervals. data frame used \tstitch correct gap caused lock mass. Correction works using scans either side gap fill .","code":""},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correct gaps in data — stitch-methods","text":"stitch corrected xcmsRaw-class object makeacqNum numeric vector scan locations corresponding lock Mass scans","code":""},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correct gaps in data — stitch-methods","text":"Paul Benton, hpaul.benton08@imperial.ac.uk","code":""},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Correct gaps in data — stitch-methods","text":"","code":"if (FALSE) library(xcms) library(faahKO) ## These files do not have this problem to correct for but just ## for an example cdfpath <- system.file(\"cdf\", package = \"faahKO\") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE) xr<-xcmsRaw(cdffiles[1]) #> Create profile matrix with method 'bin' and step 1 ... #> OK xr #> An \"xcmsRaw\" object with 1278 mass spectra #> #> Time range: 2501.4-4499.8 seconds (41.7-75 minutes) #> Mass range: 200-600 m/z #> Intensity range: 70-1373180 #> #> MSn data on 0 mass(es) #> \twith 0 MSn spectra #> Profile method: bin #> Profile step: 1 m/z (401 grid points from 200 to 600 m/z) #> #> Memory usage: 10.8 MB ##Lets assume that the lockmass starts at 1 and is every 100 scans lockMass<-xcms:::makeacqNum(xr, freq=100, start=1) ## these are equcal lockmass<-AutoLockMass(xr) #> Warning: #> Lock mass frequency wasn't detected ob<-stitch(xr, lockMass) ob #> An \"xcmsRaw\" object with 1304 mass spectra #> #> Time range: 1.6-2040.7 seconds (0-34 minutes) #> Mass range: 200-600 m/z #> Intensity range: 70-1373180 #> #> MSn data on 0 mass(es) #> \twith 0 MSn spectra #> Profile method: bin #> Profile step: no profile data #> #> Memory usage: 6.96 MB ## plot the old data before correction foo<-rawEIC(xr, m=c(200,210), scan=c(80,140)) plot(foo$scan, foo$intensity, type=\"h\") ## plot the new corrected data to see what changed foo<-rawEIC(ob, m=c(200,210), scan=c(80,140)) plot(foo$scan, foo$intensity, type=\"h\")"},{"path":"https://sneumann.github.io/xcms/reference/storeResults.html","id":null,"dir":"Reference","previous_headings":"","what":"Save xcms result objects in a specified format — storeResults","title":"Save xcms result objects in a specified format — storeResults","text":"storeResults function saves object resulting processing xcms package (mainly XcmsExperiment). Multiple formats storing exporting available can defined param argument. Supported param objects : RDataParam: Save .RData format file. name file can specified fileName argument. PlainTextParam: Store MsExperiment XcmsExperiment objects folder plain text files, folder path defined path argument. MzTabMParam: Save MzTab format (defined). specific examples, see help pages individual parameter classes listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/storeResults.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save xcms result objects in a specified format — storeResults","text":"","code":"storeResults(object, param, ...)"},{"path":"https://sneumann.github.io/xcms/reference/storeResults.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save xcms result objects in a specified format — storeResults","text":"object MsExperiment XcmsExperiment data object needs saved. param parameter object selecting configuring format saving. can one following classes: RDataParam, PlainTextParam, MzTabMParam. ... Optional parameters.","code":""},{"path":"https://sneumann.github.io/xcms/reference/storeResults.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Save xcms result objects in a specified format — storeResults","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/storeResults.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save xcms result objects in a specified format — storeResults","text":"","code":"## Load a test data set with detected peaks library(xcms) library(MsExperiment) faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Set up parameter to save as .RData file param <- RDataParam(fileName = \"example_xcms_results\") ## save as .RData storeResults(object = faahko_sub, param = param) ## Set up parameter to save as a collection of plain text file param <- PlainTextParam(path = \"test/path/\") ## Save as a collection of plain text files storeResults(object = faahko_sub, param = param)"},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"Subset xcmsRaw object scans. returned xcmsRaw object contains values scans specified argument . Note scanrange slot returned xcmsRaw c(1, length(object@scantime)) hence range().","code":""},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"","code":"# S4 method for xcmsRaw,logicalOrNumeric,missing,missing [(x, i, j, drop)"},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"x xcmsRaw object sub-setted. Integer logical vector specifying scans/spectra x sub-setted. j supported. drop supported.","code":""},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"sub-setted xcmsRaw object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"subsetting scan index increasing order logical vector supported. ordered, argument sorted automatically. Indices larger total number scans discarded.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"","code":"## Load a test file file <- system.file('cdf/KO/ko15.CDF', package = \"faahKO\") xraw <- xcmsRaw(file, profstep = 0) ## The number of scans/spectra: length(xraw@scantime) #> [1] 1278 ## Subset the object to scans with a scan time from 3500 to 4000. xsub <- xraw[xraw@scantime >= 3500 & xraw@scantime <= 4000] range(xsub@scantime) #> [1] 3501.383 3999.039 ## The number of scans: length(xsub@scantime) #> [1] 319 ## The number of values of the subset: length(xsub@env$mz) #> [1] 130569"},{"path":"https://sneumann.github.io/xcms/reference/updateObject-xcmsSet-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Update an xcmsSet object — updateObject,xcmsSet-method","title":"Update an xcmsSet object — updateObject,xcmsSet-method","text":"method updates old xcmsSet object latest definition.","code":""},{"path":"https://sneumann.github.io/xcms/reference/updateObject-xcmsSet-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update an xcmsSet object — updateObject,xcmsSet-method","text":"","code":"# S4 method for xcmsSet updateObject(object, ..., verbose = FALSE)"},{"path":"https://sneumann.github.io/xcms/reference/updateObject-xcmsSet-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update an xcmsSet object — updateObject,xcmsSet-method","text":"object xcmsSet object update. ... Optional additional arguments. Currently ignored. verbose Currently ignored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/updateObject-xcmsSet-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update an xcmsSet object — updateObject,xcmsSet-method","text":"updated xcmsSet containing data input object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/updateObject-xcmsSet-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Update an xcmsSet object — updateObject,xcmsSet-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":null,"dir":"Reference","previous_headings":"","what":"Enable usage of old xcms code — useOriginalCode","title":"Enable usage of old xcms code — useOriginalCode","text":"function allows enable usage old, partially deprecated code xcms setting corresponding global option. See details functions affected.","code":""},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enable usage of old xcms code — useOriginalCode","text":"","code":"useOriginalCode(x)"},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enable usage of old xcms code — useOriginalCode","text":"x logical(1) specify whether original old code used corresponding functions. provided function simply returns value global option.","code":""},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enable usage of old xcms code — useOriginalCode","text":"logical(1) indicating whether old code used.","code":""},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Enable usage of old xcms code — useOriginalCode","text":"functions/methods affected option : do_findChromPeaks_matchedFilter: use original code iteratively creates subset binned (profile) matrix. helpful computers limited memory matchedFilter settings small bin size. getPeaks","code":""},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Enable usage of old xcms code — useOriginalCode","text":"parallel processing using SOCKS method (e.g. SnowParam() Windows computers) option might passed individual R processes performing calculations. cases suggested specify option manually system-wide adding line options(XCMSuseOriginalCode = TRUE) file called .Rprofile folder new R processes started (usually user's home directory; ensure option correctly read add new line file ). See also Startup base R documentation specify system-wide options R. Usage old code strongly dicouraged. function thought used mainly transition phase xcms xcms version 3.","code":""},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Enable usage of old xcms code — useOriginalCode","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/verify.mzQuantML.html","id":null,"dir":"Reference","previous_headings":"","what":"Verify an mzQuantML file — verify.mzQuantM","title":"Verify an mzQuantML file — verify.mzQuantM","text":"Export XML data formats: verify written data","code":""},{"path":"https://sneumann.github.io/xcms/reference/verify.mzQuantML.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Verify an mzQuantML file — verify.mzQuantM","text":"","code":"verify.mzQuantML(filename, xsdfilename)"},{"path":"https://sneumann.github.io/xcms/reference/verify.mzQuantML.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Verify an mzQuantML file — verify.mzQuantM","text":"filename filename (may include full path) output file. Pipes URLs allowed. xsdfilename Filename XSD verify (may include full path)","code":""},{"path":"https://sneumann.github.io/xcms/reference/verify.mzQuantML.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Verify an mzQuantML file — verify.mzQuantM","text":"verify.mzQuantML() function verify PSI standard format mzQuantML document XSD schemda, see http://www.psidev.info/mzquantml","code":""},{"path":"https://sneumann.github.io/xcms/reference/verify.mzQuantML.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Verify an mzQuantML file — verify.mzQuantM","text":"None.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/write.cdf-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Save an xcmsRaw object to file — write.cdf-methods","title":"Save an xcmsRaw object to file — write.cdf-methods","text":"Write raw data (simple) CDF file.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.cdf-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Save an xcmsRaw object to file — write.cdf-methods","text":"object = \"xcmsRaw\" write.cdf(object, filename)","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.cdf-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save an xcmsRaw object to file — write.cdf-methods","text":"object xcmsRaw object filename filename (may include full path) CDF file. Pipes URLs allowed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.cdf-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save an xcmsRaw object to file — write.cdf-methods","text":"Currently application known read resulting file XCMS. Others, especially build AndiMS library, refuse load output.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.cdf-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save an xcmsRaw object to file — write.cdf-methods","text":"None.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/write.mzQuantML.html","id":null,"dir":"Reference","previous_headings":"","what":"Save an xcmsSet object to an PSI mzQuantML file — write.mzQuantML-methods","title":"Save an xcmsSet object to an PSI mzQuantML file — write.mzQuantML-methods","text":"Export XML data formats: Write processed data xcmsSet mzQuantML.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzQuantML.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Save an xcmsSet object to an PSI mzQuantML file — write.mzQuantML-methods","text":"object = \"xcmsSet\" write.mzQuantML(object, filename)","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzQuantML.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save an xcmsSet object to an PSI mzQuantML file — write.mzQuantML-methods","text":"object xcmsRaw xcmsSet object filename filename (may include full path) output file. Pipes URLs allowed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzQuantML.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save an xcmsSet object to an PSI mzQuantML file — write.mzQuantML-methods","text":"write.mzQuantML() function write (grouped) xcmsSet PSI standard format mzQuantML, see http://www.psidev.info/mzquantml","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzQuantML.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save an xcmsSet object to an PSI mzQuantML file — write.mzQuantML-methods","text":"None.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/write.mzdata-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Save an xcmsRaw object to a file — write.mzdata-methods","title":"Save an xcmsRaw object to a file — write.mzdata-methods","text":"Write raw data (simple) mzData file.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzdata-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Save an xcmsRaw object to a file — write.mzdata-methods","text":"object = \"xcmsRaw\" write.mzdata(object, filename)","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzdata-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save an xcmsRaw object to a file — write.mzdata-methods","text":"object xcmsRaw object filename filename (may include full path) mzData file. Pipes URLs allowed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzdata-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save an xcmsRaw object to a file — write.mzdata-methods","text":"function export given xcmsRaw object mzData file. mzData file contain containing mass intensity values 32 bit precision. formats currently supported. header information (e.g. additional information ) lost. Currently, also MSn information stored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzdata-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save an xcmsRaw object to a file — write.mzdata-methods","text":"None.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/writeMSData-XCMSnExp-character-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Export MS data to mzML/mzXML files — writeMSData,XCMSnExp,character-method","title":"Export MS data to mzML/mzXML files — writeMSData,XCMSnExp,character-method","text":"writeMSData exports mass spectrometry data mzML mzXML format. adjusted retention times present, used retention time exported spectra.","code":""},{"path":"https://sneumann.github.io/xcms/reference/writeMSData-XCMSnExp-character-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export MS data to mzML/mzXML files — writeMSData,XCMSnExp,character-method","text":"","code":"# S4 method for XCMSnExp,character writeMSData( object, file, outformat = c(\"mzml\", \"mzxml\"), copy = FALSE, software_processing = NULL, ... )"},{"path":"https://sneumann.github.io/xcms/reference/writeMSData-XCMSnExp-character-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export MS data to mzML/mzXML files — writeMSData,XCMSnExp,character-method","text":"object XCMSnExp object mass spectrometry data. file character file name(s). length parameter match number files/samples object. outformat character(1) defining format output files ( either \"mzml\" \"mzxml\"). copy logical(1) metadata (data processing, software used, original file names etc) copied original files. software_processing optionally provide specific data processing steps. See documentation software_processing parameter mzR::writeMSData(). ... Additional parameters pass writeMSData() function MSnbase package, outformat specify output format (\"mzml\" \"mzxml\") copy specify whether general information original MS data files (data processing, software etc) copied new files.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/writeMSData-XCMSnExp-character-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Export MS data to mzML/mzXML files — writeMSData,XCMSnExp,character-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/writeMzTab.html","id":null,"dir":"Reference","previous_headings":"","what":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","title":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","text":"Write grouped xcmsSet mzTab file.","code":""},{"path":"https://sneumann.github.io/xcms/reference/writeMzTab.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","text":"object = \"xcmsSet\" writeMzTab(object, filename)","code":""},{"path":"https://sneumann.github.io/xcms/reference/writeMzTab.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","text":"object xcmsSet object filename filename (may include full path) mzTab file. Pipes URLs allowed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/writeMzTab.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","text":"mzTab file format MS-based metabolomics (proteomics) lightweight supplement existing standard XML-based file formats (mzML, mzIdentML, mzQuantML), providing comprehensive summary, similar concept supplemental material scientific publication. mzTab files xcms contain small molecule sections together experimental metadata basic quantitative information. format intended store simple summary final results.","code":""},{"path":"https://sneumann.github.io/xcms/reference/writeMzTab.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","text":"None.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/writeMzTab.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","text":"","code":"library(faahKO) xs <- group(faahko) mzt <- data.frame(character(0)) mzt <- xcms:::mzTabHeader(mzt, version=\"1.1.0\", mode=\"Complete\", type=\"Quantification\", description=\"faahKO\", xset=xs) mzt <- xcms:::mzTabAddSME(mzt, xs) xcms:::writeMzTab(mzt, \"faahKO.mzTab\")"},{"path":"https://sneumann.github.io/xcms/reference/xcms-deprecated.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecated functions in package ‘xcms’ — xcms-deprecated","title":"Deprecated functions in package ‘xcms’ — xcms-deprecated","text":"functions provided compatibility older versions ‘xcms’ , defunct next release.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcms-deprecated.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Deprecated functions in package ‘xcms’ — xcms-deprecated","text":"following functions/methods deprecated. profBin, profBinM, profBinLin, profBinLinM, profBinLinBase, profBinLinBaseM deprecated binYonX combination imputeLinInterpol used instead. extractMsData: replaced (x, \"data.frame\"). plotMsData: replaced plot(x, type = \"XIC\").","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsEIC-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","title":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","text":"class used store plot parallel extracted ion chromatograms multiple sample files. integrates xcmsSet class display peak area integrated peak identification fill-.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsEIC-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","text":"Objects can created getEIC method xcmsSet class. Objects can also created calls form new(\"xcmsEIC\", ...).","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsEIC-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","text":"eic: list containing named entries every sample. entry, list two column EIC matricies retention time intensity mzrange: two column matrix containing starting ending m/z EIC rtrange: two column matrix containing starting ending time EIC rt: either \"raw\" \"corrected\" specify retention times contained object groupnames: group names xcmsSet object used generate EICs","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsEIC-class.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","text":"groupnames signature(object = \"xcmsEIC\"): get groupnames slot mzrange signature(object = \"xcmsEIC\"): get mzrange slot plot signature(x = \"xcmsEIC\"): plot extracted ion chromatograms rtrange signature(object = \"xcmsEIC\"): get rtrange slot sampnames signature(object = \"xcmsEIC\"): get sample names","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsEIC-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsEIC-class.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","text":"notes yet.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsFileSource-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Base class for loading raw data from a file — xcmsFileSource-class","title":"Base class for loading raw data from a file — xcmsFileSource-class","text":"Data sources read data file inherit class. xcms package provides classes read netCDF, mzData, mzXML, mzML files using xcmsFileSource. class considered virtual work passed loadRaw-methods. reason explicitly virtual appear way class virtual data part (lets functions treat objects character strings). class validates file exists path given.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFileSource-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"Base class for loading raw data from a file — xcmsFileSource-class","text":"xcmsFileSource objects instantiated directly. Instead, create subclasses instantiate .","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFileSource-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Base class for loading raw data from a file — xcmsFileSource-class","text":".Data: Object class \"character\". File path file read raw data object's data part","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFileSource-class.html","id":"extends","dir":"Reference","previous_headings":"","what":"Extends","title":"Base class for loading raw data from a file — xcmsFileSource-class","text":"Class \"character\", data part. Class \"xcmsSource\", directly.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFileSource-class.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Base class for loading raw data from a file — xcmsFileSource-class","text":"xcmsSource signature(object = \"character\"): Create xcmsFileSource object referencing given file name.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFileSource-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Base class for loading raw data from a file — xcmsFileSource-class","text":"Daniel Hackney dan@haxney.org","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class xcmsFragments, a class for handling Tandem MS and MS$^n$ data — xcmsFragments-class","title":"Class xcmsFragments, a class for handling Tandem MS and MS$^n$ data — xcmsFragments-class","text":"class similar xcmsSet stores peaks number individual files. However, xcmsFragments keeps Tandem MS e.g. Ion Trap Orbitrap MS$^n$ peaks, including parent ion relationships.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"Class xcmsFragments, a class for handling Tandem MS and MS$^n$ data — xcmsFragments-class","text":"Objects can created xcmsFragments constructor filled peaks using collect method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Class xcmsFragments, a class for handling Tandem MS and MS$^n$ data — xcmsFragments-class","text":"peaks: matrix colmns peakID (MS1 parent corresponding xcmsSet), MSnParentPeakID (parent peak within xcmsFragments), msLevel (e.g. 2 Tandem MS), rt (retention time case LC data), mz (fragment mass--charge), intensity (peak intensity extracted original xcmsSet), sample (index rawData-file). MS2spec: list matrixes. matrix list single collected spectra collect. column ID's mz, intensity, full width half maximum(fwhm). fwhm column relevant spectra came profile data. specinfo: matrix reference data spectra MS2spec. column id's preMZ, AccMZ, rtmin, rtmax, ref, CollisionEnergy. preMZ precursor mass MS1 scan. mass given XML file. instruments mass given nominal mass, therefore AccMZ given weighted average mass MS1 scan collected spectra. retention time given rtmin rtmax. ref column pointer MS2spec matrix spectra. collisionEnergy column collision Energy spectra.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments-class.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Class xcmsFragments, a class for handling Tandem MS and MS$^n$ data — xcmsFragments-class","text":"collect signature(object = \"xcmsFragments\"): gets xcmsSet-object, collects ms1-peaks msn-peaks corresponding xcmsRaw-files. plotTree signature(object = \"xcmsFragments\"): prints (text based) pseudo-tree peaktable display dependencies peaks among . show signature(object = \"xcmsFragments\"): print human-readable description object console.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Class xcmsFragments, a class for handling Tandem MS and MS$^n$ data — xcmsFragments-class","text":"S. Neumann, J. Kutzera","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments.html","id":null,"dir":"Reference","previous_headings":"","what":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","title":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","text":"EXPERIMANTAL FEATURE xcmsFragments object similar xcmsSet, holds peaks picked (collected) one several xcmsRaw objects. still discussions going exact API MS$^n$ data, likely change future. code yet pipeline-ified.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","text":"","code":"xcmsFragments(xs, ...)"},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","text":"xs xcmsSet-class object contains picked ms1-peaks one several experiments ... arguments collect method","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","text":"running collect(xFragments,xSet) peaktable xcmsFragments includes ms1Peaks experinemts stored xcmsSet-object. contains relevant MSn-peaks xcmsRaw-objects, created temporarily paths xcmsSet.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","text":"xcmsFragments object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","text":"Joachim Kutzera, Steffen Neumann, sneumann@ipb-halle.de","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsPeaks-class.html","id":null,"dir":"Reference","previous_headings":"","what":"A matrix of peaks — xcmsPeaks-class","title":"A matrix of peaks — xcmsPeaks-class","text":"matrix peak information. actual columns depend generated (.e. findPeaks method).","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsPeaks-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"A matrix of peaks — xcmsPeaks-class","text":"Objects can created calls form new(\"xcmsPeaks\", ...).","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsPeaks-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"A matrix of peaks — xcmsPeaks-class","text":".Data: matrix holding peak information","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsPeaks-class.html","id":"extends","dir":"Reference","previous_headings":"","what":"Extends","title":"A matrix of peaks — xcmsPeaks-class","text":"Class \"matrix\", data part. Class \"array\", class \"matrix\", distance 2. Class \"structure\", class \"matrix\", distance 3. Class \"vector\", class \"matrix\", distance 4, explicit coerce.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsPeaks-class.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"A matrix of peaks — xcmsPeaks-class","text":"None yet. utilities working peak data nice.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsPeaks-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"A matrix of peaks — xcmsPeaks-class","text":"Michael Lawrence","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class xcmsRaw, a class for handling raw data — xcmsRaw-class","title":"Class xcmsRaw, a class for handling raw data — xcmsRaw-class","text":"class handles processing visualization raw data single LC/MS GS/MS run. includes methods producing standard suite plots including individual spectra, multi-scan average spectra, TIC, EIC. also produce feature list significant peaks using matched filtration.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"Class xcmsRaw, a class for handling raw data — xcmsRaw-class","text":"Objects can created xcmsRaw constructor reads data NetCDF file new object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Class xcmsRaw, a class for handling raw data — xcmsRaw-class","text":"acquisitionNum: Numeric representing acquisition number individual scans/spectra. Length acquisitionNum equal number spectra/scans object hence equal scantime slot. Note however information available mzML files. env: environment three variables: mz - concatenated m/z values scans, intensity - corresponding signal intensity m/z value, profile - matrix represention intensity values columns representing scans rows representing equally spaced m/z values. profile matrix extracted profMat method. filepath: Path raw data file gradient: matrix first row, time, containing time point interpolation successive columns representing solvent fractions point msnAcquisitionNum: scan unique acquisition number reported via \"spectrum id\" (mzData) \"\" \"\" (mzXML) msnCollisionEnergy: \"CollisionEnergy\" (mzData) \"collisionEnergy\" (mzXML) msnLevel: scan \"msLevel\" (mzData mzXML) msnPrecursorCharge: \"ChargeState\" (mzData) \"precursorCharge\" (mzXML) msnPrecursorIntensity: \"Intensity\" (mzData) \"precursorIntensity\" (mzXML) msnPrecursorMz: \"MassToChargeRatio\" (mzData) \"precursorMz\" (mzXML) msnPrecursorScan: \"spectrumRef\" (mzData mzXML) msnRt: Retention time scan msnScanindex: msnScanindex mzrange: numeric vector length 2 minimum maximum m/z values represented profile matrix polarity: polarity profmethod: characer value name method used generating profile matrix. profparam: list store additional profile matrix generation settings. Use profinfo method extract profile matrix creation relevant information. scanindex: integer vector starting positions scan mz intensity variables (note index values based 0 initial position instead 1). scantime: numeric vector acquisition time (seconds) scan. tic: numeric vector total ion count (intensity) scan mslevel: Numeric representing MS level present MS1 slot. slot accessed getter method mslevel. scanrange: Numeric length 2 specifying scan range (NULL full range). slot accessed getter method scanrange. Note scanrange always 1 number scans within xcmsRaw object, necessarily match scan index original mzML file (e.g. original data sub-setted). acquisitionNum information can used track original position scan mzML file.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw-class.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Class xcmsRaw, a class for handling raw data — xcmsRaw-class","text":"findPeaks signature(object = \"xcmsRaw\"): feature detection using matched filtration chromatographic time domain getEIC signature(object = \"xcmsRaw\"): get extracted ion chromatograms specified m/z ranges. return total ion chromatogram (TIC) m/z range corresponds full m/z range (.e. sum signals per retention time across m/z). getPeaks signature(object = \"xcmsRaw\"): get data peaks specified m/z time ranges getScan signature(object = \"xcmsRaw\"): get m/z intensity values single mass scan getSpec signature(object = \"xcmsRaw\"): get average m/z intensity values multiple mass scans image signature(x = \"xcmsRaw\"): get data peaks specified m/z time ranges levelplot Create image raw (profile) data m/z retention time, intensity color coded. mslevel Getter method mslevel slot. plotChrom signature(object = \"xcmsRaw\"): plot chromatogram profile data plotRaw signature(object = \"xcmsRaw\"): plot locations raw intensity data points plotScan signature(object = \"xcmsRaw\"): plot mass spectrum individual scan raw data plotSpec signature(object = \"xcmsRaw\"): plot mass spectrum profile data plotSurf signature(object = \"xcmsRaw\"): experimental method plotting 3D surface profile data rgl. plotTIC signature(object = \"xcmsRaw\"): plot total ion count chromatogram profinfo signature(object = \"xcmsRaw\"): returns list containing profile generation method step (profile m/z step size) eventual additional parameters profile function. profMedFilt signature(object = \"xcmsRaw\"): median filter profile data time m/z dimensions profMethod<- signature(object = \"xcmsRaw\"): change method generating profile matrix profMethod signature(object = \"xcmsRaw\"): get method generating profile matrix profMz signature(object = \"xcmsRaw\"): get vector m/z values row profile matrix profRange signature(object = \"xcmsRaw\"): interpret flexible ways specifying subsets profile matrix profStep<- signature(object = \"xcmsRaw\"): change m/z step used generating profile matrix profStep signature(object = \"xcmsRaw\"): get m/z step used generating profile matrix revMz signature(object = \"xcmsRaw\"): reverse order data points scan scanrange Getter method scanrange slot. See slot description information. sortMz signature(object = \"xcmsRaw\"): sort data points increasing m/z scan stitch signature(object = \"xcmsRaw\"): Raw data correction lock mass calibration gaps. findmzROI signature(object = \"xcmsRaw\"): \tinternal function identify regions interest raw \tdata part first step centWave-based peak detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Class xcmsRaw, a class for handling raw data — xcmsRaw-class","text":"Colin . Smith, csmith@scripps.edu, Johannes Rainer johannes.rainer@eurac.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":null,"dir":"Reference","previous_headings":"","what":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"function handles task reading NetCDF/mzXML file containing LC/MS GC/MS data new xcmsRaw object. also transforms data profile (maxrix) mode efficient plotting data exploration.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"","code":"xcmsRaw(filename, profstep = 1, profmethod = \"bin\", profparam = list(), includeMSn=FALSE, mslevel=NULL, scanrange=NULL) deepCopy(object)"},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"filename path name NetCDF mzXML file read profstep step size (m/z) use profile generation profmethod method use profile generation. See profile-matrix details supported values. profparam extra parameters use profile generation includeMSn XML file formats: also read MS$^n$ (Tandem-MS Ion-/Orbi- Trap spectra) mslevel move data mslevel normal MS1 slots, e.g. peak picking visualisation scanrange scan range read object xcmsRaw object","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"See profile-matrix details profile matrix generation methods settings. scanrange import can restricted, otherwise MS1 data read. profstep set 0, profile matrix generated. Unless includeMSn = TRUE first level MS data read, MS/MS, etc. deepCopy(xraw) create copy xcmsRaw object copy mz intensity data xraw@env.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"xcmsRaw object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"NetCDF file format: https://www.unidata.ucar.edu/software/netcdf/ http://www.astm.org/Standards/E2077.htm http://www.astm.org/Standards/E2078.htm mzXML file format: http://sashimi.sourceforge.net/software_glossolalia.html PSI-MS working group developed mzData mzML file formats: http://www.psidev.info/index.php?q=node/80 Parser used XML file formats: http://tools.proteomecenter.org/wiki/index.php?title=Software:RAMP","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"","code":"if (FALSE) { library(xcms) library(faahKO) cdfpath <- system.file(\"cdf\", package = \"faahKO\") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE) xr<-xcmsRaw(cdffiles[1]) xr ##This gives some information about the file names(attributes(xr)) ## Lets have a look at the structure of the object str(xr) ##same but with a preview of each slot in the object ##SO... lets have a look at how this works head(xr@scanindex) ##[1] 0 429 860 1291 1718 2140 xr@env$mz[425:430] ##[1] 596.3 597.0 597.3 598.1 599.3 200.1 ##We can see that the 429 index is the last mz of scan 1 therefore... mz.scan1<-xr@env$mz[(1+xr@scanindex[1]):xr@scanindex[2]] intensity.scan1<-xr@env$intensity[(1+xr@scanindex[1]):xr@scanindex[2]] plot(mz.scan1, intensity.scan1, type=\"h\", main=paste(\"Scan 1 of file\", basename(cdffiles[1]), sep=\"\")) ##the easier way :p scan1<-getScan(xr, 1) head(scan1) plotScan(xr, 1) }"},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","title":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","text":"class transforms set peaks multiple LC/MS GC/MS samples matrix preprocessed data. groups peaks nonlinear retention time correction without internal standards. fills missing peak values raw data. Lastly, generates extracted ion chromatograms ions interest.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","text":"Objects can created xcmsSet constructor gathers peaks set NetCDF files. Objects can also created calls form new(\"xcmsSet\", ...).","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","text":"peaks matrix containing peak data. filled vector peak indices peaks added fillPeaks method. groups Matrix containing statistics peak groups. groupidx List containing indices peaks group. phenoData data.frame containing experimental design factors. rt list containing two lists, raw corrected, containing retention times every scan every sample. filepaths Character vector absolute path name NetCDF file. profinfo list containing values method - profile generation method, step - profile m/z step size eventual additional parameters profile function. dataCorrection logical vector filled waters Lock mass correction parameter used. polarity string (\"positive\" \"negative\" NULL) describing whether positive negative scans used reading raw data. progressInfo Progress informations xcms functions (GUI). progressCallback Function called, progressInfo changes (GUI). mslevel Numeric representing MS level peak picking performed (default MS1). slot accessed getter method mslevel. scanrange Numeric length 2 specifying scan range (NULL full range). slot accessed getter method scanrange. scan range provided slot represents scans whole raw data subsetted. .processHistory Internal slot used keep track performed processing steps. slot directly accessed user.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet-class.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","text":"c signature(\"xcmsSet\"): combine objects together filepaths<- signature(object = \"xcmsSet\"): set filepaths slot filepaths signature(object = \"xcmsSet\"): get filepaths slot diffreport signature(object = \"xcmsSet\"): create report differentially regulated ions including EICs fillPeaks signature(object = \"xcmsSet\"): fill peak data groups missing peaks getEIC signature(object = \"xcmsSet\"): get list EICs sample set getXcmsRaw signature(object = \"xcmsSet\", sampleidx = 1, \tprofmethod = profMethod(object), profstep = profStep(object), \tprofparam=profinfo(object), mslevel = NULL, scanrange = NULL, \trt=c(\"corrected\", \"raw\"), BPPARAM = bpparam()): read raw data one files xcmsSet return . default parameters apply settings used original xcmsSet call generate xcmsSet object applied also raw data. Parameter sampleidx allows specify raw file(s) loaded. Argument BPPARAM allows setup parallel processing. groupidx<- signature(object = \"xcmsSet\"): set groupidx slot groupidx signature(object = \"xcmsSet\"): get groupidx slot groupnames signature(object = \"xcmsSet\"): get textual names peak groups groups<- signature(object = \"xcmsSet\"): set groups slot groups signature(object = \"xcmsSet\"): get groups slot groupval signature(object = \"xcmsSet\"): get matrix values peak data row peak group group signature(object = \"xcmsSet\"): find groups peaks across samples share similar m/z retention times mslevel Getter method mslevel slot. peaks<- signature(object = \"xcmsSet\"): set peaks slot peaks signature(object = \"xcmsSet\"): get peaks slot plotrt signature(object = \"xcmsSet\"): plot retention time deviation profiles profinfo<- signature(object = \"xcmsSet\"): set profinfo slot profinfo signature(object = \"xcmsSet\"): get profinfo slot profMethod signature(object = \"xcmsSet\"): extract method used generate profile matrix. profStep signature(object = \"xcmsSet\"): extract profile step used generation profile matrix. retcor signature(object = \"xcmsSet\"): use initial grouping peaks nonlinear loess retention time correction sampclass<- signature(object = \"xcmsSet\"): Replaces column “class” phenoData slot. See details information. sampclass signature(object = \"xcmsSet\"): Returns content column “class” phenoData slot , present, interaction experimental design factors (.e. phenoData data.frame). See details information. phenoData<- signature(object = \"xcmsSet\"): set phenoData slot phenoData signature(object = \"xcmsSet\"): get phenoData slot progressCallback<- signature(object = \"xcmsSet\"): set progressCallback slot progressCallback signature(object = \"xcmsSet\"): get progressCallback slot scanrange Getter method scanrange slot. See scanrange slot description details. sampnames<- signature(object = \"xcmsSet\"): set rownames phenoData slot sampnames signature(object = \"xcmsSet\"): get rownames phenoData slot split signature(\"xcmsSet\"): divide xcmsSet list xcmsSet objects depending provided factor. Note peak data preserved, .e. eventual peak grouping information lost. object$name, object$name<-value Access set name column phenoData object[, ] Conducts subsetting xcmsSet instance. subsetting columns, .e. samples, supported. Subsetting performed slots, also groups groupidx. Parameter can integer vector, logical vector character vector sample names (matching sampnames).","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet-class.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","text":"phenoData slot (phenoData parameter xcmsSet function) intended contain data.frame describing experimental factors, .e. samples along properties. data.frame contains column named “class”, returned sampclass method thus used methods determine sample grouping/class assignment (e.g. define colors various plots group method). sampclass<- method adds replaces “class” column phenoData slot. data.frame submitted method, interaction columns stored “class” column. Also, similar classes Bioconductor, $ method can used directly access columns phenoData slot (e.g. use xset$name xcmsSet object called “xset” extract values column named “name” phenoData slot).","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","text":"Colin . Smith, csmith@scripps.edu, Johannes Rainer johannes.rainer@eurac.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":null,"dir":"Reference","previous_headings":"","what":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"function handles construction xcmsSet objects. finds peaks batch mode pre-sorts files subdirectories different classes suitable grouping.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"","code":"xcmsSet(files = NULL, snames = NULL, sclass = NULL, phenoData = NULL, profmethod = \"bin\", profparam = list(), polarity = NULL, lockMassFreq=FALSE, mslevel=NULL, nSlaves=0, progressCallback=NULL, scanrange = NULL, BPPARAM = bpparam(), stopOnError = TRUE, ...)"},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"files path names NetCDF/mzXML files read snames sample names. default file name without extension used. sclass sample classes. phenoData data.frame AnnotatedDataFrame defining sample names classes sample related properties. provided, argument sclass subdirectories samples stored used specify sample grouping. profmethod Method use profile generation. Supported values \"bin\", \"binlin\", \"binlinbase\" \"intlin\" (methods profBin, profBinLin, profBinLinBase profIntLin, respectively). See help profBin complete list available methods supported parameters. profparam parameters use profile generation. polarity filter raw data positive/negative scans lockMassFreq Performs correction Waters LockMass function mslevel perform peak picking data given mslevel nSlaves DEPRECATED, use BPPARAM argument instead. progressCallback function called, progressInfo changes (useful GUIs) scanrange scan range read BPPARAM BiocParallel parameter object control parallel processing performed. objects can created SerialParam, MulticoreParam SnowParam functions. stopOnError Logical specifying whether feature detection call stop first encountered error (default), whether feature detection performed files regardless eventual failures individual files case errors reported warnings. ... arguments findPeaks method xcmsRaw class","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"default values files, snames, sclass, phenoData arguments cause function recursively search readable files. filename without extention used sample name. subdirectory path used sample class. files contain positive negative spectra, polarity can selected explicitly. default (NULL) read scans. phenoData provided, stored phenoData slot returned xcmsSet class. data.frame contains column named “class”, content returned sampclass method thus used group/class assignment individual files (e.g. peak grouping etc.). details see help xcmsSet-class. step size (m/z) use profile generation can submitted either using profparam argument (e.g. profparam=list(step=0.1)) submitting step=0.1. specifying value 0 profile matrix generation can skipped. feature/peak detection algorithm can specified method argument defaults \"matchFilter\" method (findPeaks.matchedFilter). Possible values returned getOption(\"BioC\")$xcms$findPeaks.methods. lock mass correction allows lock mass scan added back last working scan. correction gives better reproducibility sample sets.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"xcmsSet object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"arguments profmethod profparam influence feature/peak detection. step size parameter step profile generation findPeaks.matchedFilter peak detection algorithm can passed using ....","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsSource-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Virtual class for raw data sources — xcmsSource-class","title":"Virtual class for raw data sources — xcmsSource-class","text":"virtual class provides implementation-independent way load mass spectrometer data various sources use xcmsRaw object. Subclasses can defined enable data loaded user-specified sources. virtual class xcmsFileSource included box contains file name character string. implementing child classes xcmsSource, corresponding loadRaw-methods method must provided accepts xcmsSource child class returns list format described loadRaw-methods.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSource-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"Virtual class for raw data sources — xcmsSource-class","text":"virtual Class: objects may created .","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSource-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Virtual class for raw data sources — xcmsSource-class","text":"Daniel Hackney, dan@haxney.org","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsSource-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Create an xcmsSource object in a flexible way — xcmsSource-methods","title":"Create an xcmsSource object in a flexible way — xcmsSource-methods","text":"Users can define alternate means reading data xcmsRaw objects creating new implementations method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSource-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Create an xcmsSource object in a flexible way — xcmsSource-methods","text":"signature(object = \"xcmsSource\") Pass object unmodified.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSource-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create an xcmsSource object in a flexible way — xcmsSource-methods","text":"Daniel Hackney, dan@haxney.org","code":""},{"path":[]},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.12","title":"xcms 4.1","text":"Implementation LamaParama class method adjustRtime() function. Allowing alignment dataset based landmarks (lamas) external reference dataset. Implementation related user-level function matchLamasChromPeaks(), summarizeMatchLama() plot(LamaParama) allows evaluation matching lamas chromPeaks.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-1","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.11","title":"xcms 4.1","text":"Clean required suggested packages namespace imports. Re-creation bundled data objects.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-2","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.10","title":"xcms 4.1","text":"Ensure backward compatibility parameter objects gained additional slots.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-3","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.9","title":"xcms 4.1","text":"Fix bug filterFeatures,PercentMissingFilter.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-4","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.8","title":"xcms 4.1","text":"Fixing issue #716: edit .empty_chrom_peaks function sn column returned. Fixes extracting plotting peaks using manualChromPeaks","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-5","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.7","title":"xcms 4.1","text":"Implementation filterFeatures function filter parameters: RsdFilter, DratioFilter, PercentMissingFilter, BlankFlag. can used ot filter features XcmsResult SummarizedExperiment objects. Addition section main xcms vignette describe use .","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-6","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.6","title":"xcms 4.1","text":"Import filterSpectra MsExperiment. Import breaks_ppm MsCoreUtils. Update featureArea function consider chromatographic peaks per feature, one highest intensity. consequence, returned m/z rt ranges might higher influence featureChromatograms, EIC-based feature grouping , lesser extent also gap-filling. Related documentation updated. Improve performance featureArea function (related PeakAreaParam-based gap filling). Add parameter ppm PeakDensityParam enable peak-density-based correspondence throgh m/z-dependent bins along m/z.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-7","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.5","title":"xcms 4.1","text":"Improve performance chromatogram call XcmsExperiment objects. Remove internal (exported) normalization functions. transferred MetaboCoreUtils package. Support subsetting XcmsExperiment negative indices.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-8","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.4","title":"xcms 4.1","text":"Rename variable data vignette faahko. Fix issue adjustRtime resulting corrupt processHistory. Add support perform peakGroups alignment using pre-defined anchor peak matrix (.e., numeric matrix retention times anchor peaks samples can used align samples). Fix errors related invalid Chromatogram objects extracted xcms results: ensure MS level chromPeaksMatrix integer. Fix definition anchor peaks peakGroups alignment subset (issue #702). Add filterMsLevel method MsExperiment XcmsExperiment. Ensure chunk-wise processing Spectra (introduced version 1.13.2) disabled xcms using chunk-wise processing.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-9","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.3","title":"xcms 4.1","text":"Add parameter verboseBetaColumns CentWaveParam enable calculation additional peak quality metrics comparing EIC idealized bell curve.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-10","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.2","title":"xcms 4.1","text":"Add param = generic function storeResults: PlainTextParam save XcmsExperiment MsExperiment object colleciton plain text files.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-11","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.1","title":"xcms 4.1","text":"Add method storeResults one param =: RDataParam save XcmsExperiment object .RData file.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.6","title":"xcms 3.99","text":"Add method coerce XcmsExperiment xcmsSet (issue #696). Support providing mz rt also chromatogram,MsExperiment.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.5","title":"xcms 3.99","text":"mz rt need provided chromatogram.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.4","title":"xcms 3.99","text":"Add chromPeakChromatograms function extract (EIC) chromatograms chromatographic peaks.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.3","title":"xcms 3.99","text":"Small fixes direct injection vignette. Add parameter isolationWindowTargetMz chromatogram function MsExperiment XcmsExperiment ensure MS2 chromatographic data extracted MS2 spectra containing fragments compound interest.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.2","title":"xcms 3.99","text":"Add xmse data set representing XcmsExperiment object. Update compounding vignette use new objects. Add loadXcmsData load test data objects (fix/update paths). Add groupFeatures methods XcmsExperiment. Fix issue featureArea XcmsExperiment. Update main vignette use describe new data objects. Add findChromPeaksIsolationWindow method MsExperiment XcmsExperiment. Make reconstructChromPeakSpectra method. Add reconstructChromPeakSpectra implementation XcmsExperiment. Add filterIsolationWindow MsExperiment XcmsExperiment filter spectra (eventually chromatographic peaks) based isolation window. Update LC-MS/MS vignette adding also example deisotope SWATH MS2 spectra.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99-5","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.1","title":"xcms 3.99","text":"featureSummary overlappingFeatures gain support XcmsExperiment. Fix featureChromatograms ensure valid object returned.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99-6","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.0","title":"xcms 3.99","text":"Add XcmsExperiment support MsExperiment/Spectra: add functionality full xcms processing MsExperiment object. Fix issue refineChromPeaks MergeNeighboringPeaksParam wrong apex position considered evaluation whether candidate peaks merged (happen merging > 2 candidate peaks). Re-write reconstructChromPeakSpectra DIA data analysis fix issue chromatographic peaks overlapping SWATH isolation windows generally improve performance.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-21","dir":"Changelog","previous_headings":"","what":"Changes in version 3.21.5","title":"xcms 3.21","text":"Fix issue chromatogram filtering result object (issue #511).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-21-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.21.4","title":"xcms 3.21","text":"Move multtest Suggests Imports dependencies","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-21-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.21.3","title":"xcms 3.21","text":"fixes long running tests","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-21-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.21.1","title":"xcms 3.21","text":"Fix error fillChromPeaks sparse data (many empty spectra) peak detection performed MatchedFilterParam (issue #653). Update newer function names rgl package (issue #654).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-19","dir":"Changelog","previous_headings":"","what":"Changes in version 3.19.2","title":"xcms 3.19","text":"Update/expand documentation firstBaselineCheck parameter centWave.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-19-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.19.1","title":"xcms 3.19","text":"Update documentation reference updates MassSpecWavelet package.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-17","dir":"Changelog","previous_headings":"","what":"Changes in version 3.17.6","title":"xcms 3.17","text":"Rewrite code subset features chromatographic peaks. results perfomance improvement filterFile similar functions. Add parameter expandMz featureChromatograms https://github.com/sneumann/xcms/issues/612.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-17-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.17.5","title":"xcms 3.17","text":"Change way m/z value chromatographic peak determined centWave: ROI contains one peak one scan (spectrum) intensity-weighted m/z reported scan. m/z chromatographic peak calculated based reported m/z values scan (spectrum). original version mean m/z scan reported instead. result, m/z values chromatographic peaks now slightly different expected accurate. See https://github.com/sneumann/xcms/issues/590 details.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-17-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.17.4","title":"xcms 3.17","text":"Add transformIntensity method. Fix issue calling chromPeakSpectra featureSpectra object contains also files MS1 spectra (https://github.com/sneumann/xcms/issues/603).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-17-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.17.2","title":"xcms 3.17","text":"Use mzML instead mzData files testing vignettes, since mzR drop mzData reading msdata package drop mzData files well","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-17-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.17.1","title":"xcms 3.17","text":"Fix bug feature grouping EIC correlation return non-symmetric similarity matrix. Fix error message issue 584.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-15","dir":"Changelog","previous_headings":"","what":"Changes in version 3.15.5","title":"xcms 3.15","text":"Disable testing windows i386, providing speedup Disable parallel processing Windows, causing issue testthat BioC build check","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-15-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.15.4","title":"xcms 3.15","text":"Fix plot type = \"XIC\" plot empty plot data present. Skip re-indexing peaks features necessary. results performance improvements MS1 data.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-15-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.15.3","title":"xcms 3.15","text":"Add manualFeatures allowing manually define add features XCMSnExp object. Add plotChromatogramsOverlay function support plotting multiple EICs sample plot (eventually stacked). Add feature grouping EIC similarity: EicSimilarityParam. Import compareChromatograms MSnbase. Add feature grouping similar retention time: `SimilarRtimeParams. Add feature grouping similarity feature abundances across samples: AbundanceSimilarityParam. Add feature grouping methodology based MsFeatures.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-15-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.15.2","title":"xcms 3.15","text":"Fix LC-MS/MS vignette.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-15-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.15.1","title":"xcms 3.15","text":"Compatibility fix nls() R >= 4.1, contributed Rick Helmus.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.8","title":"xcms 3.13","text":"Fix plotQC() XCMSnExp objects","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.7","title":"xcms 3.13","text":"Add featureArea function extract m/z-rt region features. Fix featureSpectra function. Re-add LC-MS/MS vignette. Feature: plotQC() supports XCMSnExp objects now","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.6","title":"xcms 3.13","text":"Fix issue #545: skip second centWave run CentWavePredIsoParam regions interest undefined peak boundaries/scan ranges. Temporarily remove LC-MS/MS vignette (MsBackendMgf added Bioconductor).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.5","title":"xcms 3.13","text":"Add filterChromPeaks method filter chromatographic peaks XChromatogram XChromatograms object. Add filterChromPeaks method XCMSnExp (issue #541). Support return Spectra objects chromPeakSpectra, featureSpectra reconstructChromPeakSpectra. Support extraction MS1 spectra chromPeakSpectra. Support extraction spectrum largest total signal largest base peak signal chromPeakSpectra. Add support extraction spectra selected/individual peaks/features using peaks features parameter chromPeakSpectra featureSpectra, respectively.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.4","title":"xcms 3.13","text":"Import Param object ProtGenerics. Import filterIntensity, normalize alignRt Chromatogram MChromatograms MSnbase.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-5","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.3","title":"xcms 3.13","text":"align,Chromatogram gains new method \"none\" keep values identical retention times. method = \"matchRtime\" (much faster) matching function closest MsCoreUtils package used. Method correlate,Chromatogram gains parameter useIntensitiesAbove perform correlation values larger threshold (avoiding thus high correlation many 0-values). Add method filterIntensity,Chromatogram allows filter chromatogram object keeping data points intensity user provided threshold.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-6","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.2","title":"xcms 3.13","text":"Add new function manualChromPeaks allowing manually add integrate chromatographic peaks.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-7","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.1","title":"xcms 3.13","text":"Support subsetting XChromatograms drop = FALSE.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.8","title":"xcms 3.11","text":"Disable parallel processing vignettes.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.7","title":"xcms 3.11","text":"efficient splitting data per file especially larger data sets. Disable parallel processing examples.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.6","title":"xcms 3.11","text":"Add FilterIntensityParam filter chromatographic peaks intensity (issue #502). Add estimatePrecursorIntensity function determine precursor intensity MS2 spectra neighboring MS1 spectra.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.4","title":"xcms 3.11","text":"Change Spectra Chromatograms MSpectra MChromatograms MSnbase version >= 2.15.3.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.3","title":"xcms 3.11","text":"reconstructChromPeakSpectra: report also polarity precusorIntensity. reconstructChromPeakSpectra: ensure retention time reported reconstructed MS2 spectra (issue #485). Change default expandRt 0 reconstructChromPeakSpectra. Fix error refineChromPeaks,MergeNeighboringPeaksParam peaks found merged.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11-5","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.2","title":"xcms 3.11","text":"Add fillChromPeaks,ChromPeakAreaParam base area missing peak data filled-actually detected chromatographic peaks feature. Potential fix issue #481: function longer throw error retention times length 0. efficient splitting processing increase speed findChromPeaks, refineChromPeaks, reconstructChromPeakSpectra chromPeakSpectra calls.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11-6","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.1","title":"xcms 3.11","text":"Fix issue #471: conversion XCMSnExp xcmsSet looses phenodata (thanks Andris Jankevics reporting providing solution). Add normalize method Chromatogram Chromatograms objects. featureChromatograms gets new parameter n value extract EICs top n samples highest intensities. filterFile gets new parameter keepFeatures support retaining correspondence results even data set filtered file. Export virtual Param class. Add filterColumnsIntensityAbove method Chromatograms object allows select columns (samples) Chromatograms object intensities chromatographic data higher threshold. Add removeIntensity method Chromatogram, Chromatograms, XChromatogram XChromatograms objects allowing remove intensities based different criteria. Add correlate method Chromatograms allowing correlate multiple chromatograms .","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-9","dir":"Changelog","previous_headings":"","what":"Changes in version 3.9.4","title":"xcms 3.9","text":"Fix issue centWave skips peak detection depending minimum peakwidth (issue #445): add parameter extendLengthMSW CentWaveParam. Thanks William Kumler contributing fix. Tentatively reduce memory requirements fillChromPeaks. Fix issue #467 fillPeaks() xcmsSet converted XCMSnSet","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-9-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.9.3","title":"xcms 3.9","text":"Move multtest Imports Suggests avoid duplicated method definition plot (issue #459). Add support peak filling MS level > 1 fillChromPeaks. featureValues gains parameter msLevel extract feature values features , specific MS level. refineChromPeaks supports different MS levels. Added support perform correspondence analysis MS level > 1 add respective results already present feature definitions. hasChromPeaks hasFeatures gain parameter msLevel check presence chromatographic peaks features specific MS level.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-9-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.9.2","title":"xcms 3.9","text":"Fix featureChromatograms chromatograms XCMSnExp object features: features can duplicated across rows (EICs). findChromPeaks: add parameter add allow several rounds peak detections object. Small performance enhancement fillChromPeaks. Better support MS > 1 data fillChromPeaks: skip MS level 2 spectra filling . Add refineChromPeaks XChromatogram XChromatograms objects. Add groupOverlaps function group arbitrary ranges. Add quantify,XCMSnExp object quantify XCMSnExp SummarizedExperiment. Fine-tune MergeNeighboringPeaks peak refinement method: average 3 data points candidate peaks used evaluate whether peaks merged making approach robust outliers. addition, ion chromatogram candidate peaks extracted m/z range expanded depending expandMz ppm setting ensuring low intensity data points candidate peaks missed (m/z might slightly shifted ToF instruments). mzmin mzmax merged peak represents also minimum maximum m/z data points extracted ion chromatogram.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-9-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.9.1","title":"xcms 3.9","text":"Fix problem shown/plotted peak positions plotChromPeakSpectra experiments peaks detected first sample(s). Add method from_to missing value imputation method imputeRowMinRand. Show warning findChromPeaks empty spectra detected. Add refineChromPeaks method CleanPeaksParam class allow removal chromatographic peaks exceeding user-definable maximal peak width. Add MergeNeighboringPeaksParam refineChromPeaks allow merging chromatographic peaks close m/z retention time signal higher certain threshold (issue #414). Fix misspelled parameter mzd LC-MS/MS vignette.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-7","dir":"Changelog","previous_headings":"","what":"Changes in version 3.7.5","title":"xcms 3.7","text":"Remove xcmsMSn vignette (based old xcms).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-7-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.7.4","title":"xcms 3.7","text":"mzClust correspondence analysis: check fix missing values column mz peaks matrix (issue #416).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-7-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.7.3","title":"xcms 3.7","text":"plot type = “XIC” XCMSnExp object draw rectangles indicating identified chromatographic peaks. Add vignette describing LC-MS/MS data analysis xcms.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-7-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.7.2","title":"xcms 3.7","text":"Fix documentation (issue #401). Add support SWATH data analysis.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-7-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.7.1","title":"xcms 3.7","text":"Add correlate method Chromatogram objects. Add parameter lwd plotAdjustedRtime. Add align method Chromatogram objects. Add findChromPeaksIsolationWindow enable chromatographic peak detection isolation windows. Fix issue chromPeakSpectra method = “signal”. chromPeakSpectra featureSpectra return now MS2 spectra precursor m/z >= mzmin, <= mzmax retention time >= rtmin, <= rtmax. Improve performance chromPeakSpectra featureSpectra.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-5","dir":"Changelog","previous_headings":"","what":"Changes in version 3.5.5","title":"xcms 3.5","text":"Add dirname dirname<- methods OnDiskMSnExp change path raw data files. Add section “Subset-based alignment” xcms vignette describe alignment possibility perform alignments based subset samples (e.g. QC samples).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-5-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.5.4","title":"xcms 3.5","text":"Fix problem featureChromatograms include = “feature_only” return non-valid object. Ensure XCMSnExp objects updated necessary analysis methods.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-5-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.5.3","title":"xcms 3.5","text":"Fix unit tests.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-5-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.5.2","title":"xcms 3.5","text":"Small changes fillChromPeaks,XCMSnExp reduce memory demand. Fix issue #359. Fix issue #360: rawEIC skipped last scan/spectrum rtrange provided. filterMsLevel keeps now chromatographic peaks feature definitions specified MS levels (issue #362). Fix bug xcmsRaw leads netCDF error message (issue #363). Add parameter msLevel chromPeaks XCMSnExp objects. Add chromPeakData allow adding arbitrary annotation chromatographic peaks. Change default parameter value featureValues value = “index” value = “”. Add parameter isFilledColumn chromPeaks allowing old behaviour include is_filled column chromatographic peak matrix.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-5-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.5.1","title":"xcms 3.5","text":"Fix issue #349. Add updateObject function XCMSnExp objects (issue #347). Add dropFilledChromPeaks methods XChromatogram XChromatograms objects. Add parameter filled = FALSE chromatogram featureChromatograms functions. Fix matchedFilter peak detection problems empty spectra (issue #325). featureChromatograms extracts default chromatographic peaks associated feature. chromatogram,XCMSnExp extracts XChromatogram containing also chromatographic peaks feature definitions. Add featureValues method XChromatograms objects (issue #336). Add correspondence analysis (peak grouping) chromatographic data (now PeakDensity method; issue #336). Add featureDefinitions slot XChromatograms object related accessor methods. Add subset alignment option subsetAdjust = “average” adjust left-samples (blanks simply non-subset samples) based interpolation results previous subsequent subset sample. Add parameter subsetAdjust PeakGroupsParam allowing switch different methods adjust samples left alignment process. Alignment based sample subset peak groups method (issue #335): sample subset can defined subset parameter, samples included subset aligned based adjusted retention times closest sample subset. Add findChromPeaks,XChromatograms (issue #332). Add processHistory,XChromatograms. Add plot,XChromatograms method automatic peak highlighting (issue #334). Add hasChromPeaks,XChromatograms method. Add XChromatograms class constructor function coercing method. Add hasChromPeaks,XChromatogram method. Add filterRt,XChromatogram, filterMz,XChromatogram. Add plot,XChromatogram function supporting highlighting/drawing identified chromatographic peaks. findChromPeaks,Chromatogram returns XChromatogram object (issue #329). Add chromPeaks,XChromatogram (issue #329). Add XChromatogram object (issue #329). Fix higlightChromPeaks type = “polygon”: peak filling represents now full detected peak longer cut provided rt. Add argument peakIds highlightChromPeaks allowing specify IDs peaks highlighted. Add example clustering base peak chromatograms vignette (issue #328). Small fix vignette (issue #327). Add parameter groupval exportMetaboAnalyst (issue #296). Fix bug show,XCMSnExp throw error process history present.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.3.6","title":"xcms 3.3","text":"Add type = “polygon” highlightChromPeaks allowing fill actual signal area identified chromatographic peaks.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-3-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.3.5","title":"xcms 3.3","text":"Performance enhancement chromPeakSpectra featureSpectra functions.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-3-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.3.4","title":"xcms 3.3","text":"Add featureChromatograms extract ion chromatograms feature. Add hasFilledChromPeaks function. Add argument skipFilled featureSummary function.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-3-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.3.3","title":"xcms 3.3","text":"Add chromPeakSpectra featureSpectra functions extract MS2 spectra chromatographic peaks features, respectively (issue #321). Fix profMat handle also data files empty spectra (issue #312). Add argument ylim plotAdjustedRtime (issue #314). Add imputeRowMin imputeRowMinRand, two simple missing value imputation helper functions. Fix additional problem mentioned issue #301 obiwarp retention time correction spectra m/z values NA. Fix issue #300 avoiding chromatographic peaks rtmin > rtmax. Fixes issues #291, #296. Add parameter ‘missing’ diffreport allowing replace NA arbitrary numbers. Add exportMetaboAnalyst function export feature matrix MetaboAnalyst format. Add parameter missing featureValues allowing specify handle/ report missing values. chromPeaks matrix now rownames uniquely identify chromatographic peaks experiment. Chromatographic peak IDs start “CP” followed number.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-3-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.3.2","title":"xcms 3.3","text":"Add writeMSData method XCMSnExp allowing write mzML/mzXML files adjusted retention times (issue #294). Fix profEIC call single-scan-peak (pull request #287 @trljcl). Fix centWave avoiding peak reported multiple times fitgauss = TRUE used (issue #284). featureSummary reports also RSD (relative standard deviations) features across samples (issue #286). Add parameters fixedMz fixedRt FillChromPeaksParam allow increase features’ m/z rt widths constant factor. Add option “sum” featureValues’ method parameter allowing sum intensities peaks assigned feature file/sample.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-3-5","dir":"Changelog","previous_headings":"","what":"Changes in version 3.3.1","title":"xcms 3.3","text":"Add overlappingFeatures function identify overlapping close features. Add support type = “apex_within” featureDefinitions. Fix bug fillChromPeaks return integrated signal Inf. Fix issue #267: error fillChromPeaks retention time peaks outside retention time range certain files. New featureSummary function calculate basic feature summaries (number samples peaks found etc). Parameter ‘type’ added plotChromPeakDensity ‘whichPeaks’ highlightChromPeaks. parameters passed ‘type’ argument chromPeaks. Parameter ‘type’ chromPeaks gets additional option “apex_within” return chromatographic peaks apex within defined rt /m/z range. Add functions rla rowRla calculate RLA (relative log abundances). Add peaksWithMatchedFilter perform peak detection chromatographic (MRM/SRM) data (issues #277 #278). Add peaksWithCentWave perform centWave peak detection chromatographic (MRM/SRM) data (issue #279). Add findChromPeaks,Chromatogram methods CentWaveParam MatchedFilterParam (issue #280).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.1.3","title":"xcms 3.1","text":"Fix misplaced parenthesis check multiple spectra findChromPeaks,OnDiskMSnExp,MSWParam. Thanks @RonanDaly (PR #276). Update link correct metlin page diffreport result (issue #204).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-1-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.1.2","title":"xcms 3.1","text":"Add filterFeatureDefinitions function. Fix #273: better error message case single feature defined groupChromPeaks.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-1-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.1.1","title":"xcms 3.1","text":"Reading raw files using xcmsSet xcmsRaw uses now automatic file type detection feature mzR. c function concatenate XCMSnExp objects. groupnames method XCMSnExp objects (issue #250). Fix #237: findPeaks.MSW throwing error applied multi-spectrum MS file. Fix #249: quantile call adjustRtime PeakGroups without na.rm = TRUE. Fix #259","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.10","title":"xcms 2.99","text":"Fix #230: Failing vignettes Windows.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-1","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.9","title":"xcms 2.99","text":"Chromatographic peak detection uses adjusted retention times aligned XCMSnExp object (issue #213, #208). New parameter msLevel processHistory,XCMSnExp. New parameter keepAdjustedRtime filterMsLevel,XCMSnExp, dropChromPeaks, XCMSnExp dropFeatureDefinitions,XCMSnExp. Add parameter msLevel chromatogram,XCMSnExp method (issue #205). Obiwarp alignment now performed one MS level adjustment applied MS levels (issue #214). Add function plotMsData plot intensity retention time m/z retention time MS slice one sample. Add argument msLevel = 1L extractMsData method (issue #223). New applyAdjustedRtime function consolidate alignment results, .e. replace raw retention times XCMSnExp adjusted retention times. [,XCMSnExp method gains argument keepAdjustedRtime allow keeping adjusted retention times sub-setting. Implement spectrapply,XCMSnExp ensure returned results use adjusted retention times (present). [[,XCMSnExp method returns Spectrum object adjusted retention time, XCMSnExp contains adjusted retention times. Argument ‘sampleGroups’ mandatory ‘PeakDensityParam’ (issue #228). Fix #191: Excessive memory use fillPeaks. Fix #220: peaks matrix missing column “sample” peaks found first sample. Fix #222: findChromPeaks return XCMSnExp object filtered single MS level despite peak detection performed single level. Fix problem plotMsData causing wrong colors used label data points.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-2","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.8","title":"xcms 2.99","text":"Replace xcmsMSn Rnw Rmd vignette fix Windows build errors.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-3","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.7","title":"xcms 2.99","text":"Fix #201: Warnings: ‘readMSData2’ deprecated, thanks L. Gatto. Merge BioC git transition","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-4","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.6","title":"xcms 2.99","text":"calibrate,XCMSnExp method allows calibrate chromatographic peaks. Export phenoDataFromPaths function (issue $195). Add arguments mz rt featureDefinitions method allowing extract features within specified ranges. Increase n density function call group density-based correspondence 2. Replace xcmsDirect.Rnw rmarkdown-based vignette using new user interface. issue #196: removed unnecessary requirement -dimension profile matrices adjustRtime,XCMSnExp,ObiwarpParam. mz range two files aligned differ, expand correctly. Depending profStep mz values/ranges matrices expanded correctly. Potential problems plotChromPeakDensity function.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-5","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.5","title":"xcms 2.99","text":"Re-enable sleep parameter findPeaks.centWave findPeaks.matchedFilter.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-6","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.4","title":"xcms 2.99","text":"Add plotChromPeaks function plot definition (rt mz range) detected chromatographic peaks one file mz-rt plane. Add plotChromPeakImage function plot number detected peaks along retention time axis per file image plot. Move Chromatogram class functionality MSnbase package Add argument msLevel findChromPeaks method allow (chromatographic) peak detection also MS level > 1. Polarity information read mzXML files (issue #192).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-7","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.3","title":"xcms 2.99","text":"issue #188: determine file type file content file ending known.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-8","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.2","title":"xcms 2.99","text":"issue #181: problem isCentroided,Spectrum method returns NA peaks spectrum. Fixed checking cases spectra file. issue #184: add parameter sleep do_groupChromPeaks_density function backwards compatible old group.density code.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-9","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.1","title":"xcms 2.99","text":"extractMsData extract raw MS data data.frame (issue #120). issue #175: error now thrown peak group identified peak group retention time correction. issue #178: scanrange collapsed adjusted range reported (pull request Jan Stanstrup). issue #180: error parameters method smooth provided retcor method.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-10","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.0","title":"xcms 2.99","text":"plotChromatogram highlightChromPeaks functions. plotChromPeakDensity function. clean method Chromatogram classes. Change default ppm parameter chromPeaks method 0. extractChromatograms supports extraction multiple rt mz ranges. New parameter missing extractChromatograms allowing specify intensity value used rts signal available within mz range. extractChromatograms returns Chromatograms length equal number scans within specified rt range, even signals measured (intensity values NA).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-53","dir":"Changelog","previous_headings":"","what":"Changes in version 1.53.1","title":"xcms 1.53","text":"Increase parameter n density call peak density correspondence method. enables separate neighboring peaks using small n (issue #161). Thanks Jan Stanstrup.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.11","title":"xcms 1.51","text":"Parameter “filled” featureValues (issue #157). Parameters “rt” “mz” chromPeaks method allowing extract chromatographic peaks specified ranges (issue #156). Fixed possible memory problem obiwarp (issue #159). Update getPeaks use non-deprecated API (issue #163).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.10","title":"xcms 1.51","text":"filterRt Chromatogram class (issue #142). adjustRtimePeakGroups function (issue #147). adjustRtime,XCMSnExp,PeakGroupsParam do_adjustRtime_peakGroups support use pre-defined matrix perform alignment (issue #153). plotAdjustedRtime visualize alignment results (issue #141). featureDefinitions featureValues return DataFrame matrix rownames corresponding arbitrary feature IDs (issue #148). New peakGroupsMatrix slot PeakGroupsParam class (issue #153). Issue #146: ensure adjusted retention times returned peakGroups method order raw retention times.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.9","title":"xcms 1.51","text":"fillChromPeaks, dropFilledChromPeaks methods FillChromPeaksParam class. featureValues method. Extended new_functionality vignette. Change default backend reading mzML files pwiz. Issue #135: fix peak signal integration centWave. Issue #139: problem expand.mz expand.rt fillPeaks.chrom. Issue #137: Error findChromPeaks peaks found.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.8","title":"xcms 1.51","text":"Add Chromatogram class extractChromatograms method. Issue #118: failing unit test Windows build machine. Issue #133: error c() xcmsSet without peaks. Issue #134: xcmsSet constructor endless loop.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-4","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.7","title":"xcms 1.51","text":"chromatographic peak (chromPeak): peaks identified rt dimension. feature: mz-rt feature, grouped chromatographic peaks within across samples. Issue #127: failing unit test Windows build machine.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-5","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.6","title":"xcms 1.51","text":"groupFeatures adjustRtime methods XCMSnExp objects. New Param classes groupFeatures adjustRtime analysis methods: FeatureDensityParam, MzClustParam, NearestFeaturesParam, FeatureGroupsParam ObiwarpParam. Issue #124 (filterRt,XCMSnExp returned empty object).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-6","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.5","title":"xcms 1.51","text":"MsFeatureData XCMSnExp objects. features, features<-, adjustedRtime, adjustedRtime<-, featureGroups, featureGroups<-, hasAlignedFeatures, hasAdjustedRtime hasDetectedFeatures methods. dropFeatures, dropFeatureGroups dropAdjustedRtime methods. filterMz, filterRt, filterFile etc implemented. mz, intensity rtime methods XCMSnExp allowing return values grouped sample. Issue #99 (rtrange outside retention time range getEIC,xcmsSet). Issue #101 (xcmsRaw function returns NULL mslevel = 1 specified). Issue #102 (centWave returns empty matrix scales OK). Thanks J. Stanstrup. Issue #91 (warning instead error peaks ROI). Thanks J. Stanstrup.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-7","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.4","title":"xcms 1.51","text":"added deepCopy avoid corrupting original object, thanks J. Stanstrup, closes #93","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-8","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.3","title":"xcms 1.51","text":"binYonX binning function. imputeLinInterpol function providing linear interpolation missing values. breaks_on_binSize breaks_on_nBins functions calculate breaks defining bins. New vignette “new_functionality.Rmd” describing new modified functionality xcms. Add do_detectFeatures_matchedFilter function. Add do_detectFeatures_centWave function. Add do_detectFeatures_centWaveWithPredIsoROIs function unit test. Implement new data import function. Add do_detectFeatures_MSW function unit test. Argument stopOnError xcmsSet function allows perform feature detection files without stopping errors. Method showError xcmsSet objects list errors feature detection (stopOnError = FALSE xcmsSet function). [ method subset xcmsRaw objects scans. profMat method extract/create profile matrix /xcmsRaw. Add new detectFeatures methods MSnExp OnDiskMSnExp objects MSnbase package. Add new CentWaveParam, MatchedFilterParam, MassifquantParam, MSWParam CentWavePredIsoParam parameter class perform method dispatch detectFeatures method. retcor.obiwarp uses new binning methods profile matrix generation. scanrange,xcmsRaw reports always scanrange 1 length(object@scantime). scanrange,xcmsSet reports scanrange eventually specified user xcmsSet function. Fixed bug rawMat (issue #58). Fix issue #60: findPeaks.massifquant always returns xcmsPeaks object.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-9","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.2","title":"xcms 1.51","text":"suggested Jan Stanstrup, error centWave ROI contains data, closes #90","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-10","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.1","title":"xcms 1.51","text":"Fix incorrrect indexing getEIC function reported Edmands, closes #92","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.7","title":"xcms 1.49","text":"Fix documentation warnings.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.6","title":"xcms 1.49","text":"Peak Picking function findPeaks.centWaveWithPredictedIsotopeROIs() findPeaks.addPredictedIsotopeFeatures(), allow sensitive detection isotope features.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.5","title":"xcms 1.49","text":"documentation updates. Preparation new binning function","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.4","title":"xcms 1.49","text":"Fix getXcmsRaw prevent retention time correction applied (issue #44 reported Aleksandr).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49-4","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.3","title":"xcms 1.49","text":"updateObject method xcmsSet. xcms uses now BiocParallel parallel processing. parallel processing functions deprecated. Added missing package imports. Fix bug fillPeaksChromPar referencing non-existing variables object. Fix bug group.nearest: variable scoreList mis-spelled (coreList). Remove DUP = FALSE .C calls ignored anyways. Re-organization class, function method definitions R-files. Use roxygen2 manage DESCRIPTION’s collate field.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49-5","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.2","title":"xcms 1.49","text":"Initial support exporint mzTab format. Since Changes still expected, xcms:::writeMzTab() yet exported.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49-6","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.1","title":"xcms 1.49","text":"raw CDF/mzXML/mzData/mzML assumed scans sorted m/z. Instead throwing “m/z sort assumption violated !” error, data re-read -demand sorted m/z.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-47","dir":"Changelog","previous_headings":"","what":"Changes in version 1.47.3","title":"xcms 1.47","text":"Disable parallel processing unit tests causing timeout BioC build machines","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-47-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.47.2","title":"xcms 1.47","text":"Fix problem getEIC xcmsSet objects reported Alan Smith issue #7 add RUnit test case test (test.issue7 runit.getEIC.R). Changed unnecessary warnings messages.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-47-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.47.2","title":"xcms 1.47","text":"Disabled parallel processing unit tests migrate dependencies ncdf -> ncdf4","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.7","title":"xcms 1.45","text":"Disabled Rmpi support usage Windows","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.6","title":"xcms 1.45","text":"J. Rainer implemented [ method allows subset xcmsSet. Fixed problem split.xcmsSet split phenoData properly. Added details documentation xcmsSet-class.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.5","title":"xcms 1.45","text":"sampclass method xcmsSet now return content column “class” data.frame phenoData slot, present, interaction factors (columns) data.frame. sampclass<- method replaces content “class” column phenoData data.frame. data.frame submitted, interaction columns calculated stored “class” column. Fixed bug resulted cryptic error message input files available xcmsSet function.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.4","title":"xcms 1.45","text":"Fixed bug levelplot method xcmsSet.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45-4","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.3","title":"xcms 1.45","text":"xcmsSet now allows phenoData AnnotatedDataFrame. mslevel: store mslevel parameter submitted xcmsRaw. scanrange: store scanrange parameter submitted xcmsRaw. mslevel: stores mslevel argument xcmsSet method. scanrange: keep track scanrange argument xcmsSet method. levelplot: similar image method, plots m/z vs RT color coded intensities. mslevel: returns value .mslevel slot. downstream compatibility, method returns NULL object named slot. profinfo: functionality profinfo method xcmsSet. scanrange: returns value scanrange slot. downstream compatibility, method returns NULL object named slot. getXcmsRaw: returns xcmsRaw object one files xcmsSet, eventually applying retention time correction etc. levelplot: similar image method, plots m/z vs RT color coded intensities. Allows addition highlight identified peaks. mslevel: returns value mslevel slot. downstream compatibility, method returns NULL object named slot. profMethod: functionality profMethod method xcmsRaw. profStep: functionality profStep method xcmsRaw. scanrange: returns value scanrange slot. downstream compatibility, method returns NULL object named slot. show method xcmsSet updated display also informations mslevel scanrange. Elaborated documentation entries. rtrange mzrange xcmsRaw method plotEIC use default full RT m/z range. Added arguments “lty” “add” plotEIC method xcmsRaw. getEIC without specifying mzrange returns ion chromatogram full m/z range (.e. base peak chromatogram). Checking phenoData data.frame AnnotatedDataFrame throw error otherwise. xcmsSet getEIC method water Lock mass corrected files subset files evaluate whether specified files corrected.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45-5","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.2","title":"xcms 1.45","text":"xcms split() function now accepts factors shorter number samples xcmsSet, following closely standard split() behaviour","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45-6","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.1","title":"xcms 1.45","text":"plotrt now allows col vector color definition, plots retcor methods. Added $ method access phenoData columns eSet/ExpressionSet like manner. Allow use “parallel” package parallel processing functions xcmsSet fillPeaks.chrom. Thanks J. Rainer!","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-43","dir":"Changelog","previous_headings":"","what":"Changes in version 1.43.3","title":"xcms 1.43","text":"Give verbose error message file found","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-43-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.43.2","title":"xcms 1.43","text":"Use ProtGenerics, adapted xcms peaks()","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-43-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.43.1","title":"xcms 1.43","text":"function plotQC() plotting various QC plots RT m/z","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-41","dir":"Changelog","previous_headings":"","what":"Changes in version 1.41.1","title":"xcms 1.41","text":"fix sampclass generation phenoData combinations factors don’t exist disable parallel code manpages avoid issues BioC windows build farm machines","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-39","dir":"Changelog","previous_headings":"","what":"Changes in version 1.39.6","title":"xcms 1.39","text":"Massifquant reports maximum intensity isotope trace (peak). useful interactive parameter optimization. Major memory reduction parallel fillPeaks() thanks Jan Stanstrup. Now using environment mirror gvals list item large argList.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-39-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.39.4","title":"xcms 1.39","text":"Fixed write.cdf(), intensity offset +1, added unit test","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-39-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.39.3","title":"xcms 1.39","text":"New R-devel check unload better. Lingering ramp code removed, import mzR. Cleaned errors package check.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-39-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.39.1","title":"xcms 1.39","text":"Updated doubleMatrix c code allow larger profile matrixes Moved inst/doc vignettes","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-37","dir":"Changelog","previous_headings":"","what":"Changes in version 1.37.6","title":"xcms 1.37","text":"Introducing write.mzQuantML(xcmsSet) export peak list grouped matrix PSI format mzQuantML (see http://www.psidev.info/mzquantml) Add Brigham Young University LICENSE file copyright purposes. Add copyright information display running findPeaks.massifquant() within xcmsRaw.R Clean update documentation findPeaks.massifquant-methods.Rd Remove unused parameters findKalmanROIs() within xcmsRaw.R","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-37-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.37.5","title":"xcms 1.37","text":"fixed bug retcor.obiwarp scanrange first sample checked instead center sample","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-37-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.37.4","title":"xcms 1.37","text":"Skip t-test diffreport() one class less 2 samples.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-37-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.37.3","title":"xcms 1.37","text":"fixed bug patternVsRowScore (group.nearest) introduced modifications rev 65169 caused features aligned far outside given m/z retention time windows.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-37-4","dir":"Changelog","previous_headings":"","what":"Changes in version 1.37.1","title":"xcms 1.37","text":"fixed fillPeaks, 1) dropped non-standard columns 2) failed nothing , based patches Tony Larson.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-37-5","dir":"Changelog","previous_headings":"","what":"Changes in version 1.37.1","title":"xcms 1.37","text":"Introducing msn2xcmsRaw, allow findPeaks() MS2 MSn data","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-35","dir":"Changelog","previous_headings":"","what":"Changes in version 1.35.7","title":"xcms 1.35","text":"fixed indexing bug group.nearest, certain circumstances caused peaks first sample ignored (reported Tony Larson)","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-35-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.35.6","title":"xcms 1.35","text":"Obiwarp retention time alignment error-ed scanrange used parameter setting xcmsSet/peak detection method now tries automatically find set scanrange uses range alignment.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-35-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.35.4","title":"xcms 1.35","text":"Introducing parallel fillPeaks Replace snow requirement minimum R version 2.14.0","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-35-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.35.3","title":"xcms 1.35","text":"group.density used low minfrac settings (< 0.5) return feature groups, include features least 50% samples group. limitation removed.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-35-4","dir":"Changelog","previous_headings":"","what":"Changes in version 1.35.2","title":"xcms 1.35","text":"Behind scenes xcms now uses xcmsSource class read raw data. allows e.g. write class pulls raw data e.g. database massifquant: simplified logic structure Tracker::claimDataIdx resolved failure new test case. massifquant: reporting features data structure compatible multiple sample comparison within XCMS.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-35-5","dir":"Changelog","previous_headings":"","what":"Changes in version 1.35.1","title":"xcms 1.35","text":"mzData export now much faster uses less memory","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.16","title":"xcms 1.33","text":"diffreport plotEIC new parameter mzdec, number decimal places m/z values EIC plot title","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.16","title":"xcms 1.33","text":"Lock mass gap filler now works netCDF lock mass function file find exact times scans works newer Waters MS instruments.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.15","title":"xcms 1.33","text":"scanrage now honoured xcmsSet, also parallel mode","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.14","title":"xcms 1.33","text":"scanrage now honoured xcmsRaw, consequently also xcmsSet(matchedFilter), previously ignored.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33-4","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.13","title":"xcms 1.33","text":"write.cdf() fixed write files AMDIS can read","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33-5","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.12","title":"xcms 1.33","text":"write.mzData adds Polarity file available","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33-6","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.11","title":"xcms 1.33","text":"centWave uses new method estimate local noise improves detection closely spaced peaks group.mzClust failing result one peak","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"xcms-132-and-before","dir":"Changelog","previous_headings":"","what":"xcms 1.32 and before","title":"xcms 1.32 and before","text":"details changes May 2012 please see (now discontinued) CHANGELOG source package (inst/ folder).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changed-behaviour-since-version-1-32","dir":"Changelog","previous_headings":"","what":"CHANGED BEHAVIOUR since Version 1.32:","title":"xcms 1.32 and before","text":"Changes since Version 1.32: - improved mzData writing, now includes MSn spectra less verbose. - improved netCDF writing, yet good enough AMDIS","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changed-behaviour-since-version-1-32-1","dir":"Changelog","previous_headings":"","what":"CHANGED BEHAVIOUR since Version 1.14:","title":"xcms 1.32 and before","text":"centWave may report smaller set peaks, due small bug ROI algorithm features mass deviation > ppm retained. Changes since Version 1.14: New method grouping: algorithm inspired mzMine group(method=“nearest”) implemented. slower group(method=“density”). can individually group close-eluting peaks similar mass New method retention time correction: retcor(method=“obiwarp”) algorithm operates raw data, thus allows correct runs without well-behaving peak groups, without peak picking . fillPeaks(method=“MSW”) now also available direct infusion spectra. findPeaks(method=“MSW”) now returns several intensities, correctly reports mzmin mzmax peaks. centWave now uses dynamic memory allocation, needs much less memory, BUF related errors thing past. centWave gains optional argument “noise”, useful data centroided without intensity threshold, centroids intensity < “noise” omitted ROI detection fillPeaks() methods now remember observed, “filled” peak. direct infusion spectra diffreport() now shows raw peak shapes, also indicated “real” “filled” peaks. xcmsRaw can now filter positive/negative spectra, file includes polarities. xcmsSet() can pass polarity contain positive/negative peaks .","code":""}] +[{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Compounding (grouping) of LC-MS features","text":"typical LC-MS-based metabolomics experiment compounds eluting chromatography first ionized measured mass spectrometry (MS). ionization different (multiple) ions can generated compound measured MS. general, resulting data pre-processed identify chromatographic peaks data group across samples correspondence analysis. result distinct LC-MS features, characterized specific m/z retention time range. Different ions generated ionization detected different features. Compounding aims now grouping features presumably representing signal originating compound reduce data set complexity (aid subsequent annotation steps). General MS feature grouping functionality defined MsFeatures package additional functionality implemented xcms package enable compounding LC-MS data. document provides simple compounding workflow using xcms. Note present functionality (yet) aggregate combine actual features per values, define feature groups (one per compound).","code":""},{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"compounding-of-lc-ms-data","dir":"Articles","previous_headings":"","what":"Compounding of LC-MS data","title":"Compounding (grouping) of LC-MS features","text":"demonstrate compounding (feature grouping) functionality simple toy data set used also xcms package provided faahKO package. data set consists samples 4 mice knock-fatty acid amide hydrolase (FAAH) 4 wild type mice. Pre-processing data set described detail main vignette xcms package. load required packages result pre-processing updating also location respective raw data files current machine. performing feature grouping inspect result object. featureDefinitions can extract results correspondence analysis. row data frame represents definition one feature, average range m/z retention time. Column \"peakidx\" provides index chromatographic peak assigned feature chromPeaks matrix result object. featureValues function allows extract feature values, .e. matrix feature abundances, one row per feature columns representing samples present data set. extract feature values without filled-peak data. Without gap-filled data abundances detected chromatographic peaks reported. gap-filled data, samples chromatographic peak feature detected, signal m/z - retention time range defined based detected chromatographic peaks integrated. total 351 features defined present data set, many likely represent signal different ions (adducts isotopes) compound. aim grouping functions now define features likely come original compound. feature grouping functions base following assumptions/properties LC-MS data: Features (ions) compound similar retention time. abundance features (ions) compound similar pattern across samples, .e. compound highly concentrated one sample low another, ions follow pattern. peak shape extracted ion chromatograms (EIC) features compound similar follow elution pattern original compound LC. main method perform feature grouping called groupFeatures takes xcms result object (.e., XcmsExperiment XCMSnExp) input well parameter object chose grouping algorithm specify settings. xcms provides supports following grouping approaches: SimilarRtimeParam: perform initial grouping based similar retention time. AbundanceSimilarityParam: perform feature grouping based correlation feature abundances (values) across samples. EicSimilarityParam: perform feature grouping based correlation EICs. Calling groupFeatures xcms result object perform feature grouping assigning feature data set feature group. feature groups stored additional column called \"feature_group\" featureDefinition data frame result object can accessed featureGroups function. subsequent groupFeature call sub-group (refine) identified feature groups . thus possible use single grouping approach, combine multiple generate desired feature grouping incremental fashion. individual feature grouping algorithms can called order, advisable use EicSimilarityParam last refinement step, computationally expensive, especially applied result object without pre-defined feature groups feature groups large.","code":"library(MSnbase) library(xcms) library(faahKO) library(MsFeatures) xmse <- loadXcmsData(\"xmse\") featureDefinitions(xmse) |> head() ## mzmed mzmin mzmax rtmed rtmin rtmax npeaks KO WT peakidx ## FT001 200.1 200.1 200.1 2902.634 2882.603 2922.664 2 2 0 458, 116.... ## FT002 205.0 205.0 205.0 2789.901 2782.955 2796.531 8 4 4 44, 443,.... ## FT003 206.0 206.0 206.0 2789.405 2781.389 2794.219 7 3 4 29, 430,.... ## FT004 207.1 207.1 207.1 2718.560 2714.047 2727.347 7 4 3 16, 420,.... ## FT005 233.0 233.0 233.1 3023.579 3015.145 3043.959 7 3 4 69, 959,.... ## FT006 241.1 241.1 241.2 3683.299 3661.586 3695.886 8 3 4 276, 284.... ## ms_level ## FT001 1 ## FT002 1 ## FT003 1 ## FT004 1 ## FT005 1 ## FT006 1 head(featureValues(xmse, filled = FALSE)) ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF wt15.CDF wt16.CDF wt21.CDF ## FT001 NA 506848.9 NA 169955.6 NA NA NA ## FT002 1924712.0 1757151.0 1383416.7 1180288.2 2129885.1 1634342.0 1623589.2 ## FT003 213659.3 289500.7 NA 178285.7 253825.6 241844.4 240606.0 ## FT004 349011.5 451863.7 343897.8 208002.8 364609.8 360908.9 NA ## FT005 286221.4 NA 164009.0 149097.6 255697.7 311296.8 366441.5 ## FT006 1160580.5 NA 380970.3 588986.4 1286883.0 1739516.6 639755.3 ## wt22.CDF ## FT001 NA ## FT002 1354004.9 ## FT003 185399.5 ## FT004 221937.5 ## FT005 271128.0 ## FT006 508546.4 head(featureValues(xmse, filled = TRUE)) ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF wt15.CDF wt16.CDF wt21.CDF ## FT001 135162.4 506848.9 111657.3 169955.6 209929.4 141607.9 226853.7 ## FT002 1924712.0 1757151.0 1383416.7 1180288.2 2129885.1 1634342.0 1623589.2 ## FT003 213659.3 289500.7 164380.7 178285.7 253825.6 241844.4 240606.0 ## FT004 349011.5 451863.7 343897.8 208002.8 364609.8 360908.9 226234.4 ## FT005 286221.4 285857.6 164009.0 149097.6 255697.7 311296.8 366441.5 ## FT006 1160580.5 1102832.6 380970.3 588986.4 1286883.0 1739516.6 639755.3 ## wt22.CDF ## FT001 138341.2 ## FT002 1354004.9 ## FT003 185399.5 ## FT004 221937.5 ## FT005 271128.0 ## FT006 508546.4"},{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"grouping-of-features-by-similar-retention-time","dir":"Articles","previous_headings":"Compounding of LC-MS data","what":"Grouping of features by similar retention time","title":"Compounding (grouping) of LC-MS features","text":"intuitive simple way group features based retention time. perform initial grouping evaluate retention times m/z features present data set. Plot retention times m/z features data set. Several features retention time (different m/z) can spotted, especially beginning LC. thus group features within retention time window 10 seconds feature groups. results feature grouping can accessed featureGroups function. determine size feature groups (.e. many features grouped together). addition visualize feature groups plotFeatureGroups function shows features m/z - retention time space grouped features connected line. Feature groups defined rt window 10 seconds Let’s assume don’t agree feature grouping, also knowing quite large shifts retention times runs. thus first remove defined feature groups assigning value NULL re-perform feature grouping using larger rt window. Feature groups defined rt window 20 seconds Grouping similar retention time grouped total 351 features 118 feature groups.","code":"plot(featureDefinitions(xmse)$rtmed, featureDefinitions(xmse)$mzmed, xlab = \"retention time\", ylab = \"m/z\", main = \"features\", col = \"#00000080\", pch = 21, bg = \"#00000040\") grid() xmse <- groupFeatures(xmse, param = SimilarRtimeParam(10)) table(featureGroups(xmse)) ## ## FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 FG.009 FG.010 FG.011 ## 4 6 2 4 6 5 2 4 3 4 3 ## FG.012 FG.013 FG.014 FG.015 FG.016 FG.017 FG.018 FG.019 FG.020 FG.021 FG.022 ## 6 4 2 3 3 3 4 3 2 5 2 ## FG.023 FG.024 FG.025 FG.026 FG.027 FG.028 FG.029 FG.030 FG.031 FG.032 FG.033 ## 2 4 5 2 5 2 3 4 2 2 4 ## FG.034 FG.035 FG.036 FG.037 FG.038 FG.039 FG.040 FG.041 FG.042 FG.043 FG.044 ## 2 2 6 3 2 2 4 2 2 4 4 ## FG.045 FG.046 FG.047 FG.048 FG.049 FG.050 FG.051 FG.052 FG.053 FG.054 FG.055 ## 2 3 2 3 3 5 2 3 4 2 6 ## FG.056 FG.057 FG.058 FG.059 FG.060 FG.061 FG.062 FG.063 FG.064 FG.065 FG.066 ## 2 6 4 2 4 3 3 2 2 2 2 ## FG.067 FG.068 FG.069 FG.070 FG.071 FG.072 FG.073 FG.074 FG.075 FG.076 FG.077 ## 3 2 2 3 2 3 2 3 3 3 3 ## FG.078 FG.079 FG.080 FG.081 FG.082 FG.083 FG.084 FG.085 FG.086 FG.087 FG.088 ## 2 3 3 3 2 3 3 3 3 3 2 ## FG.089 FG.090 FG.091 FG.092 FG.093 FG.094 FG.095 FG.096 FG.097 FG.098 FG.099 ## 3 2 2 2 2 3 2 4 2 3 3 ## FG.100 FG.101 FG.102 FG.103 FG.104 FG.105 FG.106 FG.107 FG.108 FG.109 FG.110 ## 3 3 2 2 2 2 2 2 2 2 2 ## FG.111 FG.112 FG.113 FG.114 FG.115 FG.116 FG.117 FG.118 FG.119 FG.120 FG.121 ## 2 2 1 1 1 1 1 1 1 1 1 ## FG.122 FG.123 FG.124 FG.125 FG.126 FG.127 FG.128 FG.129 FG.130 FG.131 FG.132 ## 1 1 1 1 1 1 1 1 1 1 1 ## FG.133 ## 1 plotFeatureGroups(xmse, pch = 21, lwd = 2, col = \"#00000040\", bg = \"#00000020\") grid() ## Remove previous feature grouping results to repeat the rtime-based ## feature grouping with different setting featureDefinitions(xmse)$feature_group <- NULL ## Repeat the grouping xmse <- groupFeatures(xmse, SimilarRtimeParam(20)) table(featureGroups(xmse)) ## ## FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 FG.009 FG.010 FG.011 ## 4 6 2 4 6 5 2 4 3 4 3 ## FG.012 FG.013 FG.014 FG.015 FG.016 FG.017 FG.018 FG.019 FG.020 FG.021 FG.022 ## 6 4 2 3 3 3 4 3 2 5 2 ## FG.023 FG.024 FG.025 FG.026 FG.027 FG.028 FG.029 FG.030 FG.031 FG.032 FG.033 ## 2 4 6 3 5 2 3 4 2 2 4 ## FG.034 FG.035 FG.036 FG.037 FG.038 FG.039 FG.040 FG.041 FG.042 FG.043 FG.044 ## 2 2 6 3 2 2 4 2 2 4 5 ## FG.045 FG.046 FG.047 FG.048 FG.049 FG.050 FG.051 FG.052 FG.053 FG.054 FG.055 ## 2 3 2 3 4 5 2 4 4 2 6 ## FG.056 FG.057 FG.058 FG.059 FG.060 FG.061 FG.062 FG.063 FG.064 FG.065 FG.066 ## 2 6 4 2 5 3 3 2 2 2 2 ## FG.067 FG.068 FG.069 FG.070 FG.071 FG.072 FG.073 FG.074 FG.075 FG.076 FG.077 ## 4 2 2 3 2 3 2 4 3 3 3 ## FG.078 FG.079 FG.080 FG.081 FG.082 FG.083 FG.084 FG.085 FG.086 FG.087 FG.088 ## 2 3 3 3 2 3 3 4 3 4 2 ## FG.089 FG.090 FG.091 FG.092 FG.093 FG.094 FG.095 FG.096 FG.097 FG.098 FG.099 ## 3 2 2 2 2 3 3 4 2 3 4 ## FG.100 FG.101 FG.102 FG.103 FG.104 FG.105 FG.106 FG.107 FG.108 FG.109 FG.110 ## 3 3 3 2 2 3 2 3 2 2 2 ## FG.111 FG.112 FG.113 FG.114 FG.115 FG.116 FG.117 FG.118 ## 2 2 1 1 1 1 1 1 plotFeatureGroups(xmse, pch = 21, lwd = 2, col = \"#00000040\", bg = \"#00000020\") grid()"},{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"grouping-of-features-by-abundance-correlation-across-samples","dir":"Articles","previous_headings":"Compounding of LC-MS data","what":"Grouping of features by abundance correlation across samples","title":"Compounding (grouping) of LC-MS features","text":"Assuming OK crude initial feature grouping previous section, can next refine feature groups considering also feature abundances across samples. can use groupFeatures method AbundanceSimilarityParam object. approach performs pairwise correlation (non-missing) feature values (abundances; across samples) features predefined feature group (defined previous section). Features correlation >= threshold grouped together. Feature grouping based approach works best features higher variability concentration across samples. Parameter subset allows restrict analysis subset samples allows thus e.g. exclude QC sample pools correlation artificially increase correlation. parameters passed directly internal featureValues call extracts feature values correlation performed. performing grouping also evaluate correlation features based (log2 transformed) abundances across samples heatmap. Correlation features based feature abundances. large correlations can observed several groups features, many within feature group defined previous section (.e. eluting time). might thus represent correlated metabolites, ions adducts metabolite. use groupFeatures AbundanceSimilarityParam group features correlation coefficient higher 0.7 including detected filled-signal. Whether filled-detected signal used correlation analysis evaluated data set data set. specifying transform = log2 tell function log2 transform abundance prior correlation analysis. See help page groupFeatures AbundanceSimilarityParam xcms package details options. Many larger retention time-based feature groups splitted two sub-groups based correlation feature abundances (e.g. feature group FG.004 split feature groups FG.004.001, FG.004.002 FG.004.003). evaluate refinement feature group \"FG.040\" plotting pairwise correlation. better visualize feature grouping addition define custom panel plot pairs function plots data points blue features correlation coefficient selected threshold (0.7) red otherwise. Pairwise correlation plot features initially grouped feature group FG.040. Indeed, correlation seems present features retention time feature group, e.g. clearly FT273 FT274 also FT143 FT273. Note however abundance correlation suffers relatively samples (8 total), relatively small variance abundances across samples. feature grouping abundance correlation, 351 features grouped 249 feature groups.","code":"library(pheatmap) fvals <- log2(featureValues(xmse, filled = TRUE)) cormat <- cor(t(fvals), use = \"pairwise.complete.obs\") ann <- data.frame(fgroup = featureGroups(xmse)) rownames(ann) <- rownames(cormat) res <- pheatmap(cormat, annotation_row = ann, cluster_rows = TRUE, cluster_cols = TRUE) xmse <- groupFeatures( xmse, AbundanceSimilarityParam(threshold = 0.7, transform = log2), filled = TRUE) table(featureGroups(xmse)) ## ## FG.001.001 FG.001.002 FG.002.001 FG.002.002 FG.002.003 FG.002.004 FG.003.001 ## 3 1 2 2 1 1 1 ## FG.003.002 FG.004.001 FG.004.002 FG.004.003 FG.005.001 FG.005.002 FG.005.003 ## 1 2 1 1 3 2 1 ## FG.006.001 FG.006.002 FG.007.001 FG.008.001 FG.008.002 FG.008.003 FG.008.004 ## 4 1 2 1 1 1 1 ## FG.009.001 FG.010.001 FG.010.002 FG.011.001 FG.011.002 FG.012.001 FG.012.002 ## 3 3 1 2 1 3 2 ## FG.012.003 FG.013.001 FG.013.002 FG.014.001 FG.015.001 FG.015.002 FG.015.003 ## 1 3 1 2 1 1 1 ## FG.016.001 FG.016.002 FG.016.003 FG.017.001 FG.017.002 FG.018.001 FG.018.002 ## 1 1 1 2 1 2 2 ## FG.019.001 FG.019.002 FG.019.003 FG.020.001 FG.020.002 FG.021.001 FG.021.002 ## 1 1 1 1 1 1 1 ## FG.021.003 FG.021.004 FG.021.005 FG.022.001 FG.022.002 FG.023.001 FG.024.001 ## 1 1 1 1 1 2 2 ## FG.024.002 FG.025.001 FG.025.002 FG.025.003 FG.026.001 FG.026.002 FG.027.001 ## 2 4 1 1 2 1 2 ## FG.027.002 FG.027.003 FG.027.004 FG.028.001 FG.028.002 FG.029.001 FG.029.002 ## 1 1 1 1 1 1 1 ## FG.029.003 FG.030.001 FG.030.002 FG.031.001 FG.032.001 FG.032.002 FG.033.001 ## 1 3 1 2 1 1 2 ## FG.033.002 FG.033.003 FG.034.001 FG.034.002 FG.035.001 FG.036.001 FG.036.002 ## 1 1 1 1 2 3 1 ## FG.036.003 FG.036.004 FG.037.001 FG.038.001 FG.038.002 FG.039.001 FG.039.002 ## 1 1 3 1 1 1 1 ## FG.040.001 FG.040.002 FG.040.003 FG.040.004 FG.041.001 FG.041.002 FG.042.001 ## 1 1 1 1 1 1 1 ## FG.042.002 FG.043.001 FG.043.002 FG.044.001 FG.044.002 FG.045.001 FG.046.001 ## 1 3 1 3 2 2 1 ## FG.046.002 FG.046.003 FG.047.001 FG.047.002 FG.048.001 FG.048.002 FG.049.001 ## 1 1 1 1 2 1 1 ## FG.049.002 FG.049.003 FG.049.004 FG.050.001 FG.050.002 FG.051.001 FG.051.002 ## 1 1 1 4 1 1 1 ## FG.052.001 FG.052.002 FG.052.003 FG.052.004 FG.053.001 FG.053.002 FG.054.001 ## 1 1 1 1 2 2 1 ## FG.054.002 FG.055.001 FG.056.001 FG.057.001 FG.057.002 FG.057.003 FG.057.004 ## 1 6 2 2 1 1 1 ## FG.057.005 FG.058.001 FG.058.002 FG.058.003 FG.058.004 FG.059.001 FG.060.001 ## 1 1 1 1 1 2 2 ## FG.060.002 FG.060.003 FG.061.001 FG.061.002 FG.062.001 FG.062.002 FG.063.001 ## 2 1 2 1 2 1 1 ## FG.063.002 FG.064.001 FG.065.001 FG.065.002 FG.066.001 FG.067.001 FG.067.002 ## 1 2 1 1 2 3 1 ## FG.068.001 FG.068.002 FG.069.001 FG.070.001 FG.070.002 FG.071.001 FG.071.002 ## 1 1 2 2 1 1 1 ## FG.072.001 FG.072.002 FG.072.003 FG.073.001 FG.073.002 FG.074.001 FG.074.002 ## 1 1 1 1 1 2 1 ## FG.074.003 FG.075.001 FG.075.002 FG.075.003 FG.076.001 FG.076.002 FG.076.003 ## 1 1 1 1 1 1 1 ## FG.077.001 FG.077.002 FG.078.001 FG.079.001 FG.079.002 FG.079.003 FG.080.001 ## 2 1 2 1 1 1 2 ## FG.080.002 FG.081.001 FG.081.002 FG.082.001 FG.082.002 FG.083.001 FG.083.002 ## 1 2 1 1 1 1 1 ## FG.083.003 FG.084.001 FG.084.002 FG.084.003 FG.085.001 FG.085.002 FG.086.001 ## 1 1 1 1 3 1 2 ## FG.086.002 FG.087.001 FG.087.002 FG.088.001 FG.088.002 FG.089.001 FG.089.002 ## 1 2 2 1 1 2 1 ## FG.090.001 FG.090.002 FG.091.001 FG.092.001 FG.093.001 FG.094.001 FG.094.002 ## 1 1 2 2 2 2 1 ## FG.095.001 FG.096.001 FG.096.002 FG.097.001 FG.097.002 FG.098.001 FG.098.002 ## 3 3 1 1 1 1 1 ## FG.098.003 FG.099.001 FG.099.002 FG.099.003 FG.100.001 FG.100.002 FG.101.001 ## 1 2 1 1 2 1 3 ## FG.102.001 FG.102.002 FG.102.003 FG.103.001 FG.104.001 FG.104.002 FG.105.001 ## 1 1 1 2 1 1 2 ## FG.105.002 FG.106.001 FG.107.001 FG.107.002 FG.108.001 FG.108.002 FG.109.001 ## 1 2 2 1 1 1 1 ## FG.109.002 FG.110.001 FG.111.001 FG.112.001 FG.112.002 FG.113.001 FG.114.001 ## 1 2 2 1 1 1 1 ## FG.115.001 FG.116.001 FG.117.001 FG.118.001 ## 1 1 1 1 cor_plot <- function(x, y) { C <- cor(x, y, use = \"pairwise.complete.obs\") col <- ifelse(C >= 0.7, yes = \"#0000ff80\", no = \"#ff000080\") points(x, y, pch = 16, col = col) grid() } fts <- grep(\"FG.040\", featureGroups(xmse)) pairs(t(fvals[fts, ]), gap = 0.1, main = \"FG.040\", panel = cor_plot)"},{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"grouping-of-features-by-similarity-of-their-eics","dir":"Articles","previous_headings":"Compounding of LC-MS data","what":"Grouping of features by similarity of their EICs","title":"Compounding (grouping) of LC-MS features","text":"chromatographic peak shape ion compound highly similar elution pattern compound. Thus, features compound assumed similar peak shapes EICs within sample. grouping features based similarity EICs can performed groupFeatures EicSimilarityParam object. advisable perform peak shape correlation subset samples (peak shape correlation computationally intense chromatographic peaks low intensity features notoriously noisy). EicSimilarityParam approach allows select number top n samples (ordered total intensity feature abundances per feature group) correlation performed parameter n. n =3, 3 samples highest signal features respective feature group first identified pairwise similarity calculation performed EICs samples. resulting similarity score 3 samples aggregated single score taking 75% quantile across 3 samples. value subsequently compared cut-similarity (parameter threshold) features score >= threshold grouped feature group. group features based similarity EICs two samples highest total signal respective feature groups. default, Pearson correlation coefficient used similarity score similarity/distance metric function used instead (parameter FUN EicSimilarityParam - see respective help page ?EicSimilarityParam details options). define threshold correlation coefficient 0.7. computationally intense approach since involves also loading raw MS data extract ion chromatograms feature. results grouping shown . many cases, pre-defined feature groups (retention time similarity abundance correlation) subdivided. evaluate feature groups, starting FG.008.001 split two different feature groups based EIC correlation. first extract EICs features initial feature group. n = 1 specify extract EIC sample highest intensity. Next plot EICs using different color subgroups. peakType = \"none\" disable highlighting detected chromatographic peaks. Feature EICs per sample features feature group defined rentention time feature abudances across samples. Features high correlation EICs shown color. Feature EICs per sample normalized absolute intensity 1 features feature group defined rentention time feature abudances across samples. Features high correlation EICs shown color. One features (highlighted red plots ) within original feature group separated two low similarity EICs. fact, feature’s EIC shifted samples along retention time dimension can thus represent signal compound. evaluate next sub-grouping another feature group. Next plot EICs using different color subgroups. Feature EICs per sample features feature group defined rentention time feature abudances across samples. Features high correlation EICs shown color. Feature EICs per sample normalized absolute intensity 1 features feature group defined rentention time feature abudances across samples. Features high correlation EICs shown color. Based EIC correlation, initial feature group FG.045.001 grouped two separate sub-groups. grouping based EIC correlation pre-defined feature groups previous sections grouped 351 features 267 feature groups.","code":"xmse <- groupFeatures(xmse, EicSimilarityParam(threshold = 0.7, n = 2)) table(featureGroups(xmse)) ## ## FG.001.001.001 FG.001.002.001 FG.002.001.001 FG.002.002.001 FG.002.003.001 ## 3 1 2 2 1 ## FG.002.004.001 FG.003.001.001 FG.003.002.001 FG.004.001.001 FG.004.002.001 ## 1 1 1 2 1 ## FG.004.003.001 FG.005.001.001 FG.005.002.001 FG.005.003.001 FG.006.001.001 ## 1 3 2 1 4 ## FG.006.002.001 FG.007.001.001 FG.007.001.002 FG.008.001.001 FG.008.002.001 ## 1 1 1 1 1 ## FG.008.003.001 FG.008.004.001 FG.009.001.001 FG.010.001.001 FG.010.002.001 ## 1 1 3 3 1 ## FG.011.001.001 FG.011.002.001 FG.012.001.001 FG.012.002.001 FG.012.003.001 ## 2 1 3 2 1 ## FG.013.001.001 FG.013.002.001 FG.014.001.001 FG.015.001.001 FG.015.002.001 ## 3 1 2 1 1 ## FG.015.003.001 FG.016.001.001 FG.016.002.001 FG.016.003.001 FG.017.001.001 ## 1 1 1 1 2 ## FG.017.002.001 FG.018.001.001 FG.018.002.001 FG.019.001.001 FG.019.002.001 ## 1 2 2 1 1 ## FG.019.003.001 FG.020.001.001 FG.020.002.001 FG.021.001.001 FG.021.002.001 ## 1 1 1 1 1 ## FG.021.003.001 FG.021.004.001 FG.021.005.001 FG.022.001.001 FG.022.002.001 ## 1 1 1 1 1 ## FG.023.001.001 FG.024.001.001 FG.024.001.002 FG.024.002.001 FG.025.001.001 ## 2 1 1 2 4 ## FG.025.002.001 FG.025.003.001 FG.026.001.001 FG.026.001.002 FG.026.002.001 ## 1 1 1 1 1 ## FG.027.001.001 FG.027.002.001 FG.027.003.001 FG.027.004.001 FG.028.001.001 ## 2 1 1 1 1 ## FG.028.002.001 FG.029.001.001 FG.029.002.001 FG.029.003.001 FG.030.001.001 ## 1 1 1 1 2 ## FG.030.001.002 FG.030.002.001 FG.031.001.001 FG.032.001.001 FG.032.002.001 ## 1 1 2 1 1 ## FG.033.001.001 FG.033.002.001 FG.033.003.001 FG.034.001.001 FG.034.002.001 ## 2 1 1 1 1 ## FG.035.001.001 FG.036.001.001 FG.036.001.002 FG.036.002.001 FG.036.003.001 ## 2 2 1 1 1 ## FG.036.004.001 FG.037.001.001 FG.037.001.002 FG.038.001.001 FG.038.002.001 ## 1 2 1 1 1 ## FG.039.001.001 FG.039.002.001 FG.040.001.001 FG.040.002.001 FG.040.003.001 ## 1 1 1 1 1 ## FG.040.004.001 FG.041.001.001 FG.041.002.001 FG.042.001.001 FG.042.002.001 ## 1 1 1 1 1 ## FG.043.001.001 FG.043.002.001 FG.044.001.001 FG.044.001.002 FG.044.002.001 ## 3 1 2 1 1 ## FG.044.002.002 FG.045.001.001 FG.046.001.001 FG.046.002.001 FG.046.003.001 ## 1 2 1 1 1 ## FG.047.001.001 FG.047.002.001 FG.048.001.001 FG.048.002.001 FG.049.001.001 ## 1 1 2 1 1 ## FG.049.002.001 FG.049.003.001 FG.049.004.001 FG.050.001.001 FG.050.001.002 ## 1 1 1 3 1 ## FG.050.002.001 FG.051.001.001 FG.051.002.001 FG.052.001.001 FG.052.002.001 ## 1 1 1 1 1 ## FG.052.003.001 FG.052.004.001 FG.053.001.001 FG.053.002.001 FG.054.001.001 ## 1 1 2 2 1 ## FG.054.002.001 FG.055.001.001 FG.056.001.001 FG.056.001.002 FG.057.001.001 ## 1 6 1 1 2 ## FG.057.002.001 FG.057.003.001 FG.057.004.001 FG.057.005.001 FG.058.001.001 ## 1 1 1 1 1 ## FG.058.002.001 FG.058.003.001 FG.058.004.001 FG.059.001.001 FG.060.001.001 ## 1 1 1 2 2 ## FG.060.002.001 FG.060.003.001 FG.061.001.001 FG.061.002.001 FG.062.001.001 ## 2 1 2 1 2 ## FG.062.002.001 FG.063.001.001 FG.063.002.001 FG.064.001.001 FG.065.001.001 ## 1 1 1 2 1 ## FG.065.002.001 FG.066.001.001 FG.067.001.001 FG.067.002.001 FG.068.001.001 ## 1 2 3 1 1 ## FG.068.002.001 FG.069.001.001 FG.070.001.001 FG.070.002.001 FG.071.001.001 ## 1 2 2 1 1 ## FG.071.002.001 FG.072.001.001 FG.072.002.001 FG.072.003.001 FG.073.001.001 ## 1 1 1 1 1 ## FG.073.002.001 FG.074.001.001 FG.074.002.001 FG.074.003.001 FG.075.001.001 ## 1 2 1 1 1 ## FG.075.002.001 FG.075.003.001 FG.076.001.001 FG.076.002.001 FG.076.003.001 ## 1 1 1 1 1 ## FG.077.001.001 FG.077.002.001 FG.078.001.001 FG.079.001.001 FG.079.002.001 ## 2 1 2 1 1 ## FG.079.003.001 FG.080.001.001 FG.080.002.001 FG.081.001.001 FG.081.002.001 ## 1 2 1 2 1 ## FG.082.001.001 FG.082.002.001 FG.083.001.001 FG.083.002.001 FG.083.003.001 ## 1 1 1 1 1 ## FG.084.001.001 FG.084.002.001 FG.084.003.001 FG.085.001.001 FG.085.001.002 ## 1 1 1 1 1 ## FG.085.001.003 FG.085.002.001 FG.086.001.001 FG.086.001.002 FG.086.002.001 ## 1 1 1 1 1 ## FG.087.001.001 FG.087.002.001 FG.087.002.002 FG.088.001.001 FG.088.002.001 ## 2 1 1 1 1 ## FG.089.001.001 FG.089.002.001 FG.090.001.001 FG.090.002.001 FG.091.001.001 ## 2 1 1 1 2 ## FG.092.001.001 FG.093.001.001 FG.093.001.002 FG.094.001.001 FG.094.002.001 ## 2 1 1 2 1 ## FG.095.001.001 FG.095.001.002 FG.096.001.001 FG.096.002.001 FG.097.001.001 ## 2 1 3 1 1 ## FG.097.002.001 FG.098.001.001 FG.098.002.001 FG.098.003.001 FG.099.001.001 ## 1 1 1 1 2 ## FG.099.002.001 FG.099.003.001 FG.100.001.001 FG.100.002.001 FG.101.001.001 ## 1 1 2 1 2 ## FG.101.001.002 FG.102.001.001 FG.102.002.001 FG.102.003.001 FG.103.001.001 ## 1 1 1 1 2 ## FG.104.001.001 FG.104.002.001 FG.105.001.001 FG.105.002.001 FG.106.001.001 ## 1 1 2 1 2 ## FG.107.001.001 FG.107.001.002 FG.107.002.001 FG.108.001.001 FG.108.002.001 ## 1 1 1 1 1 ## FG.109.001.001 FG.109.002.001 FG.110.001.001 FG.111.001.001 FG.112.001.001 ## 1 1 2 2 1 ## FG.112.002.001 FG.113.001.001 FG.114.001.001 FG.115.001.001 FG.116.001.001 ## 1 1 1 1 1 ## FG.117.001.001 FG.118.001.001 ## 1 1 fidx <- grep(\"FG.013.001.\", featureGroups(xmse)) eics <- featureChromatograms( xmse, features = rownames(featureDefinitions(xmse))[fidx], filled = TRUE, n = 1) cols <- c(\"#ff000080\", \"#0000ff80\") names(cols) <- unique(featureGroups(xmse)[fidx]) plotChromatogramsOverlay(eics, col = cols[featureGroups(xmse)[fidx]], lwd = 2, peakType = \"none\") plotChromatogramsOverlay(normalize(eics), col = cols[featureGroups(xmse)[fidx]], lwd = 2, peakType = \"none\") fidx <- grep(\"FG.045.001.\", featureGroups(xmse)) eics <- featureChromatograms( xmse, features = rownames(featureDefinitions(xmse))[fidx], filled = TRUE, n = 1) cols <- c(\"#ff000080\", \"#0000ff80\") names(cols) <- unique(featureGroups(xmse)[fidx]) plotChromatogramsOverlay(eics, col = cols[featureGroups(xmse)[fidx]], lwd = 2, peakType = \"none\") plotChromatogramsOverlay(normalize(eics), col = cols[featureGroups(xmse)[fidx]], lwd = 2, peakType = \"none\")"},{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"grouping-of-subsets-of-features","dir":"Articles","previous_headings":"Compounding of LC-MS data","what":"Grouping of subsets of features","title":"Compounding (grouping) of LC-MS features","text":"previous sections always considering features data set, sometimes desirable just group pre-defined set features, example features found particular interest certain experiment (e.g. significant features). can easily achieved assigning features interest initial feature group, using NA group ID features. illustrate reset feature groups setting NA assign features interest (example just 30 randomly selected features) initial feature group \"FG\". call groupFeatures now simply sub-group set 30 features. feature NA \"feature_group\" column ignored.","code":"featureDefinitions(xmse)$feature_group <- NA_character_ set.seed(123) fts_idx <- sample(1:nrow(featureDefinitions(xmse)), 30) featureDefinitions(xmse)$feature_group[fts_idx] <- \"FG\" xmse <- groupFeatures(xmse, SimilarRtimeParam(diffRt = 20)) xmse <- groupFeatures(xmse, AbundanceSimilarityParam(threshold = 0.7)) table(featureGroups(xmse)) ## ## FG.001.001 FG.001.002 FG.002.001 FG.002.002 FG.003.001 FG.003.002 FG.004.001 ## 1 1 1 1 1 1 1 ## FG.004.002 FG.005.001 FG.006.001 FG.006.002 FG.006.003 FG.007.001 FG.007.002 ## 1 2 1 1 1 2 1 ## FG.008.001 FG.009.001 FG.010.001 FG.011.001 FG.012.001 FG.013.001 FG.014.001 ## 1 1 1 1 1 1 1 ## FG.015.001 FG.016.001 FG.017.001 FG.018.001 FG.019.001 FG.020.001 FG.021.001 ## 1 1 1 1 1 1 1"},{"path":"https://sneumann.github.io/xcms/articles/LC-MS-feature-grouping.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"Compounding (grouping) of LC-MS features","text":"","code":"sessionInfo() ## R Under development (unstable) (2024-03-28 r86224) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.4 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] pheatmap_1.0.12 faahKO_1.43.0 MSnbase_2.29.4 ## [4] ProtGenerics_1.35.4 S4Vectors_0.41.5 mzR_2.37.3 ## [7] Rcpp_1.0.12 Biobase_2.63.1 BiocGenerics_0.49.1 ## [10] MsFeatures_1.11.0 xcms_4.1.12 BiocParallel_1.37.1 ## [13] BiocStyle_2.31.0 ## ## loaded via a namespace (and not attached): ## [1] DBI_1.2.2 rlang_1.1.3 ## [3] magrittr_2.0.3 clue_0.3-65 ## [5] MassSpecWavelet_1.69.0 matrixStats_1.2.0 ## [7] compiler_4.5.0 systemfonts_1.0.6 ## [9] vctrs_0.6.5 MetaboCoreUtils_1.11.2 ## [11] pkgconfig_2.0.3 crayon_1.5.2 ## [13] fastmap_1.1.1 XVector_0.43.1 ## [15] utf8_1.2.4 rmarkdown_2.26 ## [17] preprocessCore_1.65.0 ragg_1.3.0 ## [19] purrr_1.0.2 xfun_0.43 ## [21] MultiAssayExperiment_1.29.1 zlibbioc_1.49.3 ## [23] cachem_1.0.8 GenomeInfoDb_1.39.10 ## [25] jsonlite_1.8.8 progress_1.2.3 ## [27] highr_0.10 DelayedArray_0.29.9 ## [29] prettyunits_1.2.0 parallel_4.5.0 ## [31] cluster_2.1.6 R6_2.5.1 ## [33] bslib_0.7.0 RColorBrewer_1.1-3 ## [35] limma_3.59.6 GenomicRanges_1.55.4 ## [37] jquerylib_0.1.4 bookdown_0.38 ## [39] SummarizedExperiment_1.33.3 iterators_1.0.14 ## [41] knitr_1.45 IRanges_2.37.1 ## [43] Matrix_1.7-0 igraph_2.0.3 ## [45] tidyselect_1.2.1 abind_1.4-5 ## [47] yaml_2.3.8 doParallel_1.0.17 ## [49] codetools_0.2-20 affy_1.81.0 ## [51] lattice_0.22-6 tibble_3.2.1 ## [53] plyr_1.8.9 evaluate_0.23 ## [55] desc_1.4.3 Spectra_1.13.8 ## [57] pillar_1.9.0 affyio_1.73.0 ## [59] BiocManager_1.30.22 MatrixGenerics_1.15.0 ## [61] foreach_1.5.2 MALDIquant_1.22.2 ## [63] ncdf4_1.22 generics_0.1.3 ## [65] hms_1.1.3 ggplot2_3.5.0 ## [67] munsell_0.5.1 scales_1.3.0 ## [69] MsExperiment_1.5.4 glue_1.7.0 ## [71] lazyeval_0.2.2 tools_4.5.0 ## [73] mzID_1.41.0 QFeatures_1.13.3 ## [75] vsn_3.71.1 fs_1.6.3 ## [77] XML_3.99-0.16.1 grid_4.5.0 ## [79] impute_1.77.0 MsCoreUtils_1.15.6 ## [81] colorspace_2.1-0 GenomeInfoDbData_1.2.12 ## [83] PSMatch_1.7.2 cli_3.6.2 ## [85] textshaping_0.3.7 fansi_1.0.6 ## [87] S4Arrays_1.3.6 dplyr_1.1.4 ## [89] AnnotationFilter_1.27.0 pcaMethods_1.95.0 ## [91] gtable_0.3.4 sass_0.4.9 ## [93] digest_0.6.35 SparseArray_1.3.4 ## [95] farver_2.1.1 htmlwidgets_1.6.4 ## [97] memoise_2.0.1 htmltools_0.5.8 ## [99] pkgdown_2.0.7.9000 lifecycle_1.0.4 ## [101] statmod_1.5.0 MASS_7.3-60.2"},{"path":[]},{"path":"https://sneumann.github.io/xcms/articles/xcms-direct-injection.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Grouping FTICR-MS data with xcms","text":"document describes use xcms analysis direct injection mass spec data, including peak detection, calibration correspondence (grouping peaks across samples).","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms-direct-injection.html","id":"peak-detection","dir":"Articles","previous_headings":"","what":"Peak detection","title":"Grouping FTICR-MS data with xcms","text":"Prior analysis step, peaks identified mass spec data. contrast typical metabolomics workflow, peaks identified chromatographic (time) dimension, direct injection mass spec data sets peaks identified m/z dimension. xcms uses functionality MassSpecWavelet package identify peaks. load required packages. information parallel processing setup please see BiocParallel vignette. documentation use example data set msdata package. Assuming msdata installed, locate path package load data set. create also data.frame describing experimental setup based file names. data files direct injection mass spectrometry experiments, .e. single spectrum available sample retention times. Peaks identified within spectrum using mass spec wavelet method.","code":"library(MSnbase) library(xcms) library(MassSpecWavelet) register(SerialParam()) mzML_path <- system.file(\"fticr-mzML\", package = \"msdata\") mzML_files <- list.files(mzML_path, recursive = TRUE, full.names = TRUE) ## We're subsetting to 2 samples per condition mzML_files <- mzML_files[c(1, 2, 6, 7)] ## Create a data.frame assigning samples to sample groups, i.e. ham4 and ham5. grp <- rep(\"ham4\", length(mzML_files)) grp[grep(basename(mzML_files), pattern = \"^HAM005\")] <- \"ham5\" pd <- data.frame(filename = basename(mzML_files), sample_group = grp) ## Load the data. ham_raw <- readMSData(files = mzML_files, pdata = new(\"NAnnotatedDataFrame\", pd), mode = \"onDisk\") ## Only a single spectrum with an *artificial* retention time is available ## for each sample rtime(ham_raw) ## F1.S1 F2.S1 F3.S1 F4.S1 ## -1 -1 -1 -1 ## Define the parameters for the peak detection msw <- MSWParam(scales = c(1, 4, 9), nearbyPeak = TRUE, winSize.noise = 500, SNR.method = \"data.mean\", snthresh = 10) ham_prep <- findChromPeaks(ham_raw, param = msw) head(chromPeaks(ham_prep)) ## mz mzmin mzmax rt rtmin rtmax into maxo sn intf ## CP01 403.2367 403.2279 403.2447 -1 -1 -1 4735258 372259.4 22.97534 NA ## CP02 409.1845 409.1747 409.1936 -1 -1 -1 4158404 310572.1 20.61382 NA ## CP03 413.2677 413.2585 413.2769 -1 -1 -1 6099006 435462.6 27.21723 NA ## CP04 423.2363 423.2266 423.2459 -1 -1 -1 2708391 174252.7 14.74527 NA ## CP05 427.2681 427.2574 427.2779 -1 -1 -1 6302089 461385.6 32.50050 NA ## CP06 437.2375 437.2254 437.2488 -1 -1 -1 7523070 517917.6 34.37645 NA ## maxf sample ## CP01 814693.1 1 ## CP02 732119.9 1 ## CP03 1018994.8 1 ## CP04 435858.5 1 ## CP05 1125644.3 1 ## CP06 1282906.5 1"},{"path":"https://sneumann.github.io/xcms/articles/xcms-direct-injection.html","id":"calibration","dir":"Articles","previous_headings":"","what":"Calibration","title":"Grouping FTICR-MS data with xcms","text":"calibrate method can used correct m/z values identified peaks. currently implemented method requires identified peaks list m/z values known calibrants. identified peaks m/z values adjusted based differences calibrants’ m/z values m/z values closest peaks (within user defined permitted maximal distance). Note method presently calibrate identified peaks, original m/z values spectra. demonstrate calibrate method one data files artificially defined calibration m/z values. first subset data set first data file, extract m/z values 3 peaks modify values slightly. Next calibrate data set using previously defined artificial calibrants. using \"edgeshift\" method calibration adjusts peaks within range m/z values calibrants using linear interpolation shifts chromatographic peaks outside range constant factor (difference lowest respectively largest calibrant m/z closest peak’s m/z). Note real use case, m/z values obviously represent known m/z calibrants defined actual data. evaluate calibration plot difference adjusted raw m/z values (y-axis) raw m/z values.","code":"## Subset to the first file. first_file <- filterFile(ham_prep, file = 1) ## Extract 3 m/z values calib_mz <- chromPeaks(first_file)[c(1, 4, 7), \"mz\"] calib_mz <- calib_mz + 0.00001 * runif(1, 0, 0.4) * calib_mz + 0.0001 ## Set-up the parameter class for the calibration prm <- CalibrantMassParam(mz = calib_mz, method = \"edgeshift\", mzabs = 0.0001, mzppm = 5) first_file_calibrated <- calibrate(first_file, param = prm) diffs <- chromPeaks(first_file_calibrated)[, \"mz\"] - chromPeaks(first_file)[, \"mz\"] plot(x = chromPeaks(first_file)[, \"mz\"], xlab = expression(m/z[raw]), y = diffs, ylab = expression(m/z[calibrated] - m/z[raw]))"},{"path":"https://sneumann.github.io/xcms/articles/xcms-direct-injection.html","id":"correspondence","dir":"Articles","previous_headings":"","what":"Correspondence","title":"Grouping FTICR-MS data with xcms","text":"Correspondence aims group peaks across samples define features (ions m/z values). Peaks single spectrum, direct injection MS experiments can grouped MZclust method. perform correspondence analysis groupChromPeaks method using default settings. Getting overview performed processings: peak group information, .e. feature definitions can accessed featureDefinitions method. Plotting raw data direct injection samples involves little processing LC/GC-MS data can simply use chromatogram method extract data. extract m/z-intensity pairs peaks associated first feature. thus first identify peaks feature define m/z values range. Using range can subsequently use filterMz function sub-set full data set signal associated feature’s peaks. object can call mz intensity functions extract data. access actual intensity values feature sample featureValue method can used. setting value = \"\" tells function return integrated signal peak (one representative peak) per sample. NA reported features samples peak identified feature’s m/z value. instances might still signal feature’s position raw data files, peak detection failed identify peak. cases signal can recovered using fillChromPeaks method integrates raw signal feature’s location. signal location NA reported.","code":"## Using default settings but define sample group assignment mzc_prm <- MzClustParam(sampleGroups = ham_prep$sample_group) ham_prep <- groupChromPeaks(ham_prep, param = mzc_prm) ham_prep ## MSn experiment data (\"XCMSnExp\") ## Object size in memory: 0.04 Mb ## - - - Spectra data - - - ## MS level(s): 1 ## Number of spectra: 4 ## MSn retention times: -1:59 - -1:59 minutes ## - - - Processing information - - - ## Data loaded [Wed Apr 3 13:50:09 2024] ## MSnbase version: 2.29.4 ## - - - Meta data - - - ## phenoData ## rowNames: 1 2 3 4 ## varLabels: filename sample_group ## varMetadata: labelDescription ## Loaded from: ## [1] HAM004_641fE_14-11-07--Exp1.extracted.mzML... [4] HAM005_641fE_14-11-07--Exp2.extracted.mzML ## Use 'fileNames(.)' to see all files. ## protocolData: none ## featureData ## featureNames: F1.S1 F2.S1 F3.S1 F4.S1 ## fvarLabels: fileIdx spIdx ... spectrum (35 total) ## fvarMetadata: labelDescription ## experimentData: use 'experimentData(object)' ## - - - xcms preprocessing - - - ## Chromatographic peak detection: ## method: MSW ## 38 peaks identified in 4 samples. ## On average 9.5 chromatographic peaks per sample. ## Correspondence: ## method: mzClust ## 20 features identified. ## Median mz range of features: 9.1553e-05 ## Median rt range of features: 0 featureDefinitions(ham_prep) ## DataFrame with 20 rows and 10 columns ## mzmed mzmin mzmax rtmed rtmin rtmax npeaks ## ## FT01 402.285 402.285 402.286 -1 -1 -1 2 ## FT02 403.237 403.237 403.237 -1 -1 -1 4 ## FT03 405.109 405.109 405.109 -1 -1 -1 2 ## FT04 409.184 409.184 409.185 -1 -1 -1 2 ## FT05 410.144 410.144 410.145 -1 -1 -1 2 ## ... ... ... ... ... ... ... ... ## FT16 437.238 437.238 437.238 -1 -1 -1 2 ## FT17 438.240 438.240 438.240 -1 -1 -1 2 ## FT18 439.151 439.151 439.151 -1 -1 -1 2 ## FT19 441.130 441.130 441.131 -1 -1 -1 2 ## FT20 445.293 445.292 445.293 -1 -1 -1 2 ## ham4 ham5 peakidx ## ## FT01 0 2 16,28 ## FT02 2 2 17,29,1,... ## FT03 0 2 18,30 ## FT04 2 0 10,2 ## FT05 0 2 19,31 ## ... ... ... ... ## FT16 2 0 6,13 ## FT17 2 0 7,14 ## FT18 0 2 26,37 ## FT19 0 2 38,27 ## FT20 2 0 15,8 ## Get the peaks belonging to the first feature pks <- chromPeaks(ham_prep)[featureDefinitions(ham_prep)$peakidx[[1]], ] ## Define the m/z range mzr <- c(min(pks[, \"mzmin\"]) - 0.001, max(pks[, \"mzmax\"]) + 0.001) ## Subset the object to the m/z range ham_prep_sub <- filterMz(ham_prep, mz = mzr) ## Extract the mz and intensity values mzs <- mz(ham_prep_sub, bySample = TRUE) ints <- intensity(ham_prep_sub, bySample = TRUE) ## Plot the data plot(3, 3, pch = NA, xlim = range(mzs), ylim = range(ints), main = \"FT01\", xlab = \"m/z\", ylab = \"intensity\") ## Define colors cols <- rep(\"#ff000080\", length(mzs)) cols[ham_prep_sub$sample_group == \"ham5\"] <- \"#0000ff80\" tmp <- mapply(mzs, ints, cols, FUN = function(x, y, col) { points(x, y, col = col, type = \"l\") }) feat_vals <- featureValues(ham_prep, value = \"into\") head(feat_vals) ## HAM004_641fE_14-11-07--Exp1.extracted.mzML ## FT01 NA ## FT02 4735258 ## FT03 NA ## FT04 4158404 ## FT05 NA ## FT06 6099006 ## HAM004_641fE_14-11-07--Exp2.extracted.mzML ## FT01 NA ## FT02 6202418 ## FT03 NA ## FT04 5004546 ## FT05 NA ## FT06 4950642 ## HAM005_641fE_14-11-07--Exp1.extracted.mzML ## FT01 4095293 ## FT02 4811391 ## FT03 2982453 ## FT04 NA ## FT05 2872023 ## FT06 NA ## HAM005_641fE_14-11-07--Exp2.extracted.mzML ## FT01 4804763 ## FT02 2581183 ## FT03 2268984 ## FT04 NA ## FT05 2133219 ## FT06 NA ham_prep <- fillChromPeaks(ham_prep, param = FillChromPeaksParam()) head(featureValues(ham_prep, value = \"into\")) ## HAM004_641fE_14-11-07--Exp1.extracted.mzML ## FT01 768754.0 ## FT02 4735257.5 ## FT03 652566.6 ## FT04 4158404.5 ## FT05 652201.1 ## FT06 6099006.3 ## HAM004_641fE_14-11-07--Exp2.extracted.mzML ## FT01 1230140.4 ## FT02 6202417.6 ## FT03 374109.9 ## FT04 5004546.3 ## FT05 403448.4 ## FT06 4950641.7 ## HAM005_641fE_14-11-07--Exp1.extracted.mzML ## FT01 4095293 ## FT02 4811391 ## FT03 2982453 ## FT04 1221031 ## FT05 2872023 ## FT06 1573988 ## HAM005_641fE_14-11-07--Exp2.extracted.mzML ## FT01 4804762.5 ## FT02 2581183.1 ## FT03 2268984.5 ## FT04 1241294.4 ## FT05 2133219.4 ## FT06 977694.5"},{"path":"https://sneumann.github.io/xcms/articles/xcms-direct-injection.html","id":"further-analysis","dir":"Articles","previous_headings":"","what":"Further analysis","title":"Grouping FTICR-MS data with xcms","text":"analysis, .e. detection features/metabolites significantly different abundances, PCA analyses can performed feature matrix using functionality R packages, limma.","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms-direct-injection.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"Grouping FTICR-MS data with xcms","text":"","code":"sessionInfo() ## R Under development (unstable) (2024-03-28 r86224) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.4 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] MassSpecWavelet_1.69.0 xcms_4.1.12 BiocParallel_1.37.1 ## [4] MSnbase_2.29.4 ProtGenerics_1.35.4 S4Vectors_0.41.5 ## [7] mzR_2.37.3 Rcpp_1.0.12 Biobase_2.63.1 ## [10] BiocGenerics_0.49.1 BiocStyle_2.31.0 ## ## loaded via a namespace (and not attached): ## [1] DBI_1.2.2 rlang_1.1.3 ## [3] magrittr_2.0.3 clue_0.3-65 ## [5] matrixStats_1.2.0 compiler_4.5.0 ## [7] systemfonts_1.0.6 vctrs_0.6.5 ## [9] MetaboCoreUtils_1.11.2 pkgconfig_2.0.3 ## [11] crayon_1.5.2 fastmap_1.1.1 ## [13] XVector_0.43.1 utf8_1.2.4 ## [15] rmarkdown_2.26 preprocessCore_1.65.0 ## [17] ragg_1.3.0 purrr_1.0.2 ## [19] xfun_0.43 MultiAssayExperiment_1.29.1 ## [21] zlibbioc_1.49.3 cachem_1.0.8 ## [23] GenomeInfoDb_1.39.10 jsonlite_1.8.8 ## [25] progress_1.2.3 highr_0.10 ## [27] DelayedArray_0.29.9 prettyunits_1.2.0 ## [29] parallel_4.5.0 cluster_2.1.6 ## [31] R6_2.5.1 RColorBrewer_1.1-3 ## [33] bslib_0.7.0 limma_3.59.6 ## [35] GenomicRanges_1.55.4 jquerylib_0.1.4 ## [37] bookdown_0.38 SummarizedExperiment_1.33.3 ## [39] iterators_1.0.14 knitr_1.45 ## [41] IRanges_2.37.1 Matrix_1.7-0 ## [43] igraph_2.0.3 tidyselect_1.2.1 ## [45] abind_1.4-5 yaml_2.3.8 ## [47] doParallel_1.0.17 codetools_0.2-20 ## [49] affy_1.81.0 lattice_0.22-6 ## [51] tibble_3.2.1 plyr_1.8.9 ## [53] signal_1.8-0 evaluate_0.23 ## [55] desc_1.4.3 Spectra_1.13.8 ## [57] pillar_1.9.0 affyio_1.73.0 ## [59] BiocManager_1.30.22 MatrixGenerics_1.15.0 ## [61] foreach_1.5.2 MALDIquant_1.22.2 ## [63] ncdf4_1.22 generics_0.1.3 ## [65] hms_1.1.3 ggplot2_3.5.0 ## [67] munsell_0.5.1 scales_1.3.0 ## [69] MsExperiment_1.5.4 glue_1.7.0 ## [71] MsFeatures_1.11.0 lazyeval_0.2.2 ## [73] tools_4.5.0 mzID_1.41.0 ## [75] QFeatures_1.13.3 vsn_3.71.1 ## [77] fs_1.6.3 XML_3.99-0.16.1 ## [79] grid_4.5.0 impute_1.77.0 ## [81] MsCoreUtils_1.15.6 colorspace_2.1-0 ## [83] GenomeInfoDbData_1.2.12 PSMatch_1.7.2 ## [85] cli_3.6.2 textshaping_0.3.7 ## [87] fansi_1.0.6 S4Arrays_1.3.6 ## [89] dplyr_1.1.4 AnnotationFilter_1.27.0 ## [91] pcaMethods_1.95.0 gtable_0.3.4 ## [93] sass_0.4.9 digest_0.6.35 ## [95] SparseArray_1.3.4 htmlwidgets_1.6.4 ## [97] memoise_2.0.1 htmltools_0.5.8 ## [99] pkgdown_2.0.7.9000 lifecycle_1.0.4 ## [101] statmod_1.5.0 MASS_7.3-60.2"},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"LC-MS/MS data analysis with xcms","text":"Metabolite identification important step non-targeted metabolomics requires different steps. One involves use tandem mass spectrometry generate fragmentation spectra detected metabolites (LC-MS/MS), compared fragmentation spectra known metabolites. Different approaches exist generation fragmentation spectra, whereas used data dependent acquisition (DDA) also known top-n method. method top N intense ions (m/z values) MS1 scan selected fragmentation next N scans cycle starts . method allows generate clean MS2 fragmentation spectra fly acquisition without need experiments, suffers poor coverage detected metabolites (since limited number ions fragmented) less accurate quantification compounds (since fewer MS1 scans generated). Data independent approaches (DIA) like Bruker bbCID, Agilent AllIons Waters MSe don’t use preselection, rather fragment detected molecules . using alternating schemes scan low high collision energy collect MS1 MS2 data. Using approach, problem coverage, relation precursor fragment masses lost leading chimeric spectra. Sequential Window Acquisition Theoretical Mass Spectra (SWATH [1]) combines approaches middle-way approach. precursor selection acquisition independent acquired data, rather isolating precusors , defined windows (.e. ranges m/z values) used scanned. reduces overlap fragment spectra still keeping high coverage. document showcases analysis two small LC-MS/MS data sets using xcms. data files used reversed-phase LC-MS/MS runs Agilent Pesticide mix obtained Sciex 6600 Triple ToF operated SWATH acquisition mode. comparison DDA file sample included.","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"analysis-of-dda-data","dir":"Articles","previous_headings":"","what":"Analysis of DDA data","title":"LC-MS/MS data analysis with xcms","text":"load example DDA data set create total ion chromatogram MS1 data. According TIC signal measured ~ 200 600 seconds (see plot ). thus filter DDA data retention time range. variable dda_data contains now MS1 MS2 spectra specified mzML file. number spectra MS level listed . Note subset experiment first data file (using [1]) access directly spectra within sample spectra function (returns Spectra object Spectra package). Note use pipe operator |> better readability. MS2 spectra can get m/z precursor ion precursorMz function. first subset data set single sample filter spectra MS level 2 extracting precursor m/z values. precursorIntensity function also possible extract intensity precursor ion. manufacturers (like Sciex) don’t define/export precursor intensity thus either NA 0 reported. can however use estimatePrecursorIntensity function Spectra package determine precursor intensity MS 2 spectrum based intensity respective ion previous MS1 scan (note method = \"interpolation\" precursor intensity defined based interpolation intensity previous subsequent MS1 scan). estimate precursor intensities, full data (MS1 spectra NA value reported). next set precursor intensity spectrum metadata dda_data. can extracted later precursorIntensity function. Next perform chromatographic peak detection MS level 1 data findChromPeaks method. define settings centWave-based peak detection perform analysis. total 114 peaks identified present data set. advantage LC-MS/MS data (MS1) ions fragmented corresponding MS2 spectra measured. Thus, ions (identified MS1 chromatographic peaks) MS2 spectra available. can facilitate annotation respective MS1 chromatographic peaks (MS1 features correspondence analysis). Spectra identified chromatographic peaks can extracted chromPeakSpectra method. MS2 spectra precursor m/z retention time within rt m/z range chromatographic peak returned. default chromPeakSpectra returns spectra associated MS1 chromatographic peak, parameter method allows choose return one spectrum per peak (look ?chromPeakSpectra help page details). Also, possible extract MS1 spectra peak specifying msLevel = 1L call (e.g. evaluate full MS1 signal peak’s apex position). returned Spectra contains also reference respective chromatographic peak additional spectra variable \"peak_id\" contains identifier chromatographic peak (.e. row name chromPeaks matrix). Note also return.type = \"List\" list parallel chromPeaks matrix returned, .e. element list contain spectra chromatographic peak index. data representation might eventually simplify processing. next use MS2 information aid annotation chromatographic peak. example use chromatographic peak ion m/z 304.1131 extract code block . search potential ions similar m/z reference database (e.g. Metlin) returned large list potential hits, small ppm. two hits, Flumazenil (Metlin ID 2724) Fenamiphos (Metlin ID 72445) experimental MS2 spectra available. Thus, match MS2 spectrum identified chromatographic peak annotate ion. extract MS2 spectra associated candidate chromatographic peak using ID peak present data set. 5 MS2 spectra representing fragmentation ion(s) measured candidate chromatographic peak. next reduce single MS2 spectrum using combineSpectra method employing combinePeaks function determine peaks keep resulting spectrum (look ?combinePeaks help page details). Parameter f allows specify spectra input object combined one. Note combination multiple fragment spectra single spectrum might generally best approach suggested types data. Mass peaks input spectra difference m/z smaller 20 ppm (parameter ppm) combined one peak median m/z intensity reported . Due parameter minProp = 0.8, resulting MS2 spectrum contains peaks present 80% input spectra. plot consensus spectrum shown . Consensus MS2 spectrum created measured MS2 spectra ions chromatographic peak CP53. now match consensus spectrum database MS2 spectra. example simply load MS2 spectra two compounds matching m/z exported Metlin. compounds MS2 spectra created collision energies 0V, 10V, 20V 40V available. import respective data plot candidate spectrum MS2 spectra Flumanezil Fenamiphos (collision energy 20V). import files MGF format load MsBackendMgf Bioconductor package adds MGF file support Spectra package. Prior plotting scale experimental spectra replace peak intensities values relative maximum peak intensity (set value 100). Mirror plots candidate MS2 spectrum Flumanezil (left) Fenamiphos (right). upper panel represents candidate MS2 spectrum, lower target MS2 spectrum. Matching peaks indicated dot. candidate spectrum matches Fenamiphos, thus, example chromatographic peak represents signal measured compound. addition plotting spectra, can also calculate similarities compareSpectra method (uses default normalized dot-product calculate similarity). Clearly, candidate spectrum match Flumanezil, high similarity Fenamiphos. performed MS2-based annotation single chromatographic peak, easily extended full list MS2 spectra (returned chromPeakSpectra) chromatographic peaks experiment. See also alternative tutorials matching experimental fragment spectra reference. present example used single data file thus need perform sample alignment correspondence analysis. tasks however performed similarly plain LC-MS data, retention times recorded MS2 spectra however also adjusted alignment based MS1 data. correspondence analysis (peak grouping) MS2 spectra features can extracted featureSpectra function returns MS2 spectra associated chromatographic peak feature. Note also workflow can included Feature-Based Molecular Networking FBMN match MS2 spectra GNPS. See details examples.","code":"library(xcms) library(MsExperiment) dda_file <- system.file(\"TripleTOF-SWATH\", \"PestMix1_DDA.mzML\", package = \"msdata\") dda_data <- readMsExperiment(dda_file) chr <- chromatogram(dda_data, aggregationFun = \"sum\", msLevel = 1L) plot(chr) abline(v = c(230, 610)) ## filter the data dda_data <- filterRt(dda_data, rt = c(230, 610)) ## Filter spectra dda_data[1] |> spectra() |> msLevel() |> table() ## ## 1 2 ## 1389 2214 dda_data[1] |> spectra() |> filterMsLevel(2) |> precursorMz() |> head() ## [1] 182.18777 182.18893 55.00579 182.19032 237.12296 237.11987 dda_data[1] |> spectra() |> filterMsLevel(2) |> precursorIntensity() |> head() ## [1] 0 0 0 0 0 0 prec_int <- estimatePrecursorIntensity(spectra(dda_data)) spectra(dda_data)$precursorIntensity <- prec_int dda_data[1] |> spectra() |> filterMsLevel(2) |> precursorIntensity() |> head() ## [1] NA 9.198155 2.773988 27.590797 3.443145 7.621923 cwp <- CentWaveParam(snthresh = 5, noise = 100, ppm = 10, peakwidth = c(3, 30)) dda_data <- findChromPeaks(dda_data, param = cwp, msLevel = 1L) library(Spectra) dda_spectra <- chromPeakSpectra(dda_data, msLevel = 2L) dda_spectra ## MSn data (Spectra) with 142 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 2 237.869 1812 ## 2 2 241.299 1846 ## 3 2 325.763 2439 ## 4 2 326.583 2446 ## 5 2 327.113 2450 ## ... ... ... ... ## 138 2 574.725 5110 ## 139 2 575.255 5115 ## 140 2 596.584 5272 ## 141 2 592.424 5236 ## 142 2 596.054 5266 ## ... 34 more variables/columns. ## ## file(s): ## PestMix1_DDA.mzML ## Processing: ## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 13:50:30 2024] ## Filter: select MS level(s) 2 [Wed Apr 3 13:50:37 2024] ## Merge 1 Spectra into one [Wed Apr 3 13:50:37 2024] dda_spectra$peak_id ## [1] \"CP004\" \"CP004\" \"CP005\" \"CP005\" \"CP006\" \"CP006\" \"CP008\" \"CP008\" \"CP011\" ## [10] \"CP011\" \"CP012\" \"CP012\" \"CP013\" \"CP013\" \"CP013\" \"CP013\" \"CP014\" \"CP014\" ## [19] \"CP014\" \"CP014\" \"CP018\" \"CP022\" \"CP022\" \"CP022\" \"CP025\" \"CP025\" \"CP025\" ## [28] \"CP025\" \"CP026\" \"CP026\" \"CP026\" \"CP026\" \"CP033\" \"CP033\" \"CP034\" \"CP034\" ## [37] \"CP034\" \"CP034\" \"CP034\" \"CP035\" \"CP035\" \"CP035\" \"CP041\" \"CP041\" \"CP041\" ## [46] \"CP042\" \"CP042\" \"CP042\" \"CP043\" \"CP047\" \"CP047\" \"CP049\" \"CP049\" \"CP049\" ## [55] \"CP049\" \"CP050\" \"CP050\" \"CP050\" \"CP051\" \"CP051\" \"CP051\" \"CP054\" \"CP055\" ## [64] \"CP055\" \"CP055\" \"CP056\" \"CP056\" \"CP056\" \"CP056\" \"CP056\" \"CP060\" \"CP060\" ## [73] \"CP060\" \"CP060\" \"CP064\" \"CP064\" \"CP065\" \"CP065\" \"CP066\" \"CP066\" \"CP069\" ## [82] \"CP069\" \"CP069\" \"CP070\" \"CP070\" \"CP070\" \"CP072\" \"CP072\" \"CP072\" \"CP073\" ## [91] \"CP074\" \"CP074\" \"CP074\" \"CP074\" \"CP075\" \"CP075\" \"CP075\" \"CP077\" \"CP077\" ## [100] \"CP077\" \"CP079\" \"CP079\" \"CP079\" \"CP079\" \"CP080\" \"CP080\" \"CP080\" \"CP081\" ## [109] \"CP086\" \"CP086\" \"CP086\" \"CP086\" \"CP086\" \"CP088\" \"CP088\" \"CP088\" \"CP089\" ## [118] \"CP089\" \"CP091\" \"CP091\" \"CP093\" \"CP093\" \"CP094\" \"CP094\" \"CP094\" \"CP095\" ## [127] \"CP095\" \"CP095\" \"CP096\" \"CP096\" \"CP096\" \"CP098\" \"CP098\" \"CP098\" \"CP098\" ## [136] \"CP098\" \"CP099\" \"CP099\" \"CP099\" \"CP100\" \"CP101\" \"CP101\" ex_mz <- 304.1131 chromPeaks(dda_data, mz = ex_mz, ppm = 20) ## mz mzmin mzmax rt rtmin rtmax into intb ## CP056 304.1133 304.1126 304.1143 425.024 417.985 441.773 13040.8 13007.79 ## maxo sn sample ## CP056 3978.987 232 1 ex_id <- rownames(chromPeaks(dda_data, mz = ex_mz, ppm = 20)) ex_spectra <- dda_spectra[dda_spectra$peak_id == ex_id] ex_spectra ## MSn data (Spectra) with 5 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 2 418.926 3505 ## 2 2 419.306 3510 ## 3 2 423.036 3582 ## 4 2 423.966 3603 ## 5 2 424.296 3609 ## ... 34 more variables/columns. ## ## file(s): ## PestMix1_DDA.mzML ## Processing: ## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 13:50:30 2024] ## Filter: select MS level(s) 2 [Wed Apr 3 13:50:37 2024] ## Merge 1 Spectra into one [Wed Apr 3 13:50:37 2024] ex_spectrum <- combineSpectra(ex_spectra, FUN = combinePeaks, ppm = 20, peaks = \"intersect\", minProp = 0.8, intensityFun = median, mzFun = median, f = ex_spectra$peak_id) ## Warning in FUN(X[[i]], ...): 'combinePeaks' for lists of peak matrices is ## deprecated; please use 'combinePeaksData' instead. ex_spectrum ## MSn data (Spectra) with 1 spectra in a MsBackendMemory backend: ## msLevel rtime scanIndex ## ## 1 2 418.926 3505 ## ... 34 more variables/columns. ## Processing: ## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 13:50:30 2024] ## Filter: select MS level(s) 2 [Wed Apr 3 13:50:37 2024] ## Merge 1 Spectra into one [Wed Apr 3 13:50:37 2024] ## ...1 more processings. Use 'processingLog' to list all. plotSpectra(ex_spectrum) scale_fun <- function(z, ...) { z[, \"intensity\"] <- z[, \"intensity\"] / max(z[, \"intensity\"], na.rm = TRUE) * 100 z } ex_spectrum <- addProcessing(ex_spectrum, FUN = scale_fun) library(MsBackendMgf) flumanezil <- Spectra( system.file(\"mgf\", \"metlin-2724.mgf\", package = \"xcms\"), source = MsBackendMgf()) ## Start data import from 1 files ... done fenamiphos <- Spectra( system.file(\"mgf\", \"metlin-72445.mgf\", package = \"xcms\"), source = MsBackendMgf()) ## Start data import from 1 files ... done par(mfrow = c(1, 2)) plotSpectraMirror(ex_spectrum, flumanezil[3], main = \"against Flumanezil\", ppm = 40) plotSpectraMirror(ex_spectrum, fenamiphos[3], main = \"against Fenamiphos\", ppm = 40) compareSpectra(ex_spectrum, flumanezil, ppm = 40) ## [1] 4.520957e-02 3.283806e-02 2.049379e-03 3.374354e-05 compareSpectra(ex_spectrum, fenamiphos, ppm = 40) ## [1] 0.1326234432 0.4879399946 0.7198406271 0.3997922658 0.0004876129 ## [6] 0.0028408885 0.0071030051 0.0053809736"},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"dia-swath-data-analysis","dir":"Articles","previous_headings":"","what":"DIA (SWATH) data analysis","title":"LC-MS/MS data analysis with xcms","text":"section analyze small SWATH data set consisting single mzML file data sample analyzed previous section recorded SWATH mode. read data readMsExperiment function. resulting object contain recorded MS1 MS2 spectra specified file. Similar previous data file, filter file signal 230 610 seconds. determine number MS level 1 2 spectra present data set. described introduction, SWATH mode ions within pre-defined isolation windows fragmented MS2 spectra measured. definition isolation windows (SWATH pockets) imported mzML files available additional spectra variables. inspect respective information first spectra. upper lower isolation window m/z available spectra variables \"isolationWindowLowerMz\" \"isolationWindowUpperMz\" respectively target m/z isolation window \"isolationWindowTargetMz\". can use spectraData function extract information spectra within swath_data object. also access variables directly dedicated isolationWindowLowerMz isolationWindowUpperMz functions. present data set use value isolation window target m/z define individual SWATH pockets. list number spectra recorded pocket/isolation window. thus 422 423 MS2 spectra measured isolation window. inspect data can also extract chromatograms measured MS1 well MS2 data. MS2 data set parameter msLevel = 2L addition also specify isolation window want extract data. extract TIC MS1 data one isolation windows (isolation window target m/z 270.85) plot . TIC MS1 (upper panel) MS2 data isolation window target m/z 270.85 (lower panel). Note also DIA data manufacturers (e.g. Waters MSe) supported long spectra variable isolationWindowTargetMz available. variable provided raw data files can also manually assigned spectrum data set. example precursor m/z individual spectra used \"isolationWindowTargetMz\" (note: line shown example evaluated).","code":"swath_file <- system.file(\"TripleTOF-SWATH\", \"PestMix1_SWATH.mzML\", package = \"msdata\") swath_data <- readMsExperiment(swath_file) swath_data <- filterRt(swath_data, rt = c(230, 610)) spectra(swath_data) |> msLevel() |> table() ## ## 1 2 ## 422 3378 spectra(swath_data) |> spectraData(c(\"isolationWindowTargetMz\", \"isolationWindowLowerMz\", \"isolationWindowUpperMz\", \"msLevel\", \"rtime\")) |> head() ## DataFrame with 6 rows and 5 columns ## isolationWindowTargetMz isolationWindowLowerMz isolationWindowUpperMz ## ## 1 299.10 283.5 314.7 ## 2 329.80 313.7 345.9 ## 3 367.35 344.9 389.8 ## 4 601.85 388.8 814.9 ## 5 NA NA NA ## 6 163.75 139.5 188.0 ## msLevel rtime ## ## 1 2 230.073 ## 2 2 230.170 ## 3 2 230.267 ## 4 2 230.364 ## 5 1 230.459 ## 6 2 230.585 head(isolationWindowLowerMz(spectra(swath_data))) ## [1] 283.5 313.7 344.9 388.8 NA 139.5 head(isolationWindowUpperMz(spectra(swath_data))) ## [1] 314.7 345.9 389.8 814.9 NA 188.0 table(isolationWindowTargetMz(spectra(swath_data))) ## ## 163.75 208.95 244.05 270.85 299.1 329.8 367.35 601.85 ## 422 422 422 422 423 423 422 422 tic_ms1 <- chromatogram(swath_data, msLevel = 1L, aggregationFun = \"sum\") tic_ms2 <- chromatogram(swath_data, msLevel = 2L, aggregationFun = \"sum\", isolationWindowTargetMz = 270.85) par(mfrow = c(2, 1)) plot(tic_ms1, main = \"MS1\") plot(tic_ms2, main = \"MS2, isolation window m/z 270.85\") spectra(swath_data)$isolationWindowTargetMz <- precursorMz(spectra(swath_data))"},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"chromatographic-peak-detection-in-ms1-and-ms2-data","dir":"Articles","previous_headings":"DIA (SWATH) data analysis","what":"Chromatographic peak detection in MS1 and MS2 data","title":"LC-MS/MS data analysis with xcms","text":"Similar conventional LC-MS analysis, perform first chromatographic peak detection (MS level 1 data) findChromPeaks method. define settings centWave-based peak detection perform analysis. Next perform chromatographic peak detection MS level 2 data separately individual isolation window. use findChromPeaksIsolationWindow function employing peak detection algorithm reducing however required signal--noise ratio. isolationWindow parameter allows specify MS2 spectra belong isolation window hence defines set MS2 spectra chromatographic peak detection performed. default \"isolationWindowTargetMz\" variable object’s spectra used. findChromPeaksIsolationWindow function added peaks identified individual isolation windows chromPeaks matrix containing already MS1 chromatographic peaks. newly added peaks can identified \"isolationWindow\" column object’s chromPeakData. count number chromatographic peaks identified within isolation window (number chromatographic peaks identified MS1 62). thus successfully identified chromatographic peaks different MS levels isolation windows. next step identify measured signals represents data original compound reconstruct fragment spectra MS1 signal (chromatographic peak).","code":"cwp <- CentWaveParam(snthresh = 5, noise = 100, ppm = 10, peakwidth = c(3, 30)) swath_data <- findChromPeaks(swath_data, param = cwp) swath_data ## Object of class XcmsExperiment ## Spectra: MS1 (422) MS2 (3378) ## Experiment data: 1 sample(s) ## Sample data links: ## - spectra: 1 sample(s) to 3800 element(s). ## xcms results: ## - chromatographic peaks: 62 in MS level(s): 1 cwp <- CentWaveParam(snthresh = 3, noise = 10, ppm = 10, peakwidth = c(3, 30)) swath_data <- findChromPeaksIsolationWindow(swath_data, param = cwp) swath_data ## Object of class XcmsExperiment ## Spectra: MS1 (422) MS2 (3378) ## Experiment data: 1 sample(s) ## Sample data links: ## - spectra: 1 sample(s) to 3800 element(s). ## xcms results: ## - chromatographic peaks: 370 in MS level(s): 1, 2 chromPeakData(swath_data) ## DataFrame with 370 rows and 6 columns ## ms_level is_filled isolationWindow isolationWindowTargetMZ ## ## CP01 1 FALSE NA NA ## CP02 1 FALSE NA NA ## CP03 1 FALSE NA NA ## CP04 1 FALSE NA NA ## CP05 1 FALSE NA NA ## ... ... ... ... ... ## CP366 2 FALSE 601.85 601.85 ## CP367 2 FALSE 601.85 601.85 ## CP368 2 FALSE 601.85 601.85 ## CP369 2 FALSE 601.85 601.85 ## CP370 2 FALSE 601.85 601.85 ## isolationWindowLowerMz isolationWindowUpperMz ## ## CP01 NA NA ## CP02 NA NA ## CP03 NA NA ## CP04 NA NA ## CP05 NA NA ## ... ... ... ## CP366 388.8 814.9 ## CP367 388.8 814.9 ## CP368 388.8 814.9 ## CP369 388.8 814.9 ## CP370 388.8 814.9 table(chromPeakData(swath_data)$isolationWindow) ## ## 163.75 208.95 244.05 270.85 299.1 329.8 367.35 601.85 ## 2 38 32 14 105 23 62 32"},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"reconstruction-of-ms2-spectra","dir":"Articles","previous_headings":"DIA (SWATH) data analysis","what":"Reconstruction of MS2 spectra","title":"LC-MS/MS data analysis with xcms","text":"Identifying signal fragment ions precursor measured MS1 chromatographic peak non-trivial task. MS2 spectrum fragment ion MS1 chromatographic peak reconstructed available MS2 signal (.e. chromatographic peaks identified MS level 2). SWATH data, fragment ion signal present isolation window contains m/z precursor ion chromatographic peak shape MS2 chromatographic peaks fragment ions specific precursor similar retention time peak shape precursor’s MS1 chromatographic peak. detection MS1 MS2 chromatographic peaks performed, can reconstruct MS2 spectra using reconstructChromPeakSpectra function. function defines MS2 spectrum MS1 chromatographic peak based following approach: Identify MS2 chromatographic peaks isolation window containing m/z ion (MS1 chromatographic peak) approximately retention time MS1 chromatographic peak (accepted difference retention time can defined diffRt parameter). Extract MS1 chromatographic peak MS2 chromatographic peaks identified previous step correlate peak shapes candidate MS2 chromatographic peaks shape MS1 peak. MS2 chromatographic peaks correlation coefficient larger minCor retained. Reconstruct MS2 spectrum using m/z selected MS2 chromatographic peaks intensity; MS2 chromatographic peak selected MS1 peak thus represent one mass peak reconstructed spectrum. illustrate process perform individual steps example fenamiphos (exact mass 303.105800777 m/z [M+H]+ adduct 304.113077). first step extract chromatographic peak ion. Next identify MS2 chromatographic peaks identified isolation window containing m/z fenamiphos. information isolation window chromatographic peak identified available chromPeakData. also require retention time MS2 chromatographic peaks similar retention time MS1 peak extract corresponding peak information. thus select chromatographic peaks retention time range contains retention time apex position MS1 chromatographic peak. total 24 MS2 chromatographic peaks match conditions. Next extract ion chromatogram MS1 peak selected candidate MS2 signals. ensure chromatograms extracted spectra correct isolation window need specify respective isolation window passing isolation window target m/z chromatogram function (addition setting msLevel = 2). can done either getting isolationWindowTargetMz spectra data subset using filterIsolationWindow (done ) selecting isolationWindowTargetMz closest m/z compound interest. target m/z isolation window containing m/z interest thus 299.1 can use chromatogram call extract data correct (MS2) spectra. can now plot extracted ion chromatogram MS1 extracted MS2 data. Extracted ion chromatograms Fenamiphos MS1 (blue) potentially related signal MS2 (grey). Next can calculate correlations peak shapes MS2 chromatogram MS1 peak. illustrate process example one MS2 chromatographic peaks. Note , MS1 MS2 spectra recorded consecutively, retention times individual data points differ MS2 MS1 chromatographic data data points thus matched (aligned) performing correlation analysis. done automatically correlate function. See help align method information alignment options. identifying MS2 chromatographic peaks shapes enough high similarity MS1 chromatographic peaks, MS2 spectrum reconstructed based m/z intensities MS2 chromatographic peaks (.e., using \"mz\" \"maxo\" \"\" values). Instead performing assignment MS2 signal MS1 chromatographic peaks manually , can use reconstructChromPeakSpectra function performs exact steps MS1 chromatographic peaks DIA data set. use function reconstruct MS2 spectra example data requiring peak shape correlation higher 0.9 candidate MS2 chromatographic peak target MS1 chromatographic peak. result got Spectra object length equal number MS1 peaks data. length spectrum represents number peaks contains. Thus, length 0 indicates matching peak (MS2 signal) found respective MS1 chromatographic peak. reconstructed spectra additional annotations available IDs MS2 chromatographic peaks spectrum reconstructed (\"ms2_peak_id\") well correlation coefficient chromatographic peak shape precursor’s shape (\"ms2_peak_cor\"). Metadata column \"peak_id\" contains ID MS1 chromatographic peak: next extract MS2 spectrum example peak likely representing [M+H]+ ions Fenamiphos using chromatographic peak ID: can now compare reconstructed spectrum example consensus spectrum DDA experiment previous section (variable ex_spectrum) well MS2 spectrum Fenamiphos Metlin (collision energy 10V). better visualization normalize also peak intensities reconstructed SWATH spectrum function used experimental DDA spectrum. Mirror plot comparing reconstructed MS2 spectrum Fenamiphos (upper panel) measured spectrum DDA data Fenamiphhos spectrum Metlin. wanted get EICs MS2 chromatographic peaks used generate MS2 spectrum can use IDs peaks provided $ms2_peak_id result spectrum. peak IDs available can extract retention time window m/z ranges chromPeaks matrix use chromatogram function extract EIC. Note however SWATH data MS2 signal different isolation windows. Thus first filter swath_data object isolation window containing precursor m/z filterIsolationWindow subset data MS2 spectra related ion interest. addition, use msLevel = 2L chromatogram call chromatogram extracts default data MS1 spectra need specify target m/z isolation window containing fragment data compound interest. row ms2_eics contains now EIC one MS2 chromatographic peaks. can also plot overlay plot. Overlay EICs chromatographic peaks used reconstruct MS2 spectrum fenamiphos. second example analyze signal [M+H]+ ion m/z 376.0381 (match Prochloraz). first identify MS1 chromatographic peak m/z retrieve reconstructed MS2 spectrum peak. MS2 spectrum (tentative) MS1 signal prochloraz reconstructed SWATH MS2 data thus 9 peaks. addition identify corresponding MS1 peak DDA data set, extract measured MS2 chromatographic peaks build consensus spectrum . retention times chromatographic peaks DDA SWATH data match almost perfectly. Next get MS2 spectra peak. total 5 spectra measured, relatively high number peaks. Next combine consensus spectrum. last load also Prochloraz MS2 spectra (different collision energies) Metlin. validate reconstructed spectrum plot corresponding DDA spectrum MS2 spectrum Prochloraz (collision energy 10V) Metlin. Mirror plot comparing reconstructed MS2 spectrum Prochloraz (upper panel) measured spectrum DDA data Prochloraz spectrum Metlin. spectra fit relatively well. Interestingly, peak representing precursor (right-peak) seems slightly shifted m/z value reconstructed spectrum. Also, closer inspecting spectrum two groups peaks small differences m/z can observed (see plot ). SWATH-derived MS2 spectrum prochloraz. represent fragments isotopes original compound. DIA MS2 data, since ions given retention time fragmented, can contain fragments isotopes. thus use isotopologues function MetaboCoreUtils package check presence potential isotope peaks reconstructed MS2 spectrum prochloraz. Indeed, peaks 3, 4 5 well 6 7 assigned group potential isotope peaks. proof peaks indeed fragment isotopes prochloraz highly likely (given difference m/z relative intensity differences). thus define function keeps monoisotopic peak isotope group spectrum. SWATH MS2 spectrum prochloraz (left) deisotoping (right). Removing isotope peaks SWATH MS2 spectrum increases also spectra similarity score (since reference spectra generally contain fragments ion interest, isotopes). Similar DDA data, reconstructed MS2 spectra SWATH data used annotation MS1 chromatographic peaks.","code":"fenamiphos_mz <- 304.113077 fenamiphos_ms1_peak <- chromPeaks(swath_data, mz = fenamiphos_mz, ppm = 2) fenamiphos_ms1_peak ## mz mzmin mzmax rt rtmin rtmax into intb ## CP34 304.1124 304.1121 304.1126 423.945 419.445 428.444 10697.34 10688.34 ## maxo sn sample ## CP34 2401.849 618 1 keep <- chromPeakData(swath_data)$isolationWindowLowerMz < fenamiphos_mz & chromPeakData(swath_data)$isolationWindowUpperMz > fenamiphos_mz keep <- keep & chromPeaks(swath_data)[, \"rtmin\"] < fenamiphos_ms1_peak[, \"rt\"] & chromPeaks(swath_data)[, \"rtmax\"] > fenamiphos_ms1_peak[, \"rt\"] fenamiphos_ms2_peak <- chromPeaks(swath_data)[which(keep), ] rtr <- fenamiphos_ms1_peak[, c(\"rtmin\", \"rtmax\")] mzr <- fenamiphos_ms1_peak[, c(\"mzmin\", \"mzmax\")] fenamiphos_ms1_chr <- chromatogram(swath_data, rt = rtr, mz = mzr) ## Processing chromatographic peaks rtr <- fenamiphos_ms2_peak[, c(\"rtmin\", \"rtmax\")] mzr <- fenamiphos_ms2_peak[, c(\"mzmin\", \"mzmax\")] ## Get the isolationWindowTargetMz for spectra containing the m/z of the ## compound of interest swath_data |> filterIsolationWindow(mz = fenamiphos_mz) |> spectra() |> isolationWindowTargetMz() |> table() ## ## 299.1 ## 423 fenamiphos_ms2_chr <- chromatogram( swath_data, rt = rtr, mz = mzr, msLevel = 2L, isolationWindowTargetMz = rep(299.1, nrow(rtr))) ## Processing chromatographic peaks plot(rtime(fenamiphos_ms1_chr[1, 1]), intensity(fenamiphos_ms1_chr[1, 1]), xlab = \"retention time [s]\", ylab = \"intensity\", pch = 16, ylim = c(0, 5000), col = \"blue\", type = \"b\", lwd = 2) #' Add data from all MS2 peaks tmp <- lapply(fenamiphos_ms2_chr@.Data, function(z) points(rtime(z), intensity(z), col = \"#00000080\", type = \"b\", pch = 16)) compareChromatograms(fenamiphos_ms2_chr[1, 1], fenamiphos_ms1_chr[1, 1], ALIGNFUNARGS = list(method = \"approx\")) ## [1] 0.9997871 swath_spectra <- reconstructChromPeakSpectra(swath_data, minCor = 0.9) swath_spectra ## MSn data (Spectra) with 62 spectra in a MsBackendMemory backend: ## msLevel rtime scanIndex ## ## CP01 2 239.458 NA ## CP02 2 240.358 NA ## CP03 2 329.577 NA ## CP04 2 329.771 NA ## CP05 2 346.164 NA ## ... ... ... ... ## CP58 2 551.735 NA ## CP59 2 551.735 NA ## CP60 2 575.134 NA ## CP61 2 575.134 NA ## CP62 2 574.942 NA ## ... 20 more variables/columns. ## Processing: ## Merge 1 Spectra into one [Wed Apr 3 13:50:45 2024] lengths(swath_spectra) ## [1] 0 0 1 1 1 0 0 0 0 0 0 0 3 0 3 4 0 3 0 1 0 9 14 1 0 ## [26] 0 15 4 1 1 2 4 6 15 12 11 2 4 13 0 0 0 0 1 2 0 1 0 0 0 ## [51] 3 0 2 1 7 7 0 0 0 0 0 2 spectraData(swath_spectra, c(\"peak_id\", \"ms2_peak_id\", \"ms2_peak_cor\")) ## DataFrame with 62 rows and 3 columns ## peak_id ms2_peak_id ms2_peak_cor ## ## CP01 CP01 ## CP02 CP02 ## CP03 CP03 CP063 0.950582 ## CP04 CP04 CP105 0.95157 ## CP05 CP05 CP153 0.924545 ## ... ... ... ... ## CP58 CP58 ## CP59 CP59 ## CP60 CP60 ## CP61 CP61 ## CP62 CP62 CP334,CP329 0.918915,0.911944 fenamiphos_swath_spectrum <- swath_spectra[ swath_spectra$peak_id == rownames(fenamiphos_ms1_peak)] fenamiphos_swath_spectrum <- addProcessing(fenamiphos_swath_spectrum, scale_fun) par(mfrow = c(1, 2)) plotSpectraMirror(fenamiphos_swath_spectrum, ex_spectrum, ppm = 50, main = \"against DDA\") plotSpectraMirror(fenamiphos_swath_spectrum, fenamiphos[2], ppm = 50, main = \"against Metlin\") pk_ids <- fenamiphos_swath_spectrum$ms2_peak_id[[1]] pk_ids ## [1] \"CP199\" \"CP201\" \"CP211\" \"CP208\" \"CP200\" \"CP202\" \"CP217\" \"CP215\" \"CP205\" ## [10] \"CP212\" \"CP221\" \"CP223\" \"CP213\" \"CP207\" \"CP220\" rt_range <- chromPeaks(swath_data)[pk_ids, c(\"rtmin\", \"rtmax\")] mz_range <- chromPeaks(swath_data)[pk_ids, c(\"mzmin\", \"mzmax\")] pmz <- precursorMz(fenamiphos_swath_spectrum)[1] ## Determine the isolation window target m/z tmz <- swath_data |> filterIsolationWindow(mz = pmz) |> spectra() |> isolationWindowTargetMz() |> unique() ms2_eics <- chromatogram( swath_data, rt = rt_range, mz = mz_range, msLevel = 2L, isolationWindowTargetMz = rep(tmz, nrow(rt_range))) ## Processing chromatographic peaks plotChromatogramsOverlay(ms2_eics) prochloraz_mz <- 376.0381 prochloraz_ms1_peak <- chromPeaks(swath_data, msLevel = 1L, mz = prochloraz_mz, ppm = 5) prochloraz_ms1_peak ## mz mzmin mzmax rt rtmin rtmax into intb ## CP22 376.0373 376.037 376.0374 405.046 401.446 409.546 3664.051 3655.951 ## maxo sn sample ## CP22 897.3923 278 1 prochloraz_swath_spectrum <- swath_spectra[ swath_spectra$peak_id == rownames(prochloraz_ms1_peak)] lengths(prochloraz_swath_spectrum) ## [1] 9 prochloraz_dda_peak <- chromPeaks(dda_data, msLevel = 1L, mz = prochloraz_mz, ppm = 5) prochloraz_dda_peak ## mz mzmin mzmax rt rtmin rtmax into intb ## CP034 376.0385 376.0378 376.0391 405.295 401.166 410.145 5082.157 5072.77 ## maxo sn sample ## CP034 1350.633 310 1 prochloraz_dda_spectra <- dda_spectra[ dda_spectra$peak_id == rownames(prochloraz_dda_peak)] prochloraz_dda_spectra ## MSn data (Spectra) with 5 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 2 401.438 3253 ## 2 2 402.198 3259 ## 3 2 404.677 3306 ## 4 2 405.127 3316 ## 5 2 405.877 3325 ## ... 34 more variables/columns. ## ## file(s): ## PestMix1_DDA.mzML ## Processing: ## Filter: select retention time [230..610] on MS level(s) 1 2 [Wed Apr 3 13:50:30 2024] ## Filter: select MS level(s) 2 [Wed Apr 3 13:50:37 2024] ## Merge 1 Spectra into one [Wed Apr 3 13:50:37 2024] prochloraz_dda_spectrum <- combineSpectra( prochloraz_dda_spectra, FUN = combinePeaks, ppm = 20, peaks = \"intersect\", minProp = 0.8, intensityFun = median, mzFun = median, f = prochloraz_dda_spectra$peak_id) ## Backend of the input object is read-only, will change that to an 'MsBackendMemory' ## Warning in FUN(X[[i]], ...): 'combinePeaks' for lists of peak matrices is ## deprecated; please use 'combinePeaksData' instead. prochloraz <- Spectra( system.file(\"mgf\", \"metlin-68898.mgf\", package = \"xcms\"), source = MsBackendMgf()) ## Start data import from 1 files ... done prochloraz_swath_spectrum <- addProcessing(prochloraz_swath_spectrum, scale_fun) prochloraz_dda_spectrum <- addProcessing(prochloraz_dda_spectrum, scale_fun) par(mfrow = c(1, 2)) plotSpectraMirror(prochloraz_swath_spectrum, prochloraz_dda_spectrum, ppm = 40, main = \"against DDA\") plotSpectraMirror(prochloraz_swath_spectrum, prochloraz[2], ppm = 40, main = \"against Metlin\") plotSpectra(prochloraz_swath_spectrum) library(MetaboCoreUtils) isotopologues(peaksData(prochloraz_swath_spectrum)[[1]]) ## [[1]] ## [1] 3 4 5 ## ## [[2]] ## [1] 6 7 ## Function to keep only the first (monoisotopic) peak for potential ## isotopologue peak groups. rem_iso <- function(x, ...) { idx <- isotopologues(x) idx <- unlist(lapply(idx, function(z) z[-1]), use.names = FALSE) if (length(idx)) x[-idx, , drop = FALSE] else x } prochloraz_swath_spectrum2 <- addProcessing(prochloraz_swath_spectrum, rem_iso) par(mfrow = c(1, 2)) plotSpectra(prochloraz_swath_spectrum) plotSpectra(prochloraz_swath_spectrum2) compareSpectra(prochloraz_swath_spectrum, prochloraz_dda_spectrum) ## [1] 0.4623719 compareSpectra(prochloraz_swath_spectrum2, prochloraz_dda_spectrum) ## [1] 0.5932303"},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"outlook","dir":"Articles","previous_headings":"","what":"Outlook","title":"LC-MS/MS data analysis with xcms","text":"Currently, spectra data representation, handling processing re-implemented part RforMassSpectrometry initiative aiming increasing performance methods simplifying use. Thus, parts workflow described changed (improved) future. Along developments, improved matching strategies larger data sets implemented well functionality compare Spectra directly reference MS2 spectra public annotation resources (e.g. Massbank HMDB). See example information. Regarding SWATH data analysis, future development involve improved selection correct MS2 chromatographic peaks considering also correlation intensity values across several samples.","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms-lcms-ms.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"LC-MS/MS data analysis with xcms","text":"","code":"sessionInfo() ## R Under development (unstable) (2024-03-28 r86224) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.4 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] MetaboCoreUtils_1.11.2 MsBackendMgf_1.11.2 MsExperiment_1.5.4 ## [4] pander_0.6.5 Spectra_1.13.8 ProtGenerics_1.35.4 ## [7] S4Vectors_0.41.5 BiocGenerics_0.49.1 xcms_4.1.12 ## [10] BiocParallel_1.37.1 BiocStyle_2.31.0 ## ## loaded via a namespace (and not attached): ## [1] DBI_1.2.2 rlang_1.1.3 ## [3] magrittr_2.0.3 clue_0.3-65 ## [5] MassSpecWavelet_1.69.0 matrixStats_1.2.0 ## [7] compiler_4.5.0 systemfonts_1.0.6 ## [9] vctrs_0.6.5 pkgconfig_2.0.3 ## [11] crayon_1.5.2 fastmap_1.1.1 ## [13] XVector_0.43.1 utf8_1.2.4 ## [15] rmarkdown_2.26 preprocessCore_1.65.0 ## [17] ragg_1.3.0 purrr_1.0.2 ## [19] xfun_0.43 MultiAssayExperiment_1.29.1 ## [21] zlibbioc_1.49.3 cachem_1.0.8 ## [23] GenomeInfoDb_1.39.10 jsonlite_1.8.8 ## [25] progress_1.2.3 highr_0.10 ## [27] DelayedArray_0.29.9 prettyunits_1.2.0 ## [29] parallel_4.5.0 cluster_2.1.6 ## [31] R6_2.5.1 bslib_0.7.0 ## [33] RColorBrewer_1.1-3 limma_3.59.6 ## [35] GenomicRanges_1.55.4 jquerylib_0.1.4 ## [37] Rcpp_1.0.12 bookdown_0.38 ## [39] SummarizedExperiment_1.33.3 iterators_1.0.14 ## [41] knitr_1.45 IRanges_2.37.1 ## [43] Matrix_1.7-0 igraph_2.0.3 ## [45] tidyselect_1.2.1 abind_1.4-5 ## [47] yaml_2.3.8 doParallel_1.0.17 ## [49] codetools_0.2-20 affy_1.81.0 ## [51] lattice_0.22-6 tibble_3.2.1 ## [53] plyr_1.8.9 Biobase_2.63.1 ## [55] evaluate_0.23 desc_1.4.3 ## [57] pillar_1.9.0 affyio_1.73.0 ## [59] BiocManager_1.30.22 MatrixGenerics_1.15.0 ## [61] foreach_1.5.2 MSnbase_2.29.4 ## [63] MALDIquant_1.22.2 ncdf4_1.22 ## [65] generics_0.1.3 hms_1.1.3 ## [67] ggplot2_3.5.0 munsell_0.5.1 ## [69] scales_1.3.0 glue_1.7.0 ## [71] MsFeatures_1.11.0 lazyeval_0.2.2 ## [73] tools_4.5.0 mzID_1.41.0 ## [75] QFeatures_1.13.3 vsn_3.71.1 ## [77] mzR_2.37.3 fs_1.6.3 ## [79] XML_3.99-0.16.1 grid_4.5.0 ## [81] impute_1.77.0 MsCoreUtils_1.15.6 ## [83] colorspace_2.1-0 GenomeInfoDbData_1.2.12 ## [85] PSMatch_1.7.2 cli_3.6.2 ## [87] textshaping_0.3.7 fansi_1.0.6 ## [89] S4Arrays_1.3.6 dplyr_1.1.4 ## [91] AnnotationFilter_1.27.0 pcaMethods_1.95.0 ## [93] gtable_0.3.4 sass_0.4.9 ## [95] digest_0.6.35 SparseArray_1.3.4 ## [97] htmlwidgets_1.6.4 memoise_2.0.1 ## [99] htmltools_0.5.8 pkgdown_2.0.7.9000 ## [101] lifecycle_1.0.4 statmod_1.5.0 ## [103] MASS_7.3-60.2"},{"path":[]},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"LC-MS data pre-processing and analysis with xcms","text":"xcms package provides functionality perform pre-processing LC-MS, GC-MS LC-MS/MS data raw signals mzML, mzXML CDF files processed feature abundances. pre-processing includes chromatographic peak detection, sample alignment correspondence analysis. first version package already published 2006 [1] since updated modernized several rounds better integrate R-based packages analysis untargeted metabolomics data. includes version 3 xcms used MSnbase package MS data representation [2]. recent update (xcms version 4) enables addition pre-processing MS data represented modern MsExperiment Spectra packages provides even better integration RforMassSpectrometry R package ecosystem simplifying e.g. also compound annotation [3]. document describes data import, exploration pre-processing simple test LC-MS data set xcms package version >= 4. functions can applied older MSnbase-based workflows (xcms version 3). Additional documents tutorials covering also topics untargeted metabolomics analysis listed end document. also xcms tutorial available examples details.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"data-import","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Data import","title":"LC-MS data pre-processing and analysis with xcms","text":"xcms supports analysis LC-MS(/MS) data can imported Spectra package. data typically provided (AIA/ANDI) NetCDF, mzXML mzML format can, dedicated extensions Spectra package, also imported sources, e.g. also directly raw data files manufacturer’s formats. demonstration purpose analyze document small subset data [4] metabolic consequences knock-fatty acid amide hydrolase (FAAH) gene mice investigated. raw data files (NetCDF format) provided faahKO data package. data set consists samples spinal cords 6 knock-6 wild-type mice. file contains data centroid mode acquired positive ion polarity 200-600 m/z 2500-4500 seconds. speed-processing vignette restrict analysis 8 files. load required packages, locate raw CDF files within faahKO package build phenodata data.frame describing experimental setup. Generally, data frames contain relevant experimental variables sample descriptions (including also names raw data files) imported R using either read.table function (file csv tabulator delimited text file format) also using functions readxl R package Excel file format. next load data using readMsExperiment function MsExperiment package. MS spectra data experiment now available Spectra object within faahko. Note MsExperiment container addition spectra data also contain types data also references files. See vignette MsExperiment details. Also, loading data mzML, mzXML CDF files, default general spectra data loaded memory actual peaks data, .e. m/z intensity values retrieved --fly raw files needed (similar MSnbase -disk mode described [2]). guarantees low memory footprint hence allowing analyze also large experiments without need high performance computing environments. Note also different alternative backends (hence data representations) used Spectra object within faahko eventually even lower memory footprint, higher performance. See package vignette Spectra package SpectraTutorials tutorial details Spectra backends change .","code":"library(xcms) library(faahKO) library(RColorBrewer) library(pander) library(pheatmap) library(MsExperiment) ## Get the full path to the CDF files cdfs <- dir(system.file(\"cdf\", package = \"faahKO\"), full.names = TRUE, recursive = TRUE)[c(1, 2, 5, 6, 7, 8, 11, 12)] ## Create a phenodata data.frame pd <- data.frame(sample_name = sub(basename(cdfs), pattern = \".CDF\", replacement = \"\", fixed = TRUE), sample_group = c(rep(\"KO\", 4), rep(\"WT\", 4)), stringsAsFactors = FALSE) faahko <- readMsExperiment(spectraFiles = cdfs, sampleData = pd) faahko ## Object of class MsExperiment ## Spectra: MS1 (10224) ## Experiment data: 8 sample(s) ## Sample data links: ## - spectra: 8 sample(s) to 10224 element(s)."},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"initial-data-inspection","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Initial data inspection","title":"LC-MS data pre-processing and analysis with xcms","text":"MsExperiment object simple flexible container MS experiments. raw MS data stored Spectra object can accessed spectra function. spectra organized sequentially (.e., file) fromFile function can used get spectrum information data files belongs. simply count number spectra per file. Information samples can retrieved sampleData function. row DataFrame represents one sample (input file). Using [ possible subset MsExperiment object sample. subset faahko 3rd sample (file) access spectra sample data. first evaluation data plot base peak chromatogram (BPC) file experiment. use chromatogram method set aggregationFun \"max\" return spectrum maximal intensity hence create BPC raw data. create total ion chromatogram set aggregationFun \"sum\". Base peak chromatogram. chromatogram method returned MChromatograms object organizes individual Chromatogram objects (fact contain chromatographic data) two-dimensional array: columns represent samples rows (optionally) m/z /retention time ranges. extract chromatogram first sample access retention time intensity values. BPC seems around 4200 seconds signal measured anymore. Thus, filter full data set retention time range 2550 4250 seconds using filterRt function. Note present subset spectra within MsExperiment. Subsequently re-create also BPC. next create boxplots representing distribution total ion currents per data file. plots can useful spot potentially problematic MS runs. extract information, use tic function Spectra object within faahko split values file using fromFile. Distribution total ion currents per file. addition, can also cluster samples based similarity base peak chromatograms. Samples thus grouped based similarity LC runs. need however bin data along retention time axis, since retention times generally differ samples. use bin function BPC bin intensities 2 second wide retention time bins. clustering performed using complete linkage hierarchical clustering pairwise correlations binned base peak chromatograms. Grouping samples based similarity base peak chromatogram. samples cluster pairwise manner, KO WT samples sample index similar BPC.","code":"spectra(faahko) ## MSn data (Spectra) with 10224 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 1 2501.38 1 ## 2 1 2502.94 2 ## 3 1 2504.51 3 ## 4 1 2506.07 4 ## 5 1 2507.64 5 ## ... ... ... ... ## 10220 1 4493.56 1274 ## 10221 1 4495.13 1275 ## 10222 1 4496.69 1276 ## 10223 1 4498.26 1277 ## 10224 1 4499.82 1278 ## ... 33 more variables/columns. ## ## file(s): ## ko15.CDF ## ko16.CDF ## ko21.CDF ## ... 5 more files table(fromFile(faahko)) ## ## 1 2 3 4 5 6 7 8 ## 1278 1278 1278 1278 1278 1278 1278 1278 sampleData(faahko) ## DataFrame with 8 rows and 3 columns ## sample_name sample_group spectraOrigin ## ## 1 ko15 KO /__w/_temp... ## 2 ko16 KO /__w/_temp... ## 3 ko21 KO /__w/_temp... ## 4 ko22 KO /__w/_temp... ## 5 wt15 WT /__w/_temp... ## 6 wt16 WT /__w/_temp... ## 7 wt21 WT /__w/_temp... ## 8 wt22 WT /__w/_temp... faahko_3 <- faahko[3] spectra(faahko_3) ## MSn data (Spectra) with 1278 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 1 2501.38 1 ## 2 1 2502.94 2 ## 3 1 2504.51 3 ## 4 1 2506.07 4 ## 5 1 2507.64 5 ## ... ... ... ... ## 1274 1 4493.56 1274 ## 1275 1 4495.13 1275 ## 1276 1 4496.69 1276 ## 1277 1 4498.26 1277 ## 1278 1 4499.82 1278 ## ... 33 more variables/columns. ## ## file(s): ## ko21.CDF sampleData(faahko_3) ## DataFrame with 1 row and 3 columns ## sample_name sample_group spectraOrigin ## ## 1 ko21 KO /__w/_temp... ## Get the base peak chromatograms. This reads data from the files. bpis <- chromatogram(faahko, aggregationFun = \"max\") ## Define colors for the two groups group_colors <- paste0(brewer.pal(3, \"Set1\")[1:2], \"60\") names(group_colors) <- c(\"KO\", \"WT\") ## Plot all chromatograms. plot(bpis, col = group_colors[sampleData(faahko)$sample_group]) bpi_1 <- bpis[1, 1] rtime(bpi_1) |> head() ## [1] 2501.378 2502.943 2504.508 2506.073 2507.638 2509.203 intensity(bpi_1) |> head() ## [1] 43888 43960 43392 42632 42200 42288 faahko <- filterRt(faahko, rt = c(2550, 4250)) ## Filter spectra ## creating the BPC on the subsetted data bpis <- chromatogram(faahko, aggregationFun = \"max\") ## Get the total ion current by file tc <- spectra(faahko) |> tic() |> split(f = fromFile(faahko)) boxplot(tc, col = group_colors[sampleData(faahko)$sample_group], ylab = \"intensity\", main = \"Total ion current\") ## Bin the BPC bpis_bin <- bin(bpis, binSize = 2) ## Calculate correlation on the log2 transformed base peak intensities cormat <- cor(log2(do.call(cbind, lapply(bpis_bin, intensity)))) colnames(cormat) <- rownames(cormat) <- bpis_bin$sample_name ## Define which phenodata columns should be highlighted in the plot ann <- data.frame(group = bpis_bin$sample_group) rownames(ann) <- bpis_bin$sample_name ## Perform the cluster analysis pheatmap(cormat, annotation = ann, annotation_color = list(group = group_colors))"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"chromatographic-peak-detection","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Chromatographic peak detection","title":"LC-MS data pre-processing and analysis with xcms","text":"Chromatographic peak detection aims identifying signal sample created ions originating compound species. Chromatographic peak detection can performed xcms findChromPeaks function parameter object defines configures algorithm used (see ?findChromPeaks list supported algorithms). running peak detection however strongly suggested first visually inspect extracted ion chromatogram e.g. internal standards compounds known present samples order evaluate adapt settings peak detection algorithm since default settings appropriate LC-MS setups. extract EIC one compound using chromatogram function specifying addition m/z retention time range expect signal compound. Extracted ion chromatogram one peak. Note Chromatogram objects extracted chromatogram method contain NA value certain scan (.e. spectrum specific retention time) signal measured respective m/z range. reflected lines drawn continuous lines plot . peak thus width 50 seconds. can use information define peakwidth parameter centWave peak detection method [5] use chromatographic peak detection data. peakwidth parameter allows define expected lower upper width (retention time dimension) chromatographic peaks. data set thus peakwidth = c(20, 80). second important parameter centWave ppm defines expected maximum deviation m/z values centroids included one chromatographic peak (note precision m/z values provided MS instrument manufacturer). ppm parameter extract full MS data (intensity, retention time m/z values) corresponding peak. end first filter raw object retention time, m/z finally plot object type = \"XIC\" produce plot . use pipe (|>) operator better illustrate corresponding workflow. Visualization raw MS data one peak. plot: upper panel: chromatogram plotting intensity values retention time, lower panel m/z retention time plot. individual data points colored according intensity. present data actually variation m/z values. Usually m/z values individual centroids (lower panel) plots scatter around real m/z value compound (intensity dependent manner). first step centWave algorithm defines regions interest (ROI) subsequently screened presence chromatographic peaks. ROIs defined based difference m/z values centroids consecutive scans (spectra). detail, centroids consecutive scans included ROI difference m/z mean m/z ROI smaller user defined ppm parameter. reasonable choice ppm thus maximal m/z difference data points neighboring scans/spectra part chromatographic peak internal standard known compound. suggested inspect ranges m/z values several compounds (either internal standards compounds known present sample) define ppm parameter centWave according . See also tutorial additional information examples choosing testing peak detection settings. Chromatographic peak detection can also performed extracted ion chromatograms, helps testing tuning peak detection settings. Note however peak detection EICs involve first step centWave described thus consider ppm parameter. Also, since less data available algorithms, background signal estimation performed differently different settings snthresh need used (generally lower snthresh used EICs since estimated background signal tends higher data subsets full data). perform peak detection findChromPeaks function EIC generated . submitted parameter object defines algorithm used allows define settings algorithm. use CentWaveParam parameter object use configure centWave algorithm default settings, except snthresh. can access identified chromatographic peaks chromPeaks function. Parallel chromPeaks matrix also chromPeakData data frame allows add arbitrary annotations chromatographic peak, e.g. MS level peak detected: plot EIC along identified chromatographic peaks using plot function result object . Additional parameters peakCol peakBg allow define foreground background (fill) color identified chromatographic peak provided result object (.e., need define one color row chromPeaks(xchr) - column \"column\" (\"sample\" present) peak matrix specifies sample peak identified). Signal example peak. Red blue colors represent KO wild type samples, respectively. Peak area identified chromatographic peaks highlighted sample group color. happy settings can use peak detection full data set (.e. MsExperiment object data whole experiment). Note set argument prefilter c(6, 5000) noise 5000 reduce run time vignette. setting consider ROIs least 6 centroids intensity larger 5000 centWave chromatographic peak detection. results findChromPeaks MsExperiment object returned XcmsExperiment object. object extends MsExperiment directly (hence providing access raw data) contains xcms pre-processing results. Note also additional rounds chromatographic peak detections performed results added existing peak detection results additional calls findChromPeaks result object using parameter add = TRUE. chromPeaks function can also used access results chromatographic peak detection. show first 6 identified chromatographic peaks. Columns chromPeaks matrix might differ depending used peak detection algorithm. Columns algorithms provide : \"mz\", \"mzmin\", \"mzmax\", \"rt\", \"rtmin\" \"rtmax\" define m/z retention time range chromatographic peak (.e. mass peaks within area used integrate peak signal) well m/z retention time peak apex. mandatory columns \"\" \"maxo\" absolute integrated peak signal maximum peak intensity. Finally, \"sample\" provides index sample peak identified. Additional annotations individual peak can extracted chromPeakData function. data frame also used add/store arbitrary annotations detected peak (don’t necessarily need numeric). Peak detection always work perfectly types peak shapes present data set leading peak detection artifacts, (partially completely) overlapping peaks artificially split peaks (common issues especially centWave). xcms provides refineChromPeaks function can called peak detection results order refine (clean) peak detection results either removing identified peaks passing certain criteria merging artificially split partially completely overlapping chromatographic peaks. Different algorithms available can configured respective parameter objects: CleanPeaksParam FilterIntensityParam allow remove peaks retention time range intensity specified threshold, respectively. MergeNeighboringPeaksParam possible merge chromatographic peaks hence remove many mentioned (centWave) peak detection artifacts. See also ?refineChromPeaks information help different methods. post-process peak detection results merging peaks overlap 4 second window per file signal lower 75% smaller peak’s maximal intensity. See ?MergeNeighboringPeaksParam help page detailed description settings approach. example merged peak given . Result peak refinement step. Left: data processing, right: refinement. splitted peak merged one. centWave thus detected originally 3 chromatographic peaks m/z slice (left panel plot ) peak refinement MergeNeighboringPeaksParam specified settings merged first two peaks single one (right panel figure ). close peaks, lower intensity , however merged (see ). Result peak refinement step. Left: data processing, right: refinement. peaks merged. also possible perform peak refinement extracted ion chromatograms. used test fine-tune settings parameter avoid potential problematic behavior. minProp parameter example carefully chosen avoid merging isomer peaks (like example ). default minProp = 0.75 peaks merged signal two peaks higher 75% smaller peak’s maximal intensity. Setting value low eventually result merging isomers shown . Thus, running peak refinement evaluate isomers present data set wrongly merged based chosen settings. proceeding next replace faahko object results peak refinement step. use data chromPeaks matrix calculate per-file summaries peak detection results, number peaks per file well distribution retention time widths. Summary statistics identified chromatographic peaks. Shown number identified peaks per sample widths/duration chromatographic peaks. default chromPeaks return identified chromatographic peaks result object also possible extract chromatographic peaks specified m/z /rt range: can also plot location identified chromatographic peaks m/z - retention time space one file using plotChromPeaks function. plot information third sample. Identified chromatographic peaks m/z retention time space one sample. general overview peak detection results can addition visualize number identified chromatographic peaks per file along retention time axis. Parameter binSize allows define width bins rt dimension peaks counted. number chromatographic peaks within bin shown color-coded resulting plot. Frequency identified chromatographic peaks along retention time axis. frequency color coded higher frequency represented yellow-white. line shows peak frequency one file. Note extracting ion chromatorams xcms result object addition chromatographic data also extract identified chromatographic peaks within region. can thus also used validate verify used peak detection settings identified e.g. peaks known compounds internal standards properly. extract ion chromatogram m/z - rt region access detected peaks region using chromPeaks function. can also plot extracted ion chromatogram also visualize identified chromatographic peaks region. Signal example peak. Red blue colors represent KO wild type samples, respectively. signal area identified chromatographic peaks filled color. Chromatographic peaks can visualized also ways: setting peakType = \"rectangle\" indicated rectangle instead default highlighting option (peakType = \"polygon\") used . third alternative also possible just indicate apex position identified chromatographic peak single point (peakType = \"point\"). plot data using peakType = \"rectangle\". Signal example peak. Red blue colors represent KO wild type samples, respectively. rectangles indicate identified chromatographic peaks per sample. Finally plot also distribution peak intensity per sample. allows investigate whether systematic differences peak signals samples present. Peak intensity distribution per sample. signal identified chromatographic peaks comparable across samples, exception samples 3, 4 , degree, also 7 show slightly higher average intensities, also lower number detected peaks (indicated smaller width boxes). Note addition described identification chromatographic peaks, also possible manually define add chromatographic peaks manualChromPeaks function (see ?manualChromPeaks help page information).","code":"## Define the rt and m/z range of the peak area rtr <- c(2700, 2900) mzr <- c(334.9, 335.1) ## extract the chromatogram chr_raw <- chromatogram(faahko, mz = mzr, rt = rtr) plot(chr_raw, col = group_colors[chr_raw$sample_group]) faahko |> filterRt(rt = rtr) |> filterMz(mz = mzr) |> plot(type = \"XIC\") xchr <- findChromPeaks(chr_raw, param = CentWaveParam(snthresh = 2)) chromPeaks(xchr) ## rt rtmin rtmax into intb maxo sn row column ## [1,] 2781.505 2761.160 2809.674 412134.255 355516.374 16856 13 1 1 ## [2,] 2786.199 2764.290 2812.803 1496244.206 1391821.332 58736 20 1 2 ## [3,] 2734.556 2714.211 2765.855 21579.367 18449.428 899 4 1 3 ## [4,] 2797.154 2775.245 2815.933 159058.782 150289.314 6295 12 1 3 ## [5,] 2784.635 2761.160 2808.109 54947.545 37923.532 2715 2 1 4 ## [6,] 2859.752 2845.668 2878.532 13895.212 13874.868 905 904 1 4 ## [7,] 2897.311 2891.051 2898.876 5457.155 5450.895 995 994 1 4 ## [8,] 2819.064 2808.109 2834.713 19456.914 19438.134 1347 1576 1 4 ## [9,] 2789.329 2762.725 2808.109 174473.311 91114.975 8325 3 1 5 ## [10,] 2786.199 2764.290 2812.803 932645.211 569236.246 35856 2 1 6 ## [11,] 2792.461 2768.987 2823.760 876585.527 511324.134 27200 2 1 7 ## [12,] 2789.329 2773.680 2806.544 89582.569 73871.386 5427 6 1 8 chromPeakData(xchr) ## DataFrame with 12 rows and 4 columns ## ms_level is_filled row column ## ## 1 1 FALSE 1 1 ## 2 1 FALSE 1 2 ## 3 1 FALSE 1 3 ## 4 1 FALSE 1 3 ## 5 1 FALSE 1 4 ## ... ... ... ... ... ## 8 1 FALSE 1 4 ## 9 1 FALSE 1 5 ## 10 1 FALSE 1 6 ## 11 1 FALSE 1 7 ## 12 1 FALSE 1 8 ## Define a color for each sample sample_colors <- group_colors[xchr$sample_group] ## Define the background color for each chromatographic peak bg <- sample_colors[chromPeaks(xchr)[, \"column\"]] ## Parameter `col` defines the color of each sample/line, `peakBg` of each ## chromatographic peak. plot(xchr, col = sample_colors, peakBg = bg) cwp <- CentWaveParam(peakwidth = c(20, 80), noise = 5000, prefilter = c(6, 5000)) faahko <- findChromPeaks(faahko, param = cwp) chromPeaks(faahko) |> head() ## mz mzmin mzmax rt rtmin rtmax into intb maxo sn ## CP0001 594.0 594.0 594.0 2601.535 2581.191 2637.529 161042.2 146073.3 7850 11 ## CP0002 577.0 577.0 577.0 2604.665 2581.191 2626.574 136105.2 128067.9 6215 11 ## CP0003 307.0 307.0 307.0 2618.750 2592.145 2645.354 284782.4 264907.0 16872 20 ## CP0004 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 669778.1 30552 43 ## CP0005 370.1 370.1 370.1 2673.523 2643.789 2700.127 449284.6 417225.3 25672 17 ## CP0006 427.0 427.0 427.0 2675.088 2643.789 2684.478 283334.7 263943.2 11025 13 ## sample ## CP0001 1 ## CP0002 1 ## CP0003 1 ## CP0004 1 ## CP0005 1 ## CP0006 1 chromPeakData(faahko) ## DataFrame with 2908 rows and 2 columns ## ms_level is_filled ## ## CP0001 1 FALSE ## CP0002 1 FALSE ## CP0003 1 FALSE ## CP0004 1 FALSE ## CP0005 1 FALSE ## ... ... ... ## CP2904 1 FALSE ## CP2905 1 FALSE ## CP2906 1 FALSE ## CP2907 1 FALSE ## CP2908 1 FALSE mpp <- MergeNeighboringPeaksParam(expandRt = 4) faahko_pp <- refineChromPeaks(faahko, mpp) mzr_1 <- 305.1 + c(-0.01, 0.01) chr_1 <- chromatogram(faahko[1], mz = mzr_1) ## Processing chromatographic peaks chr_2 <- chromatogram(faahko_pp[1], mz = mzr_1) ## Processing chromatographic peaks par(mfrow = c(1, 2)) plot(chr_1) plot(chr_2) mzr_1 <- 496.2 + c(-0.01, 0.01) chr_1 <- chromatogram(faahko[1], mz = mzr_1) ## Processing chromatographic peaks chr_2 <- chromatogram(faahko_pp[1], mz = mzr_1) ## Processing chromatographic peaks par(mfrow = c(1, 2)) plot(chr_1) plot(chr_2) #' Too low minProp could cause merging of isomers! res <- refineChromPeaks(chr_1, MergeNeighboringPeaksParam(minProp = 0.05)) chromPeaks(res) ## mz mzmin mzmax rt rtmin rtmax into intb maxo sn ## CPM1 496.2 496.19 496.21 3384.012 3294.809 3412.181 45940118 NA 1128960 177 ## sample row column ## CPM1 1 1 1 plot(res) faahko <- faahko_pp summary_fun <- function(z) c(peak_count = nrow(z), rt = quantile(z[, \"rtmax\"] - z[, \"rtmin\"])) T <- chromPeaks(faahko) |> split.data.frame(f = chromPeaks(faahko)[, \"sample\"]) |> lapply(FUN = summary_fun) |> do.call(what = rbind) rownames(T) <- basename(fileNames(faahko)) pandoc.table( T, caption = paste0(\"Summary statistics on identified chromatographic\", \" peaks. Shown are number of identified peaks per\", \" sample and widths/duration of chromatographic \", \"peaks.\")) chromPeaks(faahko, mz = c(334.9, 335.1), rt = c(2700, 2900)) ## mz mzmin mzmax rt rtmin rtmax into intb maxo sn ## CP0038 335 335 335 2781.505 2761.160 2809.674 412134.3 383167.4 16856 23 ## CP0494 335 335 335 2786.199 2764.290 2812.803 1496244.2 1461187.3 58736 72 ## CP1025 335 335 335 2797.154 2775.245 2815.933 159058.8 149229.6 6295 13 ## CP1964 335 335 335 2786.199 2764.290 2812.803 932645.2 915333.8 35856 66 ## CP2349 335 335 335 2792.461 2768.987 2823.760 876585.5 848569.1 27200 36 ## sample ## CP0038 1 ## CP0494 2 ## CP1025 3 ## CP1964 6 ## CP2349 7 plotChromPeaks(faahko, file = 3) plotChromPeakImage(faahko, binSize = 10) chr_ex <- chromatogram(faahko, mz = mzr, rt = rtr) chromPeaks(chr_ex) ## mz mzmin mzmax rt rtmin rtmax into intb maxo sn ## CP0038 335 335 335 2781.505 2761.160 2809.674 412134.3 383167.4 16856 23 ## CP0494 335 335 335 2786.199 2764.290 2812.803 1496244.2 1461187.3 58736 72 ## CP1025 335 335 335 2797.154 2775.245 2815.933 159058.8 149229.6 6295 13 ## CP1964 335 335 335 2786.199 2764.290 2812.803 932645.2 915333.8 35856 66 ## CP2349 335 335 335 2792.461 2768.987 2823.760 876585.5 848569.1 27200 36 ## sample row column ## CP0038 1 1 1 ## CP0494 2 1 2 ## CP1025 3 1 3 ## CP1964 6 1 6 ## CP2349 7 1 7 sample_colors <- group_colors[chr_ex$sample_group] plot(chr_ex, col = group_colors[chr_raw$sample_group], lwd = 2, peakBg = sample_colors[chromPeaks(chr_ex)[, \"sample\"]]) plot(chr_ex, col = sample_colors, peakType = \"rectangle\", peakCol = sample_colors[chromPeaks(chr_ex)[, \"sample\"]], peakBg = NA) ## Extract a list of per-sample peak intensities (in log2 scale) ints <- split(log2(chromPeaks(faahko)[, \"into\"]), f = chromPeaks(faahko)[, \"sample\"]) boxplot(ints, varwidth = TRUE, col = sample_colors, ylab = expression(log[2]~intensity), main = \"Peak intensities\") grid(nx = NA, ny = NULL)"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"alignment","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Alignment","title":"LC-MS data pre-processing and analysis with xcms","text":"time analytes elute chromatography can vary samples (even compounds). differences already visible BPC even extracted ion chromatogram plot previous section. alignment step, also referred retention time correction, aims adjust differences shifting signals along retention time axis aligning different samples within experiment. plethora alignment algorithms exist (see [6]), also implemented xcms. Alignment LC-MS data can performed xcms using adjustRtime method algorithm-specific parameter class (see ?adjustRtime overview available methods xcms). example use obiwarp method [7] align samples. use binSize = 0.6 creates warping functions m/z bins 0.6. Also advisable modify adapt settings experiment. Note adjustRtime, besides calculating adjusted retention times spectrum, adjusts also retention times identified chromatographic peaks xcms result object. Adjusted retention times individual spectra can extracted result object using either adjustedRtime function using rtime parameter adjusted = TRUE (default): evaluate impact alignment plot BPC adjusted data. addition plot also differences adjusted raw retention times per sample using plotAdjustedRtime function. disable automatic extraction identified chromatographic peaks chromatogram function (make much sense BPC) use chromPeaks = \"none\" . Obiwarp aligned data. Base peak chromatogram (top) alignment (middle) difference adjusted raw retention times along retention time axis (bottom). large differences adjusted raw retention times indicate poorly performing samples alignment. last evaluate also impact alignment test peak. Example extracted ion chromatogram (top) alignment (bottom). Note: xcms result objects (XcmsExperiment well XCMSnExp) contain raw adjusted retention times spectra subset operation many cases drop adjusted retention times. Thus might sometimes useful immediately replace raw retention times data using applyAdjustedRtime function.","code":"faahko <- adjustRtime(faahko, param = ObiwarpParam(binSize = 0.6)) ## Extract adjusted retention times adjustedRtime(faahko) |> head() ## [1] 2551.457 2553.089 2554.720 2556.352 2557.983 2559.615 ## Or simply use the rtime method rtime(faahko) |> head() ## [1] 2551.457 2553.089 2554.720 2556.352 2557.983 2559.615 ## Get raw (unadjusted) retention times rtime(faahko, adjusted = FALSE) |> head() ## [1] 2551.457 2553.022 2554.586 2556.151 2557.716 2559.281 ## Get the base peak chromatograms. bpis_adj <- chromatogram(faahko, aggregationFun = \"max\", chromPeaks = \"none\") par(mfrow = c(3, 1), mar = c(4.5, 4.2, 1, 0.5)) plot(bpis, col = sample_colors) grid() plot(bpis_adj, col = sample_colors) grid() ## Plot also the difference of adjusted to raw retention time. plotAdjustedRtime(faahko, col = sample_colors) grid() par(mfrow = c(2, 1)) ## Plot the raw data plot(chr_raw, col = sample_colors) grid() ## Extract the chromatogram from the adjusted object chr_adj <- chromatogram(faahko, rt = rtr, mz = mzr) plot(chr_adj, col = sample_colors, peakType = \"none\") grid()"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"subset-based-alignment","dir":"Articles","previous_headings":"Pre-processing of LC-MS data > Alignment","what":"Subset-based alignment","title":"LC-MS data pre-processing and analysis with xcms","text":"experiments might better perform alignment based subset available samples, e.g. pooled QC samples injected regular intervals experiment contains blanks. alignment methods xcms support subset-based alignment retention time shifts estimated specified subset samples followed alignment whole data set based aligned subset. subset samples alignment can specified parameter subset PeakGroupsParam ObiwarpParam object. Parameter subsetAdjust allows specify method left-samples adjusted. currently two options available: subsetAdjust = \"previous\": adjust retention times non-subset sample based alignment results previous subset sample (e.g. QC sample). samples e.g. order A1, B1, B2, A2, B3, B4 representing QC samples B study samples, using subset = c(1, 4) subsetAdjust = \"previous\" result samples aligned non-subset samples B1 B2 adjusted based alignment result subset samples A1 B3 B4 A2. subsetAdjust = \"average\": adjust retention times non-subset samples based interpolation alignment results previous subsequent subset sample. example , B1 adjusted based average adjusted retention times subset (QC) samples A1 A2. Since subset sample non-subset samples B3 B4 adjusted based alignment results A2 alone. Note weighted average used calculate adjusted retention time averages, uses inverse difference index non-subset sample subset samples weights. Thus, setup like A1, B1, B2, A2 adjusted retention times A1 get larger weight A2 adjustment non-subset sample B1 causing ’s adjusted retention times closer A1 A2. See examples. Important: cases require meaningful/correct ordering samples within object (.e., samples ordered injection index). examples aim illustrate effect alignment options. assume samples 1, 4 7 faahKO data set QC pool samples. thus want perform alignment based samples subsequently adjust retention times left-samples (2, 3, 5, 6 8) based interpolation results neighboring subset (QC) samples. initial peak grouping perform subset-based alignment peak groups method passing indices QC samples subset parameter PeakGroupsParam function set subsetAdjust = \"average\" adjust study samples based interpolation alignment results neighboring subset/QC samples. Note subset-alignment parameters minFraction relative subset, full experiment! first remove previous alignment results dropAdjustedRtime function allow fresh alignment using subset-based option outlined . addition removing adjusted retention times spectra, function also restore original retention times identified chromatographic peaks. alignment peak groups method initial peak grouping (correspondence) analysis required, algorithm estimates retention times shifts samples using retention times hook peaks (.e. chromatographic peaks present /samples). use default settings peak density method-based correspondence, strongly advised adapt parameters data set (details next section). definition sample groups (.e. assignment individual samples sample groups experiment) mandatory PeakDensityParam. sample groups experiment, sampleGroups set single value file (e.g. rep(1, length(fileNames(faahko))). plot results alignment highlighting subset samples green. nicely shows interpolation subsetAdjust = \"average\" works: retention times sample 2 adjusted based subset sample 1 4, giving however weight closer subset sample 1 results adjusted retention times 2 similar sample 1. Sample 3 hand gets adjusted giving weight second subset sample (4). Subset-alignment results option average. Difference adjusted raw retention times along retention time axis. Samples alignment models estimated shown green, study samples grey. Option subsetAdjust = \"previous\" adjust retention times non-subset sample based single subset sample (previous), results cases adjusted retention times non-subset sample highly similar subset sample used adjustment.","code":"faahko <- dropAdjustedRtime(faahko) ## Define the experimental layout sampleData(faahko)$sample_type <- \"study\" sampleData(faahko)$sample_type[c(1, 4, 7)] <- \"QC\" ## Initial peak grouping. Use sample_type as grouping variable pdp_subs <- PeakDensityParam(sampleGroups = sampleData(faahko)$sample_type, minFraction = 0.9) faahko <- groupChromPeaks(faahko, param = pdp_subs) ## Define subset-alignment options and perform the alignment pgp_subs <- PeakGroupsParam( minFraction = 0.85, subset = which(sampleData(faahko)$sample_type == \"QC\"), subsetAdjust = \"average\", span = 0.4) faahko <- adjustRtime(faahko, param = pgp_subs) clrs <- rep(\"#00000040\", 8) clrs[sampleData(faahko)$sample_type == \"QC\"] <- c(\"#00ce0080\") par(mfrow = c(2, 1), mar = c(4, 4.5, 1, 0.5)) plot(chromatogram(faahko, aggregationFun = \"max\", chromPeaks = \"none\"), col = clrs) grid() plotAdjustedRtime(faahko, col = clrs, peakGroupsPch = 1, peakGroupsCol = \"#00ce0040\") grid()"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"correspondence","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Correspondence","title":"LC-MS data pre-processing and analysis with xcms","text":"Correspondence usually final step LC-MS data pre-processing data, presumably representing signal originating ions, matched across samples. result, chromatographic peaks different samples similar m/z retention times get grouped LC-MS features. function perform correspondence xcms called groupChromPeaks supports different algorithms can selected configured specific parameter object (see ?groupChromPeaks overview). example use peak density method [1] , within small slices along m/z dimension, combines chromatographic peaks depending density peaks along retention time axis. illustrate , simulate peak grouping m/z slice containing multiple chromatoghaphic peaks within sample using plotChromPeakDensity function PeakDensityParam object parameter minFraction = 0.4 (features defined least 40% samples chromatographic peak present) - parameter sampleGroups used define sample group sample belongs. Example peak density correspondence. Upper panel: chromatogram mz slice multiple chromatographic peaks. lower panel: identified chromatographic peaks retention time (x-axis) index within samples experiments (y-axis) different values bw parameter. black line represents peak density estimate. Grouping peaks (based provided settings) indicated grey rectangles. upper panel plot shows extracted ion chromatogram sample detected peaks highlighted. retention times individual chromatographic peaks sample (y-axis index sample data set) shown lower panel solid black line representing density estimate distribution detected peaks along retention time. Parameter bw defines smoothness estimation. grey rectangles indicate chromatographic peaks grouped feature (grey rectangle thus representing one feature). type visualization thus ideal test, validate optimize correspondence settings manually defined m/z slices applying full data set. tested m/z slice settings seemed OK thus applying full data set . Especially parameter bw data set dependent (specifically LC-dependent) adapted data set. Another important parameter binSize defines size m/z slices (bins) within peaks grouped. parameter thus defines required similarity m/z values chromatographic peaks assumed represent signal (type ion ) compound hence evaluated grouping. default, constant m/z bin size used, changing parameter ppm value larger 0, m/z-relative bin sizes used instead (.e., bin size increase m/z value hence better representing measurement error/precision MS instruments). bin sizes (subsequently m/z width defined features) reach maximal value binSize plus ppm parts-per-million largest m/z value chromatographic peak data set. See also xcms tutorial examples details. alternative perform correspondence using m/z relative bin sizes. results mostly similar, except higher m/z range (larger m/z bins used). plot m/z range features median m/z. present data set (acquired triple quad instrument) clear difference can seen two approaches hence proceed analysis fixed bin size setting. stronger relationship expected example data measured TOF instruments. Relationship feature’s m/z m/z width (max - min m/z) feature. Red points represent results fixed m/z bin size, blue m/z-relative bin size. Results correspondence analysis can accessed featureDefinitions featureValues function. former returns data frame general information defined features, row one feature columns providing information median m/z retention time well indices chromatographic peaks assigned feature column \"peakidx\". show information first 6 features. featureValues function returns matrix rows features columns samples. content matrix can defined using value argument can column name chromPeaks matrix. default value = \"\" matrix integrated signal peaks corresponding feature sample returned. generally used intensity matrix downstream analysis. extract intensities first 6 features. can see several missing values feature matrix. Missing values reported one sample chromatographic peak detected m/z - rt region feature. however necessarily mean signal specific ion sample. chromatographic peak detection algorithm also just failed identify peak region, e.g. signal noisy low. Thus advisable perform, correspondence, also gap-filling (see next section). performance peak detection, alignment correspondence always evaluated inspecting extracted ion chromatograms e.g. known compounds, internal standards identified features general. featureChromatograms function allows extract chromatograms feature present featureDefinitions. returned MChromatograms object contains ion chromatogram feature (row containing data one feature) sample (column representing containing data one sample). Parameter features allows define specific features EIC returned. can specified index ID (.e. row name featureDefinitions data frame. features defined, EICs returned features data set, can take also considerable amount time. extract chromatograms first 4 features. plot extracted ion chromatograms. use group color identified peak fill area. Extracted ion chromatograms features 1 4. access EICs second feature can simply subset feature_chroms object.","code":"## Define the mz slice. mzr <- c(305.05, 305.15) ## Extract and plot the chromatograms chr_mzr <- chromatogram(faahko, mz = mzr) ## Define the parameters for the peak density method pdp <- PeakDensityParam(sampleGroups = sampleData(faahko)$sample_group, minFraction = 0.4, bw = 30) plotChromPeakDensity(chr_mzr, col = sample_colors, param = pdp, peakBg = sample_colors[chromPeaks(chr_mzr)[, \"sample\"]], peakCol = sample_colors[chromPeaks(chr_mzr)[, \"sample\"]], peakPch = 16) ## Perform the correspondence using fixed m/z bin sizes. pdp <- PeakDensityParam(sampleGroups = sampleData(faahko)$sample_group, minFraction = 0.4, bw = 30) faahko <- groupChromPeaks(faahko, param = pdp) ## Drop feature definitions and re-perform the correspondence ## using m/z-relative bin sizes. faahko_ppm <- groupChromPeaks( dropFeatureDefinitions(faahko), PeakDensityParam(sampleGroups = sampleData(faahko)$sample_group, minFraction = 0.4, bw = 30, ppm = 10)) ## Calculate m/z width of features mzw <- featureDefinitions(faahko)$mzmax - featureDefinitions(faahko)$mzmin mzw_ppm <- featureDefinitions(faahko_ppm)$mzmax - featureDefinitions(faahko_ppm)$mzmin plot(featureDefinitions(faahko_ppm)$mzmed, mzw_ppm, xlab = \"m/z\", ylab = \"m/z width\", pch = 21, col = \"#0000ff20\", bg = \"#0000ff10\") points(featureDefinitions(faahko)$mzmed, mzw, pch = 21, col = \"#ff000020\", bg = \"#ff000010\") featureDefinitions(faahko) |> head() ## mzmed mzmin mzmax rtmed rtmin rtmax npeaks KO WT peakidx ## FT001 200.1 200.1 200.1 2902.634 2882.603 2922.664 2 2 0 458, 1161 ## FT002 205.0 205.0 205.0 2789.901 2782.955 2796.531 8 4 4 44, 443,.... ## FT003 206.0 206.0 206.0 2789.405 2781.389 2794.219 7 3 4 29, 430,.... ## FT004 207.1 207.1 207.1 2718.560 2714.047 2727.347 7 4 3 16, 420,.... ## FT005 233.0 233.0 233.1 3023.579 3015.145 3043.959 7 3 4 69, 959,.... ## FT006 241.1 241.1 241.2 3683.299 3661.586 3695.886 8 3 4 276, 284.... ## ms_level ## FT001 1 ## FT002 1 ## FT003 1 ## FT004 1 ## FT005 1 ## FT006 1 featureValues(faahko, value = \"into\") |> head() ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF wt15.CDF wt16.CDF wt21.CDF ## FT001 NA 506848.9 NA 169955.6 NA NA NA ## FT002 1924712.0 1757151.0 1383416.7 1180288.2 2129885.1 1634342.0 1623589.2 ## FT003 213659.3 289500.7 NA 178285.7 253825.6 241844.4 240606.0 ## FT004 349011.5 451863.7 343897.8 208002.8 364609.8 360908.9 NA ## FT005 286221.4 NA 164009.0 149097.6 255697.7 311296.8 366441.5 ## FT006 1160580.5 NA 380970.3 588986.4 1286883.0 1739516.6 639755.3 ## wt22.CDF ## FT001 NA ## FT002 1354004.9 ## FT003 185399.5 ## FT004 221937.5 ## FT005 271128.0 ## FT006 508546.4 feature_chroms <- featureChromatograms(faahko, features = 1:4) feature_chroms ## XChromatograms with 4 rows and 8 columns ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF ## ## [1,] peaks: 0 peaks: 1 peaks: 0 peaks: 1 ## [2,] peaks: 1 peaks: 1 peaks: 1 peaks: 1 ## [3,] peaks: 1 peaks: 1 peaks: 0 peaks: 1 ## [4,] peaks: 1 peaks: 1 peaks: 1 peaks: 1 ## wt15.CDF wt16.CDF wt21.CDF wt22.CDF ## ## [1,] peaks: 0 peaks: 0 peaks: 0 peaks: 0 ## [2,] peaks: 1 peaks: 1 peaks: 1 peaks: 1 ## [3,] peaks: 1 peaks: 1 peaks: 1 peaks: 1 ## [4,] peaks: 1 peaks: 1 peaks: 0 peaks: 1 ## phenoData with 4 variables ## featureData with 4 variables ## - - - xcms preprocessing - - - ## Chromatographic peak detection: ## method: centWave ## Correspondence: ## method: chromatographic peak density ## 4 feature(s) identified. plot(feature_chroms, col = sample_colors, peakBg = sample_colors[chromPeaks(feature_chroms)[, \"sample\"]]) eic_2 <- feature_chroms[2, ] chromPeaks(eic_2) ## mz mzmin mzmax rt rtmin rtmax into intb maxo sn ## CP0048 205 205 205 2791.873 2771.300 2815.623 1924712 1850331 84280 64 ## CP0495 205 205 205 2795.796 2773.702 2821.043 1757151 1711473 68384 69 ## CP1033 205 205 205 2796.531 2774.506 2821.697 1383417 1334570 47384 54 ## CP1255 205 205 205 2789.405 2769.019 2812.924 1180288 1126958 48336 32 ## CP1535 205 205 205 2782.955 2762.596 2806.444 2129885 2054677 93312 44 ## CP1967 205 205 205 2787.464 2767.135 2812.486 1634342 1566379 67984 53 ## CP2350 205 205 205 2790.396 2763.847 2821.630 1623589 1531573 49208 28 ## CP2601 205 205 205 2787.273 2766.970 2812.261 1354005 1299188 55712 35 ## sample row column ## CP0048 1 1 1 ## CP0495 2 1 2 ## CP1033 3 1 3 ## CP1255 4 1 4 ## CP1535 5 1 5 ## CP1967 6 1 6 ## CP2350 7 1 7 ## CP2601 8 1 8"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"gap-filling","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Gap filling","title":"LC-MS data pre-processing and analysis with xcms","text":"Missing values LC-MS data many cases result chromatographic peak detection algorithm failing identify peaks (noisy low intensity signal). aim gap filling step reduce number missing values integrating signals original data files samples chromatographic peak found m/z - rt region signal ion expected. Gap filling can performed xcms fillChromPeaks function parameter object selecting configuring gap filling algorithm. method choice ChromPeakAreaParam integrates signal (samples chromatographic peak found feature) m/z - rt region defined based m/z retention time ranges detected chromatographic peaks specific feature. lower m/z limit area defined lower quartile (25% quantile) \"mzmin\" values peaks feature, upper m/z value upper quartile (75% quantile) \"mzmax\" values, lower rt value lower quartile (25% quantile) \"rtmin\" upper rt value upper quartile (75% quantile) \"rtmax\" values. perform gap filling test data extract feature values first 6 features gap filling. NA reported signal measured specific sample.","code":"faahko <- fillChromPeaks(faahko, param = ChromPeakAreaParam()) featureValues(faahko, value = \"into\") |> head() ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF wt15.CDF wt16.CDF wt21.CDF ## FT001 135162.4 506848.9 111657.3 169955.6 209929.4 141607.9 226853.7 ## FT002 1924712.0 1757151.0 1383416.7 1180288.2 2129885.1 1634342.0 1623589.2 ## FT003 213659.3 289500.7 164380.7 178285.7 253825.6 241844.4 240606.0 ## FT004 349011.5 451863.7 343897.8 208002.8 364609.8 360908.9 226234.4 ## FT005 286221.4 285857.6 164009.0 149097.6 255697.7 311296.8 366441.5 ## FT006 1160580.5 1102832.6 380970.3 588986.4 1286883.0 1739516.6 639755.3 ## wt22.CDF ## FT001 138341.2 ## FT002 1354004.9 ## FT003 185399.5 ## FT004 221937.5 ## FT005 271128.0 ## FT006 508546.4"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"final-result","dir":"Articles","previous_headings":"Pre-processing of LC-MS data","what":"Final result","title":"LC-MS data pre-processing and analysis with xcms","text":"can continue using xcms result set analysis (e.g. also feature grouping MsFeatures package; see LC-MS feature grouping vignette details) also extract results SummarizedExperiment object. standard data container Bioconductor defined SummarizedExperiment package integration Bioconductor packages might thus easier using type object. use quantify function extract xcms pre-processing results SummarizedExperiment object. Internally, featureValues function used generate feature value matrix. can pass parameters function quantify call. use value = \"\" method = \"sum\" report integrated peak signal intensity sum values samples one chromatographic peak assigned feature (option important run refineChromPeaks like described merge overlapping peaks sample). information featureDefinitions now stored rowData object. rowData provides annotations information row SummarizedExperiment (case features). Annotations columns (case samples) stored colData. data frame row contains annotations one sample (hence one column feature values matrix). Finally, feature matrix stored assay within object. Note SummarizedExperiment can multiple assays numeric matrices number rows columns matching number features samples, respectively. list names available assays. can access actual data using assay function, optionally also providing name assay want access. show first 6 lines matrix. Since SummarizedExperiment supports multiple assays, addition add also feature value matrix without filled-values (.e. feature intensities added gap filling step). now two assays result object. can extract feature values without gap-filling: Finally, history full processing xcms available metadata SummarizedExperiment. information can also extracted xcms result object using processHistory function. extract information first processing step. processing steps contain also individual parameter objects used analysis, hence allowing exactly reproduce analysis. last perform also principal component analysis evaluate grouping samples experiment. Note perform data normalization hence grouping might () also influenced technical biases. PCA faahKO data set, un-normalized intensities. can see expected separation KO WT samples PC2. PC1 samples separate based ID, samples ID <= 18 samples ID > 18. separation might caused technical bias (e.g. measurements performed different days/weeks) due biological properties mice analyzed (sex, age, litter mates etc).","code":"library(SummarizedExperiment) ## Loading required package: MatrixGenerics ## Loading required package: matrixStats ## ## Attaching package: 'MatrixGenerics' ## The following objects are masked from 'package:matrixStats': ## ## colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse, ## colCounts, colCummaxs, colCummins, colCumprods, colCumsums, ## colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs, ## colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats, ## colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds, ## colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads, ## colWeightedMeans, colWeightedMedians, colWeightedSds, ## colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet, ## rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods, ## rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps, ## rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins, ## rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks, ## rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars, ## rowWeightedMads, rowWeightedMeans, rowWeightedMedians, ## rowWeightedSds, rowWeightedVars ## Loading required package: GenomicRanges ## Loading required package: stats4 ## Loading required package: BiocGenerics ## ## Attaching package: 'BiocGenerics' ## The following objects are masked from 'package:stats': ## ## IQR, mad, sd, var, xtabs ## The following objects are masked from 'package:base': ## ## anyDuplicated, aperm, append, as.data.frame, basename, cbind, ## colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find, ## get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply, ## match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, ## Position, rank, rbind, Reduce, rownames, sapply, setdiff, table, ## tapply, union, unique, unsplit, which.max, which.min ## Loading required package: S4Vectors ## ## Attaching package: 'S4Vectors' ## The following object is masked from 'package:utils': ## ## findMatches ## The following objects are masked from 'package:base': ## ## expand.grid, I, unname ## Loading required package: IRanges ## ## Attaching package: 'IRanges' ## The following object is masked from 'package:xcms': ## ## distance ## Loading required package: GenomeInfoDb ## Loading required package: Biobase ## Welcome to Bioconductor ## ## Vignettes contain introductory material; view with ## 'browseVignettes()'. To cite Bioconductor, see ## 'citation(\"Biobase\")', and for packages 'citation(\"pkgname\")'. ## ## Attaching package: 'Biobase' ## The following object is masked from 'package:MatrixGenerics': ## ## rowMedians ## The following objects are masked from 'package:matrixStats': ## ## anyMissing, rowMedians res <- quantify(faahko, value = \"into\", method = \"sum\") res ## class: SummarizedExperiment ## dim: 351 8 ## metadata(6): '' '' ... '' '' ## assays(1): raw ## rownames(351): FT001 FT002 ... FT350 FT351 ## rowData names(10): mzmed mzmin ... WT ms_level ## colnames(8): ko15.CDF ko16.CDF ... wt21.CDF wt22.CDF ## colData names(4): sample_name sample_group spectraOrigin sample_type rowData(res) ## DataFrame with 351 rows and 10 columns ## mzmed mzmin mzmax rtmed rtmin rtmax npeaks ## ## FT001 200.1 200.1 200.1 2902.63 2882.60 2922.66 2 ## FT002 205.0 205.0 205.0 2789.90 2782.95 2796.53 8 ## FT003 206.0 206.0 206.0 2789.40 2781.39 2794.22 7 ## FT004 207.1 207.1 207.1 2718.56 2714.05 2727.35 7 ## FT005 233.0 233.0 233.1 3023.58 3015.14 3043.96 7 ## ... ... ... ... ... ... ... ... ## FT347 595.25 595.2 595.3 3010.60 2992.76 3014.37 6 ## FT348 596.20 596.2 596.2 2997.78 2992.76 3002.79 2 ## FT349 596.30 596.3 596.3 3819.83 3811.52 3836.39 4 ## FT350 597.40 597.4 597.4 3820.88 3817.76 3826.13 3 ## FT351 599.30 599.3 599.3 4071.41 4044.94 4125.32 3 ## KO WT ms_level ## ## FT001 2 0 1 ## FT002 4 4 1 ## FT003 3 4 1 ## FT004 4 3 1 ## FT005 3 4 1 ## ... ... ... ... ## FT347 2 3 1 ## FT348 0 2 1 ## FT349 2 2 1 ## FT350 1 2 1 ## FT351 1 2 1 colData(res) ## DataFrame with 8 rows and 4 columns ## sample_name sample_group spectraOrigin sample_type ## ## ko15.CDF ko15 KO /__w/_temp... QC ## ko16.CDF ko16 KO /__w/_temp... study ## ko21.CDF ko21 KO /__w/_temp... study ## ko22.CDF ko22 KO /__w/_temp... QC ## wt15.CDF wt15 WT /__w/_temp... study ## wt16.CDF wt16 WT /__w/_temp... study ## wt21.CDF wt21 WT /__w/_temp... QC ## wt22.CDF wt22 WT /__w/_temp... study assayNames(res) ## [1] \"raw\" assay(res) |> head() ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF wt15.CDF wt16.CDF wt21.CDF ## FT001 135162.4 506848.9 111657.3 169955.6 209929.4 141607.9 226853.7 ## FT002 1924712.0 1757151.0 1383416.7 1180288.2 2129885.1 1634342.0 1623589.2 ## FT003 213659.3 289500.7 164380.7 178285.7 253825.6 241844.4 240606.0 ## FT004 349011.5 451863.7 343897.8 208002.8 364609.8 360908.9 226234.4 ## FT005 286221.4 285857.6 164009.0 149097.6 255697.7 311296.8 366441.5 ## FT006 1923307.8 1102832.6 380970.3 588986.4 1286883.0 1739516.6 639755.3 ## wt22.CDF ## FT001 138341.2 ## FT002 1354004.9 ## FT003 185399.5 ## FT004 221937.5 ## FT005 271128.0 ## FT006 508546.4 assays(res)$raw_nofill <- featureValues(faahko, filled = FALSE, method = \"sum\") assayNames(res) ## [1] \"raw\" \"raw_nofill\" assay(res, \"raw_nofill\") |> head() ## ko15.CDF ko16.CDF ko21.CDF ko22.CDF wt15.CDF wt16.CDF wt21.CDF ## FT001 NA 506848.9 NA 169955.6 NA NA NA ## FT002 1924712.0 1757151.0 1383416.7 1180288.2 2129885.1 1634342.0 1623589.2 ## FT003 213659.3 289500.7 NA 178285.7 253825.6 241844.4 240606.0 ## FT004 349011.5 451863.7 343897.8 208002.8 364609.8 360908.9 NA ## FT005 286221.4 NA 164009.0 149097.6 255697.7 311296.8 366441.5 ## FT006 1923307.8 NA 380970.3 588986.4 1286883.0 1739516.6 639755.3 ## wt22.CDF ## FT001 NA ## FT002 1354004.9 ## FT003 185399.5 ## FT004 221937.5 ## FT005 271128.0 ## FT006 508546.4 metadata(res) ## [[1]] ## Object of class \"XProcessHistory\" ## type: Peak detection ## date: Wed Apr 3 13:51:27 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: CentWaveParam ## MS level(s) 1 ## ## [[2]] ## Object of class \"XProcessHistory\" ## type: Peak refinement ## date: Wed Apr 3 13:51:29 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: MergeNeighboringPeaksParam ## MS level(s) 1 ## ## [[3]] ## Object of class \"XProcessHistory\" ## type: Peak grouping ## date: Wed Apr 3 13:51:42 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: PeakDensityParam ## MS level(s) 1 ## ## [[4]] ## Object of class \"XProcessHistory\" ## type: Retention time correction ## date: Wed Apr 3 13:51:42 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: PeakGroupsParam ## MS level(s) 1 ## ## [[5]] ## Object of class \"XProcessHistory\" ## type: Peak grouping ## date: Wed Apr 3 13:51:46 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: PeakDensityParam ## MS level(s) 1 ## ## [[6]] ## Object of class \"XProcessHistory\" ## type: Missing peak filling ## date: Wed Apr 3 13:51:52 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: ChromPeakAreaParam ## MS level(s) 1 processHistory(faahko)[[1]] ## Object of class \"XProcessHistory\" ## type: Peak detection ## date: Wed Apr 3 13:51:27 2024 ## info: ## fileIndex: 1,2,3,4,5,6,7,8 ## Parameter class: CentWaveParam ## MS level(s) 1 processHistory(faahko)[[1]] |> processParam() ## Object of class: CentWaveParam ## Parameters: ## - ppm: [1] 25 ## - peakwidth: [1] 20 80 ## - snthresh: [1] 10 ## - prefilter: [1] 6 5000 ## - mzCenterFun: [1] \"wMean\" ## - integrate: [1] 1 ## - mzdiff: [1] -0.001 ## - fitgauss: [1] FALSE ## - noise: [1] 5000 ## - verboseColumns: [1] FALSE ## - roiList: list() ## - firstBaselineCheck: [1] TRUE ## - roiScales: numeric(0) ## - extendLengthMSW: [1] FALSE ## - verboseBetaColumns: [1] FALSE ## Extract the features and log2 transform them ft_ints <- log2(assay(res, \"raw\")) ## Perform the PCA omitting all features with an NA in any of the ## samples. Also, the intensities are mean centered. pc <- prcomp(t(na.omit(ft_ints)), center = TRUE) ## Plot the PCA pcSummary <- summary(pc) plot(pc$x[, 1], pc$x[,2], pch = 21, main = \"\", xlab = paste0(\"PC1: \", format(pcSummary$importance[2, 1] * 100, digits = 3), \" % variance\"), ylab = paste0(\"PC2: \", format(pcSummary$importance[2, 2] * 100, digits = 3), \" % variance\"), col = \"darkgrey\", bg = sample_colors, cex = 2) grid() text(pc$x[, 1], pc$x[,2], labels = res$sample_name, col = \"darkgrey\", pos = 3, cex = 2)"},{"path":[]},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"quality-based-filtering-of-features","dir":"Articles","previous_headings":"Further data processing and analysis","what":"Quality-based filtering of features","title":"LC-MS data pre-processing and analysis with xcms","text":"dealing metabolomics results, often necessary filter features based certain criteria. criteria typically derived statistical formulas applied full rows data, row represents feature. filterFeatures function provides robust solution filtering features based conventional quality assessment criteria. supports multiple types filtering, allowing users tailor filtering process specific needs, controlled filter argument. function implementations applicable XcmsExperiment results objects SummarizedExperiment objects. demonstrate use filterFeatures function perform quality assessment filtering faahko res variables defined . filter argument can accommodate various types input, determining specific type quality assessment filtering performed. RsdFilter enable users filter features based relative standard deviation (coefficient variation) specified threshold. recommended base computation quality control (QC) samples, demonstrated : features RSD (CV) strictly larger 0.3 QC samples thus removed data set. DratioFilter can used filter features based D-ratio dispersion ratio, compares standard deviation QC samples study samples. features D-ratio strictly larger 0.5 thus removed data set. PercentMissingFilter allows filter features based percentage missing values feature. function takes input parameter f supposed vector length equal length object (.e. number samples) sample type . function computes percentage missing values per sample groups filters features based . Features percent missing values larger threshold sample groups removed. Another option base quality assessment filtering QC samples. examples shown : , feature removed, meaning features less 30% NA values least one sample type. Although directly relevant experiment, BlankFlag filter can used flag features based intensity relationship blank QC samples. information can found documentation filter:","code":"# Set up parameters for RsdFilter rsd_filter <- RsdFilter(threshold = 0.3, qcIndex = sampleData(faahko)$sample_type == \"QC\") # Apply the filter to faakho object filtered_faahko <- filterFeatures(object = faahko, filter = rsd_filter) ## 255 features were removed # Now apply the same strategy to the res object rsd_filter <- RsdFilter(threshold = 0.3, qcIndex = res$sample_type == \"QC\") filtered_res <- filterFeatures(object = res, filter = rsd_filter, assay = \"raw\") ## 260 features were removed # Set up parameters for DratioFilter dratio_filter <- DratioFilter( threshold = 0.5, qcIndex = sampleData(filtered_faahko)$sample_type == \"QC\", studyIndex = sampleData(filtered_faahko)$sample_type == \"study\") # Apply the filter to faahko object filtered_faakho <- filterFeatures(object = filtered_faahko, filter = dratio_filter) ## 38 features were removed # Now same but for the res object dratio_filter <- DratioFilter( threshold = 0.5, qcIndex = filtered_res$sample_type == \"QC\", studyIndex = filtered_res$sample_type == \"study\") filtered_res <- filterFeatures(object = filtered_res, filter = dratio_filter) ## 38 features were removed # To set up parameter `f` to filter only based on QC samples f <- sampleData(filtered_faakho)$sample_type f[f != \"QC\"] <- NA # To set up parameter `f` to filter per sample type excluding QC samples f <- sampleData(filtered_faakho)$sample_type f[f == \"QC\"] <- NA missing_filter <- PercentMissingFilter(threshold = 30, f = f) # Apply the filter to faakho object filtered_faakho <- filterFeatures(object = filtered_faakho, filter = missing_filter) ## 0 features were removed # Apply the filter to res object missing_filter <- PercentMissingFilter(threshold = 30, f = f) filtered_res <- filterFeatures(object = filtered_res, filter = missing_filter) ## 0 features were removed # Retrieve documentation for the main function and the specific filter. ?filterFeatures ## Help on topic 'filterFeatures' was found in the following packages: ## ## Package Library ## ProtGenerics /__w/_temp/Library ## xcms /__w/_temp/Library ## QFeatures /__w/_temp/Library ## ## ## Using the first match ... ?BlankFlag"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"normalization","dir":"Articles","previous_headings":"Further data processing and analysis","what":"Normalization","title":"LC-MS data pre-processing and analysis with xcms","text":"Normalizing features’ signal intensities required, present (yet) supported xcms (methods might added near future). advised use SummarizedExperiment returned quantify method data processing, type object stores feature definitions, sample annotations well feature abundances object. identification e.g. features significant different intensities/abundances suggested use functionality provided R packages, Bioconductor’s excellent limma package.","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"alignment-to-an-external-reference-dataset","dir":"Articles","previous_headings":"Further data processing and analysis","what":"Alignment to an external reference dataset","title":"LC-MS data pre-processing and analysis with xcms","text":"certain experiments, aligning two different datasets necessary. can involve comparing runs samples conducted across different laboratories runs MS2 recorded initial MS1 run. Across laboratories time, samples may result variation retention time, especially LC system can quite unstable. cases, alignment step using adjustRtime() function LamaParam parameter can allow user perform type alignment. go step step . Let’s load already analyzed dataset ref previous dataset alignment, tst. first restrict retention time range dataset. Now, attempt align two samples previous dataset. first step extract landmark features (referred lamas). achieve , identify features present every QC sample ref dataset. , categorize (using factor()) data sample_type retain QC samples. variable utilized filter features using PercentMissingFilter() parameter within filterFeatures() function (see section information method) lamas input look like alignment. terms method works, alignment algorithm matches chromatographic peaks experimental data lamas, fitting model based match adjust retention times minimize differences two datasets. Now can define param object LamaParama prepare alignment. Parameters tolerance, toleranceRt, ppm relate matching chromatographic peaks lamas. parameters related type fitting generated data points. details parameter overall method can found searching ?adjustRtime. example using default parameters. extract base peak chromatogram (BPC) visualize evaluate alignment: generate plots visually compare alignment reference dataset (black) (red) (blue) adjustment: appears certain time intervals (2500 3000 3500 4500 seconds) exhibit better alignment others. variance can elucidated examining distribution matched peaks, illustrated . matchLamaChromPeaks() function facilitates assessment well lamas correspond chromatographic peaks file. analysis can conducted prior adjustments. overlay BPC provides insight correlation accurate alignment presence peaks matching lamas. Furthermore, detailed examination matching model used fitting file possible. Numerical information can obtained using summarizeLamaMatch() function. , percentage chromatographic peaks utilized alignment can computed relative total number peaks file. Additionally, feasible directly plot() param object file interest, showcasing distribution chromatographic peaks along fitted model line.","code":"ref <- loadXcmsData(\"xmse\") tst <- loadXcmsData(\"faahko_sub2\") f <- sampleData(ref)$sample_type f[f != \"QC\"] <- NA ref <- filterFeatures(ref, PercentMissingFilter(threshold = 0, f = f)) ## 4 features were removed ref_mz_rt <- featureDefinitions(ref)[, c(\"mzmed\",\"rtmed\")] head(ref_mz_rt) ## mzmed rtmed ## FT001 200.1 2902.634 ## FT002 205.0 2789.901 ## FT003 206.0 2789.405 ## FT004 207.1 2718.560 ## FT005 233.0 3023.579 ## FT006 241.1 3683.299 param <- LamaParama(lamas = ref_mz_rt, method = \"loess\", span = 0.5, outlierTolerance = 3, zeroWeight = 10, ppm = 20, tolerance = 0, toleranceRt = 20, bs = \"tp\") #' input into `adjustRtime()` tst_adjusted <- adjustRtime(tst, param = param) tst_adjusted <- applyAdjustedRtime(tst_adjusted) #' evaluate the results with BPC bpc <- chromatogram(ref, chromPeaks = \"none\") bpc_tst_raw <- chromatogram(tst, chromPeaks = \"none\") bpc_tst_adj <- chromatogram(tst_adjusted, chromPeaks = \"none\") #' BPC of a sample par(mfrow = c(1, 2), mar = c(4, 2.5, 1, 0.5)) plot(bpc[1, 1], col = \"#00000080\", main = \"Before Alignment\") points(rtime(bpc_tst_raw[1, 1]), intensity(bpc_tst_raw[1, 1]), type = \"l\", col = \"#ff000080\") grid() plot(bpc[1, 1], col = \"#00000080\", main = \"After Alignment\") points(rtime(bpc_tst_adj[1, 1]), intensity(bpc_tst_adj[1, 1]), type = \"l\", col = \"#0000ff80\") grid() param <- matchLamasChromPeaks(tst, param = param) mtch <- matchedRtimes(param) #' BPC of the first sample with matches to lamas overlay par(mfrow = c(1, 1)) plot(bpc[1, 1], col = \"#00000080\", main = \"Distribution CP matched to Lamas\") points(rtime(bpc_tst_adj[1, 1]), intensity(bpc_tst_adj[1, 1]), type = \"l\", col = \"#0000ff80\") grid() abline(v = mtch[[1]]$obs) #access summary of matches and model information summary <- summarizeLamaMatch(param) summary ## Total_peaks Matched_peaks Total_lamas Model_summary ## 1 87 34 347 30, c(0..... ## 2 100 51 347 48, c(0..... ## 3 61 34 347 33, c(0..... # coverage for each file summary$Matched_peaks / summary$Total_peaks * 100 ## [1] 39.08046 51.00000 55.73770 #access the information on the model of for the first file summary$model_summary[[1]] ## NULL # Plot obs vs. ref with fitting line plot(param, index = 1L, main = \"ChromPeaks versus Lamas for the first file\", colPoint = \"red\")"},{"path":[]},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"subsetting-and-filtering","dir":"Articles","previous_headings":"Additional details and notes","what":"Subsetting and filtering","title":"LC-MS data pre-processing and analysis with xcms","text":"xcms result objects can subset/filtered sample using [ method one filter* functions (although XcmsExperiment supports present selected filter functions). cases filtering can remove pre-processing results, filter functions support parameters keepFeatures keepAdjustedRtime can set TRUE avoid removal.","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"parallel-processing","dir":"Articles","previous_headings":"Additional details and notes","what":"Parallel processing","title":"LC-MS data pre-processing and analysis with xcms","text":"functions xcms support parallel processing, enabled default performed, operations, per-file basis. Parallel processing handled configured BiocParallel Bioconductor package can globally defined R session. Note , data objects designed low memory footprint loading peak data memory needed, parallel processing increase demand: general, full data many files parallel processes loaded memory. needs also considered, number parallel processes defined. Unix-based systems (Linux, macOS) support multicore-based parallel processing. configure globally register parameter class. Note also bpstart used initialize parallel processes. Windows supports socket-based parallel processing:","code":"register(bpstart(MulticoreParam(2))) register(bpstart(SnowParam(2)))"},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"main-differences-to-the-msnbase-based-xcms-version-3","dir":"Articles","previous_headings":"Additional details and notes","what":"Main differences to the MSnbase-based xcms version 3","title":"LC-MS data pre-processing and analysis with xcms","text":"Spectra used main container (raw) MS data. Thus changing backends supported stage analysis (e.g. load data memory load data remote databases).","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"additional-documentation-resources","dir":"Articles","previous_headings":"","what":"Additional documentation resources","title":"LC-MS data pre-processing and analysis with xcms","text":"documentations listed still based xcms version 3 subsequently updated. Metabolomics pre-processing xcms: detailed description pre-processing LC-MS data xcms. MetaboAnnotationTutorials: examples annotation metabolomics data [3]. [2]: describes concept -disk data modes used also xcms. SpectraTutorials: tutorials describing Spectra package functionality.","code":""},{"path":"https://sneumann.github.io/xcms/articles/xcms.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"LC-MS data pre-processing and analysis with xcms","text":"R packages used document listed .","code":"sessionInfo() ## R Under development (unstable) (2024-03-28 r86224) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.4 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] SummarizedExperiment_1.33.3 Biobase_2.63.1 ## [3] GenomicRanges_1.55.4 GenomeInfoDb_1.39.10 ## [5] IRanges_2.37.1 S4Vectors_0.41.5 ## [7] BiocGenerics_0.49.1 MatrixGenerics_1.15.0 ## [9] matrixStats_1.2.0 MsExperiment_1.5.4 ## [11] ProtGenerics_1.35.4 pheatmap_1.0.12 ## [13] RColorBrewer_1.1-3 pander_0.6.5 ## [15] faahKO_1.43.0 xcms_4.1.12 ## [17] BiocParallel_1.37.1 BiocStyle_2.31.0 ## ## loaded via a namespace (and not attached): ## [1] DBI_1.2.2 rlang_1.1.3 ## [3] magrittr_2.0.3 clue_0.3-65 ## [5] MassSpecWavelet_1.69.0 compiler_4.5.0 ## [7] systemfonts_1.0.6 vctrs_0.6.5 ## [9] MetaboCoreUtils_1.11.2 pkgconfig_2.0.3 ## [11] crayon_1.5.2 fastmap_1.1.1 ## [13] XVector_0.43.1 utf8_1.2.4 ## [15] rmarkdown_2.26 preprocessCore_1.65.0 ## [17] ragg_1.3.0 purrr_1.0.2 ## [19] xfun_0.43 MultiAssayExperiment_1.29.1 ## [21] zlibbioc_1.49.3 cachem_1.0.8 ## [23] jsonlite_1.8.8 progress_1.2.3 ## [25] highr_0.10 DelayedArray_0.29.9 ## [27] prettyunits_1.2.0 parallel_4.5.0 ## [29] cluster_2.1.6 R6_2.5.1 ## [31] bslib_0.7.0 limma_3.59.6 ## [33] jquerylib_0.1.4 Rcpp_1.0.12 ## [35] bookdown_0.38 iterators_1.0.14 ## [37] knitr_1.45 Matrix_1.7-0 ## [39] igraph_2.0.3 tidyselect_1.2.1 ## [41] abind_1.4-5 yaml_2.3.8 ## [43] doParallel_1.0.17 codetools_0.2-20 ## [45] affy_1.81.0 lattice_0.22-6 ## [47] tibble_3.2.1 plyr_1.8.9 ## [49] evaluate_0.23 desc_1.4.3 ## [51] Spectra_1.13.8 pillar_1.9.0 ## [53] affyio_1.73.0 BiocManager_1.30.22 ## [55] foreach_1.5.2 MSnbase_2.29.4 ## [57] MALDIquant_1.22.2 ncdf4_1.22 ## [59] generics_0.1.3 hms_1.1.3 ## [61] ggplot2_3.5.0 munsell_0.5.1 ## [63] scales_1.3.0 glue_1.7.0 ## [65] MsFeatures_1.11.0 lazyeval_0.2.2 ## [67] tools_4.5.0 mzID_1.41.0 ## [69] QFeatures_1.13.3 vsn_3.71.1 ## [71] mzR_2.37.3 fs_1.6.3 ## [73] XML_3.99-0.16.1 grid_4.5.0 ## [75] impute_1.77.0 MsCoreUtils_1.15.6 ## [77] colorspace_2.1-0 GenomeInfoDbData_1.2.12 ## [79] PSMatch_1.7.2 cli_3.6.2 ## [81] textshaping_0.3.7 fansi_1.0.6 ## [83] S4Arrays_1.3.6 dplyr_1.1.4 ## [85] AnnotationFilter_1.27.0 pcaMethods_1.95.0 ## [87] gtable_0.3.4 sass_0.4.9 ## [89] digest_0.6.35 SparseArray_1.3.4 ## [91] farver_2.1.1 htmlwidgets_1.6.4 ## [93] memoise_2.0.1 htmltools_0.5.8 ## [95] pkgdown_2.0.7.9000 lifecycle_1.0.4 ## [97] statmod_1.5.0 MASS_7.3-60.2"},{"path":[]},{"path":"https://sneumann.github.io/xcms/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Colin . Smith. Author. Ralf Tautenhahn. Author. Steffen Neumann. Author, maintainer. Paul Benton. Author. Christopher Conley. Author. Johannes Rainer. Author. Michael Witting. Contributor. William Kumler. Author. Philippine Louail. Author. Pablo Vangeenderhuysen. Contributor. Carl Brunius. Contributor.","code":""},{"path":"https://sneumann.github.io/xcms/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Smith, C.. Want, E.J. O'Maille, G. Abagyan,R. Siuzdak, G.: XCMS: Processing mass spectrometry data metabolite profiling using nonlinear peak alignment, matching identification, Analytical Chemistry, 78:779-787 (2006) Ralf Tautenhahn, Christoph Boettcher, Steffen Neumann: Highly sensitive feature detection high resolution LC/MS BMC Bioinformatics, 9:504 (2008) H. Paul Benton, Elizabeth J. Want Timothy M. D. Ebbels Correction mass calibration gaps liquid chromatography-mass spectrometry metabolomics data Bioinformatics, 26:2488 (2010)","code":"@Article{, author = {{Smith} and {C.A.} and {Want} and {E.J.} and {O'Maille} and {G.} and {Abagyan,R.} and {Siuzdak} and {G.}}, title = {XCMS: Processing mass spectrometry data for metabolite profiling using nonlinear peak alignment, matching and identification}, journal = {Analytical Chemistry}, year = {2006}, volume = {78}, pages = {779--787}, } @Article{, author = {Ralf Tautenhahn and Christoph Boettcher and Steffen Neumann}, title = {Highly sensitive feature detection for high resolution LC/MS}, journal = {BMC Bioinformatics}, year = {2008}, volume = {9}, pages = {504}, } @Article{, author = {H. Paul Benton and Elizabeth J. Want and Timothy M. D. Ebbels}, title = {Correction of mass calibration gaps in liquid chromatography-mass spectrometry metabolomics data}, journal = {BIOINFORMATICS}, year = {2010}, volume = {26}, pages = {2488}, }"},{"path":"https://sneumann.github.io/xcms/index.html","id":"the-xcms-package-pre-processing-gclc-msms-data","dir":"","previous_headings":"","what":"LC-MS and GC-MS Data Analysis","title":"LC-MS and GC-MS Data Analysis","text":"Please see package documentation information examples news latest changes.","code":""},{"path":"https://sneumann.github.io/xcms/index.html","id":"version-4","dir":"","previous_headings":"","what":"Version 4","title":"LC-MS and GC-MS Data Analysis","text":"Version 4 adds native support Spectra package xcms allows perform pre-processing MsExperiment objects (MsExperiment. new supported data containers (Spectra, MsExperiment XcmsExperiment) allow flexible analyses seamless future extensions additional types data (ion mobility data). Ultimately, changes also allow easier integration xcms R packages MsFeatures MetaboAnnotation. suggested users switch newer data result objects, functionality version 3 remain fully supported.","code":""},{"path":"https://sneumann.github.io/xcms/index.html","id":"version-3","dir":"","previous_headings":"","what":"Version 3","title":"LC-MS and GC-MS Data Analysis","text":"Version >= 3 xcms package updated partially re-written versions original xcms package. version number 3 selected avoid confusions xcms2 (http://pubs.acs.org/doi/abs/10.1021/ac800795f) software. providing original software’s functionality, xcms version >= 3 aims : Better integration Bioconductor framework: Make use extend classes defined MSnbase package. Implement class versioning (Biobase’s Versioned class). Use BiocParallel parallel processing. Implementation validation methods classes ensure data integrity. Easier faster access raw spectra data. Cleanup source code: Remove obsolete redundant functionality (getEIC, rawEIC etc). Unify interfaces, .e. implement layer base functions accessing analysis methods (implemented C, C++ R). Using consistent naming scheme methods follows established naming conventions (e.g. correspondence instead grouping). Update, improve extend documentation. Establishing layer base R-functions interface analysis methods. take M/Z, retention time (scan index) intensity values input along optional arguments downstream functions (implemented C, C++ R). input arguments basic R objects (numeric vectors) thus enabling easy integration analysis methods R packages. user interface’s analysis methods take (raw) data object parameter class, used dispatching corresponding analysis algorithm. Add unit tests. Discussions suggestions welcome: https://github.com/sneumann/xcms/issues","code":""},{"path":"https://sneumann.github.io/xcms/index.html","id":"contribution","dir":"","previous_headings":"","what":"Contribution","title":"LC-MS and GC-MS Data Analysis","text":"Contributions xcms package welcome, whether form ideas, documentation, code, packages, … contribution guideline please see guideline RforMassSpectrometry initiative. seamless integration, contributors expected adhere RforMassSpectrometry coding syle.","code":""},{"path":"https://sneumann.github.io/xcms/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"LC-MS and GC-MS Data Analysis","text":"contributors maintainers package, pledge respect people contribute reporting issues, posting feature requests, updating documentation, submitting pull requests patches, activities. See RforMassSpectrometry Code Conduct information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/AutoLockMass-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","title":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","text":"AutoLockMass - function decides lock mass scans \txcmsRaw object. done using scan time differences.","code":""},{"path":"https://sneumann.github.io/xcms/reference/AutoLockMass-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","text":"object = \"xcmsRaw\" signature(object = \"xcmsRaw\")","code":""},{"path":"https://sneumann.github.io/xcms/reference/AutoLockMass-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","text":"object xcmsRaw-class object","code":""},{"path":"https://sneumann.github.io/xcms/reference/AutoLockMass-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","text":"AutoLockMass numeric vector scan locations corresponding lock Mass scans","code":""},{"path":"https://sneumann.github.io/xcms/reference/AutoLockMass-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","text":"Paul Benton, hpaul.benton08@imperial.ac.uk","code":""},{"path":"https://sneumann.github.io/xcms/reference/AutoLockMass-methods.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Automatic parameter for Lock mass fixing AutoLockMass ~~ — AutoLockMass-methods","text":"","code":"if (FALSE) library(xcms) library(faahKO) ## These files do not have this problem ## to correct for but just for an example cdfpath <- system.file(\"cdf\", package = \"faahKO\") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE) xr<-xcmsRaw(cdffiles[1]) #> Create profile matrix with method 'bin' and step 1 ... #> OK xr #> An \"xcmsRaw\" object with 1278 mass spectra #> #> Time range: 2501.4-4499.8 seconds (41.7-75 minutes) #> Mass range: 200-600 m/z #> Intensity range: 70-1373180 #> #> MSn data on 0 mass(es) #> \twith 0 MSn spectra #> Profile method: bin #> Profile step: 1 m/z (401 grid points from 200 to 600 m/z) #> #> Memory usage: 10.8 MB ##Lets assume that the lockmass starts at 1 and is every 100 scans lockMass<-xcms:::makeacqNum(xr, freq=100, start=1) ## these are equalvent lockmass2<-AutoLockMass(xr) #> Warning: #> Lock mass frequency wasn't detected all((lockmass == lockmass2) == TRUE) #> Error in eval(expr, envir, enclos): object 'lockmass' not found ob<-stitch(xr, lockMass) #> Warning: no non-missing arguments to min; returning Inf #> Warning: no non-missing arguments to max; returning -Inf"},{"path":"https://sneumann.github.io/xcms/reference/BlankFlag.html","id":null,"dir":"Reference","previous_headings":"","what":"Flag features based on the intensity in blank samples — BlankFlag","title":"Flag features based on the intensity in blank samples — BlankFlag","text":"`BlankFlag` class method enable users flag features `XcmsExperiment` `SummarizedExperiment` object based relationship intensity feature blanks compared intensity samples. class method part possible dispatch generic function `filterFeatures`. Features ** (`<`) user-input threshold flagged calling `filterFeatures` function. means extra column created `featureDefinitions` `rowData` called `possible_contaminants` logical value feature.","code":""},{"path":"https://sneumann.github.io/xcms/reference/BlankFlag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Flag features based on the intensity in blank samples — BlankFlag","text":"","code":"BlankFlag( threshold = 2, blankIndex = integer(), qcIndex = integer(), na.rm = TRUE ) # S4 method for XcmsResult,BlankFlag filterFeatures(object, filter, ...) # S4 method for SummarizedExperiment,BlankFlag filterFeatures(object, filter, assay = 1)"},{"path":"https://sneumann.github.io/xcms/reference/BlankFlag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Flag features based on the intensity in blank samples — BlankFlag","text":"threshold `numeric` indicates minimum difference required mean abundance feature samples compared mean abundance feature blanks considered possible contaminant. example, default threshold 2 signifies mean abundance features samples least twice mean abundance blanks flagged possible contaminant. blankIndex `integer` (`logical`) vector corresponding indices blank samples. qcIndex `integer` (`logical`) vector corresponding indices quality control (QC) samples. na.rm `logical` indicates whether missing values (`NA`) removed prior calculations. object XcmsExperiment SummarizedExperiment. XcmsExperiment object, featureValues(object) evaluated, Summarizedesxperiment assay(object, assay). object filtered. filter parameter object selecting configuring type filtering. can one following classes: RsdFilter, DratioFilter, PercentMissingFilter BlankFlag. ... Optional parameters. object XcmsExperiment: parameters featureValues() call. assay filtering SummarizedExperiment objects . Indicates assay filtering based . Note features entire object removed, computations performed single assay. Default 1, means first assay object evaluated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/BlankFlag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Flag features based on the intensity in blank samples — BlankFlag","text":"`BlankFlag`: `BlankFlag` class. `filterFeatures` returns input object added column features metadata called `possible_contaminants` logical value feature. added `featureDefinitions` `XcmsExperiment` objects `rowData` `SummarizedExperiment` objects.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/BlankFlag.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Flag features based on the intensity in blank samples — BlankFlag","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/DratioFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter features based on the dispersion ratio — DratioFilter","title":"Filter features based on the dispersion ratio — DratioFilter","text":"`DratioFilter` class method enable users filter features `XcmsExperiment` `SummarizedExperiment` object based D-ratio *dispersion ratio*. defined standard deviation QC samples divided standard deviation biological test samples, feature object (Broadhurst et al.). `filter` part possible dispatch generic function `filterFeatures`. Features ** (`>`) user-input threshold removed entire dataset.","code":""},{"path":"https://sneumann.github.io/xcms/reference/DratioFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter features based on the dispersion ratio — DratioFilter","text":"","code":"DratioFilter( threshold = 0.5, qcIndex = integer(), studyIndex = integer(), na.rm = TRUE, mad = FALSE ) # S4 method for XcmsResult,DratioFilter filterFeatures(object, filter, ...) # S4 method for SummarizedExperiment,DratioFilter filterFeatures(object, filter, assay = 1)"},{"path":"https://sneumann.github.io/xcms/reference/DratioFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter features based on the dispersion ratio — DratioFilter","text":"threshold `numeric` value representing threshold. Features D-ratio *strictly higher* (`>`) removed entire dataset. qcIndex `integer` (`logical`) vector corresponding indices QC samples. studyIndex `integer` (`logical`) vector corresponding indices study samples. na.rm `logical` Indicates whether missing values (`NA`) removed prior calculations. mad `logical` Indicates whether *Median Absolute Deviation* (MAD) used instead standard deviation. suggested non-gaussian distributed data. object XcmsExperiment SummarizedExperiment. XcmsExperiment object, featureValues(object) evaluated, Summarizedesxperiment assay(object, assay). object filtered. filter parameter object selecting configuring type filtering. can one following classes: RsdFilter, DratioFilter, PercentMissingFilter BlankFlag. ... Optional parameters. object XcmsExperiment: parameters featureValues() call. assay filtering SummarizedExperiment objects . Indicates assay filtering based . Note features entire object removed, computations performed single assay. Default 1, means first assay object evaluated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/DratioFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter features based on the dispersion ratio — DratioFilter","text":"`DratioFilter`: `DratioFilter` class. `filterFeatures` return input object minus features met user input threshold","code":""},{"path":"https://sneumann.github.io/xcms/reference/DratioFilter.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Filter features based on the dispersion ratio — DratioFilter","text":"Broadhurst D, Goodacre R, Reinke SN, Kuligowski J, Wilson ID, Lewis MR, Dunn WB. Guidelines considerations use system suitability quality control samples mass spectrometry assays applied untargeted clinical metabolomic studies. Metabolomics. 2018;14(6):72. doi: 10.1007/s11306-018-1367-3. Epub 2018 May 18. PMID: 29805336; PMCID: PMC5960010.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/DratioFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filter features based on the dispersion ratio — DratioFilter","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":null,"dir":"Reference","previous_headings":"","what":"Generic parameter class — GenericParam-class","title":"Generic parameter class — GenericParam-class","text":"GenericParam class allows store generic parameter information name function /called (slot fun) arguments (slot args). object used track process history data processings XCMSnExp object. contrast e.g. CentWaveParam object passed actual processing method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generic parameter class — GenericParam-class","text":"","code":"GenericParam(fun = character(), args = list())"},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generic parameter class — GenericParam-class","text":"fun character representing name function. args list (ideally named) arguments function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generic parameter class — GenericParam-class","text":"GenericParam function returns GenericParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Generic parameter class — GenericParam-class","text":"fun character specifying function name. args list (ideally named) arguments function.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generic parameter class — GenericParam-class","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/GenericParam.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generic parameter class — GenericParam-class","text":"","code":"prm <- GenericParam(fun = \"mean\") prm <- GenericParam(fun = \"mean\", args = list(na.rm = TRUE))"},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":null,"dir":"Reference","previous_headings":"","what":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"Alignment achieved using ['adjustRtime()'] method `param` class `LamaParama`. method corrects retention time aligning chromatographic data external reference dataset. Chromatographic peaks experimental data first matched predefined (external) landmark features based mass--charge ratio retention time subsequently data aligned minimizing differences retention times matched chromatographic peaks lamas. adjustment performed file file. Adjustable parameters `ppm`, `tolerance`, `toleranceRt` define acceptable deviations matching process. crucial note lamas chromatographic peaks exhibiting one--one mapping considered estimating retention time shifts. file peaks matching lamas, adjustment performed, retention times returned -. Users can evaluate matching, example, checking number matches ranges matching peaks, first running `[matchLamasChromPeaks()]`. Different warping methods available; users can choose fit *loess* (`method = \"loess\"`, default) *gam* (`method = \"gam\"`) reference data points observed matching ChromPeaks. Additional parameters `span`, `weight`, `outlierTolerance`, `zeroWeight`, `bs` specific models. parameters offer flexibility fine-tuning matching chromatographic peaks fitted lamas, thereby generating model align overall retention time single file. functions related method: - `LamaParama()`: return respective parameter object alignment using `adjustRtime()` function. also input functions listed . - `matchLamasChromPeaks()`: quickly matches file's ChromPeaks Lamas, allowing user evaluate matches file. - `summarizeLamaMatch()`: generates summary `LamaParama` method. See details return object. - `matchedRtimes()`: Access list `data.frame` saved `LamaParama` object, generated `matchLamasChromPeaks()` function. - `plot()`:plot chromatographic peaks versus reference lamas well fitting line chosen model type. user can decide file inspect specifying assay number parameter `assay`","code":""},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"","code":"# S4 method for XcmsExperiment,LamaParama adjustRtime(object, param, BPPARAM = bpparam(), ...) matchLamasChromPeaks(object, param, BPPARAM = bpparam()) summarizeLamaMatch(param) matchedRtimes(param) LamaParama( lamas = matrix(ncol = 2, nrow = 0, dimnames = list(NULL, c(\"mz\", \"rt\"))), method = c(\"loess\", \"gam\"), span = 0.5, outlierTolerance = 3, zeroWeight = 10, ppm = 20, tolerance = 0, toleranceRt = 5, bs = \"tp\" ) # S4 method for LamaParama,ANY plot( x, index = 1L, colPoints = \"#00000060\", colFit = \"#00000080\", xlab = \"Matched Chromatographic peaks\", ylab = \"Lamas\", ... )"},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"object object class `XcmsExperiment` defined ChromPeaks. param object class `LamaParama` later used adjustment using `[adjustRtime()]` function. BPPARAM `matchLamasChromPeaks()`: parallel processing setup. Defaults `BPPARAM = bpparam()`. See [bpparam()] information. ... `plot()`: extra parameters passed function. lamas `LamaParama`: `matrix` `data.frame` m/z retention times values features (first second column) external dataset alignment based . method `LamaParama`:`character(1)` type warping. Either `method = \"gam\"` `method = \"loess\"` (default). span `LamaParama`: `numeric(1)` defining degree smoothing (`method = \"loess\"`). parameter passed internal call [loess()]. outlierTolerance `LamaParama`: `numeric(1)` defining settings outlier removal fitting. default (`outlierTolerance = 3`), data points absolute residuals larger 3 times mean absolute residual data points first, initial fit, removed final model fit. zeroWeight `LamaParama`: `numeric(1)`: defines weight first data point (.e. retention times first lama-chromatographic peak pair). Values larger 1 reduce warping problems early RT range. ppm `LamaParama`: `numeric(1)` defining m/z-relative maximal allowed difference m/z `lamas` chromatographic peaks. Used mapping identified chromatographic peaks lamas. tolerance `LamaParama`: `numeric(1)` defining absolute acceptable difference m/z lamas chromatographic peaks. Used mapping identified chromatographic peaks `lamas`. toleranceRt `LamaParama`: `numeric(1)` defining absolute acceptable difference retention time lamas chromatographic peaks. Used mapping identified chromatographic peaks `lamas`. bs `LamaParama()`: `character(1)` defining GAM smoothing method. (defaults thin plate, `bs = \"tp\"`) x `plot()`: object class `LamaParama` plotted. index `plot()`: `numeric(1)` index file plotted. colPoints `plot()`: color plotting datapoint. colFit `plot()`: color fitting line. xlab, ylab `plot()`: x- y-axis labels.","code":""},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"`matchLamasChromPeaks()`: `LamaParama` object new slot `rtMap` composed list matrices representing 1:1 matches Lamas (ref) ChromPeaks (obs). access , `matchedRtimes()` can used. `matchedRtimes()`: list `data.frame` representing matches chromPeaks `lamas` files. `summarizeLamaMatch()`:`data.frame` : - \"Total_peaks\": total number chromatographic peaks file. - \"Matched_peak\": number matched peaks Lamas. - \"Total_Lamas\": Total number Lamas. - \"Model_summary\": `summary.loess` `summary.gam` object file.","code":""},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"matches using `matchLamasChromPeaks()`, file retention adjusted calling [adjustRtime()] `LamaParama` `XcmsExperiment` object. see examples utilize methods functionality, see vignette.","code":""},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"Carl Brunius, Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/LamaParama.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Landmark-based alignment: aligning a dataset against an external reference — adjustRtime,XcmsExperiment,LamaParama-method","text":"","code":"## load test and reference datasets ref <- loadXcmsData(\"xmse\") tst <- loadXcmsData(\"faahko_sub2\") ## create lamas input from the reference dataset library(MsExperiment) #> Loading required package: ProtGenerics #> #> Attaching package: ‘ProtGenerics’ #> The following object is masked from ‘package:stats’: #> #> smooth f <- sampleData(ref)$sample_type f[f == \"QC\"] <- NA ref <- filterFeatures(ref, PercentMissingFilter(threshold = 0, f = f)) #> 5 features were removed ref_mz_rt <- featureDefinitions(ref)[, c(\"mzmed\",\"rtmed\")] ## Set up the LamaParama object param <- LamaParama(lamas = ref_mz_rt, method = \"loess\", span = 0.5, outlierTolerance = 3, zeroWeight = 10, ppm = 20, tolerance = 0, toleranceRt = 20, bs = \"tp\") ## input into `adjustRtime()` tst_adjusted <- adjustRtime(tst, param = param) ## run diagnostic functions to pre-evaluate alignment param <- matchLamasChromPeaks(tst, param = param) mtch <- matchedRtimes(param) ## Access summary of matches and model information summary <- summarizeLamaMatch(param) ##coverage for each file summary$Matched_peaks / summary$Total_peaks * 100 #> [1] 39.08046 51.00000 55.73770 ## Access the information on the model of for the first file summary$model_summary[[1]] #> NULL"},{"path":"https://sneumann.github.io/xcms/reference/PercentMissingFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter features based on the percentage of missing data — PercentMissingFilter","title":"Filter features based on the percentage of missing data — PercentMissingFilter","text":"`PercentMissingFilter` class method enable users filter features `XcmsExperiment` `SummarizedExperiment` object based percentage (values 1 100) missing values features different sample groups filters according provided threshold. `filter` part possible dispatch generic function `filterFeatures`. Features percentage missing values *higher* (`>`) user input threshold sample groups removed (.e. features proportion missing values (`<=`) threshold least one sample group retained).","code":""},{"path":"https://sneumann.github.io/xcms/reference/PercentMissingFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter features based on the percentage of missing data — PercentMissingFilter","text":"","code":"PercentMissingFilter(threshold = 30, f = factor()) # S4 method for XcmsResult,PercentMissingFilter filterFeatures(object, filter, ...) # S4 method for SummarizedExperiment,PercentMissingFilter filterFeatures(object, filter, assay = 1)"},{"path":"https://sneumann.github.io/xcms/reference/PercentMissingFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter features based on the percentage of missing data — PercentMissingFilter","text":"threshold `numeric` percentage (0 100) accepted missing values feature one sample group. f `vector` length `object`, specifying sample type sample dataset. percentage missing values per feature computed within sample groups. Parameter `f`, already `factor`, converted one using factor function. Samples `NA` value `f` excluded calculation. object XcmsExperiment SummarizedExperiment. XcmsExperiment object, featureValues(object) evaluated, Summarizedesxperiment assay(object, assay). object filtered. filter parameter object selecting configuring type filtering. can one following classes: RsdFilter, DratioFilter, PercentMissingFilter BlankFlag. ... Optional parameters. object XcmsExperiment: parameters featureValues() call. assay filtering SummarizedExperiment objects . Indicates assay filtering based . Note features entire object removed, computations performed single assay. Default 1, means first assay object evaluated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/PercentMissingFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter features based on the percentage of missing data — PercentMissingFilter","text":"`PercentMissingFilter`: `PercentMissingFilter` class. `filterFeatures` return input object minus features met user input threshold","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/PercentMissingFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filter features based on the percentage of missing data — PercentMissingFilter","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/PlainTextParam.html","id":null,"dir":"Reference","previous_headings":"","what":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","title":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","text":"`PlainTextParam` class method enable users save `MsExperiment` `XcmsExperiment` objects collections plain text files specified folder. Note , xcms results within `XcmsExperiment` can exported, full raw MS data (object's `Spectra` object) currently exported plain text format. `Spectra` using [MsBackendMzR()] backend, names raw data files however exported (enables *restore* full `Spectra` respectively `MsExperiment` objects). `MsExperiment` object, exported files include: - [sampleData()] stored text file named *sample_data.txt*. - [fileNames()] *Spectra* object stored tabular format text file named *spectra_files.txt*.file names exported `Spectra` object uses [MsBackendMzR()] backend. backends information raw spectra data currently exported `PlainTextParam`. - Processing queue `Spectra` object, ensuring spectra data modifications retained. stored `json` file named *spectra_processing_queue.json*. `XcmsExperiment` object, exported files `MsExperiment` object, addition following: - [processHistory()] information object, stored `json` file named *process_history.json*. - chromatographic peak information obtained [chromPeaks()] [chromPeaksData()], stored tabular format text files *chrom_peaks.txt* *chrom_peak_data.txt* respectively. - retention time information obtained [adjustedRtime()] stored text file named *rtime_adjusted.txt*. - [featureDefinitions()] stored text file named *feature_definitions.txt*. Additionally, second file named *feature_peak_index.txt* generated connect features' definitions names. `param` class method part possible dispatch generic function `storeResults`. folder created calling `storeResults`. folder already exists, previous exports folder might get overwritten.","code":""},{"path":"https://sneumann.github.io/xcms/reference/PlainTextParam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","text":"","code":"PlainTextParam(path = tempdir()) # S4 method for MsExperiment,PlainTextParam storeResults(object, param) # S4 method for XcmsExperiment,PlainTextParam storeResults(object, param)"},{"path":"https://sneumann.github.io/xcms/reference/PlainTextParam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","text":"path `PlainTextParam` `character(1)`, defining files going stored. default `tempdir()`. object MsExperiment XcmsExperiment data object needs saved. param parameter object selecting configuring format saving. can one following classes: RDataParam, PlainTextParam, MzTabMParam.","code":""},{"path":"https://sneumann.github.io/xcms/reference/PlainTextParam.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","text":"`PlainTextParam`: `PlainTextParam` class. `storeResults` return anything saves object collections different plain text files folder.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/PlainTextParam.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","text":"Philippine Louail, Johannes Rainer.","code":""},{"path":"https://sneumann.github.io/xcms/reference/PlainTextParam.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Store contents of `MsExperiment` and `XcmsExperiment` objects as plain text files — PlainTextParam","text":"","code":"## Load test data set of class `MsExperiment` library(MsExperiment) fls <- dir(system.file(\"sciex\", package = \"msdata\"), full.names = TRUE) pd <- data.frame(file = basename(fls), sample = c(\"POOL_1\", \"POOL_2\"), injection_index = c(1, 19), group = \"POOL\") rownames(pd) <- c(\"1\", \"2\") mse <- readMsExperiment(fls, sampleData = pd) ## Define param pth = file.path(tempdir(), \"test\") param <- PlainTextParam(path = pth) ## Save as a collection of plain text files storeResults(object = mse, param = param) ## Load a test data set with detected peaks, of class `XcmsExperiment` faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Define param pth = file.path(tempdir(), \"test\") param <- PlainTextParam(path = pth) ## Save as a collection of plain text files storeResults(object = faahko_sub, param = param) #> Warning: '/tmp/RtmprUV08K/test' already exists"},{"path":"https://sneumann.github.io/xcms/reference/ProcessHistory-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Tracking data processing — ProcessHistory-class","title":"Tracking data processing — ProcessHistory-class","text":"Objects type ProcessHistory allow keep track data processing step metabolomics experiment. created data processing methods, findChromPeaks added corresponding results objects. Thus, usually, users need create . XProcessHistory extends ProcessHistory adding slot param allows store actual parameter class processing step. processParam, processParam<-: get set parameter class XProcessHistory object. msLevel: returns MS level certain analysis performed, NA defined. processType method returns character specifying processing step type. processDate extracts start date processing step. processInfo extracts optional additional information processing step. fileIndex extracts indices files processing step applied.","code":""},{"path":"https://sneumann.github.io/xcms/reference/ProcessHistory-class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tracking data processing — ProcessHistory-class","text":"","code":"# S4 method for ProcessHistory show(object) # S4 method for XProcessHistory show(object) # S4 method for XProcessHistory processParam(object) # S4 method for XProcessHistory msLevel(object) # S4 method for ProcessHistory processType(object) # S4 method for ProcessHistory processDate(object) # S4 method for ProcessHistory processInfo(object) # S4 method for ProcessHistory fileIndex(object)"},{"path":"https://sneumann.github.io/xcms/reference/ProcessHistory-class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tracking data processing — ProcessHistory-class","text":"object ProcessHistory XProcessHistory object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/ProcessHistory-class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tracking data processing — ProcessHistory-class","text":"processParam: parameter object extending Param class. processType method returns character string processing step type. processDate method returns character string time stamp processing step start. processInfo method returns character string optional additional informations. fileIndex method returns integer vector index files/samples processing step applied.","code":""},{"path":"https://sneumann.github.io/xcms/reference/ProcessHistory-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Tracking data processing — ProcessHistory-class","text":"type character(1): string defining type processing step. string match predefined values. Use processHistoryTypes list . date character(1): date time stamp processing step started. info character(1): optional additional information. fileIndex integer length 1 > 1 specify samples object processing performed. error (): used store eventual calculation errors. param (Param): object type Param (e.g. CentWaveParam) specifying settings processing step. msLevel: integer definining MS level(s) analysis performed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/ProcessHistory-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Tracking data processing — ProcessHistory-class","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/RDataParam.html","id":null,"dir":"Reference","previous_headings":"","what":"Store `XcmsExperiment` object as .RData file — RDataParam","title":"Store `XcmsExperiment` object as .RData file — RDataParam","text":"`RDataParam` class method allow users save `XcmsExperiment` object .RData file chosen filename. object gets exported using [`save()`] function. `param` class method part possible dispatch generic function `storeResults`.","code":""},{"path":"https://sneumann.github.io/xcms/reference/RDataParam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Store `XcmsExperiment` object as .RData file — RDataParam","text":"","code":"RDataParam(fileName = tempfile()) # S4 method for XcmsExperiment,RDataParam storeResults(object, param)"},{"path":"https://sneumann.github.io/xcms/reference/RDataParam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Store `XcmsExperiment` object as .RData file — RDataParam","text":"fileName `RDataParam` `character(1)`, defining file name. default `tempfile()`. object MsExperiment XcmsExperiment data object needs saved. param parameter object selecting configuring format saving. can one following classes: RDataParam, PlainTextParam, MzTabMParam.","code":""},{"path":"https://sneumann.github.io/xcms/reference/RDataParam.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Store `XcmsExperiment` object as .RData file — RDataParam","text":"`RDataParam`: `RDataParam` class. `storeResults` return anything saves object RData file.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/RDataParam.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Store `XcmsExperiment` object as .RData file — RDataParam","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/RDataParam.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Store `XcmsExperiment` object as .RData file — RDataParam","text":"","code":"## Load a test data set with detected peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Define param param <- RDataParam(fileName = \"example_xcms_object\") ## Save as RData storeResults(object = faahko_sub, param = param)"},{"path":"https://sneumann.github.io/xcms/reference/RsdFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter features based on their coefficient of variation — RsdFilter","title":"Filter features based on their coefficient of variation — RsdFilter","text":"`RsdFilter` class methods enable users filter features `XcmsExperiment` `SummarizedExperiment` object based relative standard deviation (coefficient variation) specified threshold. `filter` part possible dispatch generic function `filterFeatures`. Features ** (`>`) user-input threshold removed entire dataset.","code":""},{"path":"https://sneumann.github.io/xcms/reference/RsdFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter features based on their coefficient of variation — RsdFilter","text":"","code":"RsdFilter(threshold = 0.3, qcIndex = integer(), na.rm = TRUE, mad = FALSE) # S4 method for XcmsResult,RsdFilter filterFeatures(object, filter, ...) # S4 method for SummarizedExperiment,RsdFilter filterFeatures(object, filter, assay = 1)"},{"path":"https://sneumann.github.io/xcms/reference/RsdFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter features based on their coefficient of variation — RsdFilter","text":"threshold `numeric` value representing threshold. Features coefficient variation *strictly higher* (`>`) removed entire dataset. qcIndex `integer` (`logical`) vector corresponding indices QC samples. na.rm `logical` indicates whether missing values (`NA`) removed prior calculations. mad `logical` indicates whether *Median Absolute Deviation* (MAD) used instead standard deviation. suggested non-gaussian distributed data. object XcmsExperiment SummarizedExperiment. XcmsExperiment object, featureValues(object) evaluated, Summarizedesxperiment assay(object, assay). object filtered. filter parameter object selecting configuring type filtering. can one following classes: RsdFilter, DratioFilter, PercentMissingFilter BlankFlag. ... Optional parameters. object XcmsExperiment: parameters featureValues() call. assay filtering SummarizedExperiment objects . Indicates assay filtering based . Note features entire object removed, computations performed single assay. Default 1, means first assay object evaluated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/RsdFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter features based on their coefficient of variation — RsdFilter","text":"`RsdFilter`: `RsdFilter` class. `filterFeatures` return input object minus features met user input threshold.","code":""},{"path":"https://sneumann.github.io/xcms/reference/RsdFilter.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Filter features based on their coefficient of variation — RsdFilter","text":"assumed abundance values natural scale. Abundances log scale first transformed natural scale calculating RSD.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/RsdFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filter features based on their coefficient of variation — RsdFilter","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/SSgauss.html","id":null,"dir":"Reference","previous_headings":"","what":"Gaussian Model — SSgauss","title":"Gaussian Model — SSgauss","text":"selfStart model evalueates Gaussian model gradient. initial attribute evalueate inital estimates parameters mu, sigma, h.","code":""},{"path":"https://sneumann.github.io/xcms/reference/SSgauss.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gaussian Model — SSgauss","text":"","code":"SSgauss(x, mu, sigma, h)"},{"path":"https://sneumann.github.io/xcms/reference/SSgauss.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gaussian Model — SSgauss","text":"x numeric vector values evaluate model mu mean distribution function sigma standard deviation distribution fuction h height distribution function","code":""},{"path":"https://sneumann.github.io/xcms/reference/SSgauss.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gaussian Model — SSgauss","text":"Initial values mu h chosen maximal value x. initial value sigma determined area x divided h*sqrt(2*pi).","code":""},{"path":"https://sneumann.github.io/xcms/reference/SSgauss.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gaussian Model — SSgauss","text":"numeric vector length x. value expression h*exp(-(x-mu)^2/(2*sigma^2), modified gaussian function maximum height treated separate parameter dependent sigma. arguments mu, sigma, h names objects, gradient matrix respect names attached attribute named gradient.","code":""},{"path":"https://sneumann.github.io/xcms/reference/SSgauss.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Gaussian Model — SSgauss","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Data container storing xcms preprocessing results — XCMSnExp-class","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"XCMSnExp object container results G/LC-MS data preprocessing comprises chromatographic peak detection, alignment correspondence. results can accessed chromPeaks, adjustedRtime featureDefinitions functions; see (Usage, Arguments, Value Slots sections) details). Along results, object contains processing history allows track processing step along used settings. can extracted processHistory method. XCMSnExp objects, directly extending OnDiskMSnExp object MSnbase package, inherit functionality allows thus easy access full raw data stage analysis. support interaction packages requiring old objects, XCMSnExp objects can coerced xcmsSet objects using method (see examples ). preprocessing results passed along resulting xcmsSet object. General functions XCMSnExp objects (see specific function handle chromatographic peak data, alignment correspondence results): processHistoryTypes returns available types process histories. can passed argument type processHistory method extract specific process step(s). hasFilledChromPeaks: whether filled-peaks present . profMat: creates profile matrix, n x m matrix, n (rows) representing equally spaced m/z values (bins) m (columns) retention time corresponding scans. cell contains maximum intensity measured specific scan m/z values. See profMat details description various binning methods. hasAdjustedRtime: whether object provides adjusted retention times. hasFeatures: whether object contains correspondence results (.e. features). hasChromPeaks: whether object contains peak detection results. hasFilledChromPeaks: whether object contains filled-chromatographic peaks. adjustedRtime,adjustedRtime<-: extract/set adjusted retention times. adjustedRtime<- called manually, called internally adjustRtime methods. XCMSnExp objects, adjustedRtime<- also apply retention time adjustments eventually present chromatographic peaks. bySample parameter allows specify whether adjusted retention time grouped sample (file). featureDefinitions, featureDefinitions<-: extract set correspondence results, .e. mz-rt features (peak groups). Similar chromPeaks possible extract features specified m/z /rt ranges. function supports also parameter type allows specify features returned rt mz specified. details see help chromPeaks. See also featureSummary function calculate simple feature summaries. chromPeaks, chromPeaks<-: extract set matrix containing information identified chromatographic peaks. Rownames matrix represent unique IDs respective peaks within experiment. Parameter bySample allows specify whether peaks returned ungrouped (default bySample = FALSE) grouped sample (bySample = TRUE). chromPeaks<- method XCMSnExp objects removes also correspondence (peak grouping) retention time correction (alignment) results. optional arguments rt, mz, ppm type allow extract chromatographic peaks overlapping defined retention time /m/z ranges. Argument type allows define overlapping determined: type == \"\" (default), peaks even partially overlapping region returned (.e. either \"mzmin\" \"mzmax\" chromPeaks featureDefinitions matrix within provided m/z range), type == \"within\" full peak within region (.e. \"mzmin\" \"mzmax\" within m/z range) type == \"apex_within\" peak's apex position (highest signal peak) within region (.e. peak's features m/z within m/z range). See description return value details returned matrix. Users usually use chromPeaks<- method directly detected chromatographic peaks added object findChromPeaks method. Also, chromPeaks<- replace existing chromPeakData. chromPeakData chromPeakData<- allow get set arbitrary chromatographic peak annotations. returned ar returned DataFrame. Note number rows rownames DataFrame match chromPeaks. rtime: extracts retention time scan. bySample parameter allows return values grouped sample/file adjusted whether adjusted raw retention times returned. default method returns adjusted retention times, available (.e. retention times adjusted using adjustRtime method). mz: extracts mz values scan files within XCMSnExp object. values extracted original data files eventual processing steps applied fly. Using bySample parameter possible switch default grouping mz values spectrum/scan grouping sample/file. intensity: extracts intensity values scan files within XCMSnExp object. values extracted original data files eventual processing steps applied fly. Using bySample parameter possible switch default grouping intensity values spectrum/scan grouping sample/file. spectra: extracts Spectrum objects containing data object. values extracted original data files eventual processing steps applied fly. setting bySample = TRUE, spectra returned grouped sample/file. XCMSnExp object contains adjusted retention times, returned default Spectrum objects (can overwritten setting adjusted = FALSE). processHistory: returns list ProcessHistory objects (objects inheriting base class) representing individual processing steps performed, eventually along settings (Param parameter class). Optional arguments fileIndex, type msLevel allow restrict process steps certain type performed certain file MS level. dropChromPeaks: drops identified chromatographic peaks returns object without information. Note XCMSnExp objects method drops default also results correspondence (peak grouping) analysis. Adjusted retention times removed alignment performed peak detection. can overruled keepAdjustedRtime = TRUE. dropFeatureDefinitions: drops results correspondence (peak grouping) analysis, .e. definition mz-rt features returns object without information. Note XCMSnExp objects method also default drop retention time adjustment results, performed last peak grouping (.e. base results peak grouping going removed). related process history steps removed well eventually filled peaks (fillChromPeaks). parameter keepAdjustedRtime can used avoid removal adjusted retention times. dropAdjustedRtime: drops retention time adjustment information returns object without adjusted retention time. XCMSnExp objects, also reverts retention times reported chromatographic peaks peak matrix original, raw, ones (chromatographic peak detection). Note XCMSnExp objects method drops also peak grouping results performed retention time adjustment. related process history steps removed . findChromPeaks performs chromatographic peak detection provided XCMSnExp objects. details see method XCMSnExp. Note default (parameter add = FALSE) previous peak detection results removed. Use add = TRUE perform second round peak detection add newly identified peaks previous peak detection results. Correspondence results (features) always removed prior peak detection. Previous alignment (retention time adjustment) results kept, .e. chromatographic peak detection performed using adjusted retention times data first aligned using e.g. obiwarp (adjustRtime). dropFilledChromPeaks: drops filled-chromatographic peaks (filled fillChromPeaks method) related process history steps. spectrapply applies provided function Spectrum object returns results. function specified function simply returns list Spectrum objects. XCMSnExp objects can combined c function. combines identified chromatographic peaks objects' pheno data discards alignment results feature definitions. plot plots spectrum data (see plot MSnExp objects MSnbase package details. type = \"XIC\", identified chromatographic peaks indicated rectangles border color peakCol.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"","code":"processHistoryTypes() # S4 method for XCMSnExp hasFilledChromPeaks(object) # S4 method for OnDiskMSnExp profMat( object, method = \"bin\", step = 0.1, baselevel = NULL, basespace = NULL, mzrange. = NULL, fileIndex, ... ) # S4 method for XCMSnExp show(object) # S4 method for XCMSnExp hasAdjustedRtime(object) # S4 method for XCMSnExp hasFeatures(object, msLevel = integer()) # S4 method for XCMSnExp hasChromPeaks(object, msLevel = integer()) # S4 method for XCMSnExp hasFilledChromPeaks(object) # S4 method for XCMSnExp adjustedRtime(object, bySample = FALSE) # S4 method for XCMSnExp adjustedRtime(object) <- value # S4 method for XCMSnExp featureDefinitions( object, mz = numeric(), rt = numeric(), ppm = 0, type = c(\"any\", \"within\", \"apex_within\"), msLevel = integer() ) # S4 method for XCMSnExp featureDefinitions(object) <- value # S4 method for XCMSnExp chromPeaks( object, bySample = FALSE, rt = numeric(), mz = numeric(), ppm = 0, msLevel = integer(), type = c(\"any\", \"within\", \"apex_within\"), isFilledColumn = FALSE ) # S4 method for XCMSnExp chromPeaks(object) <- value # S4 method for XCMSnExp rtime(object, bySample = FALSE, adjusted = hasAdjustedRtime(object)) # S4 method for XCMSnExp mz(object, bySample = FALSE, BPPARAM = bpparam()) # S4 method for XCMSnExp intensity(object, bySample = FALSE, BPPARAM = bpparam()) # S4 method for XCMSnExp spectra( object, bySample = FALSE, adjusted = hasAdjustedRtime(object), BPPARAM = bpparam() ) # S4 method for XCMSnExp processHistory(object, fileIndex, type, msLevel) # S4 method for XCMSnExp dropChromPeaks(object, keepAdjustedRtime = FALSE) # S4 method for XCMSnExp dropFeatureDefinitions(object, keepAdjustedRtime = FALSE, dropLastN = -1) # S4 method for XCMSnExp dropAdjustedRtime(object) # S4 method for XCMSnExp profMat( object, method = \"bin\", step = 0.1, baselevel = NULL, basespace = NULL, mzrange. = NULL, fileIndex, ... ) # S4 method for XCMSnExp,Param findChromPeaks( object, param, BPPARAM = bpparam(), return.type = \"XCMSnExp\", msLevel = 1L, add = FALSE ) # S4 method for XCMSnExp dropFilledChromPeaks(object) # S4 method for XCMSnExp spectrapply(object, FUN = NULL, BPPARAM = bpparam(), ...) # S3 method for XCMSnExp c(...) # S4 method for XCMSnExp chromPeakData(object, ...) # S4 method for XCMSnExp chromPeakData(object) <- value # S4 method for XCMSnExp,missing plot(x, y, type = c(\"spectra\", \"XIC\"), peakCol = \"#ff000060\", ...)"},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"object adjustedRtime, featureDefinitions, chromPeaks, hasAdjustedRtime, hasFeatures hasChromPeaks either MsFeatureData XCMSnExp object, methods XCMSnExp object. method character(1) defining profile matrix generation method. Allowed \"bin\", \"binlin\", \"binlinbase\" \"intlin\". See details section information. step numeric(1) representing m/z bin size. baselevel numeric(1) representing base value empty elements (.e. m/z bins without measured intensity) set. considered method = \"binlinbase\". See baseValue parameter imputeLinInterpol() details. basespace numeric(1) representing m/z length signal drop base level. Linear interpolation used consecutive data points falling within 2 * basespace . considered method = \"binlinbase\". specified, defaults 0.075. Internally parameter translated distance parameter imputeLinInterpol() function distance = floor(basespace / step). See distance parameter imputeLinInterpol() details. mzrange. Optional numeric(2) manually specifying mz value range used binnind. provided, whole m/z value range used. fileIndex processHistory: optional integer specifying index files/samples ProcessHistory objects retrieved. ... Additional parameters. msLevel integer specifying MS level(s) identified chromatographic peaks returned. bySample logical(1) specifying whether results grouped sample. value adjustedRtime<-: list (length equal number samples) numeric vectors representing adjusted retention times per scan. featureDefinitions<-: DataFrame peak grouping information. See return value featureDefinitions method expected format. chromPeaks<-: matrix information detected peaks. See return value chromPeaks method expected format. mz optional numeric(2) defining mz range chromatographic peaks returned. rt optional numeric(2) defining retention time range chromatographic peaks returned. ppm optional numeric(1) specifying ppm mz range extended. value ppm = 10, peaks within mz[1] - ppm / 1e6 mz[2] + ppm / 1e6 returned. type processHistory: restrict returned ProcessHistory objects analysis steps certain type. Use processHistoryTypes list supported values. chromPeaks: character specifying peaks return rt mz defined. type = \"\" chromatographic peaks partially overlapping range defined mz /rt returned, type = \"within\" returns peaks completely within region type = \"apex_within\" peaks peak's apex within region. isFilledColumn logical(1) whether column \"is_filled\" included returned \"matrix\" providing information peak filled . Alternatively, information provided chromPeakData data frame. adjusted logical(1) whether adjusted raw (.e. original retention times reported files) returned. BPPARAM Parameter class parallel processing. See bpparam. keepAdjustedRtime dropFeatureDefinitions,XCMSnExp: logical(1) defining whether eventually present retention time adjustment dropped. default dropping feature definitions drops retention time adjustment results . dropLastN dropFeatureDefinitions,XCMSnExp: numeric(1) defining number peak grouping related process history steps remove. default dropLastN = -1, dropping chromatographic peaks removes process history steps related peak grouping. Setting e.g. dropLastN = 1 remove recent peak grouping related process history step. param CentWaveParam, MatchedFilterParam, MassifquantParam, MSWParam CentWavePredIsoParam object settings chromatographic peak detection algorithm. return.type Character specifying type object method return. Can either \"XCMSnExp\" (default), \"list\" \"xcmsSet\". add findChromPeaks: newly identified chromatographic peaks added peak matrix already identified chromatographic peaks. default (add = FALSE) previous peak detection results removed. FUN spectrapply: function applied spectrum object. x plot: XCMSnExp object. y plot: used. peakCol plot: color used indicate identified chromatographic peaks (combination type = \"XIC\" chromatographic peaks present).","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"profMat: list profile matrix matrix (matrices fileIndex specified length(fileIndex) > 1). See profile-matrix general help information profile matrix. adjustedRtime: bySample = FALSE numeric vector adjusted retention spectrum files/samples within object. bySample = TRUE list (length equal number samples) adjusted retention times grouped sample. Returns NULL adjusted retention times present. featureDefinitions: DataFrame peak grouping information, row corresponding one mz-rt feature (grouped peaks within across samples) columns \"mzmed\" (median mz value), \"mzmin\" (minimal mz value), \"mzmax\" (maximum mz value), \"rtmed\" (median retention time), \"rtmin\" (minimal retention time), \"rtmax\" (maximal retention time) \"peakidx\". Column \"peakidx\" contains list indices chromatographic peaks (rows) matrix returned chromPeaks method belong feature group. method returns NULL feature definitions present. featureDefinitions supports also parameters mz, rt, ppm type return features within certain ranges (see description chromPeaks details). chromPeaks: bySample = FALSE matrix (row chromatographic peak, rownames representing unique IDs peaks) least following columns: \"mz\" (intensity-weighted mean mz values peak across scans/retention times), \"mzmin\" (minimal mz value), \"mzmax\" (maximal mz value), \"rt\" (retention time peak apex), \"rtmin\" (minimal retention time), \"rtmax\" (maximal retention time), \"\" (integrated, original, intensity peak), \"maxo\" (maximum intentity peak), \"sample\" (sample index peak identified) Depending employed peak detection algorithm verboseColumns parameter , additional columns might returned. parameter isFilledColumn set TRUE column named \"is_filled\" also returned. bySample = TRUE chromatographic peaks returned list matrices, containing chromatographic peaks specific sample. samples peaks detected matrix 0 rows returned. rtime: bySample = FALSE numeric vector retention times scan, bySample = TRUE list numeric vectors retention times per sample. mz: bySample = FALSE list mz values (numeric vectors) scan. bySample = TRUE list mz values per sample. intensity: bySample = FALSE list intensity values (numeric vectors) scan. bySample = TRUE list intensity values per sample. spectra: bySample = FALSE list Spectrum objects. bySample = TRUE result grouped sample, .e. list lists, element outer list list spectra specific file. processHistory: list ProcessHistory objects providing details individual data processing steps performed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":".processHistory list XProcessHistory objects tracking individual analysis steps performed. msFeatureData MsFeatureData class extending environment containing results chromatographic peak detection (element \"chromPeaks\"), peak grouping (element \"featureDefinitions\") retention time correction (element \"adjustedRtime\") steps. object manipulated directly.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"\"chromPeaks\" element msFeatureData slot equivalent @peaks slot xcmsSet object, \"featureDefinitions\" contains information @groups @groupidx slots xcmsSet object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"chromatographic-peak-data","dir":"Reference","previous_headings":"","what":"Chromatographic peak data","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"Chromatographic peak data added XCMSnExp object findChromPeaks function. Functions access chromatographic peak data : hasChromPeaks whether chromatographic peak data available, see help function. chromPeaks access chromatographic peaks (see help). dropChromPeaks remove chromatographic peaks (see help). dropFilledChromPeaks remove filled-peaks (see help). fillChromPeaks fill-missing peaks (see respective help page). plotChromPeaks plot identified peaks file (see respective help page). plotChromPeakImage plot distribution peaks along retention time axis (see respective help page). highlightChromPeaks add chromatographic peaks existing plot Chromatogram (see respective help page).","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"adjusted-retention-times","dir":"Reference","previous_headings":"","what":"Adjusted retention times","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"Adjusted retention times stored XCMSnExp object besides original, raw, retention times, allowing switch raw adjusted times. also possible replace raw retention times adjusted ones applyAdjustedRtime. adjusted retention times added XCMSnExp adjustRtime function. functions related access adjusted retention times : hasAdjustedRtime whether adjusted retention times available (see help). dropAdjustedRtime remove adjusted retention times (see help). applyAdjustedRtime replace raw retention times adjusted ones (see respective help page). plotAdjustedRtime plot differences adjusted raw retention times (see respective help page).","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"correspondence-results-features","dir":"Reference","previous_headings":"","what":"Correspondence results, features","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"correspondence analysis (groupChromPeaks) adds feature definitions XCMSnExp object. functions related listed : hasFeatures whether correspondence results available (see help). featureDefinitions access definitions features (see help). dropFeatureDefinitions remove correspondence results (see help). featureValues access values features (see respective help page). featureSummary perform simple summary defined features (see respective help page). overlappingFeatures identify features overlapping close m/z - rt space (see respective help page). quantify extract feature intensities put , along feature definitions phenodata information, SummarizedExperiment. See help page details.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Data container storing xcms preprocessing results — XCMSnExp-class","text":"","code":"## Load a test data set with detected peaks library(MSnbase) #> Loading required package: BiocGenerics #> #> Attaching package: ‘BiocGenerics’ #> The following objects are masked from ‘package:stats’: #> #> IQR, mad, sd, var, xtabs #> The following objects are masked from ‘package:base’: #> #> Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append, #> as.data.frame, basename, cbind, colnames, dirname, do.call, #> duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted, #> lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin, #> pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply, #> union, unique, unsplit, which.max, which.min #> Loading required package: Biobase #> Welcome to Bioconductor #> #> Vignettes contain introductory material; view with #> 'browseVignettes()'. To cite Bioconductor, see #> 'citation(\"Biobase\")', and for packages 'citation(\"pkgname\")'. #> Loading required package: mzR #> Loading required package: Rcpp #> Loading required package: S4Vectors #> Loading required package: stats4 #> #> Attaching package: ‘S4Vectors’ #> The following object is masked from ‘package:utils’: #> #> findMatches #> The following objects are masked from ‘package:base’: #> #> I, expand.grid, unname #> #> This is MSnbase version 2.29.4 #> Visit https://lgatto.github.io/MSnbase/ to get started. #> Consider switching to the 'R for Mass Spectrometry' #> packages - see https://RforMassSpectrometry.org for details. #> #> Attaching package: ‘MSnbase’ #> The following object is masked from ‘package:base’: #> #> trimws data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) ## The results from the peak detection are now stored in the XCMSnExp ## object faahko_sub #> MSn experiment data (\"XCMSnExp\") #> Object size in memory: 1.22 Mb #> - - - Spectra data - - - #> MS level(s): 1 #> Number of spectra: 3834 #> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData #> rowNames: ko15.CDF ko16.CDF ko18.CDF #> varLabels: sampleNames #> varMetadata: labelDescription #> Loaded from: #> [1] ko15.CDF... [3] ko18.CDF #> Use 'fileNames(.)' to see all files. #> protocolData: none #> featureData #> featureNames: F1.S0001 F1.S0002 ... F3.S1278 (3834 total) #> fvarLabels: fileIdx spIdx ... spectrum (35 total) #> fvarMetadata: labelDescription #> experimentData: use 'experimentData(object)' #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave #> 248 peaks identified in 3 samples. #> On average 82.7 chromatographic peaks per sample. ## The detected peaks can be accessed with the chromPeaks method. head(chromPeaks(faahko_sub)) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP001 453.2 453.2 453.2 2506.073 2501.378 2527.982 1007409.0 1007380.8 38152 #> CP002 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> CP003 344.0 344.0 344.0 2679.783 2646.919 2709.517 5210015.9 5135916.9 152320 #> CP004 430.1 430.1 430.1 2681.348 2639.094 2712.647 2395840.3 2299899.6 65752 #> CP005 366.0 366.0 366.0 2679.783 2642.224 2718.907 3365174.0 3279468.3 79928 #> CP006 343.0 343.0 343.0 2678.218 2637.529 2712.647 24147443.2 23703761.7 672064 #> sn sample #> CP001 38151 1 #> CP002 46 1 #> CP003 68 1 #> CP004 42 1 #> CP005 49 1 #> CP006 87 1 ## The settings of the chromatographic peak detection can be accessed with ## the processHistory method processHistory(faahko_sub) #> [[1]] #> Object of class \"XProcessHistory\" #> type: Peak detection #> date: Thu Mar 14 11:42:34 2024 #> info: #> fileIndex: 1,2,3 #> Parameter class: CentWaveParam #> MS level(s) 1 #> ## Also the parameter class for the peak detection can be accessed processParam(processHistory(faahko_sub)[[1]]) #> Object of class: CentWaveParam #> Parameters: #> - ppm: [1] 25 #> - peakwidth: [1] 20 50 #> - snthresh: [1] 40 #> - prefilter: [1] 3 10000 #> - mzCenterFun: [1] \"wMean\" #> - integrate: [1] 1 #> - mzdiff: [1] -0.001 #> - fitgauss: [1] FALSE #> - noise: [1] 10000 #> - verboseColumns: [1] FALSE #> - roiList: list() #> - firstBaselineCheck: [1] TRUE #> - roiScales: numeric(0) #> - extendLengthMSW: [1] FALSE #> - verboseBetaColumns: [1] FALSE ## The XCMSnExp inherits all methods from the pSet and OnDiskMSnExp classes ## defined in Bioconductor's MSnbase package. To access the (raw) retention ## time for each spectrum we can use the rtime method. Setting bySample = TRUE ## would cause the retention times to be grouped by sample head(rtime(faahko_sub)) #> F1.S0001 F1.S0002 F1.S0003 F1.S0004 F1.S0005 F1.S0006 #> 2501.378 2502.943 2504.508 2506.073 2507.638 2509.203 ## Similarly it is possible to extract the mz values or the intensity values ## using the mz and intensity method, respectively, also with the option to ## return the results grouped by sample instead of the default, which is ## grouped by spectrum. Finally, to extract all of the data we can use the ## spectra method which returns Spectrum objects containing all raw data. ## Note that all these methods read the information from the original input ## files and subsequently apply eventual data processing steps to them. mzs <- mz(faahko_sub, bySample = TRUE) length(mzs) #> [1] 3 lengths(mzs) #> 1 2 3 #> 445769 440794 442516 ## The full data could also be read using the spectra data, which returns ## a list of Spectrum object containing the mz, intensity and rt values. ## spctr <- spectra(faahko_sub) ## To get all spectra of the first file we can split them by file ## head(split(spctr, fromFile(faahko_sub))[[1]]) ############ ## Filtering ## ## XCMSnExp objects can be filtered by file, retention time, mz values or ## MS level. For some of these filter preprocessing results (mostly ## retention time correction and peak grouping results) will be dropped. ## Below we filter the XCMSnExp object by file to extract the results for ## only the second file. xod_2 <- filterFile(faahko_sub, file = 2) xod_2 #> MSn experiment data (\"XCMSnExp\") #> Object size in memory: 0.48 Mb #> - - - Spectra data - - - #> MS level(s): 1 #> Number of spectra: 1278 #> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] #> Filter: select file(s) 2. [Wed Apr 3 13:47:13 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData #> rowNames: ko16.CDF #> varLabels: sampleNames #> varMetadata: labelDescription #> Loaded from: #> ko16.CDF #> protocolData: none #> featureData #> featureNames: F2.S0001 F2.S0002 ... F2.S1278 (1278 total) #> fvarLabels: fileIdx spIdx ... spectrum (35 total) #> fvarMetadata: labelDescription #> experimentData: use 'experimentData(object)' #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave #> 100 peaks identified in 1 samples. #> On average 100 chromatographic peaks per sample. ## Now the objects contains only the idenfified peaks for the second file head(chromPeaks(xod_2)) #> mz mzmin mzmax rt rtmin rtmax into intb #> CP088 384.1 384.1 384.1 2603.100 2592.145 2614.054 274906.3 274885.96 #> CP089 533.3 533.3 533.3 2686.042 2681.347 2689.172 70456.3 70450.04 #> CP090 344.0 344.0 344.0 2686.042 2648.483 2714.211 5700652.0 5574744.87 #> CP091 366.0 366.0 366.0 2686.042 2639.094 2725.166 3448376.1 3338483.07 #> CP092 343.0 343.0 343.0 2686.042 2645.353 2717.341 26229546.1 25615117.17 #> CP093 365.0 365.0 365.0 2686.042 2639.094 2726.731 15565868.0 14884380.84 #> maxo sn sample #> CP088 15187 15186 1 #> CP089 11819 11818 1 #> CP090 151744 87 1 #> CP091 77640 42 1 #> CP092 692352 68 1 #> CP093 345536 48 1 ########## ## Coercing to an xcmsSet object ## ## We can also coerce the XCMSnExp object into an xcmsSet object: xs <- as(faahko_sub, \"xcmsSet\") #> Note: you might want to set/adjust the 'sampclass' of the returned xcmSet object before proceeding with the analysis. head(peaks(xs)) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP001 453.2 453.2 453.2 2506.073 2501.378 2527.982 1007409.0 1007380.8 38152 #> CP002 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> CP003 344.0 344.0 344.0 2679.783 2646.919 2709.517 5210015.9 5135916.9 152320 #> CP004 430.1 430.1 430.1 2681.348 2639.094 2712.647 2395840.3 2299899.6 65752 #> CP005 366.0 366.0 366.0 2679.783 2642.224 2718.907 3365174.0 3279468.3 79928 #> CP006 343.0 343.0 343.0 2678.218 2637.529 2712.647 24147443.2 23703761.7 672064 #> sn sample #> CP001 38151 1 #> CP002 46 1 #> CP003 68 1 #> CP004 42 1 #> CP005 49 1 #> CP006 87 1"},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"methods listed page allow filter subset XCMSnExp objects. inherited OnDiskMSnExp object defined MSnbase package adapted XCMSnExp enable correct subsetting preprocessing results. [: subset XCMSnExp object spectra. aware removes preprocessing results, except adjusted retention times keepAdjustedRtime = TRUE passed method. [[: extracts single Spectrum object (defined MSnbase). reported retention time adjusted retention time alignment performed. filterChromPeaks: subset chromPeaks matrix object. Parameter method allows specify chromatographic peaks filtered. Currently, method = \"keep\" supported allows specify chromatographic peaks keep parameter keep (.e. provide logical, integer character defining chromatographic peaks keep). Feature definitions (present) updated correspondingly. filterFeatureDefinitions: allows subset feature definitions XCMSnExp object. Parameter features allow define features keep. can logical, integer (index features keep) character (feature IDs) vector. filterFile: allows reduce XCMSnExp data selected files. Identified chromatographic peaks files retained correspondence results (feature definitions) removed default. force keeping feature definitions use keepFeatures = TRUE. Adjusted retention times (present) retained default present. Use keepAdjustedRtime = FALSE drop . filterMsLevel: reduces XCMSnExp object spectra specified MS level(s). Chromatographic peaks identified features also subsetted respective MS level. See also filterMsLevel documentation MSnbase details examples. filterMz: filters data set based provided m/z value range. chromatographic peaks features (grouped peaks) apex falling within provided mz value range retained (.e. chromPeaks(object)[, \"mz\"] >= mz[1] <= mz[2]). Adjusted retention times, present, kept. filterRt: filters data set based provided retention time range. chromatographic peaks features (grouped peaks) within specified retention time window retained (.e. retention time corresponding peak's apex within specified rt range). retention time correction performed, method default filter object adjusted retention times. argument adjusted allows specify manually whether filtering performed raw adjusted retention times. Filtering retention time drop preprocessing results remove change alignment results (.e. adjusted retention times). method returns empty object spectrum feature within specified retention time range. split: splits XCMSnExp object list XCMSnExp objects based provided parameter f. Note default pre-processing results removed splitting, except adjusted retention times, optional argument keepAdjustedRtime = TRUE provided.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"","code":"# S4 method for XCMSnExp,ANY,ANY,ANY [(x, i, j, ..., drop = TRUE) # S4 method for XCMSnExp,ANY,ANY [[(x, i, j, drop = FALSE) # S4 method for XCMSnExp filterMsLevel(object, msLevel., keepAdjustedRtime = hasAdjustedRtime(object)) # S4 method for XCMSnExp filterFile( object, file, keepAdjustedRtime = hasAdjustedRtime(object), keepFeatures = FALSE ) # S4 method for XCMSnExp filterMz(object, mz, msLevel., ...) # S4 method for XCMSnExp filterRt(object, rt, msLevel., adjusted = hasAdjustedRtime(object)) # S4 method for XCMSnExp,ANY split(x, f, drop = FALSE, ...) # S4 method for XCMSnExp filterChromPeaks( object, keep = rep(TRUE, nrow(chromPeaks(object))), method = \"keep\", ... ) # S4 method for XCMSnExp filterFeatureDefinitions(object, features = integer())"},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"x [ [[: XCMSnExp object. [: numeric logical vector specifying spectra data set reduced. [[: single integer character. j [ [[: supported. ... Optional additional arguments. drop [ [[: supported. object XCMSnExp object. msLevel. filterMz, filterRt: numeric defining MS level(s) operations applied object subsetted. keepAdjustedRtime filterFile, filterMsLevel, [, split: logical(1) defining whether adjusted retention times kept, even e.g. features removed (retention time correction performed features). file filterFile: integer defining file index within object subset object file character specifying file names sub set. indices expected increasingly ordered, ordered internally. keepFeatures filterFile: logical(1) whether correspondence results (feature definitions) kept dropped. Defaults keepFeatures = FALSE hence feature definitions removed returned object default. mz filterMz: numeric(2) defining lower upper mz value filtering. rt filterRt: numeric(2) defining retention time window (lower upper bound) filtering. adjusted filterRt: logical indicating whether object filtered original (adjusted = FALSE) adjusted retention times (adjusted = TRUE). spectra: whether retention times individual Spectrum objects adjusted raw retention times. f split vector length equal length x defining x splitted. converted internally factor. keep filterChromPeaks: logical, integer character defining chromatographic peaks retained. method filterChromPeaks: character(1) allowing specify method chromatographic peaks filtered. Currently method = \"keep\" supported (.e. specify parameter keep chromatographic peaks retained). features filterFeatureDefinitions: either integer specifying indices features (rows) keep, logical length matching number rows featureDefinitions character feature (row) names.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"methods return XCMSnExp object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"subsetting methods try ensure returned data consistent. Correspondence results example removed default data set sub-setted file, since correspondence results dependent files correspondence performed. can changed setting keepFeatures = TRUE. adjusted retention times, subsetting methods support argument keepAdjustedRtime (even [ method) forces adjusted retention times retained even default drop .","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"filterFile method removes also process history steps related files object sub-setted updates fileIndex attribute accordingly. Also, method allow arbitrary ordering files re-ordering files within object. Note also filtering methods, also subsetting operations [ drop selected preprocessing results. consolidate alignment results, .e. ensure adjusted retention times always preserved, use applyAdjustedRtime() function object contains alignment results. replaces raw retention times adjusted ones.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-filter-methods.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"XCMSnExp filtering and subsetting — [,XCMSnExp,ANY,ANY,ANY-method","text":"","code":"## Loading a test data set with identified chromatographic peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) ## Subset the dataset to the first and third file. xod_sub <- filterFile(faahko_sub, file = c(1, 3)) ## The number of chromatographic peaks per file for the full object table(chromPeaks(faahko_sub)[, \"sample\"]) #> #> 1 2 3 #> 87 100 61 ## The number of chromatographic peaks per file for the subset table(chromPeaks(xod_sub)[, \"sample\"]) #> #> 1 2 #> 87 61 basename(fileNames(faahko_sub)) #> [1] \"ko15.CDF\" \"ko16.CDF\" \"ko18.CDF\" basename(fileNames(xod_sub)) #> [1] \"ko15.CDF\" \"ko18.CDF\" ## Filter on mz values; chromatographic peaks and features within the ## mz range are retained (as well as adjusted retention times). xod_sub <- filterMz(faahko_sub, mz = c(300, 400)) head(chromPeaks(xod_sub)) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP002 302 302 302 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> CP003 344 344 344 2679.783 2646.919 2709.517 5210015.9 5135916.9 152320 #> CP005 366 366 366 2679.783 2642.224 2718.907 3365174.0 3279468.3 79928 #> CP006 343 343 343 2678.218 2637.529 2712.647 24147443.2 23703761.7 672064 #> CP007 365 365 365 2679.783 2634.399 2717.342 14975760.8 14525699.1 357632 #> CP009 313 313 313 2783.070 2768.985 2806.544 1744615.5 1698756.0 74080 #> sn sample #> CP002 46 1 #> CP003 68 1 #> CP005 49 1 #> CP006 87 1 #> CP007 111 1 #> CP009 44 1 nrow(chromPeaks(xod_sub)) #> [1] 89 nrow(chromPeaks(faahko_sub)) #> [1] 248 ## Filter on rt values. All chromatographic peaks and features within the ## retention time range are retained. Filtering is performed by default on ## adjusted retention times, if present. xod_sub <- filterRt(faahko_sub, rt = c(2700, 2900)) range(rtime(xod_sub)) #> [1] 2700.127 2898.877 head(chromPeaks(xod_sub)) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP008 579.1 579.1 579.1 2786.200 2765.855 2806.544 1669436.8 1642951.6 87656 #> CP009 313.0 313.0 313.0 2783.070 2768.985 2806.544 1744615.5 1698756.0 74080 #> CP010 301.0 301.0 301.0 2786.200 2765.855 2809.674 3051847.8 2958809.7 118512 #> CP011 279.0 279.0 279.0 2787.765 2764.290 2814.369 17140627.0 16526792.4 805248 #> CP012 279.1 279.1 279.1 2825.323 2820.629 2828.453 106769.4 106763.2 17760 #> CP018 453.2 453.2 453.2 2720.472 2678.218 2786.200 2987076.3 2986966.8 34208 #> sn sample #> CP008 57 1 #> CP009 44 1 #> CP010 62 1 #> CP011 45 1 #> CP012 17759 1 #> CP018 33983 1 range(chromPeaks(xod_sub)[, \"rt\"]) #> [1] 2701.693 2895.746 nrow(chromPeaks(faahko_sub)) #> [1] 248 nrow(chromPeaks(xod_sub)) #> [1] 21 ## Extract a single Spectrum faahko_sub[[4]] #> Object of class \"Spectrum1\" #> Retention time: 41:46 #> MSn level: 1 #> Total ion count: 427 #> Polarity: -1 ## Subsetting using [ removes all preprocessing results - using ## keepAdjustedRtime = TRUE would keep adjusted retention times, if present. xod_sub <- faahko_sub[fromFile(faahko_sub) == 1] #> Warning: Removed preprocessing results xod_sub #> MSn experiment data (\"XCMSnExp\") #> Object size in memory: 0.48 Mb #> - - - Spectra data - - - #> MS level(s): 1 #> Number of spectra: 1278 #> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData #> rowNames: ko15.CDF #> varLabels: sampleNames #> varMetadata: labelDescription #> Loaded from: #> ko15.CDF #> protocolData: none #> featureData #> featureNames: F1.S0001 F1.S0002 ... F1.S1278 (1278 total) #> fvarLabels: fileIdx spIdx ... spectrum (35 total) #> fvarMetadata: labelDescription #> experimentData: use 'experimentData(object)' #> - - - xcms preprocessing - - - ## Using split does also remove preprocessing results, but it supports the ## optional parameter keepAdjustedRtime. ## Split the object into a list of XCMSnExp objects, one per file xod_list <- split(faahko_sub, f = fromFile(faahko_sub)) xod_list #> $`1` #> MSn experiment data (\"XCMSnExp\") #> Object size in memory: 0.48 Mb #> - - - Spectra data - - - #> MS level(s): 1 #> Number of spectra: 1278 #> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData #> rowNames: ko15.CDF #> varLabels: sampleNames #> varMetadata: labelDescription #> Loaded from: #> ko15.CDF #> protocolData: none #> featureData #> featureNames: F1.S0001 F1.S0002 ... F1.S1278 (1278 total) #> fvarLabels: fileIdx spIdx ... spectrum (35 total) #> fvarMetadata: labelDescription #> experimentData: use 'experimentData(object)' #> - - - xcms preprocessing - - - #> #> $`2` #> MSn experiment data (\"XCMSnExp\") #> Object size in memory: 0.48 Mb #> - - - Spectra data - - - #> MS level(s): 1 #> Number of spectra: 1278 #> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData #> rowNames: ko16.CDF #> varLabels: sampleNames #> varMetadata: labelDescription #> Loaded from: #> ko16.CDF #> protocolData: none #> featureData #> featureNames: F2.S0001 F2.S0002 ... F2.S1278 (1278 total) #> fvarLabels: fileIdx spIdx ... spectrum (35 total) #> fvarMetadata: labelDescription #> experimentData: use 'experimentData(object)' #> - - - xcms preprocessing - - - #> #> $`3` #> MSn experiment data (\"XCMSnExp\") #> Object size in memory: 0.48 Mb #> - - - Spectra data - - - #> MS level(s): 1 #> Number of spectra: 1278 #> MSn retention times: 41:41 - 74:60 minutes #> - - - Processing information - - - #> Data loaded [Thu Mar 14 11:42:34 2024] #> MSnbase version: 2.29.3 #> - - - Meta data - - - #> phenoData #> rowNames: ko18.CDF #> varLabels: sampleNames #> varMetadata: labelDescription #> Loaded from: #> ko18.CDF #> protocolData: none #> featureData #> featureNames: F3.S0001 F3.S0002 ... F3.S1278 (1278 total) #> fvarLabels: fileIdx spIdx ... spectrum (35 total) #> fvarMetadata: labelDescription #> experimentData: use 'experimentData(object)' #> - - - xcms preprocessing - - - #>"},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-inherited-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"XCMSnExp data manipulation methods inherited from MSnbase — bin,XCMSnExp-method","title":"XCMSnExp data manipulation methods inherited from MSnbase — bin,XCMSnExp-method","text":"methods listed page XCMSnExp methods inherited parent, OnDiskMSnExp class MSnbase package, alter raw data related data subsetting. Thus calling methods causes xcms pre-processing results removed XCMSnExp object ensure data integrity. bin: allows bin spectra. See bin documentation MSnbase package details examples. clean: removes unused 0 intensity data points. See clean documentation MSnbase package details examples. filterAcquisitionNum: filters XCMSnExp object keeping spectra provided acquisition numbers. See filterAcquisitionNum details examples. normalize method performs basic normalization spectra intensities. See normalize documentation MSnbase package details examples. pickPeaks method performs peak picking. See pickPeaks documentation details examples. removePeaks method removes mass peaks (intensities) lower threshold. Note peaks refer mass peaks, different chromatographic peaks detected analyzed metabolomics experiment! See removePeaks documentation details examples. smooth method smooths spectra. See smooth documentation MSnbase details examples.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-inherited-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"XCMSnExp data manipulation methods inherited from MSnbase — bin,XCMSnExp-method","text":"","code":"# S4 method for XCMSnExp bin(x, binSize = 1L, msLevel.) # S4 method for XCMSnExp clean(object, all = FALSE, verbose = FALSE, msLevel.) # S4 method for XCMSnExp filterAcquisitionNum(object, n, file) # S4 method for XCMSnExp normalize(object, method = c(\"max\", \"sum\"), ...) # S4 method for XCMSnExp pickPeaks( object, halfWindowSize = 3L, method = c(\"MAD\", \"SuperSmoother\"), SNR = 0L, ... ) # S4 method for XCMSnExp removePeaks(object, t = \"min\", verbose = FALSE, msLevel.) # S4 method for XCMSnExp smooth( x, method = c(\"SavitzkyGolay\", \"MovingAverage\"), halfWindowSize = 2L, verbose = FALSE, ... )"},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-inherited-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"XCMSnExp data manipulation methods inherited from MSnbase — bin,XCMSnExp-method","text":"x XCMSnExp OnDiskMSnExp object. binSize numeric(1) defining size bin (Dalton). msLevel. bin, clean, filterMsLevel, removePeaks: numeric(1) defining MS level(s) operations applied object subsetted. object XCMSnExp OnDiskMSnExp object. clean: logical(1), TRUE zeros removed. verbose logical(1) whether progress information displayed. n filterAcquisitionNum: integer defining acquisition numbers spectra data set sub-setted. file filterAcquisitionNum: integer defining file index within object subset object file. method normalize: character(1) specifying normalization method. See normalize MSnbase package details. pickPeaks: character(1) defining method. See pickPeaks options. smooth: character(1) defining method. See smooth MSnbase package options details. ... Optional additional arguments. halfWindowSize pickPeaks smooth: integer(1) defining window size peak picking. See pickPeaks smooth MSnbase package details options. SNR pickPeaks: numeric(1) defining signal noise ratio considered. See pickPeaks documentation details. t removePeaks: either numeric(1) \"min\" defining threshold (method) used. See removePeaks details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-inherited-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"XCMSnExp data manipulation methods inherited from MSnbase — bin,XCMSnExp-method","text":"methods: XCMSnExp object.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-inherited-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"XCMSnExp data manipulation methods inherited from MSnbase — bin,XCMSnExp-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-peak-grouping-results.html","id":null,"dir":"Reference","previous_headings":"","what":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","title":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","text":"featureValues,XCMSnExp : extract matrix feature values rows representing features columns samples. Parameter value allows define column chromPeaks matrix returned. Multiple chromatographic peaks sample can assigned feature. Parameter method allows specify method used cases chose peaks value returned. Parameter `msLevel` allows choose specific MS level feature values returned (given features defined MS level). quantify,XCMSnExp: return preprocessing results SummarizedExperiment object containing feature abundances assay matrix, feature definitions (returned featureDefinitions) rowData phenotype information colData. ideal container processing data. Internally, featureValues method used extract feature abundances, parameters method can passed quantify ....","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-peak-grouping-results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","text":"","code":"# S4 method for XCMSnExp quantify(object, ...) # S4 method for XCMSnExp featureValues( object, method = c(\"medret\", \"maxint\", \"sum\"), value = \"into\", intensity = \"into\", filled = TRUE, missing = NA, msLevel = integer() )"},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-peak-grouping-results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","text":"object XCMSnExp object providing feature definitions. ... quantify: additional parameters passed featureValues method. method character specifying method resolve multi-peak mappings within sample, .e. define representative peak feature samples one peak assigned feature. \"medret\": select peak closest median retention time feature. \"maxint\": select peak yielding largest signal. \"sum\": sum values (value \"\" \"maxo\". value character specifying name column chromPeaks(object) returned. Defaults \"\" case integrated peak area returned. get index peak chromPeaks(object) matrix use \"index\". intensity character specifying name column chromPeaks(objects) matrix containing intensity value peak used conflict resolution method = \"maxint\". filled logical(1) specifying whether values filled-peaks returned . filled = FALSE, NA returned matrix respective peak. See fillChromPeaks details peak filling. missing missing values reported. Allowed values NA (default), numeric missing = \"rowmin_half\". latter replaces NA half row's minimal (non-missing) value. msLevel `featureValues`: `integer` defining MS level(s) feature values returned. default, values features defined MS levels returned.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-peak-grouping-results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","text":"featureValues: matrix feature values, columns representing samples, rows features. order features matches order found featureDefinitions(object) DataFrame. rownames matrix featureDefinitions DataFrame. NA reported features without corresponding chromatographic peak respective sample(s). quantify: SummarizedExperiment representing preprocessing results.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-peak-grouping-results.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","text":"method equivalent groupval xcmsSet objects. Note missing = 0 used get behaviour groupval, .e. report missing values 0 call fillPeaks.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/XCMSnExp-peak-grouping-results.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Accessing mz-rt feature data values — quantify,XCMSnExp-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Containers for chromatographic and peak detection data — XChromatograms","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"XChromatogram object allows store chromatographic data (e.g. extracted ion chromatogram) along identified chromatographic peaks within data. object inherits functions Chromatogram() object MSnbase package. Multiple XChromatogram objects can stored XChromatograms object. class extends MChromatograms() MSnbase package allows thus arrange chromatograms matrix-like structure, columns representing samples rows m/z-retention time ranges. functions described (grouped topic-related sections) Arguments section.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"","code":"XChromatograms(data, phenoData, featureData, chromPeaks, chromPeakData, ...) XChromatogram( rtime = numeric(), intensity = numeric(), mz = c(NA_real_, NA_real_), filterMz = c(NA_real_, NA_real_), precursorMz = c(NA_real_, NA_real_), productMz = c(NA_real_, NA_real_), fromFile = integer(), aggregationFun = character(), msLevel = 1L, chromPeaks, chromPeakData ) # S4 method for XChromatogram show(object) # S4 method for XChromatogram chromPeaks( object, rt = numeric(), mz = numeric(), ppm = 0, type = c(\"any\", \"within\", \"apex_within\"), msLevel ) # S4 method for XChromatogram chromPeaks(object) <- value # S4 method for XChromatogram,ANY plot( x, col = \"#00000060\", lty = 1, type = \"l\", xlab = \"retention time\", ylab = \"intensity\", main = NULL, peakType = c(\"polygon\", \"point\", \"rectangle\", \"none\"), peakCol = \"#00000060\", peakBg = \"#00000020\", peakPch = 1, ... ) # S4 method for XChromatogram filterMz(object, mz, ...) # S4 method for XChromatogram filterRt(object, rt, ...) # S4 method for XChromatogram hasChromPeaks(object) # S4 method for XChromatogram dropFilledChromPeaks(object) # S4 method for XChromatogram chromPeakData(object) # S4 method for XChromatogram chromPeakData(object) <- value # S4 method for XChromatogram,MergeNeighboringPeaksParam refineChromPeaks(object, param = MergeNeighboringPeaksParam()) # S4 method for XChromatogram filterChromPeaks(object, method = c(\"keepTop\"), ...) # S4 method for XChromatogram transformIntensity(object, FUN = identity) # S4 method for XChromatograms show(object) # S4 method for XChromatograms hasChromPeaks(object) # S4 method for XChromatograms hasFilledChromPeaks(object) # S4 method for XChromatograms chromPeaks( object, rt = numeric(), mz = numeric(), ppm = 0, type = c(\"any\", \"within\", \"apex_within\"), msLevel ) # S4 method for XChromatograms chromPeakData(object) # S4 method for XChromatograms filterMz(object, mz, ...) # S4 method for XChromatograms filterRt(object, rt, ...) # S4 method for XChromatograms,ANY plot( x, col = \"#00000060\", lty = 1, type = \"l\", xlab = \"retention time\", ylab = \"intensity\", main = NULL, peakType = c(\"polygon\", \"point\", \"rectangle\", \"none\"), peakCol = \"#00000060\", peakBg = \"#00000020\", peakPch = 1, ... ) # S4 method for XChromatograms processHistory(object, fileIndex, type) # S4 method for XChromatograms hasFeatures(object, ...) # S4 method for XChromatograms dropFeatureDefinitions(object, ...) # S4 method for XChromatograms,PeakDensityParam groupChromPeaks(object, param) # S4 method for XChromatograms featureDefinitions( object, mz = numeric(), rt = numeric(), ppm = 0, type = c(\"any\", \"within\", \"apex_within\") ) # S4 method for XChromatograms,ANY,ANY,ANY [(x, i, j, drop = TRUE) # S4 method for XChromatograms featureValues( object, method = c(\"medret\", \"maxint\", \"sum\"), value = \"into\", intensity = \"into\", missing = NA, ... ) # S4 method for XChromatograms plotChromPeakDensity( object, param, col = \"#00000060\", xlab = \"retention time\", main = NULL, peakType = c(\"polygon\", \"point\", \"rectangle\", \"none\"), peakCol = \"#00000060\", peakBg = \"#00000020\", peakPch = 1, simulate = TRUE, ... ) # S4 method for XChromatograms dropFilledChromPeaks(object) # S4 method for XChromatograms,MergeNeighboringPeaksParam refineChromPeaks(object, param = MergeNeighboringPeaksParam()) # S4 method for XChromatograms filterChromPeaks(object, method = c(\"keepTop\"), ...) # S4 method for XChromatograms transformIntensity(object, FUN = identity)"},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"data XChromatograms: list Chromatogram XChromatogram objects. phenoData XChromatograms: either data.frame, AnnotatedDataFrame NAnnotatedDataFrame describing phenotypical information samples. featureData XChromatograms: either data.frame AnnotatedDataFrame additional information row chromatograms. chromPeaks XChromatogram: matrix required columns \"rt\", \"rtmin\", \"rtmax\", \"\", \"maxo\" \"sn\". XChromatograms: list, length data, chromatographic peaks chromatogram. element matrix, ordering match order chromatograms data. chromPeakData XChromatogram: DataFrame optional additional annotations chromatographic peak. number rows match number chromatographic peaks. ... filterChromPeaks: additional parameters defining filter chromatographic peaks. See function description details. rtime XChromatogram: numeric retention times (length equal length intensity). intensity XChromatogram: numeric intensity values (length equal length rtime). mz XChromatogram: numeric(2) representing m/z value range (min, max) chromatogram created. supposed contain real range m/z values contrast filterMz . chromPeaks featureDefinitions: numeric(2) defining m/z range chromatographic peaks features returned. filterMz: numeric(2) defining m/z range chromatographic peaks retained.#' filterMz XChromatogram: numeric(2) representing m/z value range (min, max) used filter original object m/z dimension. applicable use filterMz = c(0, 0). precursorMz XChromatogram: numeric(2) SRM/MRM transitions. Represents mz precursor ion. See details information. productMz XChromatogram: numeric(2) SRM/MRM transitions. Represents mz product. See details information. fromFile XChromatogram: integer(1) index file within OnDiskMSnExp MSnExp object chromatogram extracted. aggregationFun XChromatogram: character(1) specifying function used aggregate intensity values retention time across m/z range. msLevel XChromatogram: integer MS level chromatogram extracted. chromPeaks chromPeakData: extract chromatographic peaks certain MS level. object XChromatogram XChromatograms object. rt chromPeaks featureDefinitions: numeric(2) defining retention time range chromatographic peaks features returned. filterRt: numeric(2) defining retention time range reduce object . ppm chromPeaks featureDefinitions: numeric(1) defining ppm expand provided m/z range. type chromPeaks featureDefinitions: character(1) defining peaks features return rt mz provided: \"\" (default) return peaks even partially overlapping rt, \"within\" return peaks completely within rt \"apex_within\" return peaks apex within rt. value chromPeaks<-: numeric matrix required columns \"rt\", \"rtmin\", \"rtmax\", \"\" \"maxo\". x plot: XChromatogram XChromatograms object. col plot: color used draw chromatogram. lty plot plotChromPeakDensity: line type. xlab plot plotChromPeakDensity: x axis label. ylab plot: y axis label. main plot plotChromPeakDensity: optional title plot. peakType plot plotChromPeakDensity: character(1) defining () identified chromatographic peak within chromatogram plotted. Options \"polygon\" (default): draw peak borders peakCol color fill peak area peakBg color, \"point\": indicate peak's apex point, \"rectangle\": draw rectangle around identified peak \"none\": draw peaks. peakCol plot plotChromPeakDensity: foreground color peaks. peakType = \"polygon\" peakType = \"rectangle\" color border. Use NA use foreground color. either single color vector colors length chromPeaks(x) rows. peakBg plot plotChromPeakDensity: background color peaks. peakType = \"polygon\" peakType = \"rectangle\" peak rectangle filled color. Use NA skip. either single color vector colors length chromPeaks(x) rows. peakPch plot plotChromPeakDensity: point character used peakType = \"point\". See plot() graphics package details. param groupChromPeaks plotChromPeakDensity: PeakDensityParam() object settings peak density correspondence analysis algorithm. method featureValues: character(1) specifying method resolve multi-peak mappings within sample sample, .e. select representative peak feature one peak assigned one sample. Options \"medret\" (default): select peak closest median retention time feature, \"maxint\": select peak largest signal \"sum\": sum values peaks (value \"\" \"maxo\"). filterChromPeaks: character(1) defining method used filter chromatographic peaks. See help filterChromPeaks details. FUN transformIntensity: function transform intensity values object. fileIndex processHistory: optional integer specifying index files/samples ProcessHistory objects returned. [: integer row indices subset XChromatograms object. j [: integer column indices subset XChromatograms object. drop [: logical(1) whether dimensionality dropped (possible). Defaults drop = TRUE, thus, length j 1 XChromatogram returned. Note drop ignored length j larger 1, thus XChromatograms returned. missing featureValues: missing values reported. Allowed values NA (default), numeric(1) replace NAs value missing = \"rowmin_half\" replace NAs half row's minimal (non-missing) value. simulate plotChromPeakDensity: logical(1) whether correspondence analysis simulated based available data provided PeakDensityParam() param argument. See section Correspondence analysis details.","code":"For `featureValues`: `character(1)` specifying the name of the column in `chromPeaks(object)` containing the intensity value of the peak that should be used for the `method = \"maxint\"` conflict resolution if. For `plot`: what type of plot should be used for the chromatogram (such as `\"l\"` for lines, `\"p\"` for points etc), see help of [plot()] in the `graphics` package for more details. For `processHistory`: restrict returned processing steps to specific types. Use [processHistoryTypes()] to list all supported values. For `featureValues`: `character(1)` specifying the name of the column in `chromPeaks(object)` that should be returned or `\"index\"` (default) to return the index of the peak associated with the feature in each sample. To return the integrated peak area instead of the index use `value = \"into\"`."},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"See help individual functions.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"Highlighting peak area(s) XChromatogram XChromatograms object (plot peakType = \"polygon\") draws polygon representing displayed chromatogram peak's minimal retention time maximal retention time. XChromatograms extracted XCMSnExp() object chromatogram() function might represent actual identified peak area m/z range used extract chromatogram larger peak's m/z.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"creation-of-objects","dir":"Reference","previous_headings":"","what":"Creation of objects","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"Objects can created contructor function XChromatogram XChromatograms, respectively. Also, can coerced Chromatogram MChromatograms() objects using (object, \"XChromatogram\") (object, \"XChromatograms\").","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"filtering-and-subsetting","dir":"Reference","previous_headings":"","what":"Filtering and subsetting","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"Besides classical subsetting [ specific filter operations MChromatograms() XChromatograms objects available. See filterColumnsIntensityAbove() details. [ allows subset XChromatograms object row () column (j), j type integer. featureDefinitions also subsetted accordingly peakidx column updated. filterMz filters chromatographic peaks within XChromatogram XChromatograms, column \"mz\" present chromPeaks matrix. case XChromatogram extracted XCMSnExp() object chromatogram() function. chromatographic peaks m/z within m/z range defined mz retained. Also feature definitions (present) subset accordingly. function returns filtered XChromatogram XChromatograms object. filterRt filters chromatogram(s) provided retention time range. eventually present chromatographic peaks apex within retention time range specified rt retained. Also feature definitions, present, filtered accordingly. function returns filtered XChromatogram XChromatograms object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"accessing-data","dir":"Reference","previous_headings":"","what":"Accessing data","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"See also help Chromatogram MSnbase package general information data access. methods listed specific XChromatogram XChromatograms objects. chromPeaks, chromPeaks<-: extract set matrix chromatographic peak definitions. Parameter rt allows specify retention time range peaks returned along parameter type defines overlapping defined (parameter description details). XChromatogram objects function returns matrix columns \"rt\" (retention time peak apex), \"rtmin\" (lower peak boundary), \"rtmax\" (upper peak boundary), \"\" (ingegrated peak signal/area peak), \"maxo\" (maximum instensity peak \"sn\" (signal noise ratio). Note , depending peak detection algorithm, matrix may contain additional columns. XChromatograms objects matrix contains also columns \"row\" \"column\" specifying chromatogram object peak identified. Chromatographic peaks ordered row. chromPeakData, chromPeakData<-: extract set DataFrame() optional chromatographic peak annotations. hasChromPeaks: infer whether XChromatogram (XChromatograms) chromatographic peaks. XChromatogram: returns logical(1), XChromatograms: returns matrix, dimensions object either TRUE FALSE chromatographic peaks available chromatogram respective position. hasFilledChromPeaks: whether XChromatogram (XChromatogram XChromatograms) filled-chromatographic peaks. XChromatogram: returns logical(1), XChromatograms: returns matrix, dimensions object either TRUE FALSE chromatographic peaks available chromatogram respective position. dropFilledChromPeaks: removes filled-chromatographic peaks. See dropFilledChromPeaks() help XCMSnExp() objects information. hasFeatures: XChromatograms objects : correspondence analysis performed m/z-rt feature definitions present. Returns logical(1). dropFeatureDefinitions: XChrmomatograms objects : delete correspondence analysis results (related process history). featureDefinitions: XChromatograms objects . Extract results correspondence analysis (performed groupChromPeaks). Returns DataFrame properties defined m/z-rt features: m/z retention time range. Columns peakidx row contain index chromatographic peaks chromPeaks matrix associated feature row XChromatograms object feature defined. Similar chromPeaks method possible filter returned feature matrix mz, rt ppm parameters. featureValues: XChromatograms objects . Extract abundance estimates individuals features. Note default (parameter value = \"index\" matrix indices peaks chromPeaks matrix associated feature returned. extract integrated peak area use value = \"\". function returns matrix one row per feature (featureDefinitions) column sample (.e. column object). features without peak associated certain sample NA returned. can changed missing argument function. filterChromPeaks: filters chromatographic peaks object depending parameter method method-specific parameters passed additional arguments .... Available methods : method = \"keepTop\": keep top n (default n = 1L) peaks chromatogram ordered column order (defaults order = \"maxo\"). Parameter decreasing (default decreasing = TRUE) can used order peaks descending (decreasing = TRUE) ascending ( decreasing = FALSE) order keep top n peaks largest smallest values, respectively. processHistory: returns list ProcessHistory objects representing individual performed processing steps. Optional parameters type fileIndex allow specify processing steps return.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"manipulating-data","dir":"Reference","previous_headings":"","what":"Manipulating data","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"transformIntensity: transforms intensity values chromatograms provided function FUN. See transformIntensity() MSnbase package details. XChromatogram XChromatograms addition intensity values also columns \"\" \"maxo\" object's chromPeaks matrix transformed function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"plotting-and-visualizing","dir":"Reference","previous_headings":"","what":"Plotting and visualizing","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"plot draws chromatogram highlights addition chromatographic peaks present XChromatogram XChromatograms (unless peakType = \"none\" specified). draw peaks different colors vector color definitions length equal nrow(chromPeaks(x)) submitted peakCol /peakBg defining one color peak (order peaks chromPeaks(x)). base peak chromatograms total ion chromatograms might better set peakType = \"none\" avoid generating busy plots. plotChromPeakDensity: visualize peak density-based correspondence analysis results. See section Correspondence analysis details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"chromatographic-peak-detection","dir":"Reference","previous_headings":"","what":"Chromatographic peak detection","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"See findChromPeaks-Chromatogram-CentWaveParam information. chromatographic peak detection also possible refine identified chromatographic peaks refineChromPeaks method (e.g. reduce peak detection artifacts). Currently, peak refinement using merge neighboring peaks method available (see MergeNeighboringPeaksParam() detailed description approach.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"correspondence-analysis","dir":"Reference","previous_headings":"","what":"Correspondence analysis","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"Identified chromatographic peaks XChromatograms object can grouped features groupChromPeaks function. Currently, correspondence analysis can performed peak density method (see groupChromPeaks details) specifying algorithm settings PeakDensityParam() object. correspondence analysis performed separately row XChromatograms object grouping chromatographic peaks across samples (columns). analysis results stored returned XChromatograms object can accessed featureDefinitions method returns DataFrame one row feature. Column \"row\" specifies row XChromatograms object feature identified. plotChromPeakDensity method can used visualize peak density correspondence results, simulate peak density correspondence analysis chromatographic data. resulting plot consists two panels, upper panel showing chromatographic data well identified chromatographic peaks, lower panel distribution peaks (peak density) along retention time axis. plot shows peak point peak's retention time x-axis, sample found y-axis. distribution peaks along retention time axis visualized density estimate. Grouped chromatographic peaks indicated grey shaded rectangles. Parameter simulate allows define whether correspondence analysis simulated ( simulate=TRUE, based available data provided PeakDensityParam() parameter class) (simulate=FALSE). latter assumed correspondence analysis performed peak density method object. See examples . Abundance estimates feature can extracted featureValues function using parameter value = \"\" extract integrated peak area feature. result matrix, columns samples rows features.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/XChromatogram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Containers for chromatographic and peak detection data — XChromatograms","text":"","code":"## ---- Creation of XChromatograms ---- ## ## Create a XChromatograms from Chromatogram objects library(MSnbase) dta <- list(Chromatogram(rtime = 1:7, c(3, 4, 6, 12, 8, 3, 2)), Chromatogram(1:10, c(4, 6, 3, 4, 7, 13, 43, 34, 23, 9))) ## Create an XChromatograms without peak data xchrs <- XChromatograms(dta) ## Create an XChromatograms with peaks data pks <- list(matrix(c(4, 2, 5, 30, 12, NA), nrow = 1, dimnames = list(NULL, c(\"rt\", \"rtmin\", \"rtmax\", \"into\", \"maxo\", \"sn\"))), NULL) xchrs <- XChromatograms(dta, chromPeaks = pks) ## Create an XChromatograms from XChromatogram objects dta <- lapply(dta, as, \"XChromatogram\") chromPeaks(dta[[1]]) <- pks[[1]] xchrs <- XChromatograms(dta, nrow = 1) hasChromPeaks(xchrs) #> 1 2 #> 1 TRUE FALSE ## Loading a test data set with identified chromatographic peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Subset the dataset to the first and third file. xod_sub <- filterFile(faahko_sub, file = c(1, 3)) od <- as(xod_sub, \"MsExperiment\") ## Extract chromatograms for a m/z - retention time slice chrs <- chromatogram(od, mz = 344, rt = c(2500, 3500)) chrs #> MChromatograms with 1 row and 2 columns #> 1 2 #> #> [1,] length: 639 length: 639 #> phenoData with 2 variables #> featureData with 4 variables ## --------------------------------------------------- ## ## Chromatographic peak detection ## ## --------------------------------------------------- ## ## Perform peak detection using CentWave xchrs <- findChromPeaks(chrs, param = CentWaveParam()) xchrs #> XChromatograms with 1 row and 2 columns #> 1 2 #> #> [1,] peaks: 2 peaks: 1 #> phenoData with 2 variables #> featureData with 4 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave ## Do we have chromatographic peaks? hasChromPeaks(xchrs) #> 1 2 #> 1 TRUE TRUE ## Process history processHistory(xchrs) #> [[1]] #> Object of class \"XProcessHistory\" #> type: Peak detection #> date: Wed Apr 3 13:47:15 2024 #> info: #> fileIndex: 1,2 #> Parameter class: CentWaveParam #> ## The chromatographic peaks, columns \"row\" and \"column\" provide information ## in which sample the peak was identified. chromPeaks(xchrs) #> rt rtmin rtmax into intb maxo sn row column #> [1,] 2589.015 2571.801 2612.490 592297.3 554533.9 27600 14 1 1 #> [2,] 2679.783 2646.919 2709.517 5210015.9 5071346.6 152320 30 1 1 #> [3,] 2682.914 2643.790 2731.427 5255689.5 4983388.9 125632 28 1 2 ## Spectifically extract chromatographic peaks for one sample/chromatogram chromPeaks(xchrs[1, 2]) #> rt rtmin rtmax into intb maxo sn #> [1,] 2682.914 2643.79 2731.427 5255689 4983389 125632 28 ## Plot the results plot(xchrs) ## Plot the results using a different color for each sample sample_colors <- c(\"#ff000040\", \"#00ff0040\", \"#0000ff40\") cols <- sample_colors[chromPeaks(xchrs)[, \"column\"]] plot(xchrs, col = sample_colors, peakBg = cols) ## Indicate the peaks with a rectangle plot(xchrs, col = sample_colors, peakCol = cols, peakType = \"rectangle\", peakBg = NA) ## --------------------------------------------------- ## ## Correspondence analysis ## ## --------------------------------------------------- ## ## Group chromatographic peaks across samples prm <- PeakDensityParam(sampleGroup = rep(1, 2)) res <- groupChromPeaks(xchrs, param = prm) hasFeatures(res) #> [1] TRUE featureDefinitions(res) #> DataFrame with 2 rows and 10 columns #> mzmed mzmin mzmax rtmed rtmin rtmax npeaks #> #> FT1 NA NA NA 2681.35 2679.78 2682.91 2 #> FT2 NA NA NA 2589.01 2589.01 2589.01 1 #> X1 peakidx row #> #> FT1 2 2,3 1 #> FT2 1 1 1 ## Plot the correspondence results. Use simulate = FALSE to show the ## actual results. Grouped chromatographic peaks are indicated with ## grey shaded rectangles. plotChromPeakDensity(res, simulate = FALSE) ## Simulate a correspondence analysis based on different settings. Larger ## bw will increase the smoothing of the density estimate hence grouping ## chromatographic peaks that are more apart on the retention time axis. prm <- PeakDensityParam(sampleGroup = rep(1, 3), bw = 60) plotChromPeakDensity(res, param = prm) ## Delete the identified feature definitions res <- dropFeatureDefinitions(res) hasFeatures(res) #> [1] FALSE library(MSnbase) ## Create a XChromatogram object pks <- matrix(nrow = 1, ncol = 6) colnames(pks) <- c(\"rt\", \"rtmin\", \"rtmax\", \"into\", \"maxo\", \"sn\") pks[, \"rtmin\"] <- 2 pks[, \"rtmax\"] <- 9 pks[, \"rt\"] <- 4 pks[, \"maxo\"] <- 19 pks[, \"into\"] <- 93 xchr <- XChromatogram(rtime = 1:10, intensity = c(4, 8, 14, 19, 18, 12, 9, 8, 5, 2), chromPeaks = pks) xchr #> Object of class: XChromatogram #> length of object: 10 #> from file: #> mz range: [NA, NA] #> rt range: [1, 10] #> MS level: 1 #> Identified chromatographic peaks (1): #> rt\trtmin\trtmax\tinto\tmaxo\tsn #> 4\t2\t9\t93\t19\tNA ## Add arbitrary peak annotations df <- DataFrame(peak_id = c(\"a\")) xchr <- XChromatogram(rtime = 1:10, intensity = c(4, 8, 14, 19, 18, 12, 9, 8, 5, 2), chromPeaks = pks, chromPeakData = df) xchr #> Object of class: XChromatogram #> length of object: 10 #> from file: #> mz range: [NA, NA] #> rt range: [1, 10] #> MS level: 1 #> Identified chromatographic peaks (1): #> rt\trtmin\trtmax\tinto\tmaxo\tsn #> 4\t2\t9\t93\t19\tNA chromPeakData(xchr) #> DataFrame with 1 row and 3 columns #> peak_id ms_level is_filled #> #> 1 a 1 FALSE ## Extract the chromatographic peaks chromPeaks(xchr) #> rt rtmin rtmax into maxo sn #> [1,] 4 2 9 93 19 NA ## Plotting of a single XChromatogram object ## o Don't highlight chromatographic peaks plot(xchr, peakType = \"none\") ## o Indicate peaks with a polygon plot(xchr) ## Add a second peak to the data. pks <- rbind(chromPeaks(xchr), c(7, 7, 10, NA, 15, NA)) chromPeaks(xchr) <- pks ## Plot the peaks in different colors plot(xchr, peakCol = c(\"#ff000080\", \"#0000ff80\"), peakBg = c(\"#ff000020\", \"#0000ff20\")) ## Indicate the peaks as rectangles plot(xchr, peakCol = c(\"#ff000060\", \"#0000ff60\"), peakBg = NA, peakType = \"rectangle\") ## Filter the XChromatogram by retention time xchr_sub <- filterRt(xchr, rt = c(4, 6)) xchr_sub #> Object of class: XChromatogram #> length of object: 3 #> from file: #> mz range: [NA, NA] #> rt range: [4, 6] #> MS level: 1 #> Identified chromatographic peaks (1): #> rt\trtmin\trtmax\tinto\tmaxo\tsn #> 4\t2\t9\t93\t19\tNA plot(xchr_sub)"},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":null,"dir":"Reference","previous_headings":"","what":"Next Generation xcms Result Object — filterFeatureDefinitions","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"XcmsExperiment data container xcms preprocessing results (.e. results chromatographic peak detection, alignment correspondence analysis). provides functionality XCMSnExp object, uses advanced modern MS infrastructure provided MsExperiment Spectra Bioconductor packages. comes higher flexibility store data. Documentation various functions XcmsExperiment objects grouped topic provided sections . default xcms workflow perform chromatographic peak detection using findChromPeaks() optionally refine identified chromatographic peaks using refineChromPeaks() perform alignment (retention time adjustment) using adjustRtime(). Depending method used requires run correspondence analysis first perform correspondence analysis using groupChromPeaks() function group chromatographic peaks across samples define LC-MS features. optionally perform gap-filling rescue signal samples chromatographic peak identified hence missing value reported. can performed using fillChromPeaks() function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"","code":"filterFeatureDefinitions(object, ...) # S4 method for MsExperiment filterRt(object, rt = numeric(), ...) # S4 method for MsExperiment filterMzRange(object, mz = numeric(), msLevel. = uniqueMsLevels(object)) # S4 method for MsExperiment filterMz(object, mz = numeric(), msLevel. = uniqueMsLevels(object)) # S4 method for MsExperiment filterMsLevel(object, msLevel. = uniqueMsLevels(object)) # S4 method for MsExperiment uniqueMsLevels(object) # S4 method for MsExperiment filterFile(object, file = integer(), ...) # S4 method for MsExperiment rtime(object) # S4 method for MsExperiment fromFile(object) # S4 method for MsExperiment fileNames(object) # S4 method for MsExperiment polarity(object) # S4 method for MsExperiment filterIsolationWindow(object, mz = numeric()) # S4 method for MsExperiment chromatogram( object, rt = matrix(nrow = 0, ncol = 2), mz = matrix(nrow = 0, ncol = 2), aggregationFun = \"sum\", msLevel = 1L, isolationWindowTargetMz = NULL, chunkSize = 2L, return.type = \"MChromatograms\", BPPARAM = bpparam() ) featureArea( object, mzmin = min, mzmax = max, rtmin = min, rtmax = max, features = character() ) # S4 method for MsExperiment,missing plot(x, y, msLevel = 1L, peakCol = \"#ff000060\", ...) # S4 method for XcmsExperiment,ANY,ANY,ANY [(x, i, j, ..., drop = TRUE) # S4 method for XcmsExperiment filterIsolationWindow(object, mz = numeric()) # S4 method for XcmsExperiment filterRt(object, rt, msLevel.) # S4 method for XcmsExperiment filterMzRange(object, mz = numeric(), msLevel. = uniqueMsLevels(object)) # S4 method for XcmsExperiment filterMsLevel(object, msLevel. = uniqueMsLevels(object)) # S4 method for XcmsExperiment hasChromPeaks(object, msLevel = integer()) # S4 method for XcmsExperiment dropChromPeaks(object, keepAdjustedRtime = FALSE) # S4 method for XcmsExperiment chromPeaks(object) <- value # S4 method for XcmsExperiment chromPeaks( object, rt = numeric(), mz = numeric(), ppm = 0, msLevel = integer(), type = c(\"any\", \"within\", \"apex_within\"), isFilledColumn = FALSE ) # S4 method for XcmsExperiment chromPeakData(object) <- value # S4 method for XcmsExperiment chromPeakData( object, msLevel = integer(), return.type = c(\"DataFrame\", \"data.frame\") ) # S4 method for XcmsExperiment filterChromPeaks( object, keep = rep(TRUE, nrow(.chromPeaks(object))), method = \"keep\", ... ) # S4 method for XcmsExperiment dropAdjustedRtime(object) # S4 method for MsExperiment hasAdjustedRtime(object) # S4 method for XcmsExperiment rtime(object, adjusted = hasAdjustedRtime(object)) # S4 method for XcmsExperiment adjustedRtime(object) # S4 method for XcmsExperiment hasFeatures(object, msLevel = integer()) # S4 method for XcmsExperiment featureDefinitions(object) <- value # S4 method for XcmsExperiment featureDefinitions( object, mz = numeric(), rt = numeric(), ppm = 0, type = c(\"any\", \"within\", \"apex_within\"), msLevel = integer() ) # S4 method for XcmsExperiment dropFeatureDefinitions(object, keepAdjustedRtime = FALSE) # S4 method for XcmsExperiment filterFeatureDefinitions(object, features = integer()) # S4 method for XcmsExperiment hasFilledChromPeaks(object) # S4 method for XcmsExperiment dropFilledChromPeaks(object) # S4 method for XcmsExperiment quantify(object, ...) # S4 method for XcmsExperiment featureValues( object, method = c(\"medret\", \"maxint\", \"sum\"), value = \"into\", intensity = \"into\", filled = TRUE, missing = NA_real_, msLevel = integer() ) # S4 method for XcmsExperiment chromatogram( object, rt = matrix(nrow = 0, ncol = 2), mz = matrix(nrow = 0, ncol = 2), aggregationFun = \"sum\", msLevel = 1L, chunkSize = 2L, isolationWindowTargetMz = NULL, return.type = c(\"XChromatograms\", \"MChromatograms\"), include = character(), chromPeaks = c(\"apex_within\", \"any\", \"none\"), BPPARAM = bpparam() ) # S4 method for XcmsExperiment processHistory(object, type) # S4 method for XcmsExperiment filterFile( object, file, keepAdjustedRtime = hasAdjustedRtime(object), keepFeatures = FALSE, ... )"},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"object XcmsExperiment object. ... Additional optional parameters. quantify: parameter featureValues call used extract feature value matrix. rt chromPeaks featureDefinitions: numeric(2) defining retention time range chromatographic peaks features returned. full range used default. chromatogram: two column numerical matrix row representing lower upper retention time window(s) chromatograms. provided full retention time range used. mz chromPeaks featureDefinitions: numeric(2) optionally defining m/z range chromatographic peaks feature definitions returned. full m/z range used default. chromatogram: two-column numerical matrix row representing m/z range aggregated chromatogram. provided full m/z range data used (hence total ion chromatogram returned aggregationFun = \"sum\" used). filterIsolationWindow: numeric(1) defining m/z contained within spectra's isolation window. msLevel. filterRt: ignored. filterRt always filter retention times MS levels regardless parameter. chromatogram: integer MS level chromatogram(s) extracted. either length 1 length equal numer rows parameters mz rt defining m/z rt regions chromatograms created. Defaults msLevel = 1L. filterMsLevel: integer defining MS level(s) data subset. file filterFile: integer indices samples (files) data subsetted. aggregationFun chromatogram: character(1) defining function used aggregate intensities retention time (.e. spectrum) along specified m/z range (parameter mz). Defaults aggregationFun = \"sum\" hence intensities summed . Alternatively, use aggregationFun = \"max\" use maximal intensity per m/z range create base peak chromatogram (BPC). msLevel integer defining MS level (multiple MS level function supports ). isolationWindowTargetMz chromatogram: numeric (length equal number rows rt mz) isolation window target m/z MS2 spectra chromatgrom generated. MS1 data (msLevel = 1L, default), parameter ignored. See examples chromatogram information. chunkSize chromatogram: integer(1) defining number files data loaded time memory. Defaults chunkSize = 2L. return.type chromPeakData: character(1) defining class returned object. Can either \"DataFrame\" (default) \"data.frame\". chromatogram: character(1) defining type returned object. Currently return.type = \"MChromatograms\" supported. BPPARAM chromatogram: parallel processing setup. Defaults BPPARAM = bpparam(). See bpparam() information. mzmin featureArea: function calculate \"mzmin\" feature based \"mzmin\" values individual chromatographic peaks assigned feature. Defaults mzmin = min. mzmax featureArea: function calculate \"mzmax\" feature based \"mzmax\" values individual chromatographic peaks assigned feature. Defaults mzmax = max. rtmin featureArea: function calculate \"rtmin\" feature based \"rtmin\" values individual chromatographic peaks assigned feature. Defaults rtmin = min. rtmax featureArea: function calculate \"rtmax\" feature based \"rtmax\" values individual chromatographic peaks assigned feature. Defaults rtmax = max. features filterFeatureDefinitions featureArea: logical, integer character defining features keep extract feature area, respectively. See function description information. x XcmsExperiment object. y plot: defined supported. peakCol plot: defines border color rectangles indicating identified chromatographic peaks. single color supported. Defaults `peakCol = \"#ff000060\". [: integer logical defining samples/files subset. j [: supported. drop [: ignored. keepAdjustedRtime logical(1): whether adjusted retention times (present) retained. value featureValues: character(1) defining value reported feature sample. Can column chromPeaks matrix \"index\" simply index assigned peak returned. Defaults value = \"\" thus integrated peak area reported. ppm chromPeaks featureDefinitions: optional numeric(1) specifying ppm m/z range (defined mz extended. value ppm = 10, peaks within mz[1] - ppm / 1e6 mz[2] + ppm / 1e6 returned. type chromPeaks featureDefinitions either mz rt defined : character(1): defining peaks (features) returned. type = \"\": returns chromatographic peaks features also partially overlapping provided ranges. type = \"within\": returns peaks features completely within region defined mz /rt. type = \"apex_within\": returns peaks features m/z retention time peak's apex within region defined mz /rt. processHistory: restrict returned processing steps specific types. Use processHistoryTypes() list supported values. isFilledColumn chromPeaks: logical(1) whether column \"is_filled\" included returned matrix information whether peak detected filled-. Note information also provided chromPeakData data frame. keep filterChromPeaks: logical, integer character specifying chromatographic peaks keep. logical length keep needs match number rows chromPeaks. Alternatively, keep allows specify index (row) peaks keep ID (.e. row name chromPeaks). method featureValues: character(1) specifying method resolve multi-peak mappings within sample (correspondence analysis can assign one chromatographic peak within sample feature, e.g. close retention time). Options: method = \"medret\": report value chromatographic peak closest feature's median retention time. method = \"maxint\": report value chromatographic peak largest signal (parameter intensity allows select column chromPeaks used signal). method = \"sum\": sum value chromatographic peaks sample assigned feature. default method = \"medret\". filterChromPeaks: currently method = \"keep\" supported. adjusted rtime,XcmsExperiment: whether adjusted raw retention times returned. default return adjusted retention times, available. intensity featureValues: character(1) specifying name column chromPeaks(objects) matrix containing intensity value peak used conflict resolution method = \"maxint\". filled featureValues: logical(1) specifying whether values filled-peaks reported. filled = TRUE (default) filled peak values returned, otherwise NA reported respective features samples peak detected. missing featureValues: default value missing values. Allows define value reported missing peak intensity. Defaults missing = NA_real_. include chromatogram: deprecated; use parameter chromPeaks instead. chromPeaks chromatogram: character(1) defining chromatographic peaks returned. Can either chromPeaks = \"apex_within\" (default) return chromatographic peaks m/z RT apex within m/z retention time window, chromPeaks = \"\" chromatographic peaks overlapping m/z - retention time window chromPeaks = \"none\" include chromatographic peaks. See also parameter type additional information. keepFeatures subsetting functions ([, filterFile): logical(1): wheter eventually present feature definitions retained returned (filtered) object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"subsetting-and-filtering","dir":"Reference","previous_headings":"","what":"Subsetting and filtering","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"[: subset XcmsExperiment sample (parameter ). Subsetting default drop correspondence results (subsetting samples obviously affect feature definition) alignment results (adjusted retention times) identified chromatographic peaks (selected samples) retained. preprocessing results kept dropped can also configured optional parameters keepChromPeaks (default TRUE), keepAdjustedRtime (default FALSE) keepFeatures (default FALSE). filterChromPeaks: filter chromatographic peaks XcmsExperiment keeping specified parameter keep. Returns XcmsExperiment filtered data. Chromatographic peaks retain can specified either providing index chromPeaks matrix, ID (rowname chromPeaks) logical vector length number rows chromPeaks. Assignment chromatographic peaks updated eventually present feature definitions filtering. filterFeatureDefinitions: filter feature definitions XcmsExperiment keeping defined parameter features, can logical length equal number features, integer index features featureDefinitions(object) keep character feature IDs (.e. row names featureDefinitions(object)). filterFile: filter XcmsExperiment (MsExperiment) file (sample). index samples data subsetted can specified parameter file. sole purpose function provide backward compatibility MSnbase package. Wherever possible, [ function used instead sample-based subsetting. Parameters keepChromPeaks, keepAdjustedRtime keepChromPeaks can passed using .... Note also contrast [, filterFile support subsetting arbitrary order. filterIsolationWindow: filter spectra within MsExperiment XcmsExperiment object keeping isolation window containing specified m/z (.e., keeping spectra \"isolationWindowLowerMz\" smaller user-provided mz \"isolationWindowUpperMz\" larger mz). XcmsExperiment also chromatographic peaks (subsequently also features) removed range \"isolationWindowLowerMz\" \"isolationWindowUpperMz\" (columns chromPeakData) contain user provided mz. filterMsLevel: filter data XcmsExperiment MsExperiment keep data MS level(s) specified parameter msLevel.. filterMz, filterMzRange: filter spectra within XcmsExperiment MsExperiment specified m/z range (parameter mz). XcmsExperiment also identified chromatographic peaks features filtered keeping within specified m/z range (.e. m/z peak apex within m/z range). Parameter msLevels. allows restrict filtering specified MS levels. default data MS levels filtered. filterRt: filter XcmsExperiment keeping data within specified retention time range (parameter rt). function keep preprocessing results present within retention time range: identified chromatographic peaks retention time apex position within retention time range rt retained along, present, associated features. Parameter msLevel. currently ignored, .e. filtering always performed MS levels object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"functionality-related-to-chromatographic-peaks","dir":"Reference","previous_headings":"","what":"Functionality related to chromatographic peaks","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"chromatogram: extract chromatographic data data set. Parameters mz rt allow define specific m/z - retention time regions extract data (e.g. extracted ion chromatograms EICs). parameters expected numerical two-column matrices first column defining lower second upper margin. row can define separate m/z - retention time region. Currently function returns MChromatograms() object object MsExperiment , object XcmsExperiment, either MChromatograms XChromatograms() depending parameter return.type (can either \"MChromatograms\" \"XChromatograms\"). latter also chromatographic peaks detected within provided m/z retention times returned. Parameter chromPeaks allows specify chromatographic peaks reported. See documentation chromPeaks parameter information. XcmsExperiment contains correspondence results, also associated feature definitions included returned XChromatograms. default function returns chromatograms MS1 data, setting parameter msLevel = 2L possible e.g. extract also MS2 chromatograms. msLevel 1 addition important also specify isolationWindowTargetMz MS2 data extracted (e.g. SWATH data MS2 spectra created different m/z isolation windows isolationWindowTargetMz parameter allows define MS2 chromatogram extracted. Note future efficient data structures chromatographic data available well. chromPeaks: returns numeric matrix identified chromatographic peaks. row represents chromatographic peak identified one sample (file). number columns depends peak detection algorithm (see findChromPeaks()) methods return following columns: \"mz\" (intensity-weighted mean m/z values mass peaks included chromatographic peak), \"mzmin\" ( smallest m/z value mass peak chromatographic peak), \"mzmax\" (largest m/z value mass peak chromatographic peak), \"rt\" (retention time peak apex), \"rtmin\" (retention time first scan/mass peak chromatographic peak), \"rtmax\" (retention time last scan/mass peak chromatographic peak), \"\" (integrated intensity chromatographic peak), \"maxo\" (maximal intensity mass peak chromatographic peak), \"sample\" (index sample object peak identified). Parameters rt, mz, ppm, msLevel type allow extract subsets identified chromatographic peaks object. See parameter description details. chromPeakData: returns DataFrame potential additional annotations identified chromatographic peaks. row DataFrame corresponds row (index row name) chromPeaks matrix. default annotations \"ms_level\" (MS level peak identified) \"is_filled\" (whether chromatographic peak detected (findChromPeaks) filled-(fillChromPeaks). chromPeakSpectra: extract MS spectra identified chromatographic peaks. can either (full scan) MS1 spectra retention times retention time range chromatographic peak, MS2 spectra (present) retention time within retention time range (MS1) chromatographic peak precursor m/z within m/z range chromatographic peak single, selected spectra depending total signal highest signal. Parameter msLevel allows define MS level spectra extracted, parameter method allows define selected spectra returned. See chromPeakSpectra() details. dropChromPeaks: removes () chromatographic peak detection results object. also remove correspondence results (.e. features) eventually present adjusted retention times object alignment performed peak detection. Alignment results (adjusted retention times) can retained parameter keepAdjustedRtime set TRUE. dropFilledChromPeaks: removes chromatographic peaks added gap filling fillChromPeaks. fillChromPeaks: perform gap filling integrate signal missing values samples chromatographic peak found. depends correspondence results, hence groupChromPeaks needs called first. details options see fillChromPeaks(). findChromPeaks: perform chromatographic peak detection. See findChromPeaks() details. hasChromPeaks: whether object contains peak detection results. Parameter msLevel allows check whether peak detection results available specified MS level(s). hasFilledChromPeaks: whether gap-filling results (.e., filled-chromatographic peaks) present. manualChromPeaks: manually add chromatographic peaks defining m/z retention time ranges. See manualChromPeaks() details examples. plotChromPeakImage: show density identified chromatographic peaks per file along retention time. See plotChromPeakImage() details. plotChromPeaks: indicate identified chromatographic peaks one sample RT-m/z space. See plotChromPeaks() details. refineChromPeaks: refines identified chromatographic peaks object. See refineChromPeaks() details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"functionality-related-to-alignment","dir":"Reference","previous_headings":"","what":"Functionality related to alignment","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"adjustedRtime: extract adjusted retention times. just alias rtime(object, adjusted = TRUE). adjustRtime: performs retention time adjustment (alignment) data. See adjustRtime() details. applyAdjustedRtime: replaces original (raw) retention times adjusted ones. See applyAdjustedRtime() information. dropAdjustedRtime: drops alignment results (adjusted retention time) result object. also reverts retention times identified chromatographic peaks present result object. Note results correspondence analysis (.e. feature definitions) dropped (correspondence analysis performed alignment). can overruled keepAdjustedRtime = TRUE. hasAdjustedRtime: whether alignment performed object (.e., object contains alignment results). plotAdjustedRtime: plot alignment results; see plotAdjustedRtime() information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"functionality-related-to-correspondence-analysis","dir":"Reference","previous_headings":"","what":"Functionality related to correspondence analysis","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"dropFeatureDefinitions: removes correspondence analysis results object well filled-chromatographic peaks. default (parameter keepAdjustedRtime = FALSE) also alignment results removed alignment performed correspondence analysis. can overruled keepAdjustedRtime = TRUE. featureArea: returns matrix columns \"mzmin\", \"mzmax\", \"rtmin\" \"rtmax\" m/z retention time range feature (row) object. default represent minimal m/z retention times well maximal m/z retention times chromatographic peaks assigned feature. Parameter features allows extract values selected features . Parameters mzmin, mzmax, rtmin rtmax allow define function calculate reported \"mzmin\", \"mzmax\", \"rtmin\" \"rtmax\" values. featureChromatograms: extract ion chromatograms (EICs) feature object. See featureChromatograms() details. featureDefinitions: returns data.frame feature definitions empty data.frame correspondence analysis results present. Parameters msLevel, mz, ppm rt allow define subsets feature definitions returned parameter type defining parameters used subset returned data.frame. See parameter descriptions details. featureSpectra: returns Spectra() List Spectra (MS1 MS2) spectra associated feature. See featureSpectra() details available parameters. featuresSummary: calculate simple summary features. See featureSummary() details. groupChromPeaks: performs correspondence analysis (.e., grouping chromatographic peaks LC-MS features). See groupChromPeaks() details. hasFeatures: whether correspondence analysis results presentin object. optional parameter msLevel allows define MS level(s) determined feature definitions available. overlappingFeatures: identify features overlapping close m/z - rt dimension. See overlappingFeatures() information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"extracting-data-and-results-from-an-xcmsexperiment","dir":"Reference","previous_headings":"","what":"Extracting data and results from an XcmsExperiment","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"Preprocessing results can extracted using following functions: chromPeaks: extract identified chromatographic peaks. See section chromatographic peak detection details. featureDefinitions: extract definition features (chromatographic peaks grouped across samples). See section correspondence analysis details. featureValues: extract matrix values features sample (file). Rows features, columns samples. value returned can defined parameter value, can column chromPeaks matrix. default (value = \"\") integrated chromatographic peak intensities returned. parameter msLevel possible extract values features certain MS levels. correspondence analysis, one chromatographic peak per sample can assigned feature (e.g. close retention time). Parameter method allows define strategy deal cases: method = \"medret\": report value chromatographic peak apex position closest feautre's median retention time. method = \"maxint\": report value chromatographic peak largest signal (parameter intensity allows define column chromPeaks selected; defaults intensity = \"\"). method = \"sum\"`: sum values chromatographic peaks assigned feature sample. quantify: extract correspondence analysis results SummarizedExperiment(). feature values used assay returned SummarizedExperiment, rowData contains featureDefinitions (without column \"peakidx\") colData sampleData object. Additional parameters featureValues function (used extract feature value matrix) can passed via ....","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"visualization","dir":"Reference","previous_headings":"","what":"Visualization","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"plot: plot file position individual peaks m/z - retention time space (color-coded intensity) base peak chromatogram. function ideally called data subset (.e. using filterRt filterMz restrict region interest). Parameter msLevel allows define MS level plot created. x XcmsExperiment available identified chromatographic peaks, also region defining peaks indicated rectangle. Parameter peakCol allows define color border rectangles. plotAdjustedRtime: plot alignment results; see plotAdjustedRtime() information. plotChromPeakImage: show density identified chromatographic peaks per file along retention time. See plotChromPeakImage() details. plotChromPeaks: indicate identified chromatographic peaks one sample RT-m/z space. See plotChromPeaks() details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"general-functionality-and-functions-for-backward-compatibility","dir":"Reference","previous_headings":"","what":"General functionality and functions for backward compatibility","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"uniqueMsLevels: returns unique MS levels spectra object. functions listed ensure compatibility older XCMSnExp() xcms result object. fileNames: returns original data file names spectra data. Ideally, dataOrigin dataStorage spectra variables object's spectra used instead. fromFile: returns file (sample) index spectrum within object. Generally, subsetting sample using [ preferred way get spectra specific sample. polarity: returns polarity information spectrum object. processHistory: returns list ProcessHistory process history objects contain also parameter object used different processings. Optional parameter type allows query specific processing steps. rtime: extract retention times spectra MsExperiment XcmsExperiment object. thus shortcut rtime(spectra(object)) preferred way extract retention times MsExperiment. rtime method XcmsExperiment additional parameter adjusted allows define whether adjusted retention times (present - adjusted = TRUE) raw retention times (adjusted = FALSE) returned. default adjusted retention times returned available.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"differences-compared-to-the-xcmsnexp-object","dir":"Reference","previous_headings":"","what":"Differences compared to the XCMSnExp() object","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"Subsetting [ supports arbitrary ordering.","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/XcmsExperiment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Next Generation xcms Result Object — filterFeatureDefinitions","text":"","code":"## Creating a MsExperiment object representing the data from an LC-MS ## experiment. library(MsExperiment) ## Defining the raw data files fls <- c(system.file('cdf/KO/ko15.CDF', package = \"faahKO\"), system.file('cdf/KO/ko16.CDF', package = \"faahKO\"), system.file('cdf/KO/ko18.CDF', package = \"faahKO\")) ## Defining a data frame with the sample characterization df <- data.frame(mzML_file = basename(fls), sample = c(\"ko15\", \"ko16\", \"ko18\")) ## Importing the data. This will initialize a `Spectra` object representing ## the raw data and assign these to the individual samples. mse <- readMsExperiment(spectraFiles = fls, sampleData = df) ## Extract a total ion chromatogram and base peak chromatogram ## from the data bpc <- chromatogram(mse, aggregationFun = \"max\") tic <- chromatogram(mse) ## Plot them par(mfrow = c(2, 1)) plot(bpc, main = \"BPC\") plot(tic, main = \"TIC\") ## Extracting MS2 chromatographic data ## ## To show how MS2 chromatograms can be extracted we first load a DIA ## (SWATH) data set. mse_dia <- readMsExperiment(system.file(\"TripleTOF-SWATH\", \"PestMix1_SWATH.mzML\", package = \"msdata\")) ## Extracting MS2 chromatogram requires also to specify the isolation ## window from which to extract the data. Without that chromatograms ## will be empty: chr_ms2 <- chromatogram(mse_dia, msLevel = 2L) intensity(chr_ms2[[1L]]) #> numeric(0) ## First we list available isolation windows table(isolationWindowTargetMz(spectra(mse_dia))) #> #> 163.75 208.95 244.05 270.85 299.1 329.8 367.35 601.85 #> 1000 1000 1000 1000 1000 1000 1000 1000 ## We can then extract the TIC of MS2 data for a specific isolation window chr_ms2 <- chromatogram(mse_dia, msLevel = 2L, isolationWindowTargetMz = 244.05) plot(chr_ms2) #### ## Chromatographic peak detection ## Perform peak detection on the data using the centWave algorith. Note ## that the parameters are chosen to reduce the run time of the example. p <- CentWaveParam(noise = 10000, snthresh = 40, prefilter = c(3, 10000)) xmse <- findChromPeaks(mse, param = p) xmse #> Object of class XcmsExperiment #> Spectra: MS1 (3834) #> Experiment data: 3 sample(s) #> Sample data links: #> - spectra: 3 sample(s) to 3834 element(s). #> xcms results: #> - chromatographic peaks: 248 in MS level(s): 1 ## Have a quick look at the identified chromatographic peaks head(chromPeaks(xmse)) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP001 453.2 453.2 453.2 2506.073 2501.378 2527.982 1007409.0 1007380.8 38152 #> CP002 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> CP003 344.0 344.0 344.0 2679.783 2646.919 2709.517 5210015.9 5135916.9 152320 #> CP004 430.1 430.1 430.1 2681.348 2639.094 2712.647 2395840.3 2299899.6 65752 #> CP005 366.0 366.0 366.0 2679.783 2642.224 2718.907 3365174.0 3279468.3 79928 #> CP006 343.0 343.0 343.0 2678.218 2637.529 2712.647 24147443.2 23703761.7 672064 #> sn sample #> CP001 38151 1 #> CP002 46 1 #> CP003 68 1 #> CP004 42 1 #> CP005 49 1 #> CP006 87 1 ## Extract chromatographic peaks identified between 3000 and 3300 seconds chromPeaks(xmse, rt = c(3000, 3300), type = \"within\") #> mz mzmin mzmax rt rtmin rtmax into intb #> CP021 453.2 453.2 453.2 3063.196 3035.027 3114.840 3001594.78 3001514.97 #> CP030 361.1 361.1 361.1 3147.704 3141.444 3153.964 367361.84 362278.28 #> CP031 340.3 340.3 340.3 3230.646 3225.952 3233.776 68671.25 68664.99 #> CP032 526.2 526.2 526.2 3243.166 3238.471 3246.296 374698.56 374692.30 #> CP033 313.1 313.1 313.1 3276.030 3254.121 3290.115 1199152.63 1162839.05 #> CP034 454.1 454.1 454.1 3276.030 3261.945 3294.809 12283448.95 12024951.77 #> CP108 307.1 307.1 307.1 3143.009 3121.099 3164.918 2191519.65 2063202.03 #> CP109 278.1 278.1 278.1 3196.217 3180.568 3213.432 657840.25 651048.36 #> CP110 526.1 526.1 526.1 3179.003 3150.833 3210.302 21334966.98 21147392.01 #> CP111 380.1 380.1 380.1 3152.398 3132.054 3174.308 2201517.91 2201474.09 #> CP112 380.1 380.1 380.1 3210.302 3210.302 3216.561 187031.44 187023.61 #> CP113 380.1 380.1 380.1 3202.477 3174.308 3216.561 1156780.73 1156736.91 #> CP114 380.1 380.1 380.1 3222.821 3216.561 3240.036 485818.25 485793.21 #> CP115 286.2 286.2 286.2 3258.815 3246.296 3280.725 1264118.64 1247233.70 #> CP116 308.1 308.1 308.1 3261.945 3241.601 3285.419 2066854.37 2025917.82 #> CP204 380.1 380.1 380.1 3150.835 3128.925 3171.179 2036803.99 1937655.24 #> CP205 286.2 286.2 286.2 3250.992 3233.777 3257.252 732016.23 722185.86 #> CP206 568.2 568.2 568.2 3207.173 3185.264 3232.212 3951832.25 3866503.74 #> maxo sn sample #> CP021 53096 53095 1 #> CP030 49240 57 1 #> CP031 11391 11390 1 #> CP032 60800 60799 1 #> CP033 55392 50 1 #> CP034 554112 58 1 #> CP108 101400 43 2 #> CP109 30208 54 2 #> CP110 622144 251 2 #> CP111 95176 95175 2 #> CP112 25144 28791 2 #> CP113 28920 28919 2 #> CP114 23176 23535 2 #> CP115 67600 41 2 #> CP116 96272 78 2 #> CP204 82624 49 3 #> CP205 74824 68 3 #> CP206 164352 113 3 ## Extract ion chromatograms (EIC) for the first two chromatographic ## peaks. chrs <- chromatogram(xmse, mz = chromPeaks(xmse)[1:2, c(\"mzmin\", \"mzmax\")], rt = chromPeaks(xmse)[1:2, c(\"rtmin\", \"rtmax\")]) #> Processing chromatographic peaks ## An EIC for each sample and each of the two regions was extracted. ## Identified chromatographic peaks in the defined regions are extracted ## as well. chrs #> XChromatograms with 2 rows and 3 columns #> 1 2 3 #> #> [1,] peaks: 1 peaks: 0 peaks: 0 #> [2,] peaks: 1 peaks: 0 peaks: 0 #> phenoData with 3 variables #> featureData with 4 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave ## Plot the EICs for the second defined region plot(chrs[2, ]) ## Subsetting the data to the results (and data) for the second sample a <- xmse[2] nrow(chromPeaks(xmse)) #> [1] 248 nrow(chromPeaks(a)) #> [1] 100 ## Filtering the result by retention time: keeping all spectra and ## chromatographic peaks within 3000 and 3500 seconds. xmse_sub <- filterRt(xmse, rt = c(3000, 3500)) #> Filter spectra xmse_sub #> Object of class XcmsExperiment #> Spectra: MS1 (960) #> Experiment data: 3 sample(s) #> Sample data links: #> - spectra: 3 sample(s) to 960 element(s). #> xcms results: #> - chromatographic peaks: 79 in MS level(s): 1 nrow(chromPeaks(xmse_sub)) #> [1] 79 ## Perform an initial feature grouping to allow alignment using the ## peak groups method: pdp <- PeakDensityParam(sampleGroups = rep(1, 3)) xmse <- groupChromPeaks(xmse, param = pdp) ## Perform alignment using the peak groups method. pgp <- PeakGroupsParam(span = 0.4) xmse <- adjustRtime(xmse, param = pgp) #> Performing retention time correction using 19 peak groups. ## Visualizing the alignment results plotAdjustedRtime(xmse) ## Performing the final correspondence analysis xmse <- groupChromPeaks(xmse, param = pdp) ## Show the definition of the first 6 features featureDefinitions(xmse) |> head() #> mzmed mzmin mzmax rtmed rtmin rtmax npeaks 1 peakidx #> FT01 279.0 279.0 279.0 2789.588 2787.430 2791.746 2 2 11, 199 #> FT02 286.2 286.2 286.2 3253.923 3245.811 3262.034 2 2 115, 205 #> FT03 300.2 300.2 300.2 3385.835 3384.068 3390.895 4 3 35, 125,.... #> FT04 301.0 301.0 301.0 2789.066 2787.430 2790.180 3 3 10, 97, 198 #> FT05 305.1 305.1 305.1 2927.922 2922.158 2933.686 2 2 14, 202 #> FT06 305.1 305.1 305.1 3000.543 2991.470 3009.616 2 2 15, 203 #> ms_level #> FT01 1 #> FT02 1 #> FT03 1 #> FT04 1 #> FT05 1 #> FT06 1 ## Extract the feature values; show the results for the first 6 rows. featureValues(xmse) |> head() #> ko15.CDF ko16.CDF ko18.CDF #> FT01 17140627.0 NA 16919266.9 #> FT02 NA 1264119 732016.2 #> FT03 4700903.2 5313736 5169558.2 #> FT04 3051847.8 1964444 2774885.3 #> FT05 1070389.9 NA 1983342.5 #> FT06 847473.1 NA 1003750.6 ## The full results can also be extracted as a `SummarizedExperiment` ## that would eventually simplify subsequent analyses with other packages. ## Any additional parameters passed to the function are passed to the ## `featureValues` function that is called to generate the feature value ## matrix. se <- quantify(xmse, method = \"sum\") ## EICs for all features can be extracted with the `featureChromatograms` ## function. Note that, depending on the data set, extracting this for ## all features might take some time. Below we extract EICs for the ## first 10 features by providing the feature IDs. chrs <- featureChromatograms(xmse, features = rownames(featureDefinitions(xmse))[1:10]) chrs #> XChromatograms with 10 rows and 3 columns #> ko15.CDF ko16.CDF ko18.CDF #> #> [1,] peaks: 1 peaks: 0 peaks: 1 #> [2,] peaks: 0 peaks: 1 peaks: 1 #> ... ... ... ... #> [9,] peaks: 1 peaks: 2 peaks: 0 #> [10,] peaks: 1 peaks: 1 peaks: 1 #> phenoData with 3 variables #> featureData with 4 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave #> Correspondence: #> method: chromatographic peak density #> 10 feature(s) identified. plot(chrs[3, ])"},{"path":"https://sneumann.github.io/xcms/reference/absent-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine which peaks are absent / present in a sample class — absent-methods","title":"Determine which peaks are absent / present in a sample class — absent-methods","text":"Determine peaks absent / present sample class","code":""},{"path":"https://sneumann.github.io/xcms/reference/absent-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Determine which peaks are absent / present in a sample class — absent-methods","text":"object = \"xcmsSet\" absent(object, ...) present(object, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/absent-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine which peaks are absent / present in a sample class — absent-methods","text":"object xcmsSet-class object class Name sample class sampclass minfrac minimum fraction samples necessary class absent/present","code":""},{"path":"https://sneumann.github.io/xcms/reference/absent-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Determine which peaks are absent / present in a sample class — absent-methods","text":"Determine peaks absent / present sample class functions treat peaks present fillPeaks correctly, .e. count present.","code":""},{"path":"https://sneumann.github.io/xcms/reference/absent-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine which peaks are absent / present in a sample class — absent-methods","text":"logical vector length nrow(groups(object)).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":null,"dir":"Reference","previous_headings":"","what":"Alignment: Retention time correction methods. — adjustRtime","title":"Alignment: Retention time correction methods. — adjustRtime","text":"adjustRtime method(s) perform retention time correction (alignment) chromatograms different samples/dataset. Alignment performed default MS level 1 data. Retention times spectra MS levels, present, subsequently adjusted based adjusted retention times MS1 spectra. Note calling adjustRtime xcms result object remove eventually present previous alignment results well correspondence analysis results. run second round alignment, raw retention times need replaced adjusted ones using applyAdjustedRtime() function. alignment method can specified (configured) using dedicated param argument. Supported param objects : ObiwarpParam: performs retention time adjustment based full m/z - rt data using obiwarp method (Prince (2006)). based original code supports addition alignment multiple samples aligning center sample. alignment performed directly profile-matrix can hence performed independently peak detection peak grouping. PeakGroupsParam: performs retention time correction based alignment features defined /samples (corresponding house keeping compounds marker compounds) (Smith 2006). First retention time deviation features described fitting either polynomial (smooth = \"loess\") linear (smooth = \"linear\") function data points. subsequently used adjust retention time spectrum sample (even spectra MS levels different MS 1). Since function based features (.e. chromatographic peaks grouped across samples) initial correspondence analysis performed using groupChromPeaks() function. Alternatively, also possible manually define numeric matrix retention times markers samples used alignment. matrix can passed alignment function using peakGroupsMatrix parameter PeakGroupsParam parameter object. default adjustRtimePeakGroups function used define matrix. function identifies peak groups (features) alignment object based parameters defined param. See also do_adjustRtime_peakGroups() core API function. LamaParama: function performs retention time correction aligning chromatographic data external reference dataset (concept initial implementation Carl Brunius). process involves identifying aligning peaks within experimental chromatographic data, represented XcmsExperiment object, predefined set landmark features called \"lamas\". landmark features characterized mass--charge ratio (m/z) retention time. see LamaParama() information method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Alignment: Retention time correction methods. — adjustRtime","text":"","code":"adjustRtime(object, param, ...) # S4 method for MsExperiment,ObiwarpParam adjustRtime(object, param, chunkSize = 2L, BPPARAM = bpparam()) # S4 method for MsExperiment,PeakGroupsParam adjustRtime(object, param, msLevel = 1L, ...) PeakGroupsParam( minFraction = 0.9, extraPeaks = 1, smooth = \"loess\", span = 0.2, family = \"gaussian\", peakGroupsMatrix = matrix(nrow = 0, ncol = 0), subset = integer(), subsetAdjust = c(\"average\", \"previous\") ) ObiwarpParam( binSize = 1, centerSample = integer(), response = 1L, distFun = \"cor_opt\", gapInit = numeric(), gapExtend = numeric(), factorDiag = 2, factorGap = 1, localAlignment = FALSE, initPenalty = 0, subset = integer(), subsetAdjust = c(\"average\", \"previous\") ) adjustRtimePeakGroups(object, param = PeakGroupsParam(), msLevel = 1L) # S4 method for OnDiskMSnExp,ObiwarpParam adjustRtime(object, param, msLevel = 1L) # S4 method for PeakGroupsParam minFraction(object) # S4 method for PeakGroupsParam minFraction(object) <- value # S4 method for PeakGroupsParam extraPeaks(object) # S4 method for PeakGroupsParam extraPeaks(object) <- value # S4 method for PeakGroupsParam smooth(x) # S4 method for PeakGroupsParam smooth(object) <- value # S4 method for PeakGroupsParam span(object) # S4 method for PeakGroupsParam span(object) <- value # S4 method for PeakGroupsParam family(object) # S4 method for PeakGroupsParam family(object) <- value # S4 method for PeakGroupsParam peakGroupsMatrix(object) # S4 method for PeakGroupsParam peakGroupsMatrix(object) <- value # S4 method for PeakGroupsParam subset(x) # S4 method for PeakGroupsParam subset(object) <- value # S4 method for PeakGroupsParam subsetAdjust(object) # S4 method for PeakGroupsParam subsetAdjust(object) <- value # S4 method for ObiwarpParam binSize(object) # S4 method for ObiwarpParam binSize(object) <- value # S4 method for ObiwarpParam centerSample(object) # S4 method for ObiwarpParam centerSample(object) <- value # S4 method for ObiwarpParam response(object) # S4 method for ObiwarpParam response(object) <- value # S4 method for ObiwarpParam distFun(object) # S4 method for ObiwarpParam distFun(object) <- value # S4 method for ObiwarpParam gapInit(object) # S4 method for ObiwarpParam gapInit(object) <- value # S4 method for ObiwarpParam gapExtend(object) # S4 method for ObiwarpParam gapExtend(object) <- value # S4 method for ObiwarpParam factorDiag(object) # S4 method for ObiwarpParam factorDiag(object) <- value # S4 method for ObiwarpParam factorGap(object) # S4 method for ObiwarpParam factorGap(object) <- value # S4 method for ObiwarpParam localAlignment(object) # S4 method for ObiwarpParam localAlignment(object) <- value # S4 method for ObiwarpParam initPenalty(object) # S4 method for ObiwarpParam initPenalty(object) <- value # S4 method for ObiwarpParam subset(x) # S4 method for ObiwarpParam subset(object) <- value # S4 method for ObiwarpParam subsetAdjust(object) # S4 method for ObiwarpParam subsetAdjust(object) <- value # S4 method for XCMSnExp,PeakGroupsParam adjustRtime(object, param, msLevel = 1L) # S4 method for XCMSnExp,ObiwarpParam adjustRtime(object, param, msLevel = 1L)"},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Alignment: Retention time correction methods. — adjustRtime","text":"object adjustRtime: OnDiskMSnExp(), XCMSnExp(), MsExperiment() XcmsExperiment() object. param parameter object defining alignment method (setting). ... ignored. chunkSize adjustRtime object either MsExperiment XcmsExperiment: integer(1) defining number files (samples) loaded memory processed time. Alignment performed parallel (per sample) subset loaded data. setting thus allows balance memory demand speed (due parallel processing). parallel processing can performed subset data currently loaded memory iteration, value chunkSize match defined parallel setting setup. Using parallel processing setup using 4 CPUs (separate processes) using chunkSize = 1will perform parallel processing, data one sample loaded memory time. hand, settingchunkSize` total number samples experiment load full MS data memory thus settings cause --memory error. BPPARAM parallel processing setup. Defaults BPPARAM = bpparam(). See bpparam() details. msLevel adjustRtime: integer(1) defining MS level alignment performed. minFraction PeakGroupsParam: numeric(1) 0 1 defining minimum required proportion samples peaks peak group identified. Peak groups passing criteria aligned across samples retention times individual spectra adjusted based alignment. minFraction = 1 peak group contain peaks samples experiment. Note subset provided, specified fraction relative defined subset samples total number samples within experiment (.e., peak present specified proportion subset samples). extraPeaks PeakGroupsParam: numeric(1) defining maximal number additional peaks samples assigned peak group (feature) retention time correction. data set 6 samples, extraPeaks = 1 uses peak groups total peak count <= 6 + 1. total peak count total number peaks assigned peak group considers also multiple peaks within sample assigned group. smooth PeakGroupsParam: character(1) defining function used interpolate corrected retention times peak groups. Can either \"loess\" \"linear\". span PeakGroupsParam: numeric(1) defining degree smoothing (smooth = \"loess\"). parameter passed internal call loess(). family PeakGroupsParam: character(1) defining method loess smoothing. Allowed values \"gaussian\" \"symmetric\". See loess() information. peakGroupsMatrix PeakGroupsParam: optional matrix (raw) retention times (marker) peak groups alignment performed. column represents sample, row feature/peak group. adjustRtimePeakGroups method used default determine matrix provided object. subset ObiwarpParam PeakGroupsParam: integer indices samples within experiment alignment models estimated. Samples part subset adjusted based closest subset sample. See Subset-based alignment section details. subsetAdjust ObiwarpParam PeakGroupsParam: character(1) specifying method non-subset samples adjusted. Supported options \"previous\" \"average\" (default). See Subset-based alignment section details. binSize numeric(1) defining bin size (mz dimension) used profile matrix generation. See step parameter profile-matrix documentation details. centerSample integer(1) defining index center sample experiment. defaults floor(median(1:length(fileNames(object)))). Note subset used, index passed centerSample within subset samples. response ObiwarpParam: numeric(1) defining responsiveness warping response = 0 giving linear warping start end points response = 100 warping using bijective anchors. distFun ObiwarpParam: character(1) defining distance function used. Allowed values \"cor\" (Pearson's correlation), \"cor_opt\" (calculate 10% diagonal band distance matrix; better runtime), \"cov\" (covariance), \"prd\" (product) \"euc\" (Euclidian distance). default value distFun = \"cor_opt\". gapInit ObiwarpParam: numeric(1) defining penalty gap opening. default value depends value distFun: distFun = \"cor\" distFun = \"cor_opt\" 0.3, distFun = \"cov\" distFun = \"prd\" 0.0 distFun = \"euc\" 0.9. gapExtend ObiwarpParam: numeric(1) defining penalty gap enlargement. default value gapExtend depends value distFun: distFun = \"cor\" distFun = \"cor_opt\" 2.4, distFun = \"cov\" 11.7, distFun = \"euc\" 1.8 distFun = \"prd\" 7.8. factorDiag ObiwarpParam: numeric(1) defining local weight applied diagonal moves alignment. factorGap ObiwarpParam: numeric(1) defining local weight gap moves alignment. localAlignment ObiwarpParam: logical(1) whether local alignment performed instead default global alignment. initPenalty ObiwarpParam: numeric(1) defining penalty initiating alignment (local alignment ). value value slot. x ObiwarpParam, PeakGroupsParam LamaParama object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Alignment: Retention time correction methods. — adjustRtime","text":"adjustRtime OnDiskMSnExp XCMSnExp object return XCMSnExp object alignment results. adjustRtime MsExperiment XcmsExperiment return XcmsExperiment adjusted retention times stored new spectra variable rtime_adjusted object's spectra. ObiwarpParam, PeakGroupsParam LamaParama return respective parameter object. adjustRtimeGroups returns matrix retention times marker features sample (row one feature, row one sample).","code":""},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":"subset-based-alignment","dir":"Reference","previous_headings":"","what":"Subset-based alignment","title":"Alignment: Retention time correction methods. — adjustRtime","text":"alignment methods allow perform retention time correction user-selected subset samples (e.g. QC samples) samples part subset adjusted based adjusted retention times closest subset sample (close terms index within object hence possibly injection index). thus suggested load MS data files order samples injected measurement run(s). non-subset samples adjusted depends also parameter subsetAdjust: subsetAdjust = \"previous\", non-subset sample adjusted based closest previous subset sample results cases adjusted retention times non-subset sample identical subset sample adjustment bases. second, default, option subsetAdjust = \"average\" case non subset sample adjusted based average retention time adjustment previous following subset sample. average, weighted mean used weights inverse distance non-subset sample subset samples used alignment. See also section Alignment experiments including blanks xcms vignette details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Alignment: Retention time correction methods. — adjustRtime","text":"Prince, J. T., Marcotte, E. M. (2006) \"Chromatographic Alignment ESI-LC-MS Proteomic Data Sets Ordered Bijective Interpolated Warping\" Anal. Chem., 78 (17), 6140-6152. Smith, C.., Want, E.J., O'Maille, G., Abagyan, R. Siuzdak, G. (2006). \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 78:779-787.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/adjustRtime.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Alignment: Retention time correction methods. — adjustRtime","text":"Colin Smith, Johannes Rainer, Philippine Louail, Carl Brunius","code":""},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace raw with adjusted retention times — applyAdjustedRtime","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"Replaces raw retention times adjusted retention time returns object unchanged none present.","code":""},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"","code":"applyAdjustedRtime(object)"},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"object XCMSnExp XcmsExperiment object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"XCMSnExp XcmsExperiment object raw (original) retention times replaced adjusted retention time.","code":""},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"Adjusted retention times stored parallel adjusted retention times XCMSnExp XcmsExperiment objects. applyAdjustedRtime replaces raw (original) retention times adjusted retention times.","code":""},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"Replacing raw retention times adjusted retention times disables possibility restore raw retention times using dropAdjustedRtime() method. function remove retention time processing step settings alignment processHistory() object ensure processing history preserved.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/applyAdjustedRtime.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace raw with adjusted retention times — applyAdjustedRtime","text":"","code":"## Load a test data set with detected peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) xod <- adjustRtime(faahko_sub, param = ObiwarpParam()) #> Sample number 2 used as center sample. #> Aligning ko15.CDF against ko16.CDF ... #> OK #> Aligning ko18.CDF against ko16.CDF ... #> OK #> Applying retention time adjustment to the identified chromatographic peaks ... #> OK hasAdjustedRtime(xod) #> [1] TRUE ## Replace raw retention times with adjusted retention times. xod <- applyAdjustedRtime(xod) ## No adjusted retention times present hasAdjustedRtime(xod) #> [1] FALSE ## Raw retention times have been replaced with adjusted retention times plot(split(rtime(faahko_sub), fromFile(faahko_sub))[[1]] - split(rtime(xod), fromFile(xod))[[1]], type = \"l\") ## And the process history still contains the settings for the alignment processHistory(xod) #> [[1]] #> Object of class \"XProcessHistory\" #> type: Peak detection #> date: Thu Mar 14 11:42:34 2024 #> info: #> fileIndex: 1,2,3 #> Parameter class: CentWaveParam #> MS level(s) 1 #> #> [[2]] #> Object of class \"XProcessHistory\" #> type: Retention time correction #> date: Wed Apr 3 13:47:28 2024 #> info: #> fileIndex: 1,2,3 #> Parameter class: ObiwarpParam #> MS level(s) 1 #>"},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":null,"dir":"Reference","previous_headings":"","what":"Aggregate values in y for bins defined on x — binYonX","title":"Aggregate values in y for bins defined on x — binYonX","text":"functions takes two -sized numeric vectors x y, bins/cuts x bins (either pre-defined number equal-sized bins bins pre-defined size) aggregates values y corresponding x values falling within bin. default (.e. method = \"max\") maximal y value corresponding x values identified. x expected incrementally sorted , , internally sorted ( case also y ordered according order x).","code":""},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Aggregate values in y for bins defined on x — binYonX","text":"","code":"binYonX( x, y, breaks, nBins, binSize, binFromX, binToX, fromIdx = 1L, toIdx = length(x), method = \"max\", baseValue, sortedX = !is.unsorted(x), shiftByHalfBinSize = FALSE, returnIndex = FALSE, returnX = TRUE )"},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Aggregate values in y for bins defined on x — binYonX","text":"x Numeric vector used binning. y Numeric vector (length x) maximum values bin defined. provided, x used. breaks Numeric vector defining breaks bins, .e. lower upper values bin. See examples . nBins integer(1) defining number desired bins. binSize numeric(1) defining desired bin size. binFromX Optional numeric(1) allowing manually specify range x-values used binning. affect calculation breaks bins (.e. nBins binSize provided). provided minimal value sub-set fromIdx-toIdx input vector x used. binToX binFromX, defining maximum x-value used binning. fromIdx Integer vector defining start position one multiple sub-sets input vector x used binning. toIdx toIdx, defining maximum index (indices) x used binning. method character string specifying method used aggregate values y. Allowed \"max\", \"min\", \"sum\" \"mean\" identify maximal minimal value sum values within bin calculate mean value. baseValue base value empty bins (.e. bins either values x fall, NA values y assigned). default (.e. specified), NA assigned bins. sortedX Whether x sorted. shiftByHalfBinSize Logical specifying whether bins shifted half bin size left. Thus, first bin center fromX lower upper boundary fromX - binSize/2 fromX + binSize/2. argument ignored breaks provided. returnIndex Logical indicating whether index max (method = \"max\") min (method = \"min\") value within bin input vector x also reported. methods \"max\" \"min\" argument ignored. returnX logical allowing avoid returning $x, .e. mid-points bins. returnX = FALSE might useful cases breaks pre-defined considerably reduces memory demand.","code":""},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Aggregate values in y for bins defined on x — binYonX","text":"Returns list length 2, first element (named \"x\") contains bin mid-points, second element (named \"y\") aggregated values input vector y within bin. returnIndex = TRUE list contains additional element \"index\" index max min (depending whether method = \"max\" method = \"min\") value within bin input vector x.","code":""},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Aggregate values in y for bins defined on x — binYonX","text":"breaks defining boundary bin can either passed directly function argument breaks, calculated data based arguments nBins binSize along fromIdx, toIdx optionally binFromX binToX. Arguments fromIdx toIdx allow specify subset(s) input vector x bins calculated. default full x vector considered. Also, specified otherwise arguments binFromX binToX , range bins within sub-sets x[fromIdx] x[toIdx]. Arguments binFromX binToX allow overwrite manually defining range breaks calculated. See examples details. Calculation breaks: nBins breaks correspond seq(min(x[fromIdx])), max(x[fromIdx], length.= (nBins + 1)). binSize breaks correspond seq(min(x[fromIdx]), max(x[toIdx]), = binSize) exception last break value forced equal max(x[toIdx]). ensures values specified range covered breaks defining bins. last bin however instances slightly larger binSize. See breaks_on_binSize breaks_on_nBins details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Aggregate values in y for bins defined on x — binYonX","text":"function ensures values within range used define breaks considered binning (assigned bin). means bins except last one values x >= xlower < xupper (xlower xupper lower upper boundary, respectively). last bin condition x >= xlower & x <= xupper. Note also shiftByHalfBinSize TRUE range values used binning expanded binSize (.e. lower boundary fromX - binSize/2, upper toX + binSize/2). Setting argument TRUE resembles binning /used profBin function xcms < 1.51. NA handling: default function ignores NA values y (thus inherently assumes na.rm = TRUE). NA values allowed x.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Aggregate values in y for bins defined on x — binYonX","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/binYonX.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Aggregate values in y for bins defined on x — binYonX","text":"","code":"######## ## Simple example illustrating the breaks and the binning. ## ## Define breaks for 5 bins: brks <- seq(2, 12, length.out = 6) ## The first bin is then [2,4), the second [4,6) and so on. brks #> [1] 2 4 6 8 10 12 ## Get the max value falling within each bin. binYonX(x = 1:16, y = 1:16, breaks = brks) #> $x #> [1] 3 5 7 9 11 #> #> $y #> [1] 3 5 7 9 12 #> ## Thus, the largest value in x = 1:16 falling into the bin [2,4) (i.e. being ## >= 2 and < 4) is 3, the largest one falling into [4,6) is 5 and so on. ## Note however the function ensures that the minimal and maximal x-value ## (in this example 1 and 12) fall within a bin, i.e. 12 is considered for ## the last bin. ####### ## Performing the binning ons sub-set of x ## X <- 1:16 ## Bin X from element 4 to 10 into 5 bins. X[4:10] #> [1] 4 5 6 7 8 9 10 binYonX(X, X, nBins = 5L, fromIdx = 4, toIdx = 10) #> $x #> [1] 4.6 5.8 7.0 8.2 9.4 #> #> $y #> [1] 5 6 7 8 10 #> ## This defines breaks for 5 bins on the values from 4 to 10 and bins ## the values into these 5 bins. Alternatively, we could manually specify ## the range for the binning, i.e. the minimal and maximal value for the ## breaks: binYonX(X, X, nBins = 5L, fromIdx = 4, toIdx = 10, binFromX = 1, binToX = 16) #> $x #> [1] 2.5 5.5 8.5 11.5 14.5 #> #> $y #> [1] NA 6 9 10 NA #> ## In this case the breaks for 5 bins were defined from a value 1 to 16 and ## the values 4 to 10 were binned based on these breaks. ####### ## Bin values within a sub-set of x, second example ## ## This example illustrates how the fromIdx and toIdx parameters can be used. ## x defines 3 times the sequence form 1 to 10, while y is the sequence from ## 1 to 30. In this very simple example x is supposed to represent M/Z values ## from 3 consecutive scans and y the intensities measured for each M/Z in ## each scan. We want to get the maximum intensities for M/Z value bins only ## for the second scan, and thus we use fromIdx = 11 and toIdx = 20. The breaks ## for the bins are defined with the nBins, binFromX and binToX. X <- rep(1:10, 3) Y <- 1:30 ## Bin the M/Z values in the second scan into 5 bins and get the maximum ## intensity for each bin. Note that we have to specify sortedX = TRUE as ## the x and y vectors would be sorted otherwise. binYonX(X, Y, nBins = 5L, sortedX = TRUE, fromIdx = 11, toIdx = 20) #> $x #> [1] 1.9 3.7 5.5 7.3 9.1 #> #> $y #> [1] 12 14 16 18 20 #> ####### ## Bin in overlapping sub-sets of X ## ## In this example we define overlapping sub-sets of X and perform the binning ## within these. X <- 1:30 ## Define the start and end indices of the sub-sets. fIdx <- c(2, 8, 21) tIdx <- c(10, 25, 30) binYonX(X, nBins = 5L, fromIdx = fIdx, toIdx = tIdx) #> [[1]] #> [[1]]$x #> [1] 2.8 4.4 6.0 7.6 9.2 #> #> [[1]]$y #> [1] 3 5 6 8 10 #> #> #> [[2]] #> [[2]]$x #> [1] 9.7 13.1 16.5 19.9 23.3 #> #> [[2]]$y #> [1] 11 14 18 21 25 #> #> #> [[3]] #> [[3]]$x #> [1] 21.9 23.7 25.5 27.3 29.1 #> #> [[3]]$y #> [1] 22 24 26 28 30 #> #> ## The same, but pre-defining also the desired range of the bins. binYonX(X, nBins = 5L, fromIdx = fIdx, toIdx = tIdx, binFromX = 4, binToX = 28) #> [[1]] #> [[1]]$x #> [1] 6.4 11.2 16.0 20.8 25.6 #> #> [[1]]$y #> [1] 8 10 NA NA NA #> #> #> [[2]] #> [[2]]$x #> [1] 6.4 11.2 16.0 20.8 25.6 #> #> [[2]]$y #> [1] 8 13 18 23 25 #> #> #> [[3]] #> [[3]]$x #> [1] 6.4 11.2 16.0 20.8 25.6 #> #> [[3]]$y #> [1] NA NA NA 23 28 #> #> ## The same bins are thus used for each sub-set."},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"Defines breaks binSize sized bins values ranging fromX toX.","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"","code":"breaks_on_binSize(fromX, toX, binSize)"},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"fromX numeric(1) specifying lowest value bins. toX numeric(1) specifying largest value bins. binSize numeric(1) defining size bin.","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"numeric vector defining lower upper bounds bins.","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"function creates breaks bins size binSize. function ensures full data range included bins, .e. last value (upper boundary last bin) always equal toX. however means size last bin always equal desired bin size. See examples details comparisom R's seq function.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_binSize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate breaks for binning using a defined bin size. — breaks_on_binSize","text":"","code":"## Define breaks with a size of 0.13 for a data range from 1 to 10: breaks_on_binSize(1, 10, 0.13) #> [1] 1.00 1.13 1.26 1.39 1.52 1.65 1.78 1.91 2.04 2.17 2.30 2.43 #> [13] 2.56 2.69 2.82 2.95 3.08 3.21 3.34 3.47 3.60 3.73 3.86 3.99 #> [25] 4.12 4.25 4.38 4.51 4.64 4.77 4.90 5.03 5.16 5.29 5.42 5.55 #> [37] 5.68 5.81 5.94 6.07 6.20 6.33 6.46 6.59 6.72 6.85 6.98 7.11 #> [49] 7.24 7.37 7.50 7.63 7.76 7.89 8.02 8.15 8.28 8.41 8.54 8.67 #> [61] 8.80 8.93 9.06 9.19 9.32 9.45 9.58 9.71 9.84 10.00 ## The size of the last bin is however larger than 0.13: diff(breaks_on_binSize(1, 10, 0.13)) #> [1] 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 #> [16] 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 #> [31] 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 #> [46] 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 #> [61] 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.13 0.16 ## If we would use seq, the max value would not be included: seq(1, 10, by = 0.13) #> [1] 1.00 1.13 1.26 1.39 1.52 1.65 1.78 1.91 2.04 2.17 2.30 2.43 2.56 2.69 2.82 #> [16] 2.95 3.08 3.21 3.34 3.47 3.60 3.73 3.86 3.99 4.12 4.25 4.38 4.51 4.64 4.77 #> [31] 4.90 5.03 5.16 5.29 5.42 5.55 5.68 5.81 5.94 6.07 6.20 6.33 6.46 6.59 6.72 #> [46] 6.85 6.98 7.11 7.24 7.37 7.50 7.63 7.76 7.89 8.02 8.15 8.28 8.41 8.54 8.67 #> [61] 8.80 8.93 9.06 9.19 9.32 9.45 9.58 9.71 9.84 9.97 ## In the next example we use binSize that leads to an additional last bin with ## a smaller binSize: breaks_on_binSize(1, 10, 0.51) #> [1] 1.00 1.51 2.02 2.53 3.04 3.55 4.06 4.57 5.08 5.59 6.10 6.61 #> [13] 7.12 7.63 8.14 8.65 9.16 9.67 10.00 ## Again, the max value is included, but the size of the last bin is < 0.51. diff(breaks_on_binSize(1, 10, 0.51)) #> [1] 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 0.51 #> [16] 0.51 0.51 0.33 ## Using just seq would result in the following bin definition: seq(1, 10, by = 0.51) #> [1] 1.00 1.51 2.02 2.53 3.04 3.55 4.06 4.57 5.08 5.59 6.10 6.61 7.12 7.63 8.14 #> [16] 8.65 9.16 9.67 ## Thus it defines one bin (break) less."},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate breaks for binning — breaks_on_nBins","title":"Generate breaks for binning — breaks_on_nBins","text":"Calculate breaks -sized bins data values fromX toX.","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate breaks for binning — breaks_on_nBins","text":"","code":"breaks_on_nBins(fromX, toX, nBins, shiftByHalfBinSize = FALSE)"},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate breaks for binning — breaks_on_nBins","text":"fromX numeric(1) specifying lowest value bins. toX numeric(1) specifying largest value bins. nBins numeric(1) defining number bins. shiftByHalfBinSize Logical indicating whether bins shifted left half bin size. results centered bins, .e. first bin centered fromX last around toX.","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate breaks for binning — breaks_on_nBins","text":"numeric vector length nBins + 1 defining lower upper bounds bins.","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generate breaks for binning — breaks_on_nBins","text":"generates bins call seq(fromX, toX, length.= nBins) . first second element result vector thus defines lower upper boundary first bin, second third value second bin .","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate breaks for binning — breaks_on_nBins","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/breaks_on_nBins.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate breaks for binning — breaks_on_nBins","text":"","code":"## Create breaks to bin values from 3 to 20 into 20 bins breaks_on_nBins(3, 20, nBins = 20) #> [1] 3.00 3.85 4.70 5.55 6.40 7.25 8.10 8.95 9.80 10.65 11.50 12.35 #> [13] 13.20 14.05 14.90 15.75 16.60 17.45 18.30 19.15 20.00 ## The same call but using shiftByHalfBinSize breaks_on_nBins(3, 20, nBins = 20, shiftByHalfBinSize = TRUE) #> [1] 2.552632 3.447368 4.342105 5.236842 6.131579 7.026316 7.921053 #> [8] 8.815789 9.710526 10.605263 11.500000 12.394737 13.289474 14.184211 #> [15] 15.078947 15.973684 16.868421 17.763158 18.657895 19.552632 20.447368"},{"path":"https://sneumann.github.io/xcms/reference/c.xcmsSet.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine xcmsSet objects — c-methods","title":"Combine xcmsSet objects — c-methods","text":"Combines samples peaks multiple xcmsSet objects single object. Group retention time correction data discarded. profinfo list set equal first object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/c.xcmsSet.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Combine xcmsSet objects — c-methods","text":"xs1 = \"xcmsRaw\" c(xs1, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/c.xcmsSet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine xcmsSet objects — c-methods","text":"xs1 xcmsSet object ... xcmsSet objects","code":""},{"path":"https://sneumann.github.io/xcms/reference/c.xcmsSet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine xcmsSet objects — c-methods","text":"xcmsSet object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/c.xcmsSet.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Combine xcmsSet objects — c-methods","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":null,"dir":"Reference","previous_headings":"","what":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"Calibrate peaks using mz values known masses/calibrants. mz values identified peaks adjusted based peaks close provided mz values. See details information. isCalibrated function returns TRUE chromatographic peaks XCMSnExp object x calibrated FALSE otherwise.","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"","code":"CalibrantMassParam( mz = list(), mzabs = 1e-04, mzppm = 5, neighbors = 3, method = \"linear\" ) isCalibrated(object) # S4 method for XCMSnExp calibrate(object, param)"},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"mz numeric list numeric vectors reference mz values. numeric vector provided, used sample XCMSnExp object. list provided, length equal number samples experiment. mzabs numeric(1) absolute error/deviation matching peaks calibrants (Da). mzppm numeric(1) relative error matching peaks calibrants ppm (parts per million). neighbors integer(1) maximal number peaks within permitted distance calibrants considered. Among mz value peak largest intensity used calibration function estimation. method character(1) defining method used estimate calibration function. Can \"shift\", \"linear\" (default) \"edgeshift\". object XCMSnExp object. param CalibrantMassParam object calibration settings.","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"CalibrantMassParam: CalibrantMassParam instance. calibrate: XCMSnExp object chromatographic peaks calibrated. aware actual raw mz values (yet) calibrated, identified chromatographic peaks. CalibrantMassParam function returns instance CalibrantMassParam class settings properties set. calibrate method returns XCMSnExp object chromatographic peaks calibrated. Note detected peaks calibrated, individual mz values spectrum.","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"method first identify peaks close provided mz values , given difference calibrants smaller user provided cut (based arguments mzabs mzppm), mz values replaced provided mz values. mz values peaks either globally shifted (method = \"shift\" estimated linear model calibrants. Peaks considered close calibrant mz difference calibrant mz <= mzabs + mz * mzppm /1e6. Adjustment methods: adjustment function/factor estimated using difference calibrant peak mz values peaks close enough calibrants. availabel methods : shift: shifts m/z peak global factor corresponds average difference peak mz calibrant mz. linear: fits linear model throught differences calibrant peak mz values adjusts mz values peaks using . edgeshift: performs adjustment linear peaks within mz range calibrants shift outside . information, details examples refer xcms-direct-injection vignette.","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"CalibrantMassParam classes exported getter setter methods.","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate-calibrant-mass.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calibrant mass based calibration of chromatgraphic peaks — CalibrantMassParam-class","text":"Joachim Bargsten, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate.html","id":null,"dir":"Reference","previous_headings":"","what":"Calibrate peaks for correcting unprecise m/z values — calibrate-methods","title":"Calibrate peaks for correcting unprecise m/z values — calibrate-methods","text":"Calibrate peaks xcmsSet via set known masses","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Calibrate peaks for correcting unprecise m/z values — calibrate-methods","text":"object = \"xcmsSet\" calibrate(object, calibrants,method=\"linear\", mzabs=0.0001, mzppm=5, neighbours=3, plotres=FALSE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calibrate peaks for correcting unprecise m/z values — calibrate-methods","text":"object xcmsSet object uncalibrated mz calibrants vector list vectors reference m/z-values method used calibrating-method, see mzppm relative error used matching peaks ppm (parts per million) mzabs absolute error used matching peaks Da neighbours number neighbours wich one highest intensity used (instead nearest) plotres can set TRUE wanted result-plot showing found m/z distances regression","code":""},{"path":"https://sneumann.github.io/xcms/reference/calibrate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calibrate peaks for correcting unprecise m/z values — calibrate-methods","text":"object xcmsSet one ore samples calibrants sample different calibrants can used, list m/z-vectors given. length list must number samples, alternatively single vector masses can given used samples. method \"shift\" shifting m/z, \"linear\" linear regression adds linear term m/z. \"edgeshift\" linear regression within range mz-calibrants shift outside.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/chromPeakChromatograms.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract an ion chromatogram for each chromatographic peak — chromPeakChromatograms","title":"Extract an ion chromatogram for each chromatographic peak — chromPeakChromatograms","text":"Extract ion chromatogram (EIC) chromatographic peak XcmsExperiment() object. result returned XChromatograms() length equal number chromatographic peaks (one column).","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromPeakChromatograms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract an ion chromatogram for each chromatographic peak — chromPeakChromatograms","text":"","code":"chromPeakChromatograms(object, ...) # S4 method for XcmsExperiment chromPeakChromatograms( object, expandRt = 0, expandMz = 0, aggregationFun = \"max\", peaks = character(), return.type = c(\"XChromatograms\", \"MChromatograms\"), ..., progressbar = TRUE )"},{"path":"https://sneumann.github.io/xcms/reference/chromPeakChromatograms.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract an ion chromatogram for each chromatographic peak — chromPeakChromatograms","text":"object XcmsExperiment() identified chromatographic peaks. ... currently ignored. expandRt numeric(1) eventually expand retention time range signal integrated. chromatogram contain signal chromPeaks[, \"rtmin\"] - expandRt chromPeaks[, \"rtmax\"] + expandRt. default expandRt = 0. expandMz numeric(1) eventually expand m/z range signal integrated. chromatogram contain signal chromPeaks[, \"mzmin\"] - expandMz chromPeaks[, \"mzmax\"] + expandMz. default expandMz = 0. aggregationFun character(1) defining function signals within m/z range spectrum (.e. discrete retention time) aggregated. default (aggregationFun = \"max\") reports largest signal spectrum. peaks optional character providing IDs chromatographic peaks (.e. row names peaks chromPeaks(object)) chromatograms returned. return.type character(1) specifying type returned object. Can either return.type = \"XChromatograms\" (default) return.type = \"MChromatograms\" return either chromatographic object without identified chromatographic peaks, respectively. progressbar logical(1) whether progress extraction process displayed.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/chromPeakChromatograms.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract an ion chromatogram for each chromatographic peak — chromPeakChromatograms","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromPeakChromatograms.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract an ion chromatogram for each chromatographic peak — chromPeakChromatograms","text":"","code":"## Load a test data set with detected peaks library(MSnbase) library(xcms) library(MsExperiment) faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Get EICs for every detected chromatographic peak chrs <- chromPeakChromatograms(faahko_sub) chrs #> XChromatograms with 248 rows and 1 column #> 1 #> #> [1,] peaks: 1 #> [2,] peaks: 1 #> ... ... #> [247,] peaks: 1 #> [248,] peaks: 1 #> phenoData with 2 variables #> featureData with 5 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave ## Order of EICs matches the order in chromPeaks chromPeaks(faahko_sub) |> head() #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP001 453.2 453.2 453.2 2506.073 2501.378 2527.982 1007409.0 1007380.8 38152 #> CP002 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> CP003 344.0 344.0 344.0 2679.783 2646.919 2709.517 5210015.9 5135916.9 152320 #> CP004 430.1 430.1 430.1 2681.348 2639.094 2712.647 2395840.3 2299899.6 65752 #> CP005 366.0 366.0 366.0 2679.783 2642.224 2718.907 3365174.0 3279468.3 79928 #> CP006 343.0 343.0 343.0 2678.218 2637.529 2712.647 24147443.2 23703761.7 672064 #> sn sample #> CP001 38151 1 #> CP002 46 1 #> CP003 68 1 #> CP004 42 1 #> CP005 49 1 #> CP006 87 1 ## variable \"sample_index\" provides the index of the sample the EIC was ## extracted from fData(chrs)$sample_index #> [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 #> [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 #> [75] 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 #> [112] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 #> [149] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 #> [186] 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 #> [223] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 ## Get the EIC for selected peaks only. pks <- rownames(chromPeaks(faahko_sub))[c(6, 12)] pks #> [1] \"CP006\" \"CP012\" ## Expand the data on retention time dimension by 15 seconds (on each side) res <- chromPeakChromatograms(faahko_sub, peaks = pks, expandRt = 5) plot(res[1, ])"},{"path":"https://sneumann.github.io/xcms/reference/chromPeakSpectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","title":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","text":"Extract (MS1 MS2) spectra XcmsExperiment XCMSnExp object identified chromatographic peaks. return spectra selected chromatographic peaks, peak ID (.e., row name chromPeaks matrix) can provided parameter peaks. msLevel = 1L (supported return.type = \"Spectra\" return.type = \"List\") MS1 spectra within retention time boundaries (file peak detected) returned. msLevel = 2L MS2 spectra returned chromatographic peak precursor m/z within retention time m/z range chromatographic peak. Parameter method allows define whether single spectrum returned: method = \"\": (default): return spectra chromatographic peak. method = \"closest_rt\": return spectrum retention time closest peak's retention time (apex). method = \"closest_mz\": return spectrum precursor m/z closest peaks's m/z (apex); supported msLevel > 1. method = \"largest_tic\": return spectrum largest total signal (sum peaks intensities). method = \"largest_bpi\": return spectrum largest peak intensity (maximal peak intensity). method = \"signal\": object XCMSnExp: return spectrum sum intensities similar peak's apex signal (\"maxo\"); supported msLevel = 2L. Parameter return.type allows specify type result object. return.type = \"Spectra\" (default) Spectra object matching spectra returned. spectra variable \"peak_id\" returned Spectra contains ID chromatographic peak (.e., rowname peak chromPeaks matrix) spectrum. return.type = \"Spectra\" List Spectra returned. length list equal number rows chromPeaks. element list contains thus Spectra spectra one chromatographic peak (Spectra length 0 spectrum found respective chromatographic peak). See also LC-MS/MS data analysis vignette details examples.","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromPeakSpectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","text":"","code":"chromPeakSpectra(object, ...) # S4 method for XcmsExperiment chromPeakSpectra( object, method = c(\"all\", \"closest_rt\", \"closest_mz\", \"largest_tic\", \"largest_bpi\"), msLevel = 2L, expandRt = 0, expandMz = 0, ppm = 0, skipFilled = FALSE, peaks = character(), return.type = c(\"Spectra\", \"List\"), BPPARAM = bpparam() ) # S4 method for XCMSnExp chromPeakSpectra( object, msLevel = 2L, expandRt = 0, expandMz = 0, ppm = 0, method = c(\"all\", \"closest_rt\", \"closest_mz\", \"signal\", \"largest_tic\", \"largest_bpi\"), skipFilled = FALSE, return.type = c(\"Spectra\", \"MSpectra\", \"List\", \"list\"), peaks = character() )"},{"path":"https://sneumann.github.io/xcms/reference/chromPeakSpectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","text":"object XcmsExperiment XCMSnExp object identified chromatographic peaks spectra returned. ... ignored. method character(1) specifying spectra include result. Defaults method = \"\". See function description details. msLevel integer(1) defining MS level spectra returned. expandRt numeric(1) expand retention time range peak constant value side. expandMz numeric(1) expand m/z range peak constant value side. ppm numeric(1) expand m/z range peak (side) value dependent peak's m/z. skipFilled logical(1) whether spectra filled-peaks reported . peaks character, logical integer allowing specify subset chromatographic peaks chromPeaks spectra returned (providing either ID, logical vector length nrow(chromPeaks(x)) index chromPeaks(x)). parameter overrides skipFilled. return.type character(1) defining type result object returned. BPPARAM parallel processing setup. Defaults bpparam().","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromPeakSpectra.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","text":"parameter return.type allow specify type returned object: return.type = \"Spectra\" (default): Spectra object (defined Spectra package). result contains spectra peaks. Metadata column \"peak_id\" provides ID respective peak (.e. rowname chromPeaks(). return.type = \"List\": List length equal number chromatographic peaks returned, element Spectra spectra one chromatographic peak. backward compatibility options \"MSpectra\" \"list\" also supported suggested. return.type = \"MSpectra\" (deprecated): MSpectra object elements Spectrum objects. result objects contains spectra peaks. Metadata column \"peak_id\" provides ID respective peak (.e. rowname chromPeaks()). return.type = \"list\": list lists either length 0 contain Spectrum2 object(s) within m/z-rt range. length list matches number peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromPeakSpectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromPeakSpectra.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract spectra associated with chromatographic peaks — chromPeakSpectra","text":"","code":"## Read a file with DDA LC-MS/MS data library(MsExperiment) fl <- system.file(\"TripleTOF-SWATH/PestMix1_DDA.mzML\", package = \"msdata\") dda <- readMsExperiment(fl) ## Perform MS1 peak detection dda <- findChromPeaks(dda, CentWaveParam(peakwidth = c(5, 15), prefilter = c(5, 1000))) ## Return all MS2 spectro for each chromatographic peaks as a Spectra object ms2_sps <- chromPeakSpectra(dda) ms2_sps #> MSn data (Spectra) with 93 spectra in a MsBackendMzR backend: #> msLevel rtime scanIndex #> #> 1 2 237.460 1810 #> 2 2 237.869 1812 #> 3 2 240.759 1842 #> 4 2 241.299 1846 #> 5 2 318.444 2391 #> ... ... ... ... #> 89 2 552.147 4948 #> 90 2 570.506 5077 #> 91 2 574.435 5108 #> 92 2 574.725 5110 #> 93 2 575.255 5115 #> ... 34 more variables/columns. #> #> file(s): #> PestMix1_DDA.mzML #> Processing: #> Filter: select MS level(s) 2 [Wed Apr 3 13:47:35 2024] #> Merge 1 Spectra into one [Wed Apr 3 13:47:35 2024] ## spectra variable *peak_id* contain the row names of the peaks in the ## chromPeak matrix and allow thus to map chromatographic peaks to the ## returned MS2 spectra ms2_sps$peak_id #> [1] \"CP01\" \"CP01\" \"CP01\" \"CP01\" \"CP02\" \"CP03\" \"CP03\" \"CP03\" \"CP03\" \"CP04\" #> [11] \"CP04\" \"CP04\" \"CP04\" \"CP06\" \"CP06\" \"CP06\" \"CP06\" \"CP06\" \"CP06\" \"CP07\" #> [21] \"CP07\" \"CP07\" \"CP07\" \"CP07\" \"CP07\" \"CP07\" \"CP08\" \"CP08\" \"CP09\" \"CP09\" #> [31] \"CP10\" \"CP10\" \"CP11\" \"CP11\" \"CP11\" \"CP11\" \"CP11\" \"CP12\" \"CP12\" \"CP12\" #> [41] \"CP12\" \"CP12\" \"CP12\" \"CP13\" \"CP13\" \"CP13\" \"CP13\" \"CP13\" \"CP14\" \"CP14\" #> [51] \"CP14\" \"CP15\" \"CP15\" \"CP15\" \"CP15\" \"CP15\" \"CP15\" \"CP17\" \"CP17\" \"CP17\" #> [61] \"CP17\" \"CP17\" \"CP18\" \"CP18\" \"CP18\" \"CP18\" \"CP18\" \"CP19\" \"CP19\" \"CP19\" #> [71] \"CP19\" \"CP19\" \"CP19\" \"CP20\" \"CP20\" \"CP20\" \"CP21\" \"CP21\" \"CP21\" \"CP22\" #> [81] \"CP22\" \"CP22\" \"CP23\" \"CP23\" \"CP23\" \"CP23\" \"CP25\" \"CP25\" \"CP25\" \"CP27\" #> [91] \"CP27\" \"CP27\" \"CP27\" chromPeaks(dda) #> mz mzmin mzmax rt rtmin rtmax into intb #> CP01 219.0961 219.0933 219.0996 240.897 233.595 247.874 15236.49207 15222.54500 #> CP02 219.0947 219.0926 219.0963 319.236 311.979 324.874 76.97947 63.82131 #> CP03 227.9913 227.9902 227.9921 358.349 351.649 367.218 5511.96730 5496.32244 #> CP04 300.0312 300.0289 300.0321 366.568 360.029 375.738 12659.45398 12643.63044 #> CP05 302.0284 302.0273 302.0295 366.568 360.449 375.738 7953.70018 7938.19680 #> CP06 256.1102 256.1095 256.1109 388.167 379.097 397.326 7879.79234 7861.19876 #> CP07 224.0836 224.0831 224.0843 388.587 379.517 397.446 8904.69865 8886.41107 #> CP08 309.9980 309.9962 309.9987 405.715 399.527 415.525 5381.59741 5365.38152 #> CP09 378.0356 378.0341 378.0364 405.715 399.527 415.525 5117.90702 5101.66617 #> CP10 298.2751 298.2739 298.2781 345.711 339.830 354.979 39574.83769 39559.51278 #> CP11 308.0012 307.9983 308.0018 405.715 399.527 415.525 5630.65430 5614.25375 #> CP12 376.0385 376.0359 376.0391 405.715 399.527 415.525 5198.61440 5182.23188 #> CP13 292.1216 292.1204 292.1223 410.555 403.625 420.035 15783.11419 15766.32540 #> CP14 289.1217 289.1202 289.1229 425.434 415.525 433.478 10049.05516 10031.22736 #> CP15 304.1141 304.1119 304.1192 424.614 417.985 434.313 14704.14891 14687.51150 #> CP16 384.9700 384.9684 384.9706 440.533 433.893 449.312 8075.24022 8059.47631 #> CP17 382.9727 382.9715 382.9739 440.533 433.478 449.312 8307.76833 8291.81980 #> CP18 231.0144 231.0134 231.0151 450.992 444.342 460.691 5612.28545 5595.90874 #> CP19 306.1659 306.1624 306.1694 463.786 453.922 471.431 31273.95023 31256.40745 #> CP20 205.0970 205.0956 205.0976 459.421 453.092 466.461 5609.65542 5596.09130 #> CP21 230.9875 230.9862 230.9879 495.109 486.210 502.807 8036.59181 8019.64904 #> CP22 216.1414 216.1398 216.1418 508.678 502.680 516.408 4406.91863 4392.98419 #> CP23 330.2065 330.2008 330.2078 422.514 416.754 431.858 614.91821 599.73617 #> CP24 330.2059 330.2036 330.2081 474.408 460.261 479.107 248.31997 229.20853 #> CP25 330.2067 330.2054 330.2077 552.815 541.355 561.837 5890.30116 5869.52232 #> CP26 330.2057 330.2038 330.2076 505.738 495.519 515.868 315.87230 295.17246 #> CP27 373.0416 373.0406 373.0430 576.468 569.174 580.636 6184.87790 6173.40597 #> maxo sn sample #> CP01 4877.11621 4876 1 #> CP02 19.35541 18 1 #> CP03 1459.38428 1458 1 #> CP04 3156.89258 3156 1 #> CP05 1974.66846 1974 1 #> CP06 1836.12695 1835 1 #> CP07 2268.62915 2268 1 #> CP08 1345.32336 1344 1 #> CP09 1300.64075 1300 1 #> CP10 8060.13037 8059 1 #> CP11 1450.15808 1449 1 #> CP12 1350.63330 1350 1 #> CP13 3203.84229 3203 1 #> CP14 2972.63916 2972 1 #> CP15 5009.70654 5009 1 #> CP16 2224.37622 2223 1 #> CP17 2361.33594 2360 1 #> CP18 1671.33203 1670 1 #> CP19 6300.43652 6299 1 #> CP20 1717.72607 1717 1 #> CP21 2244.02979 2243 1 #> CP22 1576.85681 1576 1 #> CP23 135.81871 135 1 #> CP24 19.64630 19 1 #> CP25 2102.92871 2102 1 #> CP26 27.88095 27 1 #> CP27 2511.13501 2510 1 ## Alternatively, return the result as a List of Spectra objects. This list ## is parallel to chromPeaks hence the mapping between chromatographic peaks ## and MS2 spectra is easier. ms2_sps <- chromPeakSpectra(dda, return.type = \"List\") names(ms2_sps) #> [1] \"CP01\" \"CP02\" \"CP03\" \"CP04\" \"CP05\" \"CP06\" \"CP07\" \"CP08\" \"CP09\" \"CP10\" #> [11] \"CP11\" \"CP12\" \"CP13\" \"CP14\" \"CP15\" \"CP16\" \"CP17\" \"CP18\" \"CP19\" \"CP20\" #> [21] \"CP21\" \"CP22\" \"CP23\" \"CP24\" \"CP25\" \"CP26\" \"CP27\" rownames(chromPeaks(dda)) #> [1] \"CP01\" \"CP02\" \"CP03\" \"CP04\" \"CP05\" \"CP06\" \"CP07\" \"CP08\" \"CP09\" \"CP10\" #> [11] \"CP11\" \"CP12\" \"CP13\" \"CP14\" \"CP15\" \"CP16\" \"CP17\" \"CP18\" \"CP19\" \"CP20\" #> [21] \"CP21\" \"CP22\" \"CP23\" \"CP24\" \"CP25\" \"CP26\" \"CP27\" ms2_sps[[1L]] #> MSn data (Spectra) with 4 spectra in a MsBackendMzR backend: #> msLevel rtime scanIndex #> #> 1 2 237.460 1810 #> 2 2 237.869 1812 #> 3 2 240.759 1842 #> 4 2 241.299 1846 #> ... 34 more variables/columns. #> #> file(s): #> PestMix1_DDA.mzML #> Processing: #> Filter: select MS level(s) 2 [Wed Apr 3 13:47:35 2024] #> Merge 1 Spectra into one [Wed Apr 3 13:47:35 2024] ## Parameter `msLevel` allows to define from which MS level spectra should ## be returned. By default `msLevel = 2L` but with `msLevel = 1L` all ## MS1 spectra with a retention time within the retention time range of ## a chromatographic peak can be returned. Alternatively, selected ## spectra can be returned by specifying the selection criteria/method ## with the `method` parameter. Below we extract for each chromatographic ## peak the MS1 spectra with a retention time closest to the ## chromatographic peak's apex position. Alternatively it would also be ## possible to select the spectrum with the highest total signal or ## highest (maximal) intensity. ms1_sps <- chromPeakSpectra(dda, msLevel = 1L, method = \"closest_rt\") ms1_sps #> MSn data (Spectra) with 27 spectra in a MsBackendMzR backend: #> msLevel rtime scanIndex #> #> 1 1 240.897 1843 #> 2 1 319.236 2396 #> 3 1 358.349 2813 #> 4 1 366.568 2924 #> 5 1 366.568 2924 #> ... ... ... ... #> 23 1 422.514 3571 #> 24 1 474.408 4266 #> 25 1 552.815 4958 #> 26 1 505.738 4549 #> 27 1 576.468 5122 #> ... 34 more variables/columns. #> #> file(s): #> PestMix1_DDA.mzML #> Processing: #> Filter: select MS level(s) 1 [Wed Apr 3 13:47:35 2024] #> Merge 1 Spectra into one [Wed Apr 3 13:47:35 2024] ## Parameter peaks would allow to extract spectra for specific peaks only. ## Peaks can be defined with parameter `peaks` which can be either an ## `integer` with the index of the peak in the `chromPeaks` matrix or a ## `character` with its rowname in `chromPeaks`. chromPeakSpectra(dda, msLevel = 1L, method = \"closest_rt\", peaks = c(3, 5))"},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Extracting chromatograms — chromatogram,XCMSnExp-method","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"chromatogram: extract chromatographic data (extracted ion chromatogram, base peak chromatogram total ion chromatogram) OnDiskMSnExp XCMSnExp objects. See also help page chromatogram function MSnbase package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"","code":"# S4 method for XCMSnExp chromatogram( object, rt, mz, aggregationFun = \"sum\", missing = NA_real_, msLevel = 1L, BPPARAM = bpparam(), adjustedRtime = hasAdjustedRtime(object), filled = FALSE, include = c(\"apex_within\", \"any\", \"none\"), ... )"},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"object Either OnDiskMSnExp XCMSnExp object chromatograms extracted. rt numeric(2) two-column matrix defining lower upper boundary retention time range(s). specified, full retention time range original data used. mz numeric(2) two-column matrix defining lower upper mz value MS data slice(s). specified, chromatograms calculated full mz range. aggregationFun character(1) specifying function used aggregate intensity values across mz value range retention time. Allowed values \"sum\" (default), \"max\", \"mean\" \"min\". missing numeric(1) allowing specify intensity value used given retention time signal measured within mz range corresponding scan. Defaults NA_real_ (see also Details Notes sections ). Use missing = 0 resemble behaviour getEIC old user interface. msLevel integer(1) specifying MS level chromatogram extracted. Defaults msLevel = 1L. BPPARAM Parallelisation backend used, depend architecture. Default BiocParallel::bparam(). adjustedRtime chromatogram,XCMSnExp: whether adjusted (adjustedRtime = TRUE) raw retention times (adjustedRtime = FALSE) used filtering returned resulting MChromatograms object. Adjusted retention times used default available. filled logical(1) whether filled-peaks also returned. Defaults filled = FALSE, .e. returns detected chromatographic peaks result object. include character(1) defining chromatographic peaks returned. Supported include = \"apex_within\" (default) returns chromatographic peaks apex within mz rt range, include = \"\" return chromatographic peaks m/z rt ranges overlap mz rt include = \"none\" include chromatographic peaks. ... optional parameters - currently ignored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"chromatogram returns XChromatograms object number columns corresponding number files object number rows number specified ranges (.e. number rows matrices provided arguments mz /rt). chromatographic peaks apex position within m/z retention time range also retained well feature definitions peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"Arguments rt mz allow specify MS data slice (.e. m/z range retention time window) chromatogram extracted. parameters can either numeric length 2 lower upper limit, matrix two columns lower upper limits extract multiple EICs . parameter aggregationSum allows specify function used aggregate intensities across m/z range retention time. Setting aggregationFun = \"sum\" e.g. allow calculate total ion chromatogram (TIC), aggregationFun = \"max\" base peak chromatogram (BPC). given retention time intensity measured spectrum NA intensity value returned default. can changed parameter missing, setting missing = 0 result 0 intensity returned cases.","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"XCMSnExp objects, adjusted retention times available, chromatogram method default report use (subsetting based provided parameter rt). can changed setting adjustedRtime = FALSE.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/chromatogram-method.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extracting chromatograms — chromatogram,XCMSnExp-method","text":"","code":"## Load a test data set with identified chromatographic peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) ## Extract the ion chromatogram for one chromatographic peak in the data. chrs <- chromatogram(faahko_sub, rt = c(2700, 2900), mz = 335) chrs #> XChromatograms with 1 row and 3 columns #> ko15.CDF ko16.CDF ko18.CDF #> #> [1,] peaks: 0 peaks: 1 peaks: 0 #> phenoData with 1 variables #> featureData with 5 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave ## Identified chromatographic peaks chromPeaks(chrs) #> mz mzmin mzmax rt rtmin rtmax into intb maxo sn sample #> CP095 335 335 335 2786.199 2764.29 2812.803 1496244 1451652 58736 55 2 #> row column #> CP095 1 2 ## Plot the chromatogram plot(chrs) ## Extract chromatograms for multiple ranges. mzr <- matrix(c(335, 335, 344, 344), ncol = 2, byrow = TRUE) rtr <- matrix(c(2700, 2900, 2600, 2750), ncol = 2, byrow = TRUE) chrs <- chromatogram(faahko_sub, mz = mzr, rt = rtr) chromPeaks(chrs) #> mz mzmin mzmax rt rtmin rtmax into intb maxo sn #> CP095 335 335 335 2786.199 2764.290 2812.803 1496244 1451652 58736 55 #> CP003 344 344 344 2679.783 2646.919 2709.517 5210016 5135917 152320 68 #> CP090 344 344 344 2686.042 2648.483 2714.211 5700652 5574745 151744 87 #> CP193 344 344 344 2682.914 2643.790 2731.427 5255689 4946143 125632 41 #> sample row column #> CP095 2 1 2 #> CP003 1 2 1 #> CP090 2 2 2 #> CP193 3 2 3 plot(chrs) ## Get access to all chromatograms for the second mz/rt range chrs[1, ] #> XChromatograms with 1 row and 3 columns #> ko15.CDF ko16.CDF ko18.CDF #> #> [1,] peaks: 0 peaks: 1 peaks: 0 #> phenoData with 1 variables #> featureData with 5 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave ## Plot just that one plot(chrs[1, , drop = FALSE])"},{"path":"https://sneumann.github.io/xcms/reference/colMax.html","id":null,"dir":"Reference","previous_headings":"","what":"Find row and column maximum values — colMax","title":"Find row and column maximum values — colMax","text":"Find row column maximum values numeric arrays.","code":""},{"path":"https://sneumann.github.io/xcms/reference/colMax.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find row and column maximum values — colMax","text":"","code":"colMax(x, na.rm = FALSE, dims = 1) rowMax(x, na.rm = FALSE, dims = 1) which.colMax(x, na.rm = FALSE, dims = 1) which.rowMax(x, na.rm = FALSE, dims = 1)"},{"path":"https://sneumann.github.io/xcms/reference/colMax.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find row and column maximum values — colMax","text":"x array two dimensions, containing numeric values na.rm logical. missing values (including 'NaN') omitted calculations? (currently implemented) dims dimensions regarded \"rows\" \"columns\" maximize. rowMax, maximum dimensions dims+1, ...; colMax dimensions 1:dims.","code":""},{"path":"https://sneumann.github.io/xcms/reference/colMax.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find row and column maximum values — colMax","text":"functions designed act like colSums series functions except currently handle real arrays remove NA values.","code":""},{"path":"https://sneumann.github.io/xcms/reference/colMax.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find row and column maximum values — colMax","text":"numeric array suitable size, vector result one-dimensional. dimnames (names vector result) taken original array. .* functions, integer array suitable size, vector result one-dimensional. indecies returned accessing x one-dimensionally (.e. x[index]). .colMax(), actual row indecies determined using (.colMax(x)-1) %% nrow(x) + 1. .rowMax(), actual column indecies may determined using ceiling(rowMax(x)/nrow(x)).","code":""},{"path":"https://sneumann.github.io/xcms/reference/colMax.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find row and column maximum values — colMax","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/collect-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Collect MS^n peaks into xcmsFragments — collect-methods","title":"Collect MS^n peaks into xcmsFragments — collect-methods","text":"Collecting Peaks xcmsFragmentss several MS-runs using xcmsSet xcmsRaw.","code":""},{"path":"https://sneumann.github.io/xcms/reference/collect-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Collect MS^n peaks into xcmsFragments — collect-methods","text":"object = \"xcmsFragments\" collect(object, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/collect-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collect MS^n peaks into xcmsFragments — collect-methods","text":"object (empty) xcmsFragments-class object xs xcmsSet-class object contains picked ms1-peaks several experiments compMethod (\"floor\", \"round\", \"none\"): compare-method used find parent peak MSnpeak comparing MZ-values MS1peaks MSnParentPeaks. snthresh, mzgap, uniq parameters getspec-peakpicker included xcmsRaw.","code":""},{"path":"https://sneumann.github.io/xcms/reference/collect-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Collect MS^n peaks into xcmsFragments — collect-methods","text":"running collect(xFragments,xSet) peak table xcmsFragments includes ms1Peaks experiments stored xcmsSet-object. contains relevant msN-peaks xcmsRaw-objects, created temporarily paths xcmsSet.","code":""},{"path":"https://sneumann.github.io/xcms/reference/collect-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collect MS^n peaks into xcmsFragments — collect-methods","text":"matrix columns: peakID unique identifier every peak MSnParentPeakID PeakID parent peak msLevel>1 - peak, 0 peak msLevel 1. msLevel msLevel peak. rt retention time peak midpoint mz mz-Value peak intensity intensity peak sample number sample xcmsSet GroupPeakMSn Used grouped xcmsSet groups CollisionEnergy collision energy fragment","code":""},{"path":"https://sneumann.github.io/xcms/reference/correlate-Chromatogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","title":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","text":"xcms >= 3.15.3 please use compareChromatograms() instead correlate Correlate intensities two chromatograms . two Chromatogram objects different retention times first aligned match data points first data points second chromatogram. See help alignRt MSnbase::Chromatogram() details. correlate called single MChromatograms() object pairwise correlation chromatogram performed matrix correlation coefficients returned. Note correlation two chromatograms depends also order, e.g. correlate(chr1, chr2) might identical correlate(chr2, chr1). lower upper triangular part correlation matrix might thus different.","code":""},{"path":"https://sneumann.github.io/xcms/reference/correlate-Chromatogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","text":"","code":"# S4 method for Chromatogram,Chromatogram correlate( x, y, use = \"pairwise.complete.obs\", method = c(\"pearson\", \"kendall\", \"spearman\"), align = c(\"closest\", \"approx\"), ... ) # S4 method for MChromatograms,missing correlate( x, y = NULL, use = \"pairwise.complete.obs\", method = c(\"pearson\", \"kendall\", \"spearman\"), align = c(\"closest\", \"approx\"), ... ) # S4 method for MChromatograms,MChromatograms correlate( x, y = NULL, use = \"pairwise.complete.obs\", method = c(\"pearson\", \"kendall\", \"spearman\"), align = c(\"closest\", \"approx\"), ... )"},{"path":"https://sneumann.github.io/xcms/reference/correlate-Chromatogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","text":"x Chromatogram() MChromatograms() object. y Chromatogram() MChromatograms() object. use character(1) passed cor function. See cor() details. method character(1) passed cor function. See cor() details. align character(1) defining alignment method used. See help alignRt MSnbase::Chromatogram() details. value parameter passed method parameter alignRt. ... optional parameters passed along alignRt method tolerance , set 0 requires retention times identical.","code":""},{"path":"https://sneumann.github.io/xcms/reference/correlate-Chromatogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","text":"numeric(1) matrix (called MChromatograms objects) correlation coefficient. matrix returned, rows represent chromatograms x columns chromatograms y.","code":""},{"path":"https://sneumann.github.io/xcms/reference/correlate-Chromatogram.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","text":"Michael Witting, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/correlate-Chromatogram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Correlate chromatograms — correlate,Chromatogram,Chromatogram-method","text":"","code":"library(MSnbase) chr1 <- Chromatogram(rtime = 1:10 + rnorm(n = 10, sd = 0.3), intensity = c(5, 29, 50, NA, 100, 12, 3, 4, 1, 3)) chr2 <- Chromatogram(rtime = 1:10 + rnorm(n = 10, sd = 0.3), intensity = c(80, 50, 20, 10, 9, 4, 3, 4, 1, 3)) chr3 <- Chromatogram(rtime = 3:9 + rnorm(7, sd = 0.3), intensity = c(53, 80, 130, 15, 5, 3, 2)) chrs <- MChromatograms(list(chr1, chr2, chr3)) ## Using `compareChromatograms` instead of `correlate`. compareChromatograms(chr1, chr2) #> [1] -0.09306005 compareChromatograms(chr2, chr1) #> [1] -0.09306005 compareChromatograms(chrs, chrs) #> [,1] [,2] [,3] #> [1,] 1.00000000 -0.09306005 0.9887213 #> [2,] -0.09306005 1.00000000 0.5018044 #> [3,] 0.99355819 0.50180442 1.0000000"},{"path":"https://sneumann.github.io/xcms/reference/descendZero.html","id":null,"dir":"Reference","previous_headings":"","what":"Find start and end points of a peak — descendZero","title":"Find start and end points of a peak — descendZero","text":"Decends sides data peak finds either points greater equal zero intercept, intercept given value, bottom first valley side.","code":""},{"path":"https://sneumann.github.io/xcms/reference/descendZero.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find start and end points of a peak — descendZero","text":"","code":"descendZero(y, istart = which.max(y)) descendValue(y, value, istart = which.max(y)) descendMin(y, istart = which.max(y))"},{"path":"https://sneumann.github.io/xcms/reference/descendZero.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find start and end points of a peak — descendZero","text":"y numeric vector values istart starting point descent value numeric value descend ","code":""},{"path":"https://sneumann.github.io/xcms/reference/descendZero.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find start and end points of a peak — descendZero","text":"integer vector length 2 starting ending indicies peak start end points.","code":""},{"path":"https://sneumann.github.io/xcms/reference/descendZero.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find start and end points of a peak — descendZero","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/descendZero.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find start and end points of a peak — descendZero","text":"","code":"normdist <- dnorm(seq(-4, 4, .1)) - .1 xcms:::descendZero(normdist) #> ilower iupper #> 25 57 normdist[xcms:::descendZero(normdist)] #> [1] 0.01092083 0.01092083 xcms:::descendValue(normdist, .15) #> ilower iupper #> 32 50 normdist[xcms:::descendValue(normdist, .15)] #> [1] 0.1660852 0.1660852 xcms:::descendMin(normdist) #> ilower iupper #> 1 81"},{"path":"https://sneumann.github.io/xcms/reference/diffreport-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Create report of analyte differences — diffreport-methods","title":"Create report of analyte differences — diffreport-methods","text":"Create report showing significant differences two sets samples. Optionally create extracted ion chromatograms significant differences.","code":""},{"path":"https://sneumann.github.io/xcms/reference/diffreport-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Create report of analyte differences — diffreport-methods","text":"object = \"xcmsSet\" diffreport(object, class1 = levels(sampclass(object))[1], class2 = levels(sampclass(object))[2], filebase = character(), eicmax = 0, eicwidth = 200, sortpval = TRUE, classeic = c(class1,class2), value=c(\"\",\"maxo\",\"intb\"), metlin = FALSE, \t\t\t\t h=480,w=640, mzdec=2, missing = \t\t\t\t numeric(), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/diffreport-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create report of analyte differences — diffreport-methods","text":"object xcmsSet object class1 character vector first set sample classes compared class2 character vector second set sample classes compared filebase base file name save report, .tsv file _eic appended name tabular report EIC directory, respectively. blank nothing saved eicmax number significantly different analytes create EICs eicwidth width (seconds) EICs produced sortpval logical indicating whether reports sorted p-value classeic character vector sample classes include EICs value intensity values used diffreport. value=\"\", integrated peak intensities used. value=\"maxo\", maximum peak intensities used. value=\"intb\", baseline corrected integrated peak intensities used (available peak detection done findPeaks.centWave). metlin mass uncertainty use generating link Metlin metabolite database. sign uncertainty indicates negative positive mode data M+H M-H calculation. value FALSE 0 removes column h Numeric variable height eic boxplots printed . w Numeric variable width eic boxplots print made. mzdec Number decimal places title m/z values eic plot. missing numeric(1) defining optional value missing values. missing = 0 e.g. replace NA values feature matrix 0. Note also call fillPeaks results feature matrix NA values replaced 0. ... optional arguments passed mt.teststat multtest package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/diffreport-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create report of analyte differences — diffreport-methods","text":"method handles creation summary reports statistics analytes significantly different two sets samples. computes Welch's two-sample t-statistic analyte ranks p-value. returns summary report can optionally written tab-separated file. Additionally, heavy lifting involved creating superimposed extracted ion chromatograms given number analytes. reading raw data files associated samples interest one time. , prints name sample currently reading. Depending number size samples, process can take long time. base file name provided, report (see Value section) saved tab separated file. EICs generated, saved 640x480 PNG files newly created subdirectory. However parameter can changed commands arguments. numbered file names correspond rows report. Chromatographic traces EICs colored labeled sample class. Sample classes take color current palette. color sample class assigned dependent order xcmsSet object, order given class arguments. Thus levels(sampclass(object))[1] use color palette()[1] . way, sample classes maintain color across number different generated reports. multiple sample classes, xcms produce boxplots different classes generate single anova p-value statistic. Like eic's plot number corresponds row number report.","code":""},{"path":"https://sneumann.github.io/xcms/reference/diffreport-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create report of analyte differences — diffreport-methods","text":"data frame following columns: fold mean fold change (always greater 1, see tstat set sample classes higher) tstat Welch's two sample t-statistic, positive analytes greater intensity class2, negative analytes greater intensity class1 pvalue p-value t-statistic anova p-value anova statistic multiple classes mzmed median m/z peaks group mzmin minimum m/z peaks group mzmax maximum m/z peaks group rtmed median retention time peaks group rtmin minimum retention time peaks group rtmax maximum retention time peaks group npeaks number peaks assigned group Sample Classes number samples sample class represented group metlin URL metlin mass ... one column every sample class Sample Names integrated intensity value every sample ... one column every sample","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/dirname.html","id":null,"dir":"Reference","previous_headings":"","what":"Change the file path of an OnDiskMSnExp object — dirname","title":"Change the file path of an OnDiskMSnExp object — dirname","text":"dirname allows get set path directory containing source files OnDiskMSnExp (XCMSnExp) object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/dirname.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change the file path of an OnDiskMSnExp object — dirname","text":"","code":"# S4 method for OnDiskMSnExp dirname(path) # S4 method for OnDiskMSnExp dirname(path) <- value"},{"path":"https://sneumann.github.io/xcms/reference/dirname.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change the file path of an OnDiskMSnExp object — dirname","text":"path OnDiskMSnExp. value character length 1 length equal number files defining new path files.","code":""},{"path":"https://sneumann.github.io/xcms/reference/dirname.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Change the file path of an OnDiskMSnExp object — dirname","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":null,"dir":"Reference","previous_headings":"","what":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"function performs retention time correction assessing retention time deviation across samples using peak groups (features) containg chromatographic peaks present /samples. retention time deviation features sample described fitting either polynomial (smooth = \"loess\") linear (smooth = \"linear\") model data points. models subsequently used adjust retention time spectrum sample.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"","code":"do_adjustRtime_peakGroups( peaks, peakIndex, rtime = list(), minFraction = 0.9, extraPeaks = 1, smooth = c(\"loess\", \"linear\"), span = 0.2, family = c(\"gaussian\", \"symmetric\"), peakGroupsMatrix = matrix(ncol = 0, nrow = 0), subset = integer(), subsetAdjust = c(\"average\", \"previous\") )"},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"peaks matrix data.frame identified chromatographic peaks samples. peakIndex list indices provides grouping information chromatographic peaks (across within samples). rtime list numeric vectors retention times per file/sample. minFraction PeakGroupsParam: numeric(1) 0 1 defining minimum required proportion samples peaks peak group identified. Peak groups passing criteria aligned across samples retention times individual spectra adjusted based alignment. minFraction = 1 peak group contain peaks samples experiment. Note subset provided, specified fraction relative defined subset samples total number samples within experiment (.e., peak present specified proportion subset samples). extraPeaks PeakGroupsParam: numeric(1) defining maximal number additional peaks samples assigned peak group (feature) retention time correction. data set 6 samples, extraPeaks = 1 uses peak groups total peak count <= 6 + 1. total peak count total number peaks assigned peak group considers also multiple peaks within sample assigned group. smooth PeakGroupsParam: character(1) defining function used interpolate corrected retention times peak groups. Can either \"loess\" \"linear\". span PeakGroupsParam: numeric(1) defining degree smoothing (smooth = \"loess\"). parameter passed internal call loess(). family PeakGroupsParam: character(1) defining method loess smoothing. Allowed values \"gaussian\" \"symmetric\". See loess() information. peakGroupsMatrix optional matrix (raw) retention times peak groups alignment performed. column represents sample, row feature/peak group. provided, matrix determined depending parameters minFraction extraPeaks. provided, minFraction extraPeaks ignored. subset ObiwarpParam PeakGroupsParam: integer indices samples within experiment alignment models estimated. Samples part subset adjusted based closest subset sample. See Subset-based alignment section details. subsetAdjust ObiwarpParam PeakGroupsParam: character(1) specifying method non-subset samples adjusted. Supported options \"previous\" \"average\" (default). See Subset-based alignment section details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"list numeric vectors adjusted retention times grouped sample.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"alignment bases presence compounds can found /samples experiment. retention times individual spectra adjusted based alignment features corresponding house keeping compounds. paraneters minFraction extraPeaks can used fine tune features used alignment (.e. features likely correspond mentioned house keeping compounds). Parameter subset allows define subset samples within experiment aligned. samples part subset aligned based adjustment closest sample within subset. allows e.g. exclude blank samples alignment process retention times still adjusted based alignment results real samples.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"method ensures returned adjusted retention times increasingly ordered, just raw retention times.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"Colin . Smith, Elizabeth J. Want, Grace O'Maille, Ruben Abagyan Gary Siuzdak. \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 2006, 78:779-787.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_adjustRtime_peakGroups.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Align spectrum retention times across samples using peak groups found in most samples — do_adjustRtime_peakGroups","text":"Colin Smith, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for centWave peak detection — do_findChromPeaks_centWave","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"function performs peak density wavelet based chromatographic peak detection high resolution LC/MS data centroid mode [Tautenhahn 2008].","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"","code":"do_findChromPeaks_centWave( mz, int, scantime, valsPerSpect, ppm = 25, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, roiList = list(), firstBaselineCheck = TRUE, roiScales = NULL, sleep = 0, extendLengthMSW = FALSE, verboseBetaColumns = FALSE )"},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"mz Numeric vector individual m/z values scans/ spectra one file/sample. int Numeric vector individual intensity values scans/spectra one file/sample. scantime Numeric vector length equal number spectra/scans data representing retention time scan. valsPerSpect Numeric vector number values spectrum. ppm numeric(1) defining maximal tolerated m/z deviation consecutive scans parts per million (ppm) initial ROI definition. peakwidth numeric(2) expected approximate peak width chromatographic space. Given range (min, max) seconds. snthresh numeric(1) defining signal noise ratio cutoff. prefilter numeric(2): c(k, ) specifying prefilter step first analysis step (ROI detection). Mass traces retained contain least k peaks intensity >= . mzCenterFun Name function calculate m/z center chromatographic peak. Allowed : \"wMean\": intensity weighted mean peak's m/z values, \"mean\": mean peak's m/z values, \"apex\": use m/z value peak apex, \"wMeanApex3\": intensity weighted mean m/z value peak apex m/z values left right \"meanApex3\": mean m/z value peak apex m/z values left right . integrate Integration method. integrate = 1 peak limits found descent mexican hat filtered data, integrate = 2 descent done real data. latter method accurate prone noise, former robust, less exact. mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. fitgauss logical(1) whether Gaussian fitted peak. affects mostly retention time position peak. noise numeric(1) allowing set minimum intensity required centroids considered first analysis step (centroids intensity < noise omitted ROI detection). verboseColumns logical(1) whether additional peak meta data columns returned. roiList optional list regions--interest (ROI) representing detected mass traces. ROIs submitted first analysis step omitted chromatographic peak detection performed submitted ROIs. ROI expected following elements specified: scmin (start scan index), scmax (end scan index), mzmin (minimum m/z), mzmax (maximum m/z), length (number scans), intensity (summed intensity). ROI represented list elements single row data.frame. firstBaselineCheck logical(1). TRUE continuous data within regions interest checked first baseline. detail, first rough estimate noise calculated peak detection performed regions multiple sequential signals higher first estimated baseline/noise level. roiScales Optional numeric vector length equal roiList defining scale region interest roiList used centWave-wavelets. sleep numeric(1) defining number seconds wait iterations. Defaults sleep = 0. > 0 plot generated visualizing identified chromatographic peak. Note: argument backward compatibility removed future. extendLengthMSW Option force centWave use scales running centWave rather truncating EIC length. Uses \"open\" method extend EIC integer base-2 length prior passed convolve rather default \"reflect\" method. See https://github.com/sneumann/xcms/issues/445 information. verboseBetaColumns Option calculate two additional metrics peak quality via comparison idealized bell curve. Adds beta_cor beta_snr chromPeaks output, corresponding Pearson correlation coefficient bell curve several degrees skew well estimate signal--noise using residuals best-fitting bell curve. See https://github.com/sneumann/xcms/pull/685 https://doi.org/10.1186/s12859-023-05533-4 information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"matrix, row representing identified chromatographic peak, columns: mz Intensity weighted mean m/z values peak across scans. mzmin Minimum m/z peak. mzmax Maximum m/z peak. rt Retention time peak's midpoint. rtmin Minimum retention time peak. rtmax Maximum retention time peak. Integrated (original) intensity peak. intb Per-peak baseline corrected integrated peak intensity. maxo Maximum intensity peak. sn Signal noise ratio, defined (maxo - baseline)/sd, sd standard deviation local chromatographic noise. egauss RMSE Gaussian fit. Additional columns verboseColumns = TRUE: mu Gaussian parameter mu. sigma Gaussian parameter sigma. h Gaussian parameter h. f Region number m/z ROI peak localized. dppm m/z deviation mass trace across scans ppm. scale Scale peak localized. scpos Peak position found wavelet analysis (scan number). scmin Left peak limit found wavelet analysis (scan number). scmax Right peak limit found wavelet analysis (scan numer). Additional columns verboseBetaColumns = TRUE: beta_cor Correlation \"ideal\" bell curve raw data beta_snr Signal--noise residuals calculated beta_cor fit","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"algorithm suitable high resolution LC/{TOF,OrbiTrap,FTICR}-MS data centroid mode. first phase method identifies regions interest (ROIs) representing mass traces characterized regions less ppm m/z deviation consecutive scans LC/MS map. detail, starting single m/z, ROI extended m/z can found next scan (spectrum) difference mean m/z ROI smaller user defined ppm m/z. mean m/z ROI updated considering also newly included m/z value. ROIs , cleanup, analyzed using continuous wavelet transform (CWT) locate chromatographic peaks different scales. first analysis step skipped, regions interest passed roiList parameter.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"centWave designed work centroided mode, thus expected data presented function. function exposes core chromatographic peak detection functionality centWave method. function can called directly, users generally call corresponding method data object instead.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"Ralf Tautenhahn, Christoph Böttcher, Steffen Neumann \"Highly sensitive feature detection high resolution LC/MS\" BMC Bioinformatics 2008, 9:504","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"Ralf Tautenhahn, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWave.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Core API function for centWave peak detection — do_findChromPeaks_centWave","text":"","code":"## Load the test file faahko_sub <- loadXcmsData(\"faahko_sub\") ## Subset to one file and restrict to a certain retention time range data <- filterRt(filterFile(faahko_sub, 1), c(2500, 3000)) ## Get m/z and intensity values mzs <- mz(data) ints <- intensity(data) ## Define the values per spectrum: valsPerSpect <- lengths(mzs) ## Calling the function. We're using a large value for noise and prefilter ## to speed up the call in the example - in a real use case we would either ## set the value to a reasonable value or use the default value. res <- do_findChromPeaks_centWave(mz = unlist(mzs), int = unlist(ints), scantime = rtime(data), valsPerSpect = valsPerSpect, noise = 10000, prefilter = c(3, 10000)) #> Detecting mass traces at 25 ppm ... #> OK #> Detecting chromatographic peaks in 186 regions of interest ... #> OK: 47 found. head(res) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> [1,] 453.2 453.2 453.2 2506.073 2501.378 2527.982 1007409.0 1007380.8 38152 #> [2,] 307.0 307.0 307.0 2618.750 2592.145 2645.354 284782.4 268039.8 16872 #> [3,] 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> [4,] 360.0 360.0 360.0 2682.913 2668.828 2698.562 5641322.3 5420634.7 317568 #> [5,] 361.1 361.1 361.1 2684.478 2665.698 2698.562 1158340.2 1116522.0 72272 #> [6,] 416.1 416.1 416.1 2682.913 2635.964 2709.517 487698.6 446552.1 12036 #> sn #> [1,] 38151 #> [2,] 20 #> [3,] 46 #> [4,] 11 #> [5,] 11 #> [6,] 11"},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWaveWithPredIsoROIs.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","title":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","text":"do_findChromPeaks_centWaveWithPredIsoROIs performs two-step centWave based peak detection: chromatographic peaks identified using centWave followed prediction location identified peaks' isotopes mz-retention time space. locations fed regions interest (ROIs) subsequent centWave run. non overlapping peaks two peak detection runs reported final list identified peaks. do_findChromPeaks_centWaveAddPredIsoROIs performs centWave based peak detection based regions interest (ROIs) representing predicted isotopes peaks submitted argument peaks.. function returns matrix identified peaks consisting input peaks peaks representing predicted isotopes (found centWave algorithm).","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWaveWithPredIsoROIs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","text":"","code":"do_findChromPeaks_centWaveWithPredIsoROIs( mz, int, scantime, valsPerSpect, ppm = 25, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, roiList = list(), firstBaselineCheck = TRUE, roiScales = NULL, snthreshIsoROIs = 6.25, maxCharge = 3, maxIso = 5, mzIntervalExtension = TRUE, polarity = \"unknown\", extendLengthMSW = FALSE, verboseBetaColumns = FALSE ) do_findChromPeaks_addPredIsoROIs( mz, int, scantime, valsPerSpect, ppm = 25, peakwidth = c(20, 50), snthresh = 6.25, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, peaks. = NULL, maxCharge = 3, maxIso = 5, mzIntervalExtension = TRUE, polarity = \"unknown\" )"},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWaveWithPredIsoROIs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","text":"mz Numeric vector individual m/z values scans/ spectra one file/sample. int Numeric vector individual intensity values scans/spectra one file/sample. scantime Numeric vector length equal number spectra/scans data representing retention time scan. valsPerSpect Numeric vector number values spectrum. ppm numeric(1) defining maximal tolerated m/z deviation consecutive scans parts per million (ppm) initial ROI definition. peakwidth numeric(2) expected approximate peak width chromatographic space. Given range (min, max) seconds. snthresh do_findChromPeaks_addPredIsoROIs: numeric(1) defining signal noise threshold centWave algorithm. do_findChromPeaks_centWaveWithPredIsoROIs: numeric(1) defining signal noise threshold initial (first) centWave run. prefilter numeric(2): c(k, ) specifying prefilter step first analysis step (ROI detection). Mass traces retained contain least k peaks intensity >= . mzCenterFun Name function calculate m/z center chromatographic peak. Allowed : \"wMean\": intensity weighted mean peak's m/z values, \"mean\": mean peak's m/z values, \"apex\": use m/z value peak apex, \"wMeanApex3\": intensity weighted mean m/z value peak apex m/z values left right \"meanApex3\": mean m/z value peak apex m/z values left right . integrate Integration method. integrate = 1 peak limits found descent mexican hat filtered data, integrate = 2 descent done real data. latter method accurate prone noise, former robust, less exact. mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. fitgauss logical(1) whether Gaussian fitted peak. affects mostly retention time position peak. noise numeric(1) allowing set minimum intensity required centroids considered first analysis step (centroids intensity < noise omitted ROI detection). verboseColumns logical(1) whether additional peak meta data columns returned. roiList optional list regions--interest (ROI) representing detected mass traces. ROIs submitted first analysis step omitted chromatographic peak detection performed submitted ROIs. ROI expected following elements specified: scmin (start scan index), scmax (end scan index), mzmin (minimum m/z), mzmax (maximum m/z), length (number scans), intensity (summed intensity). ROI represented list elements single row data.frame. firstBaselineCheck logical(1). TRUE continuous data within regions interest checked first baseline. detail, first rough estimate noise calculated peak detection performed regions multiple sequential signals higher first estimated baseline/noise level. roiScales Optional numeric vector length equal roiList defining scale region interest roiList used centWave-wavelets. snthreshIsoROIs numeric(1) defining signal noise ratio cutoff used second centWave run identify peaks predicted isotope ROIs. maxCharge integer(1) defining maximal isotope charge. Isotopes defined charges 1:maxCharge. maxIso integer(1) defining number isotope peaks predicted peak identified first centWave run. mzIntervalExtension logical(1) whether mz range predicted isotope ROIs extended increase detection low intensity peaks. polarity character(1) specifying polarity data. Currently used, \"positive\", \"negative\" \"unknown\" provided. extendLengthMSW Option force centWave use scales running centWave rather truncating EIC length. Uses \"open\" method extend EIC integer base-2 length prior passed convolve rather default \"reflect\" method. See https://github.com/sneumann/xcms/issues/445 information. verboseBetaColumns Option calculate two additional metrics peak quality via comparison idealized bell curve. Adds beta_cor beta_snr chromPeaks output, corresponding Pearson correlation coefficient bell curve several degrees skew well estimate signal--noise using residuals best-fitting bell curve. See https://github.com/sneumann/xcms/pull/685 https://doi.org/10.1186/s12859-023-05533-4 information. peaks. matrix xcmsPeaks object one returned call link{do_findChromPeaks_centWave} link{findPeaks.centWave} (verboseColumns = TRUE) peaks isotopes predicted used additional peak detectoin using centWave method. Required columns : \"mz\", \"mzmin\", \"mzmax\", \"scmin\", \"scmax\", \"scale\" \"\".","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWaveWithPredIsoROIs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","text":"matrix, row representing identified chromatographic peak. non-overlapping peaks identified centWave runs reported. matrix columns : mz Intensity weighted mean m/z values peaks across scans. mzmin Minimum m/z peaks. mzmax Maximum m/z peaks. rt Retention time peak's midpoint. rtmin Minimum retention time peak. rtmax Maximum retention time peak. Integrated (original) intensity peak. intb Per-peak baseline corrected integrated peak intensity. maxo Maximum intensity peak. sn Signal noise ratio, defined (maxo - baseline)/sd, sd standard deviation local chromatographic noise. egauss RMSE Gaussian fit. Additional columns verboseColumns = TRUE: mu Gaussian parameter mu. sigma Gaussian parameter sigma. h Gaussian parameter h. f Region number m/z ROI peak localized. dppm m/z deviation mass trace across scans ppm. scale Scale peak localized. scpos Peak position found wavelet analysis (scan number). scmin Left peak limit found wavelet analysis (scan number). scmax Right peak limit found wavelet analysis (scan numer). Additional columns verboseBetaColumns = TRUE: beta_cor Correlation \"ideal\" bell curve raw data beta_snr Signal--noise residuals calculated beta_cor fit","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWaveWithPredIsoROIs.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","text":"details centWave algorithm see centWave.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_centWaveWithPredIsoROIs.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Core API function for two-step centWave peak detection with isotopes — do_findChromPeaks_centWaveWithPredIsoROIs","text":"Hendrik Treutler, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"Massifquant Kalman filter (KF)-based chromatographic peak detection XC-MS data centroid mode. identified peaks can refined centWave method (see do_findChromPeaks_centWave details centWave) specifying withWave = TRUE.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"","code":"do_findChromPeaks_massifquant( mz, int, scantime, valsPerSpect, ppm = 10, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, criticalValue = 1.125, consecMissedLimit = 2, unions = 1, checkBack = 0, withWave = FALSE )"},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"mz Numeric vector individual m/z values scans/ spectra one file/sample. int Numeric vector individual intensity values scans/spectra one file/sample. scantime Numeric vector length equal number spectra/scans data representing retention time scan. valsPerSpect Numeric vector number values spectrum. ppm numeric(1) defining maximal tolerated m/z deviation consecutive scans parts per million (ppm) initial ROI definition. peakwidth numeric(2) expected approximate peak width chromatographic space. Given range (min, max) seconds. snthresh numeric(1) defining signal noise ratio cutoff. prefilter numeric(2): c(k, ) specifying prefilter step first analysis step (ROI detection). Mass traces retained contain least k peaks intensity >= . mzCenterFun Name function calculate m/z center chromatographic peak. Allowed : \"wMean\": intensity weighted mean peak's m/z values, \"mean\": mean peak's m/z values, \"apex\": use m/z value peak apex, \"wMeanApex3\": intensity weighted mean m/z value peak apex m/z values left right \"meanApex3\": mean m/z value peak apex m/z values left right . integrate Integration method. integrate = 1 peak limits found descent mexican hat filtered data, integrate = 2 descent done real data. latter method accurate prone noise, former robust, less exact. mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. fitgauss logical(1) whether Gaussian fitted peak. affects mostly retention time position peak. noise numeric(1) allowing set minimum intensity required centroids considered first analysis step (centroids intensity < noise omitted ROI detection). verboseColumns logical(1) whether additional peak meta data columns returned. criticalValue numeric(1). Suggested values: (0.1-3.0). setting helps determine Kalman Filter prediciton margin error. real centroid belonging bonafide peak must fall within KF prediction margin error. Much like construction confidence interval, criticalVal loosely translates multiplier standard error prediction reported Kalman Filter. peak XC-MS sample small mass deviance ppm error, smaller critical value might better vice versa. consecMissedLimit integer(1) Suggested values: (1,2,3). peak proces detected Kalman Filter, Kalman Filter may find predicted centroid every scan. 1 consecutive failed predictions, setting informs Massifquant stop Kalman Filter following candidate peak. unions integer(1) set 1 apply t-test union segmentation; set 0 t-test applied chromatographically continous peaks sharing m/z range. Explanation: data points, sometimes Kalman Filter stops tracking peak prematurely. Another Kalman Filter instantiated begins following rest signal. tracking done backwards forwards, algorithmic defect leaves real peak divided two segments . option turned , program identifies segmented peaks combines (merges ) one two sample t-test. potential danger option truly distinct peaks may merged. checkBack integer(1) set 1 turned ; set 0 turned . convergence Kalman Filter peak's precise m/z mapping fast, sometimes incorporates erroneous centroids part peak (especially early ). scanBack option attempt remove occasional outlier lies beyond converged bounds Kalman Filter. option directly affect identification peak postprocessing measure; shown extremely useful thus far default set turned . withWave logical(1) TRUE, peaks identified first Massifquant subsequently filtered second step centWave algorithm, includes wavelet estimation.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"matrix, row representing identified chromatographic peak, columns: mz Intensity weighted mean m/z values peaks across scans. mzmin Minumum m/z peak. mzmax Maximum m/z peak. rtmin Minimum retention time peak. rtmax Maximum retention time peak. rt Retention time peak's midpoint. Integrated (original) intensity peak. maxo Maximum intensity peak. withWave set TRUE, result returned do_findChromPeaks_centWave method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"algorithm's performance tested rigorously high resolution LC/(OrbiTrap, TOF)-MS data centroid mode. Simultaneous kalman filters identify peaks calculate area curve. default parameters set operate complex LC-MS Orbitrap sample. Users find useful simple exploratory data analysis find set minimum intensity, identify many scans average peak spans. consecMissedLimit parameter yielded good performance Orbitrap data set (2) TOF data found best (1). may change algorithm yet tested many samples. criticalValue parameter perhaps dificult dial appropriately visual inspection peak identification best suggested tool quick optimization. ppm checkBack parameters shown less influence parameters exist give users flexibility better accuracy.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"Conley CJ, Smith R, Torgrip RJ, Taylor RM, Tautenhahn R Prince JT \"Massifquant: open-source Kalman filter-based XC-MS isotope trace feature detection\" Bioinformatics 2014, 30(18):2636-43.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"Christopher Conley","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_massifquant.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Core API function for massifquant peak detection — do_findChromPeaks_massifquant","text":"","code":"## Load the test file faahko_sub <- loadXcmsData(\"faahko_sub\") ## Subset to one file and restrict to a certain retention time range data <- filterRt(filterFile(faahko_sub, 1), c(2500, 3000)) ## Get m/z and intensity values mzs <- mz(data) ints <- intensity(data) ## Define the values per spectrum: valsPerSpect <- lengths(mzs) ## Perform the peak detection using massifquant - setting prefilter to ## a high value to speed up the call for the example res <- do_findChromPeaks_massifquant(mz = unlist(mzs), int = unlist(ints), scantime = rtime(data), valsPerSpect = valsPerSpect, prefilter = c(3, 10000)) #> #> Massifquant, Copyright (C) 2013 Brigham Young University. #> Massifquant comes with ABSOLUTELY NO WARRANTY. See LICENSE for details. #> #> Detecting mass traces at 10ppm ... #> OK #> 69 Peaks. head(res) #> mz mzmin mzmax rtmin rtmax rt into maxo #> [1,] 426.1 426.1 426.1 2963.039 2999.033 2977.124 129958 29408 #> [2,] 590.3 590.3 590.3 2963.039 2999.033 2978.689 255317 19072 #> [3,] 454.1 454.1 454.1 2934.870 2975.559 2953.650 372685 20432 #> [4,] 309.1 309.1 309.1 2905.136 2967.734 2936.435 652140 38888 #> [5,] 475.2 475.2 475.2 2880.097 2999.033 2934.870 2415224 37160 #> [6,] 532.2 532.2 532.2 2853.493 2906.701 2878.532 232493 16480"},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"function identifies peaks chromatographic time domain described [Smith 2006]. intensity values binned cutting LC/MS data slices (bins) mass unit (binSize m/z) wide. Within bin maximal intensity selected. peak detection performed bin extending based steps parameter generate slices comprising bins current_bin - steps +1 current_bin + steps - 1. slices filtered matched filtration using second-derative Gaussian model peak shape. filtration peaks detected using signal--ration cut-. details illustrations see [Smith 2006].","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"","code":"do_findChromPeaks_matchedFilter( mz, int, scantime, valsPerSpect, binSize = 0.1, impute = \"none\", baseValue, distance, fwhm = 30, sigma = fwhm/2.3548, max = 5, snthresh = 10, steps = 2, mzdiff = 0.8 - binSize * steps, index = FALSE, sleep = 0 )"},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"mz Numeric vector individual m/z values scans/ spectra one file/sample. int Numeric vector individual intensity values scans/spectra one file/sample. scantime Numeric vector length equal number spectra/scans data representing retention time scan. valsPerSpect Numeric vector number values spectrum. binSize numeric(1) specifying width bins/slices m/z dimension. impute Character string specifying method used missing value imputation. Allowed values \"none\" (linear interpolation), \"lin\" (linear interpolation), \"linbase\" (linear interpolation within certain bin-neighborhood) \"intlin\". See imputeLinInterpol details. baseValue base value empty elements set. considered method = \"linbase\" corresponds profBinLinBase's baselevel argument. distance method = \"linbase\": number non-empty neighboring element empty element considered linear interpolation. See details section information. fwhm numeric(1) specifying full width half maximum matched filtration gaussian model peak. used calculate actual sigma, see . sigma numeric(1) specifying standard deviation (width) matched filtration model peak. max numeric(1) representing maximum number peaks expected/identified per slice. snthresh numeric(1) defining signal noise ratio cutoff. steps numeric(1) defining number bins merged filtration (.e. number neighboring bins joined slice filtration peak detection performed). mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. index logical(1) specifying whether indicies returned instead values m/z retention times. sleep numeric(1) defining number seconds wait iterations. Defaults sleep = 0. > 0 plot generated visualizing identified chromatographic peak. Note: argument backward compatibility removed future.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"matrix, row representing identified chromatographic peak, columns: mz Intensity weighted mean m/z values peak across scans. mzmin Minimum m/z peak. mzmax Maximum m/z peak. rt Retention time peak's midpoint. rtmin Minimum retention time peak. rtmax Maximum retention time peak. Integrated (original) intensity peak. intf Integrated intensity filtered peak. maxo Maximum intensity peak. maxf Maximum intensity filtered peak. Rank peak merged EIC (<= max). sn Signal noise ratio peak","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"intensities binned provided m/z values within spectrum (scan). Binning performed bins centered around m/z values (.e. first bin includes m/z values min(mz) - bin_size/2 min(mz) + bin_size/2). details binning missing value imputation see binYonX imputeLinInterpol methods.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"function exposes core peak detection functionality matchedFilter method. function can called directly, users generally call corresponding method data object instead (e.g. link{findPeaks.matchedFilter} method).","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"Colin . Smith, Elizabeth J. Want, Grace O'Maille, Ruben Abagyan Gary Siuzdak. \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 2006, 78:779-787.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"Colin Smith, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findChromPeaks_matchedFilter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Core API function for matchedFilter peak detection — do_findChromPeaks_matchedFilter","text":"","code":"## Load the test file faahko_sub <- loadXcmsData(\"faahko_sub\") ## Subset to one file and restrict to a certain retention time range data <- filterRt(filterFile(faahko_sub, 1), c(2500, 3000)) ## Get m/z and intensity values mzs <- mz(data) ints <- intensity(data) ## Define the values per spectrum: valsPerSpect <- lengths(mzs) res <- do_findChromPeaks_matchedFilter(mz = unlist(mzs), int = unlist(ints), scantime = rtime(data), valsPerSpect = valsPerSpect) head(res) #> mz mzmin mzmax rt rtmin rtmax into intf maxo #> [1,] 205.0000 205.0 205.0 2784.635 2770.550 2800.284 1778568.9 3610062.2 84280 #> [2,] 205.9819 205.9 206.0 2786.200 2772.115 2800.284 237993.6 448580.3 10681 #> [3,] 207.0821 207.0 207.1 2712.647 2698.562 2726.731 380873.0 730981.4 18800 #> [4,] 236.0956 236.0 236.1 2518.593 2504.508 2534.242 252282.0 458747.7 12957 #> [5,] 244.1000 244.1 244.1 2828.453 2814.369 2844.103 612169.9 1279308.9 31312 #> [6,] 266.0751 266.0 266.1 2828.453 2815.934 2844.103 113219.0 214886.8 5801 #> maxf i sn #> [1,] 195026.48 1 28.33394 #> [2,] 23860.11 1 16.53987 #> [3,] 40065.74 1 12.87314 #> [4,] 24536.55 1 14.99012 #> [5,] 69898.24 1 24.20989 #> [6,] 11773.56 1 10.83870"},{"path":"https://sneumann.github.io/xcms/reference/do_findPeaks_MSW.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","title":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","text":"function performs peak detection mass spectrometry direct injection spectrum using wavelet based algorithm.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findPeaks_MSW.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","text":"","code":"do_findPeaks_MSW( mz, int, snthresh = 3, verboseColumns = FALSE, scantime = numeric(), valsPerSpect = integer(), ... )"},{"path":"https://sneumann.github.io/xcms/reference/do_findPeaks_MSW.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","text":"mz Numeric vector individual m/z values scans/ spectra one file/sample. int Numeric vector individual intensity values scans/spectra one file/sample. snthresh numeric(1) defining signal noise ratio cutoff. verboseColumns logical(1) whether additional peak meta data columns returned. scantime ignored. valsPerSpect ignored. ... Additional parameters passed peakDetectionCWT function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findPeaks_MSW.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","text":"matrix, row representing identified peak, columns: mz m/z value peak centroid position. mzmin Minimum m/z peak. mzmax Maximum m/z peak. rt Always -1. rtmin Always -1. rtmax Always -1. Integrated (original) intensity peak. maxo Maximum intensity peak. intf Always NA. maxf Maximum MSW-filter response peak. sn Signal noise ratio.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_findPeaks_MSW.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","text":"wrapper around peak picker Bioconductor's MassSpecWavelet package calling peakDetectionCWT tuneInPeakInfo functions. See xcmsDirect vignette information.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_findPeaks_MSW.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Core API function for single-spectrum non-chromatography MS data peak detection — do_findPeaks_MSW","text":"Joachim Kutzera, Steffen Neumann, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"do_groupChromPeaks_density function performs chromatographic peak grouping based density (distribution) peaks, found different samples, along retention time axis slices overlapping m/z ranges. default (parameter ppm = 0) m/z ranges (constant) size (depending parameter binSize). values ppm larger 0 m/z bins (ranges slices) increasing sizes depending m/z value. better models m/z-dependent measurement error/precision seen MS instruments.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"","code":"do_groupChromPeaks_density( peaks, sampleGroups, bw = 30, minFraction = 0.5, minSamples = 1, binSize = 0.25, maxFeatures = 50, sleep = 0, index = seq_len(nrow(peaks)), ppm = 0 )"},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"peaks matrix data.frame mz values retention times identified chromatographic peaks samples experiment. Required columns \"mz\", \"rt\" \"sample\". latter contain numeric values representing index sample peak found. sampleGroups PeakDensityParam: vector length samples defining sample group assignments (.e. samples belong sample group). parameter mandatory PeakDensityParam provided also sample grouping experiment (case samples assigned group). bw PeakDensityParam: numeric(1) defining bandwidth (standard deviation ot smoothing kernel) used. argument passed [density() method. minFraction PeakDensityParam: numeric(1) defining minimum fraction samples least one sample group peaks present considered peak group (feature). minSamples PeakDensityParam: numeric(1) minimum number samples least one sample group peaks detected considered peak group (feature). binSize PeakDensityParam: numeric(1) defining size overlapping slices m/z dimension. maxFeatures PeakDensityParam: numeric(1) maximum number peak groups identified single mz slice. sleep numeric(1) defining time sleep iterations plot result current iteration. index optional integer providing indices peaks original peak matrix. ppm MzClustParam: numeric(1) representing relative m/z error clustering/grouping (parts per million). PeakDensityParam: numeric(1) define m/z-dependent, increasing m/z bin sizes. ppm = 0 (default) m/z bins defined sequence values smallest larges m/z value constant bin size binSize. ppm > 0 size bin increased addition ppm (upper) m/z boundary bin. maximal bin size (used largest m/z values) binSize plus ppm parts-per-million largest m/z value peaks data set.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"data.frame, row representing (mz-rt) feature (.e. peak group) columns: \"mzmed\": median peaks' apex mz values. \"mzmin\": smallest mz value peaks' apex within feature. \"mzmax\":largest mz value peaks' apex within feature. \"rtmed\": median peaks' retention times. \"rtmin\": smallest retention time peaks group. \"rtmax\": largest retention time peaks group. \"npeaks\": total number peaks assigned feature. \"peakidx\": list indices peaks feature peaks input matrix. Note number can larger total number samples, since multiple peaks sample assigned feature.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"overlapping slices along mz dimension, function calculates density distribution identified peaks along retention time axis groups peaks different samples close . See (Smith 2006) details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"default settings might appropriate LC/GC-MS setups, especially bw binSize parameter adjusted accordingly.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"Colin . Smith, Elizabeth J. Want, Grace O'Maille, Ruben Abagyan Gary Siuzdak. \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 2006, 78:779-787.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"Colin Smith, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_density.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Core API function for peak density based chromatographic peak grouping — do_groupChromPeaks_density","text":"","code":"## Load the test file library(xcms) library(MsExperiment) faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Extract the matrix with the identified peaks from the xcmsSet: pks <- chromPeaks(faahko_sub) ## Perform the peak grouping with default settings: res <- do_groupChromPeaks_density(pks, sampleGroups = rep(1, 3)) ## The feature definitions: head(res) #> mzmed mzmin mzmax rtmed rtmin rtmax npeaks 1 peakidx #> 1 279.0 279.0 279.0 2787.765 2787.765 2787.766 2 2 11, 199 #> 2 286.2 286.2 286.2 3254.904 3250.992 3258.815 2 2 115, 205 #> 3 300.2 300.2 300.2 3387.143 3379.317 3390.271 4 3 35, 125,.... #> 4 301.0 301.0 301.0 2787.766 2786.200 2792.459 3 3 10, 97, 198 #> 5 305.1 305.1 305.1 2994.338 2994.338 2994.339 2 2 15, 203 #> 6 305.1 305.1 305.1 2923.917 2923.916 2923.917 2 2 14, 202"},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_nearest.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for chromatic peak grouping using a nearest neighbor approach — do_groupChromPeaks_nearest","title":"Core API function for chromatic peak grouping using a nearest neighbor approach — do_groupChromPeaks_nearest","text":"do_groupChromPeaks_nearest function groups peaks across samples creating master peak list assigning corresponding peaks samples peak group (.e. feature). method inspired correspondence algorithm mzMine (Katajamaa 2006).","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_nearest.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for chromatic peak grouping using a nearest neighbor approach — do_groupChromPeaks_nearest","text":"","code":"do_groupChromPeaks_nearest( peaks, sampleGroups, mzVsRtBalance = 10, absMz = 0.2, absRt = 15, kNN = 10 )"},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_nearest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for chromatic peak grouping using a nearest neighbor approach — do_groupChromPeaks_nearest","text":"peaks matrix data.frame mz values retention times identified chromatographic peaks samples experiment. Required columns \"mz\", \"rt\" \"sample\". latter contain numeric values representing index sample peak found. sampleGroups PeakDensityParam: vector length samples defining sample group assignments (.e. samples belong sample group). parameter mandatory PeakDensityParam provided also sample grouping experiment (case samples assigned group). mzVsRtBalance NearestPeaksParam: numeric(1) representing factor m/z values multiplied calculating (euclician) distance two peaks. absMz NearestPeaksParam MzClustParam: numeric(1) maximum tolerated distance m/z values. absRt NearestPeaksParam: numeric(1) maximum tolerated distance retention times. kNN NearestPeaksParam: integer(1) representing number nearest neighbors check.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_nearest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for chromatic peak grouping using a nearest neighbor approach — do_groupChromPeaks_nearest","text":"list elements \"featureDefinitions\" \"peakIndex\". \"featureDefinitions\" matrix, row representing (mz-rt) feature (.e. peak group) columns: \"mzmed\": median peaks' apex mz values. \"mzmin\": smallest mz value peaks' apex within feature. \"mzmax\":largest mz value peaks' apex within feature. \"rtmed\": median peaks' retention times. \"rtmin\": smallest retention time peaks feature. \"rtmax\": largest retention time peaks feature. \"npeaks\": total number peaks assigned feature. \"peakIndex\" list indices peaks feature peaks input matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupChromPeaks_nearest.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Core API function for chromatic peak grouping using a nearest neighbor approach — do_groupChromPeaks_nearest","text":"Katajamaa M, Miettinen J, Oresic M: MZmine: Toolbox processing visualization mass spectrometry based molecular profile data. Bioinformatics 2006, 22:634-636.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/do_groupPeaks_mzClust.html","id":null,"dir":"Reference","previous_headings":"","what":"Core API function for peak grouping using mzClust — do_groupPeaks_mzClust","title":"Core API function for peak grouping using mzClust — do_groupPeaks_mzClust","text":"do_groupPeaks_mzClust function performs high resolution correspondence single spectra samples.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupPeaks_mzClust.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Core API function for peak grouping using mzClust — do_groupPeaks_mzClust","text":"","code":"do_groupPeaks_mzClust( peaks, sampleGroups, ppm = 20, absMz = 0, minFraction = 0.5, minSamples = 1 )"},{"path":"https://sneumann.github.io/xcms/reference/do_groupPeaks_mzClust.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Core API function for peak grouping using mzClust — do_groupPeaks_mzClust","text":"peaks matrix data.frame mz values retention times identified chromatographic peaks samples experiment. Required columns \"mz\", \"rt\" \"sample\". latter contain numeric values representing index sample peak found. sampleGroups PeakDensityParam: vector length samples defining sample group assignments (.e. samples belong sample group). parameter mandatory PeakDensityParam provided also sample grouping experiment (case samples assigned group). ppm MzClustParam: numeric(1) representing relative m/z error clustering/grouping (parts per million). PeakDensityParam: numeric(1) define m/z-dependent, increasing m/z bin sizes. ppm = 0 (default) m/z bins defined sequence values smallest larges m/z value constant bin size binSize. ppm > 0 size bin increased addition ppm (upper) m/z boundary bin. maximal bin size (used largest m/z values) binSize plus ppm parts-per-million largest m/z value peaks data set. absMz NearestPeaksParam MzClustParam: numeric(1) maximum tolerated distance m/z values. minFraction PeakDensityParam: numeric(1) defining minimum fraction samples least one sample group peaks present considered peak group (feature). minSamples PeakDensityParam: numeric(1) minimum number samples least one sample group peaks detected considered peak group (feature).","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupPeaks_mzClust.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Core API function for peak grouping using mzClust — do_groupPeaks_mzClust","text":"list elements \"featureDefinitions\" \"peakIndex\". \"featureDefinitions\" matrix, row representing (mz-rt) feature (.e. peak group) columns: \"mzmed\": median peaks' apex mz values. \"mzmin\": smallest mz value peaks' apex within feature. \"mzmax\": largest mz value peaks' apex within feature. \"rtmed\": always -1. \"rtmin\": always -1. \"rtmax\": always -1. \"npeaks\": total number peaks assigned feature. Note number can larger total number samples, since multiple peaks sample assigned group. \"peakIndex\" list indices peaks peak group peaks input matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/do_groupPeaks_mzClust.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Core API function for peak grouping using mzClust — do_groupPeaks_mzClust","text":"Saira . Kazmi, Samiran Ghosh, Dong-Guk Shin, Dennis W. Hill David F. GrantAlignment high resolution mass spectra: development heuristic approach metabolomics. Metabolomics, Vol. 2, . 2, 75-83 (2006)","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/doubleMatrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Allocate double, integer, or logical matricies — doubleMatrix","title":"Allocate double, integer, or logical matricies — doubleMatrix","text":"Allocate double, integer, logical matricies one step without copying memory around.","code":""},{"path":"https://sneumann.github.io/xcms/reference/doubleMatrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Allocate double, integer, or logical matricies — doubleMatrix","text":"","code":"doubleMatrix(nrow = 0, ncol = 0) integerMatrix(nrow = 0, ncol = 0) logicalMatrix(nrow = 0, ncol = 0)"},{"path":"https://sneumann.github.io/xcms/reference/doubleMatrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Allocate double, integer, or logical matricies — doubleMatrix","text":"nrow number matrix rows ncol number matrix columns","code":""},{"path":"https://sneumann.github.io/xcms/reference/doubleMatrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Allocate double, integer, or logical matricies — doubleMatrix","text":"Matrix double, integer, logical values. Memory zeroed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/doubleMatrix.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Allocate double, integer, or logical matricies — doubleMatrix","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/estimatePrecursorIntensity.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate precursor intensity for MS level 2 spectra — estimatePrecursorIntensity","title":"Estimate precursor intensity for MS level 2 spectra — estimatePrecursorIntensity","text":"estimatePrecursorIntensity determines precursor intensity MS 2 spectrum based intensity respective signal neighboring MS 1 spectra (.e. based peak m/z matching precursor m/z MS 2 spectrum). Based parameter method either intensity peak previous MS 1 scan used (method = \"previous\") interpolation intensity previous subsequent MS1 scan used (method = \"interpolation\", considers also retention times two MS1 scans retention time MS2 spectrum).","code":""},{"path":"https://sneumann.github.io/xcms/reference/estimatePrecursorIntensity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate precursor intensity for MS level 2 spectra — estimatePrecursorIntensity","text":"","code":"estimatePrecursorIntensity( x, ppm = 10, method = c(\"previous\", \"interpolation\"), BPPARAM = bpparam() )"},{"path":"https://sneumann.github.io/xcms/reference/estimatePrecursorIntensity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate precursor intensity for MS level 2 spectra — estimatePrecursorIntensity","text":"x OnDiskMSnExp XCMSnExp object. ppm numeric(1) defining maximal acceptable difference (ppm) precursor m/z m/z corresponding peak MS 1 scan. method character(1) defining method precursor intensity determined (see description details). Defaults method = \"previous\". BPPARAM parallel processing setup. See bpparam() details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/estimatePrecursorIntensity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate precursor intensity for MS level 2 spectra — estimatePrecursorIntensity","text":"numeric length equal number spectra x. NA returned MS 1 spectra matching peak MS 1 scan can found MS 2 spectrum","code":""},{"path":"https://sneumann.github.io/xcms/reference/estimatePrecursorIntensity.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Estimate precursor intensity for MS level 2 spectra — estimatePrecursorIntensity","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/etg.html","id":null,"dir":"Reference","previous_headings":"","what":"Empirically Transformed Gaussian function — etg","title":"Empirically Transformed Gaussian function — etg","text":"general function asymmetric chromatographic peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/etg.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Empirically Transformed Gaussian function — etg","text":"","code":"etg(x, H, t1, tt, k1, kt, lambda1, lambdat, alpha, beta)"},{"path":"https://sneumann.github.io/xcms/reference/etg.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Empirically Transformed Gaussian function — etg","text":"x times evaluate function H peak height t1 time leading edge inflection point tt time trailing edge inflection point k1 leading edge parameter kt trailing edge parameter lambda1 leading edge parameter lambdat trailing edge parameter alpha leading edge parameter beta trailing edge parameter","code":""},{"path":"https://sneumann.github.io/xcms/reference/etg.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Empirically Transformed Gaussian function — etg","text":"function evaluated times x.","code":""},{"path":"https://sneumann.github.io/xcms/reference/etg.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Empirically Transformed Gaussian function — etg","text":"Jianwei Li. Development Evaluation Flexible Empirical Peak Functions Processing Chromatographic Peaks. Anal. Chem., 69 (21), 4452-4462, 1997. http://dx.doi.org/10.1021/ac970481d","code":""},{"path":"https://sneumann.github.io/xcms/reference/etg.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Empirically Transformed Gaussian function — etg","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/exportMetaboAnalyst.html","id":null,"dir":"Reference","previous_headings":"","what":"Export data for use in MetaboAnalyst — exportMetaboAnalyst","title":"Export data for use in MetaboAnalyst — exportMetaboAnalyst","text":"Export feature table analysis MetaboAnalyst software (MetaboAnalystR R package).","code":""},{"path":"https://sneumann.github.io/xcms/reference/exportMetaboAnalyst.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export data for use in MetaboAnalyst — exportMetaboAnalyst","text":"","code":"exportMetaboAnalyst( x, file = NULL, label, value = \"into\", digits = NULL, groupnames = FALSE, ... )"},{"path":"https://sneumann.github.io/xcms/reference/exportMetaboAnalyst.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export data for use in MetaboAnalyst — exportMetaboAnalyst","text":"x XCMSnExp object identified chromatographic peaks grouped across samples. file character(1) defining file name. specified, matrix content returned. label either character(1) specifying phenodata column x defining sample grouping vector length samples x defining group assignment samples. value character(1) specifying value returned feature. See featureValues() details. digits integer(1) defining number significant digits used numeric. default NULL uses getOption(\"digits\"). See format() information. groupnames logical(1) whether row names resulting matrix feature IDs (groupnames = FALSE; default) IDs composed m/z retention time features (format MT (groupnames = TRUE). See help groupnames function details. ... additional parameters passed featureValues() function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/exportMetaboAnalyst.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Export data for use in MetaboAnalyst — exportMetaboAnalyst","text":"file specified, function returns matrix format supported MetaboAnalyst.","code":""},{"path":"https://sneumann.github.io/xcms/reference/exportMetaboAnalyst.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Export data for use in MetaboAnalyst — exportMetaboAnalyst","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/extractMsData-method.html","id":null,"dir":"Reference","previous_headings":"","what":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","title":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","text":"UPDATE: extractMsData plotMsData functions deprecated (x, \"data.frame\") plot(x, type = \"XIC\") (x OnDiskMSnExp XCMSnExp object) used instead. See examples . aware filtering raw object might however drop adjusted retention times. cases advisable use applyAdjustedRtime() function prior filtering. Extract data.frame retention time, mz intensity values file/sample provided rt-mz range (full data range rt mz defined).","code":""},{"path":"https://sneumann.github.io/xcms/reference/extractMsData-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","text":"","code":"# S4 method for OnDiskMSnExp extractMsData(object, rt, mz, msLevel = 1L) # S4 method for XCMSnExp extractMsData( object, rt, mz, msLevel = 1L, adjustedRtime = hasAdjustedRtime(object) )"},{"path":"https://sneumann.github.io/xcms/reference/extractMsData-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","text":"object XCMSnExp OnDiskMSnExp object. rt numeric(2) retention time range data extracted. mz numeric(2) mz range. msLevel integer defining MS level(s) data sub-setted prior extraction; defaults msLevel = 1L. adjustedRtime (extractMsData,XCMSnExp): logical(1) specifying adjusted raw retention times reported. Defaults adjusted retention times, present object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/extractMsData-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","text":"list length equal number samples/files object. element data.frame columns \"rt\", \"mz\" \"\" retention time, mz intensity tuples file. data available mz-rt range file data.frame 0 rows returned file.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/extractMsData-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/extractMsData-method.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"DEPRECATED: Extract a data.frame containing MS data — extractMsData,OnDiskMSnExp-method","text":"","code":"## Load a test data set with detected peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) ## Extract the full MS data for a certain retention time range ## as a data.frame tmp <- filterRt(faahko_sub, rt = c(2800, 2900)) ms_all <- as(tmp, \"data.frame\") head(ms_all) #> file rt mz i #> 1 1 2800.284 200.1 968 #> 2 1 2800.284 201.0 1273 #> 3 1 2800.284 201.9 1729 #> 4 1 2800.284 203.0 859 #> 5 1 2800.284 205.0 24136 #> 6 1 2800.284 206.0 3913 nrow(ms_all) #> [1] 79960"},{"path":"https://sneumann.github.io/xcms/reference/feature-grouping.html","id":null,"dir":"Reference","previous_headings":"","what":"Compounding of LC-MS features — feature-grouping","title":"Compounding of LC-MS features — feature-grouping","text":"Feature compounding aims identifying grouping LC-MS features representing different ions adducts (including isotopes) originating compound. MsFeatures package provides general framework functionality group features based different properties. groupFeatures methods XcmsExperiment() XCMSnExp objects implemented xcms extend enable compounding LC-MS data considering also e.g. feature peak shaped. Note functions simply define feature groups actually aggregate combine features. See MsFeatures::groupFeatures() overview general feature grouping concept well details individual settings parameters. available options groupFeatures xcms preprocessing results (.e. XcmsExperiment XCMSnExp objects correspondence analysis groupChromPeaks()) : Grouping similar retention times: groupFeatures-similar-rtime(). Grouping similar feature values across samples: AbundanceSimilarityParam(). Grouping similar peak shape extracted ion chromatograms: EicSimilarityParam(). ideal workflow grouping features sequentially perform methods (listed order). Compounded feature groups can accessed featureGroups function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/feature-grouping.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compounding of LC-MS features — feature-grouping","text":"","code":"# S4 method for XcmsResult featureGroups(object) # S4 method for XcmsResult featureGroups(object) <- value"},{"path":"https://sneumann.github.io/xcms/reference/feature-grouping.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compounding of LC-MS features — feature-grouping","text":"object XcmsExperiment() XCMSnExp() object LC-MS pre-processing results. value featureGroups<-: replacement feature groups object. length 1 length equal number features object.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/feature-grouping.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compounding of LC-MS features — feature-grouping","text":"Johannes Rainer, Mar Garcia-Aloy, Vinicius Veri Hernandes","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract ion chromatograms for each feature — featureChromatograms","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"Extract ion chromatograms features XcmsExperiment XCMSnExp object. function returns feature extracted ion chromatograms (along associated chromatographic peaks) sample. chromatogram extracted m/z - rt region includes chromatographic peaks feature. default, region defined using range chromatographic peaks' m/z retention times (mzmin = min, mzmax = max, rtmin = min rtmax = max). features, depending data, m/z rt range can thus relatively large. boundaries m/z - rt region can also restricted changing parameters mzmin, mzmax, rtmin rtmax different functions, median. default chromatographic peaks associated feature included returned XChromatograms object. object XCMSnExp object parameter include allows also return chromatographic peaks apex position within selected region (include = \"apex_within\") chromatographic peak overlapping m/z retention time range (include = \"\").","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"","code":"featureChromatograms(object, ...) # S4 method for XcmsExperiment featureChromatograms( object, expandRt = 0, expandMz = 0, aggregationFun = \"max\", features = character(), return.type = \"XChromatograms\", chunkSize = 2L, mzmin = min, mzmax = max, rtmin = min, rtmax = max, ..., progressbar = TRUE, BPPARAM = bpparam() ) # S4 method for XCMSnExp featureChromatograms( object, expandRt = 0, aggregationFun = \"max\", features, include = c(\"feature_only\", \"apex_within\", \"any\", \"all\"), filled = FALSE, n = length(fileNames(object)), value = c(\"maxo\", \"into\"), expandMz = 0, ... )"},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"object XcmsExperiment XCMSnExp object grouped chromatographic peaks. ... optional arguments passed along chromatogram() function. expandRt numeric(1) expand retention time range chromatographic peak constant value side. expandMz numeric(1) expand m/z range chromatographic peak constant value side. aware extending m/z range extracted EIC might longer represent actual identified chromatographic peak intensities potential additional mass peaks within spectra aggregated final reported intensity value per spectrum (retention time). aggregationFun character(1) specifying name used aggregate intensity values across m/z value range retention time. default \"max\" returns base peak chromatogram. features integer, character logical defining subset features chromatograms returned. Can index features featureDefinitions, feature IDs (row names featureDefinitions) logical vector. return.type character(1) defining result returned. present return.type = \"XChromatograms\" supported results thus returned XChromatograms() object. chunkSize object XcmsExperiment: integer(1) defining number files data loaded time memory. Defaults chunkSize = 2L. mzmin function defining lower boundary m/z region EIC integrated defined. Defaults mzmin = min thus smallest \"mzmin\" value chromatographic peaks feature used. mzmax function defining upper boundary m/z region EIC integrated defined. Defaults mzmax = max thus largest \"mzmax\" value chromatographic peaks feature used. rtmin function defining lower boundary rt region EIC integrated defined. Defaults rtmin = min thus smallest \"rtmin\" value chromatographic peaks feature used. rtmax function defining upper boundary rt region EIC integrated defined. Defaults rtmax = max thus largest \"rtmax\" value chromatographic peaks feature used. progressbar logical(1) defining whether progress bar shown. BPPARAM object XcmsExperiment: parallel processing setup. Defaults BPPARAM = bpparam(). See bpparam() information. include object XCMSnExp: character(1) defining chromatographic peaks (related feature definitions) included returned XChromatograms(). Defaults \"feature_only\"; See description options details. filled object XCMSnExp: logical(1) whether filled-peaks included result object. default filled = FALSE, .e. detected peaks reported. n object XCMSnExp: integer(1) optionally specify number top n samples EIC extracted. value object XCMSnExp: character(1) specifying column used sort samples. Can either \"maxo\" (default) \"\" use maximal peak intensity integrated peak area, respectively.","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"XChromatograms() object. future, depending parameter return.type, data might returned different object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"EIC data feature extracted every sample using m/z - rt area. EIC sample thus exactly represent signal actually identified chromatographic peak sample. chromPeakChromatograms() function allow extract actual EIC chromatographic peak specific sample. See also examples . Parameters include, filled, n value supported object XCMSnExp. extracting EICs top n samples can happen one features specified features dropped detected peak top n samples. chance happen smaller x contains also filled-peaks (fillChromPeaks).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureChromatograms.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Extract ion chromatograms for each feature — featureChromatograms","text":"","code":"## Load a test data set with detected peaks library(xcms) library(MsExperiment) faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Perform correspondence analysis xdata <- groupChromPeaks(faahko_sub, param = PeakDensityParam(minFraction = 0.8, sampleGroups = rep(1, 3))) ## Get the feature definitions featureDefinitions(xdata) #> mzmed mzmin mzmax rtmed rtmin rtmax npeaks 1 peakidx #> FT01 300.2 300.2 300.2 3387.143 3379.317 3390.271 4 3 35, 125,.... #> FT02 301.0 301.0 301.0 2787.766 2786.200 2792.459 3 3 10, 97, 198 #> FT03 326.2 326.2 326.2 3416.877 3415.311 3424.700 3 3 37, 128, 213 #> FT04 328.2 328.2 328.2 3626.581 3618.755 3631.274 3 3 64, 159, 231 #> FT05 329.2 329.2 329.2 3626.581 3618.755 3631.274 3 3 63, 156, 230 #> FT06 343.0 343.0 343.0 2684.479 2678.218 2686.042 3 3 6, 92, 195 #> FT07 344.0 344.0 344.0 2682.914 2679.783 2686.042 3 3 3, 90, 193 #> FT08 354.2 354.2 354.2 3614.061 3610.930 3621.884 3 3 56, 153, 228 #> FT09 356.2 356.2 356.2 3830.025 3819.069 3833.153 3 3 78, 180, 241 #> FT10 365.0 365.0 365.0 2684.479 2679.783 2686.042 3 3 7, 93, 196 #> FT11 438.3 438.3 438.3 4052.248 4047.552 4060.071 3 3 81, 186, 248 #> FT12 496.2 496.2 496.2 3335.498 3316.719 3340.194 3 3 47, 143, 220 #> FT13 496.2 496.2 496.2 3402.791 3384.012 3410.617 3 3 48, 144, 221 #> FT14 508.2 508.2 508.2 3524.859 3515.468 3529.552 3 3 67, 163, 232 #> FT15 509.2 509.2 509.2 3523.294 3512.338 3531.117 3 3 54, 160, 229 #> FT16 522.2 522.2 522.2 3387.142 3344.888 3434.091 6 3 52, 53, .... #> FT17 523.2 523.2 523.2 3387.142 3344.888 3434.091 6 3 38, 39, .... #> FT18 524.2 524.2 524.2 3676.658 3598.410 3704.828 4 3 74, 75, .... #> FT19 525.2 525.2 525.2 3690.742 3662.574 3706.393 3 3 72, 173, 238 #> FT20 532.2 532.2 532.2 3482.605 3476.344 3488.863 3 3 49, 137, 219 #> FT21 536.2 536.2 536.2 3712.653 3703.262 3718.912 3 3 73, 174, 237 #> ms_level #> FT01 1 #> FT02 1 #> FT03 1 #> FT04 1 #> FT05 1 #> FT06 1 #> FT07 1 #> FT08 1 #> FT09 1 #> FT10 1 #> FT11 1 #> FT12 1 #> FT13 1 #> FT14 1 #> FT15 1 #> FT16 1 #> FT17 1 #> FT18 1 #> FT19 1 #> FT20 1 #> FT21 1 ## Extract ion chromatograms for the first 3 features. Parameter ## `features` can be either the feature IDs or feature indices. chrs <- featureChromatograms(xdata, features = rownames(featureDefinitions)[1:3]) ## Plot the EIC for the first feature using different colors for each file. plot(chrs[1, ], col = c(\"red\", \"green\", \"blue\")) ## The EICs for all 3 samples use the same m/z and retention time range, ## which was defined using the `featureArea` function: featureArea(xdata, features = rownames(featureDefinitions(xdata))[1:3], mzmin = min, mzmax = max, rtmin = min, rtmax = max) #> mzmin mzmax rtmin rtmax #> FT01 300.2 300.2 3362.104 3413.746 #> FT02 301.0 301.0 2765.855 2820.630 #> FT03 326.2 326.2 3391.837 3449.740 ## To extract the actual (exact) EICs for each chromatographic peak of ## a feature in each sample, the `chromPeakChromatograms` function would ## need to be used instead. Below we extract the EICs for all ## chromatographic peaks of the first feature. We need to first get the ## IDs of all chromatographic peaks assigned to the first feature: peak_ids <- rownames(chromPeaks(xdata))[featureDefinitions(xdata)$peakidx[[1L]]] ## We can now pass these to the `chromPeakChromatograms` function with ## parameter `peaks`: eic_1 <- chromPeakChromatograms(xdata, peaks = peak_ids) ## To plot these into a single plot we need to use the ## `plotChromatogramsOverlay` function: plotChromatogramsOverlay(eic_1)"},{"path":"https://sneumann.github.io/xcms/reference/featureSpectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract spectra associated with features — featureSpectra","title":"Extract spectra associated with features — featureSpectra","text":"function returns spectra associated identified features input object. default, spectra returned features (MS levels), parameter features allows specify/select features result returned. Parameter msLevel allows define whether MS level 1 2 spectra returned. msLevel = 1L MS1 spectra within retention time range chromatographic peak (respective data file) associated feature returned. Note samples peak identified (even filled-) spectra returned. msLevel = 2L MS2 spectra retention time within retention time range precursor m/z within m/z range chromatographic peak feature returned. See also chromPeakSpectra() (used internally extract spectra chromatographic peak feature) additional information, specifically also parameter method. default (method = \"\") spectra associated chromatographic peaks feature returned. option method, single spectrum per chromatographic peak returned (hence multiple spectra per feature). ID chromatographic peak (.e. row name chromPeaks) feature (.e., row name featureDefinitions) available returned Spectra() spectra variables \"peak_id\" \"feature_id\", respectively.","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSpectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract spectra associated with features — featureSpectra","text":"","code":"featureSpectra(object, ...) # S4 method for XcmsExperiment featureSpectra( object, msLevel = 2L, expandRt = 0, expandMz = 0, ppm = 0, skipFilled = FALSE, return.type = c(\"Spectra\", \"List\"), features = character(), ... ) # S4 method for XCMSnExp featureSpectra( object, msLevel = 2L, expandRt = 0, expandMz = 0, ppm = 0, skipFilled = FALSE, return.type = c(\"MSpectra\", \"Spectra\", \"list\", \"List\"), features = character(), ... )"},{"path":"https://sneumann.github.io/xcms/reference/featureSpectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract spectra associated with features — featureSpectra","text":"object XcmsExperiment XCMSnExp object feature defitions. ... additional arguments passed along chromPeakSpectra(), method. msLevel integer(1) defining MS level spectra returned. expandRt numeric(1) expand retention time range peak constant value side. expandMz numeric(1) expand m/z range peak constant value side. ppm numeric(1) expand m/z range peak (side) value dependent peak's m/z. skipFilled logical(1) whether spectra filled-peaks reported . return.type character(1) defining type result object returned. features character, logical integer allowing specify subset features featureDefinitions spectra returned (providing either ID, logical vector length nrow(featureDefinitions(x)) index featureDefinitions(x)). parameter overrides skipFilled supported return.type either \"Spectra\" \"List\".","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSpectra.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract spectra associated with features — featureSpectra","text":"function returns either Spectra() (return.type = \"Spectra\") List Spectra (return.type = \"List\"). latter, order length matches parameter features (features defined order features featureDefinitions(object)). Spectra variables \"peak_id\" \"feature_id\" define chromatographic peak feature individual spectrum associated .","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSpectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract spectra associated with features — featureSpectra","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSummary.html","id":null,"dir":"Reference","previous_headings":"","what":"Simple feature summaries — featureSummary","title":"Simple feature summaries — featureSummary","text":"Simple function calculate feature summaries. include counts percentages samples chromatographic peak present feature counts percentages samples one chromatographic peak annotated feature. Also relative standard deviations (RSD) calculated integrated peak areas per feature across samples. `perSampleCounts = TRUE` also individual chromatographic peak counts per sample returned.","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSummary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simple feature summaries — featureSummary","text":"","code":"featureSummary( x, group, perSampleCounts = FALSE, method = \"maxint\", skipFilled = TRUE )"},{"path":"https://sneumann.github.io/xcms/reference/featureSummary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simple feature summaries — featureSummary","text":"x [XcmsExperiment()] [XCMSnExp()] object correspondence results. group `numeric`, `logical`, `character` `factor` length `x` samples aggregate counts groups defined `group`. perSampleCounts `logical(1)` whether feature wise individual peak counts per sample returned . method `character` passed [featureValues()] function. See respective help page information. skipFilled `logical(1)` whether filled-peaks excluded (default) included summary calculation.","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSummary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simple feature summaries — featureSummary","text":"`matrix` one row per feature columns: - `\"count\"`: total number samples peak found. - `\"perc\"`: percentage samples peak found. - `\"multi_count\"`: total number samples one peak assigned feature. - `\"multi_perc\"`: percentage samples peak found, also multiple peaks annotated feature. Example: feature, least one peak detected 50 samples. 5 2 peaks assigned feature. `\"multi_perc\"` case 10 - `\"rsd\"`: relative standard deviation (coefficient variation) integrated peak area feature's peaks. - 4 columns repeated unique element (level) `group` `group` provided. `perSampleCounts = TRUE` also one column sample returned peak counts per sample.","code":""},{"path":"https://sneumann.github.io/xcms/reference/featureSummary.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Simple feature summaries — featureSummary","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Gap Filling — fillChromPeaks","title":"Gap Filling — fillChromPeaks","text":"Gap filling integrate signal m/z-rt area feature (.e., chromatographic peak group) samples chromatographic peak feature identified add chromPeaks() matrix. filled-peaks indicated TRUE column \"is_filled\" result object's chromPeakData() data frame. method gap filling along settings can defined param argument. Two different approaches available: param = FillChromPeaksParam(): default original xcms code. Signal integrated m/z retention time range defined featureDefinitions() data frame, .e. \"rtmin\", \"rtmax\", \"mzmin\" \"mzmax\". method suggested underestimates actual peak area also available object XcmsExperiment object. See details information settings method. param = ChromPeakAreaParam(): area signal feature integrated defined based feature's chromatographic peak areas. m/z range default defined lower quartile chromatographic peaks' \"mzmin\" value upper quartile chromatographic peaks' \"mzmax\" values. retention time range area defined analogously. Alternatively, setting mzmin = median, mzmax = median, rtmin = median rtmax = median ChromPeakAreaParam, median \"mzmin\", \"mzmax\", \"rtmin\" \"rtmax\" values detected chromatographic peaks feature used instead. contrast FillChromPeaksParam approach method uses () identified chromatographic peaks feature define area signal integrated. expandMz,expandMz<-: getter setter expandMz slot object. expandRt,expandRt<-: getter setter expandRt slot object. ppm,ppm<-: getter setter ppm slot object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gap Filling — fillChromPeaks","text":"","code":"fillChromPeaks(object, param, ...) # S4 method for XcmsExperiment,ChromPeakAreaParam fillChromPeaks( object, param, msLevel = 1L, chunkSize = 2L, BPPARAM = bpparam() ) FillChromPeaksParam( expandMz = 0, expandRt = 0, ppm = 0, fixedMz = 0, fixedRt = 0 ) fixedRt(object) fixedMz(object) ChromPeakAreaParam( mzmin = function(z) quantile(z, probs = 0.25, names = FALSE), mzmax = function(z) quantile(z, probs = 0.75, names = FALSE), rtmin = function(z) quantile(z, probs = 0.25, names = FALSE), rtmax = function(z) quantile(z, probs = 0.75, names = FALSE) ) # S4 method for FillChromPeaksParam expandMz(object) # S4 method for FillChromPeaksParam expandMz(object) <- value # S4 method for FillChromPeaksParam expandRt(object) # S4 method for FillChromPeaksParam expandRt(object) <- value # S4 method for FillChromPeaksParam ppm(object) # S4 method for FillChromPeaksParam ppm(object) <- value # S4 method for XCMSnExp,FillChromPeaksParam fillChromPeaks(object, param, msLevel = 1L, BPPARAM = bpparam()) # S4 method for XCMSnExp,ChromPeakAreaParam fillChromPeaks(object, param, msLevel = 1L, BPPARAM = bpparam()) # S4 method for XCMSnExp,missing fillChromPeaks(object, param, BPPARAM = bpparam(), msLevel = 1L)"},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gap Filling — fillChromPeaks","text":"object XcmsExperiment XCMSnExp object identified grouped chromatographic peaks. param ChromPeakAreaParam FillChromPeaksParam object defining approach used (see details section). ... currently ignored. msLevel integer(1) defining MS level peak filling performed (defaults msLevel = 1L). peak filling one MS level time supported, fill peaks MS level 1 2 run first using msLevel = 1 (returned result object) msLevel = 2. chunkSize fillChromPeaks object XcmsExperiment: integer(1) defining number files (samples) loaded memory processed time. setting thus allows balance memory demand speed (due parallel processing). parallel processing can performed subset data currently loaded memory iteration, value chunkSize match defined parallel setting setup. Using parallel processing setup using 4 CPUs (separate processes) using chunkSize = 1will perform parallel processing, data one sample loaded memory time. hand, settingchunkSize` total number samples experiment load full MS data memory thus settings cause --memory error. BPPARAM Parallel processing settings. expandMz FillChromPeaksParam: numeric(1) defining value mz width peaks expanded. peak expanded mz direction expandMz * original m/z width. value 0 means expansion, value 1 grows peak 1 * m/z width peak resulting peaks twice original size m/z direction (expansion half m/z width sides). expandRt FillChromPeaksParam: numeric(1), expandMz retention time width. ppm FillChromPeaksParam: numeric(1) optionally specifying ppm m/z width peak region expanded. peaks m/z width smaller mean(c(mzmin, mzmax)) * ppm / 1e6, mzmin replaced mean(c(mzmin, mzmax)) - (mean(c(mzmin, mzmax)) * ppm / 2 / 1e6) mzmax mean(c(mzmin, mzmax)) + (mean(c(mzmin, mzmax)) * ppm / 2 / 1e6). applied eventually expanding m/z width using expandMz parameter. fixedMz FillChromPeaksParam: numeric(1) defining constant factor m/z width feature expanded. m/z width expanded sides fixedMz (.e. fixedMz subtracted lower m/z added upper m/z). expansion applied expandMz ppm. fixedRt FillChromPeaksParam: numeric(1) defining constant factor retention time width factor expanded. rt width expanded sides fixedRt (.e. fixedRt subtracted lower rt added upper rt). expansion applied expandRt. mzmin function applied values \"mzmin\" column chromatographic peaks feature define lower m/z value area signal feature integrated. Defaults mzmin = function(z) quantile(z, probs = 0.25) hence using 25% quantile values. mzmax function applied values \"mzmax\" column chromatographic peaks feature define upper m/z value area signal feature integrated. Defaults mzmax = function(z) quantile(z, probs = 0.75) hence using 75% quantile values. rtmin function applied values \"rtmin\" column chromatographic peaks feature define lower rt value area signal feature integrated. Defaults rtmin = function(z) quantile(z, probs = 0.25) hence using 25% quantile values. rtmax function applied values \"rtmax\" column chromatographic peaks feature define upper rt value area signal feature integrated. Defaults rtmax = function(z) quantile(z, probs = 0.75) hence using 75% quantile values. value value slot.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gap Filling — fillChromPeaks","text":"XcmsExperiment XCMSnExp object previously missing chromatographic peaks features filled chromPeaks() matrix. FillChromPeaksParam function returns FillChromPeaksParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gap Filling — fillChromPeaks","text":"correspondence (.e. grouping chromatographic peaks across samples) always features (peak groups) include peaks every sample. fillChromPeaks method defines intensity values features missing samples integrating signal m/z-rt region feature. Two different approaches define region available: ChromPeakAreaParam region defined based detected chromatographic peaks feature, FillChromPeaksParam region defined based m/z retention times feature (represent m/z retentention times apex position associated chromatographic peaks). latter approach various parameters available increase area signal integrated, either constant value (fixedMz fixedRt) feature-relative amount (expandMz expandRt). Adjusted retention times used available. Based peak finding algorithm used identify (chromatographic) peaks, different internal functions used guarantee integrated peak signal matches much possible peak signal integration used peak detection. peaks identified matchedFilter() method, signal integration performed profile matrix generated settings used also peak finding (using bin size example). direct injection data peaks identified MSW algorithm signal integrated along mz dimension. methods complete (raw) signal within area used.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Gap Filling — fillChromPeaks","text":"expandMz,expandRt,ppm,fixedMz,fixedRt See corresponding parameter . rtmin,rtmax,mzmin,mzmax See corresponding parameter .","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Gap Filling — fillChromPeaks","text":"reported \"mzmin\", \"mzmax\", \"rtmin\" \"rtmax\" filled peaks represents actual MS area signal integrated. peak filled signal present file/sample respective mz-rt area. samples still show NA matrix returned featureValues() method.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Gap Filling — fillChromPeaks","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillChromPeaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Gap Filling — fillChromPeaks","text":"","code":"## Load a test data set with identified chromatographic peaks library(xcms) library(MsExperiment) res <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Perform the correspondence. We assign all samples to the same group. res <- groupChromPeaks(res, param = PeakDensityParam(sampleGroups = rep(1, length(res)))) ## For how many features do we lack an integrated peak signal? sum(is.na(featureValues(res))) #> [1] 26 ## Filling missing peak data using the peak area from identified ## chromatographic peaks. res <- fillChromPeaks(res, param = ChromPeakAreaParam()) ## How many missing values do we have after peak filling? sum(is.na(featureValues(res))) #> [1] 2 ## Get the peaks that have been filled in: fp <- chromPeaks(res)[chromPeakData(res)$is_filled, ] head(fp) #> mz mzmin mzmax rt rtmin rtmax into intb maxo sn #> CP249 286.2 286.2 286.2 3252.556 3236.907 3274.857 1288521 NA 78048 NA #> CP250 380.1 380.1 380.1 3193.087 3132.054 3216.561 2094879 NA 35928 NA #> CP251 447.2 447.2 447.2 3858.193 3828.068 3914.140 2156784 NA 61256 NA #> CP252 497.2 497.2 497.2 3382.447 3347.236 3438.785 10344783 NA 310912 NA #> CP253 510.2 510.2 510.2 3750.211 3741.213 3799.898 1927180 NA 61368 NA #> CP254 531.2 531.2 531.2 3340.193 3328.848 3383.620 7589092 NA 254464 NA #> sample #> CP249 1 #> CP250 1 #> CP251 1 #> CP252 1 #> CP253 1 #> CP254 1 ## Get the process history step along with the parameters used to perform ## The peak filling: ph <- processHistory(res, type = \"Missing peak filling\")[[1]] ph #> Object of class \"XProcessHistory\" #> type: Missing peak filling #> date: Wed Apr 3 13:47:46 2024 #> info: #> fileIndex: 1,2,3 #> Parameter class: ChromPeakAreaParam #> MS level(s) 1 ## The parameter class: ph@param #> Object of class: ChromPeakAreaParam #> Parameters: #> - rtmin: function (z) #> quantile(z, probs = 0.25, names = FALSE) #> #> - rtmax: function (z) #> quantile(z, probs = 0.75, names = FALSE) #> #> - mzmin: function (z) #> quantile(z, probs = 0.25, names = FALSE) #> #> - mzmax: function (z) #> quantile(z, probs = 0.75, names = FALSE) #> ## It is also possible to remove filled-in peaks: res <- dropFilledChromPeaks(res) sum(is.na(featureValues(res))) #> [1] 26"},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Integrate areas of missing peaks — fillPeaks-methods","title":"Integrate areas of missing peaks — fillPeaks-methods","text":"sample, identify peak groups sample represented. peak groups, integrate signal region peak group create new peak.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Integrate areas of missing peaks — fillPeaks-methods","text":"object = \"xcmsSet\" fillPeaks(object, method=\"\")","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Integrate areas of missing peaks — fillPeaks-methods","text":"object xcmsSet object method filling method","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Integrate areas of missing peaks — fillPeaks-methods","text":"peak grouping, always peak groups include peaks every sample. method produces intensity values missing samples integrating raw data peak group region. According type raw-data 2 different methods available. filling gcms/lcms data method \"chrom\" integrates raw-data chromatographic domain, whereas \"MSW\" used peaklists without retention-time information like direct-infusion spectra.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Integrate areas of missing peaks — fillPeaks-methods","text":"xcmsSet objects filled peak groups.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.MSW-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","title":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","text":"sample, identify peak groups sample represented. peak groups, integrate signal region peak group create new peak.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.MSW-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","text":"object = \"xcmsSet\" fillPeaks.MSW(object)","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.MSW-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","text":"object xcmsSet object","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.MSW-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","text":"peak grouping, always peak groups include peaks every sample. method produces intensity values missing samples integrating raw data peak group region. given group, start ending m/z values integration defined median start end points detected peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.MSW-methods.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","text":"contrast fillPeaks.chrom method maximum intensity reported column \"maxo\" maximum intensity measured expected peak area (defined columns \"mzmin\" \"mzmax\"), largest intensity mz value(s) closest \"mzmed\" feature.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.MSW-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Integrate areas of missing peaks in FTICR-MS data — fillPeaks.MSW-methods","text":"xcmsSet objects filled peak groups.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.chrom-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Integrate areas of missing peaks — fillPeaks.chrom-methods","title":"Integrate areas of missing peaks — fillPeaks.chrom-methods","text":"sample, identify peak groups sample represented. peak groups, integrate signal region peak group create new peak.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.chrom-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Integrate areas of missing peaks — fillPeaks.chrom-methods","text":"object = \"xcmsSet\" fillPeaks.chrom(object, nSlaves=0,expand.mz=1,expand.rt=1, BPPARAM = bpparam())","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.chrom-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Integrate areas of missing peaks — fillPeaks.chrom-methods","text":"object xcmsSet object nSlaves (DEPRECATED): number slaves/cores used parallel peak filling. MPI used installed, otherwise snow package employed multicore support. none two packages available uses parallel package parallel processing multiple CPUs current machine. Users advised use BPPARAM parameter instead. expand.mz Expansion factor m/z range used integration. expand.rt Expansion factor rentention time range used integration. BPPARAM allows define specific parallel processing setup current task (see bpparam BiocParallel package help information). default uses globally defined parallel setup.","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.chrom-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Integrate areas of missing peaks — fillPeaks.chrom-methods","text":"peak grouping, always peak groups include peaks every sample. method produces intensity values missing samples integrating raw data peak group region. given group, start ending retention time points integration defined median start end points detected peaks. start end m/z values similarly determined. Intensities can still zero, rather unusual intensity peak. case e.g. raw data threshholded, integration area contains actual raw intensities, one sample miscalibrated, thet raw data points (just) outside integration area. Importantly, retention time correction data available, alignment information used precisely integrate propper region raw data. corrected retention time beyond end raw data, value --number (NaN).","code":""},{"path":"https://sneumann.github.io/xcms/reference/fillPeaks.chrom-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Integrate areas of missing peaks — fillPeaks.chrom-methods","text":"xcmsSet objects filled peak groups (maxo).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/filter-MChromatograms.html","id":null,"dir":"Reference","previous_headings":"","what":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","title":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","text":"functions allow filter (subset) MChromatograms() XChromatograms() objects, .e. sets chromatographic data, without changing data (intensity retention times) within individual chromatograms (Chromatogram() objects). filterColumnsIntensityAbove: subsets MChromatograms objects keeping columns (samples) value larger provided threshold rows (.e. = \"\" column kept chromatograms column value larger threshold = \"\" chromatograms column fulfill criteria). Parameter value allows define value comparison performed, value = \"bpi\" maximum intensity chromatogram compared threshold, value = \"tic\" total sum intensities chromatogram compared threshold. XChromatogramsobject,value = \"maxo\"andvalue = \"\"supported compares largest intensity identified chromatographic peaks chromatogram withthreshold`, integrated peak area, respectively. filterColumnsKeepTop: subsets MChromatograms object keeping top n columns sorted value specified sortBy. detail, column value defined sortBy extracted chromatogram aggregated using aggregationFun. Thus, default, chromatogram maximum intensity determined (sortBy = \"bpi\") values summed chromatograms column (aggregationFun = sum). columns sorted values top n columns retained returned MChromatograms. Similar filterColumnsIntensityAbove function, function allows use XChromatograms objects sort columns column sortBy = \"maxo\" sortBy = \"\" chromPeaks matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/filter-MChromatograms.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","text":"","code":"# S4 method for MChromatograms filterColumnsIntensityAbove( object, threshold = 0, value = c(\"bpi\", \"tic\"), which = c(\"any\", \"all\") ) # S4 method for MChromatograms filterColumnsKeepTop( object, n = 1L, sortBy = c(\"bpi\", \"tic\"), aggregationFun = sum ) # S4 method for XChromatograms filterColumnsIntensityAbove( object, threshold = 0, value = c(\"bpi\", \"tic\", \"maxo\", \"into\"), which = c(\"any\", \"all\") ) # S4 method for XChromatograms filterColumnsKeepTop( object, n = 1L, sortBy = c(\"bpi\", \"tic\", \"maxo\", \"into\"), aggregationFun = sum )"},{"path":"https://sneumann.github.io/xcms/reference/filter-MChromatograms.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","text":"object MChromatograms() XChromatograms() object. threshold filterColumnsIntensityAbove: numeric(1) threshold value compare . value character(1) defining value used comparison sorting. Can value = \"bpi\" (default) use maximum intensity per chromatogram value = \"tic\" use sum intensities per chromatogram. XChromatograms() objects also value = \"maxo\" value = \"\" supported use maximum intensity integrated area identified chromatographic peaks chromatogram. filterColumnsIntensityAbove: character(1) defining whether (= \"\", default) (= \"\") chromatograms column fulfill criteria column kept. n filterColumnsKeepTop: integer(1) specifying number columns returned. n rounded closest (larger) integer value. sortBy filterColumnsKeepTop: value columns ordered determine top n columns. Can either sortBy = \"bpi\" (default), case maximum intensity column's chromatograms used, sortBy = \"tic\" use total intensity sum chromatograms. XChromatograms() objects also value = \"maxo\" value = \"\" supported use maximum intensity integrated area identified chromatographic peaks chromatogram. aggregationFun filterColumnsKeepTop: function used aggregate (combine) values chromatograms column. Defaults aggregationFun = sum case sum values used rank columns. Alternatively mean, median similar function can used.","code":""},{"path":"https://sneumann.github.io/xcms/reference/filter-MChromatograms.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","text":"filtered MChromatograms (XChromatograms) object number rows (EICs) eventually lower number columns (samples).","code":""},{"path":"https://sneumann.github.io/xcms/reference/filter-MChromatograms.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/filter-MChromatograms.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filtering sets of chromatographic data — filterColumnsIntensityAbove,MChromatograms-method","text":"","code":"library(MSnbase) chr1 <- Chromatogram(rtime = 1:10 + rnorm(n = 10, sd = 0.3), intensity = c(5, 29, 50, NA, 100, 12, 3, 4, 1, 3)) chr2 <- Chromatogram(rtime = 1:10 + rnorm(n = 10, sd = 0.3), intensity = c(80, 50, 20, 10, 9, 4, 3, 4, 1, 3)) chr3 <- Chromatogram(rtime = 3:9 + rnorm(7, sd = 0.3), intensity = c(53, 80, 130, 15, 5, 3, 2)) chrs <- MChromatograms(list(chr1, chr2, chr1, chr3, chr2, chr3), ncol = 3, byrow = FALSE) chrs #> MChromatograms with 2 rows and 3 columns #> 1 2 3 #> #> [1,] length: 10 length: 10 length: 10 #> [2,] length: 10 length: 7 length: 7 #> phenoData with 0 variables #> featureData with 0 variables #### filterColumnsIntensityAbove ## ## Keep all columns with for which the maximum intensity of any of its ## chromatograms is larger 90 filterColumnsIntensityAbove(chrs, threshold = 90) #> MChromatograms with 2 rows and 3 columns #> 1 2 3 #> #> [1,] length: 10 length: 10 length: 10 #> [2,] length: 10 length: 7 length: 7 #> phenoData with 0 variables #> featureData with 0 variables ## Require that ALL chromatograms in a column have a value larger 90 filterColumnsIntensityAbove(chrs, threshold = 90, which = \"all\") #> MChromatograms with 2 rows and 1 column #> 2 #> #> [1,] length: 10 #> [2,] length: 7 #> phenoData with 0 variables #> featureData with 0 variables ## If none of the columns fulfills the criteria no columns are returned filterColumnsIntensityAbove(chrs, threshold = 900) #> MChromatograms with 2 rows and 0 columns #> phenoData with 0 variables #> featureData with 0 variables ## Filtering XChromatograms allow in addition to filter on the columns ## \"maxo\" or \"into\" of the identified chromatographic peaks within each ## chromatogram. #### filterColumnsKeepTop ## ## Keep the 2 columns with the highest sum of maximal intensities in their ## chromatograms filterColumnsKeepTop(chrs, n = 1) #> MChromatograms with 2 rows and 1 column #> 2 #> #> [1,] length: 10 #> [2,] length: 7 #> phenoData with 0 variables #> featureData with 0 variables ## Keep the 50 percent of columns with the highest total sum of signal. Note ## that n will be rounded to the next larger integer value filterColumnsKeepTop(chrs, n = 0.5 * ncol(chrs), sortBy = \"tic\") #> MChromatograms with 2 rows and 2 columns #> 2 3 #> #> [1,] length: 10 length: 10 #> [2,] length: 7 length: 7 #> phenoData with 0 variables #> featureData with 0 variables"},{"path":"https://sneumann.github.io/xcms/reference/filterFeatures.html","id":null,"dir":"Reference","previous_headings":"","what":"Filtering of features based on conventional quality assessment — filterFeatures","title":"Filtering of features based on conventional quality assessment — filterFeatures","text":"dealing metabolomics results, often necessary filter features based certain criteria. criteria typically derived statistical formulas applied full rows data, row represents feature abundance signal samples. filterFeatures function filters features based conventional quality assessment criteria. Multiple types filtering implemented can defined filter argument. Supported filter arguments : RsdFilter: Calculates relative standard deviation (.e. coefficient variation) abundance feature QC (Quality Control) samples filters input object according provided threshold. DratioFilter: Computes D-ratio dispersion ratio, defined standard deviation abundance QC samples divided standard deviation biological test samples, feature filters according provided threshold. PercentMissingFilter: Determines percentage missing values feature various sample groups filters according provided threshold. BlankFlag: Identifies features mean abundance test samples lower specified multiple mean abundance blank samples. can used flag features result contamination solvent samples. new column possible_contaminants added featureDefinitions (XcmsExperiment object) rowData (SummarizedExperiment object) reflecting . specific examples, see help pages individual parameter classes listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/filterFeatures.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filtering of features based on conventional quality assessment — filterFeatures","text":"object XcmsExperiment SummarizedExperiment. XcmsExperiment object, featureValues(object) evaluated, Summarizedesxperiment assay(object, assay). object filtered. filter parameter object selecting configuring type filtering. can one following classes: RsdFilter, DratioFilter, PercentMissingFilter BlankFlag. assay filtering SummarizedExperiment objects . Indicates assay filtering based . Note features entire object removed, computations performed single assay. Default 1, means first assay object evaluated. ... Optional parameters. object XcmsExperiment: parameters featureValues() call.","code":""},{"path":"https://sneumann.github.io/xcms/reference/filterFeatures.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Filtering of features based on conventional quality assessment — filterFeatures","text":"Broadhurst D, Goodacre R, Reinke SN, Kuligowski J, Wilson ID, Lewis MR, Dunn WB. Guidelines considerations use system suitability quality control samples mass spectrometry assays applied untargeted clinical metabolomic studies. Metabolomics. 2018;14(6):72. doi: 10.1007/s11306-018-1367-3. Epub 2018 May 18. PMID: 29805336; PMCID: PMC5960010.","code":""},{"path":"https://sneumann.github.io/xcms/reference/filterFeatures.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Filtering of features based on conventional quality assessment — filterFeatures","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/filterFeatures.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Filtering of features based on conventional quality assessment — filterFeatures","text":"","code":"## See the vignettes for more detailed examples library(MsExperiment) ## Load a test data set with features defined. test_xcms <- loadXcmsData() ## Set up parameter to filter based on coefficient of variation. By setting ## the filter such as below, features that have a coefficient of variation ## superior to 0.3 in QC samples will be removed from the object `test_xcms` ## when calling the `filterFeatures` function. rsd_filter <- RsdFilter(threshold = 0.3, qcIndex = sampleData(test_xcms)$sample_type == \"QC\") filtered_data_rsd <- filterFeatures(object = test_xcms, filter = rsd_filter) #> 255 features were removed ## Set up parameter to filter based on D-ratio. By setting the filter such ## as below, features that have a D-ratio computed based on their abundance ## between QC and study samples superior to 0.5 will be removed from the ## object `test_xcms`. dratio_filter <- DratioFilter(threshold = 0.5, qcIndex = sampleData(test_xcms)$sample_type == \"QC\", studyIndex = sampleData(test_xcms)$sample_type == \"study\") filtered_data_dratio <- filterFeatures(object = test_xcms, filter = dratio_filter) #> 237 features were removed ## Set up parameter to filter based on the percent of missing data. ## Parameter f should represent the sample group of samples, for which the ## percentage of missing values will be evaluated. As the setting is defined ## bellow, if a feature as less (or equal) to 30% missing values in one ## sample group, it will be kept in the `test_xcms` object. missing_data_filter <- PercentMissingFilter(threshold = 30, f = sampleData(test_xcms)$sample_type) filtered_data_missing <- filterFeatures(object = test_xcms, filter = missing_data_filter) #> 2 features were removed ## Set up parameter to flag possible contaminants based on blank samples' ## abundance. By setting the filter such as below, features that have mean ## abundance ratio between blank(here use study as an example) and QC ## samples less than 2 will be marked as `TRUE` in an extra column named ## `possible_contaminants` in the `featureDefinitions` table of the object ## `test_xcms`. filter <- BlankFlag(threshold = 2, qcIndex = sampleData(test_xcms)$sample_type == \"QC\", blankIndex = sampleData(test_xcms)$sample_type == \"study\") filtered_xmse <- filterFeatures(test_xcms, filter) #> -10 features were flagged"},{"path":"https://sneumann.github.io/xcms/reference/filtfft.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply an convolution filter using an FFT — filtfft","title":"Apply an convolution filter using an FFT — filtfft","text":"Expands vector length filter convolutes using two successive FFTs.","code":""},{"path":"https://sneumann.github.io/xcms/reference/filtfft.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply an convolution filter using an FFT — filtfft","text":"","code":"filtfft(y, filt)"},{"path":"https://sneumann.github.io/xcms/reference/filtfft.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply an convolution filter using an FFT — filtfft","text":"y numeric vector data filtered filt filter length nextn(length(y))","code":""},{"path":"https://sneumann.github.io/xcms/reference/filtfft.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply an convolution filter using an FFT — filtfft","text":"numeric vector length y.","code":""},{"path":"https://sneumann.github.io/xcms/reference/filtfft.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Apply an convolution filter using an FFT — filtfft","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-CentWaveParam.html","id":null,"dir":"Reference","previous_headings":"","what":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","title":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","text":"findChromPeaks Chromatogram MChromatograms object CentWaveParam parameter object performs centWave-based peak detection purely chromatographic data. See centWave details method CentWaveParam details parameter class. Note settings CentWaveParam used. See peaksWithCentWave() arguments used peak detection purely chromatographic data. chromatographic peak detection, identified peaks can also refined refineChromPeaks() method, can help reduce peak detection artifacts.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-CentWaveParam.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","text":"","code":"# S4 method for Chromatogram,CentWaveParam findChromPeaks(object, param, ...) # S4 method for MChromatograms,CentWaveParam findChromPeaks(object, param, BPPARAM = bpparam(), ...) # S4 method for MChromatograms,MatchedFilterParam findChromPeaks(object, param, BPPARAM = BPPARAM, ...)"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-CentWaveParam.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","text":"object Chromatogram MChromatograms object. param CentWaveParam object specifying settings peak detection. See peaksWithCentWave() description arguments used peak detection. ... currently ignored. BPPARAM parameter class specifying parallel processing performed (XChromatograms objects). defaults bpparam(). See bpparam() information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-CentWaveParam.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","text":"called Chromatogram object, method returns XChromatogram object identified peaks. See peaksWithCentWave() details peak matrix content.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-CentWaveParam.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-CentWaveParam.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"centWave-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,CentWaveParam-method","text":"","code":"library(MSnbase) ## Loading a test data set with identified chromatographic peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") faahko_sub <- filterRt(faahko_sub, c(2500, 3700)) #> Filter spectra ## od <- as(filterFile(faahko_sub, 1L), \"MsExperiment\") ## Extract chromatographic data for a small m/z range chr <- chromatogram(od, mz = c(272.1, 272.3))[1, 1] ## Identify peaks with default settings xchr <- findChromPeaks(chr, CentWaveParam()) xchr #> Object of class: XChromatogram #> Intensity values aggregated using: sum #> length of object: 766 #> from file: 1 #> mz range: [272.1, 272.3] #> rt range: [2501.378, 3698.567] #> MS level: 1 #> Identified chromatographic peaks (3): #> rt\trtmin\trtmax\tinto\tmaxo\tsn (1 more column(s)) #> 2734.556\t2709.517\t2770.55\t286653.221615386\t8907\t15 #> 3117.97\t3097.625\t3139.879\t372049.599925925\t16496\t33 #> 3487.299\t3457.565\t3509.208\t93049.7314242425\t2651\t15 ## Plot data and identified peaks. plot(xchr) library(MsExperiment) library(xcms) ## Perform peak detection on an MChromatograms object fls <- c(system.file(\"cdf/KO/ko15.CDF\", package = \"faahKO\"), system.file(\"cdf/KO/ko16.CDF\", package = \"faahKO\"), system.file(\"cdf/KO/ko18.CDF\", package = \"faahKO\")) od3 <- readMsExperiment(fls) ## Disable parallel processing for this example register(SerialParam()) ## Extract chromatograms for a m/z - retention time slice chrs <- chromatogram(od3, mz = 344, rt = c(2500, 3500)) ## Perform peak detection using CentWave xchrs <- findChromPeaks(chrs, param = CentWaveParam()) xchrs #> XChromatograms with 1 row and 3 columns #> 1 2 3 #> #> [1,] peaks: 2 peaks: 2 peaks: 1 #> phenoData with 2 variables #> featureData with 4 variables #> - - - xcms preprocessing - - - #> Chromatographic peak detection: #> method: centWave ## Extract the identified chromatographic peaks chromPeaks(xchrs) #> rt rtmin rtmax into intb maxo sn row column #> [1,] 2589.015 2571.801 2612.490 592297.3 554533.9 27600 14 1 1 #> [2,] 2679.783 2646.919 2709.517 5210015.9 5071346.6 152320 30 1 1 #> [3,] 2593.710 2559.281 2637.529 722415.3 640838.6 30640 14 1 2 #> [4,] 2686.042 2648.483 2714.211 5700652.0 5587464.2 151744 45 1 2 #> [5,] 2682.914 2643.790 2731.427 5255689.5 4983388.9 125632 28 1 3 ## plot the result plot(xchrs)"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-MatchedFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","title":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","text":"findChromPeaks Chromatogram MChromatograms object MatchedFilterParam parameter object performs matchedFilter-based peak detection purely chromatographic data. See matchedFilter details method MatchedFilterParam details parameter class. Note settings MatchedFilterParam used. See peaksWithMatchedFilter() arguments used peak detection purely chromatographic data.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-MatchedFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","text":"","code":"# S4 method for Chromatogram,MatchedFilterParam findChromPeaks(object, param, ...)"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-MatchedFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","text":"object Chromatogram MChromatograms object. param MatchedFilterParam object specifying settings peak detection. See peaksWithMatchedFilter() description arguments used peak detection. ... currently ignored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-MatchedFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","text":"called Chromatogram object, method returns matrix identified peaks. See peaksWithMatchedFilter() details matrix content.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-MatchedFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-Chromatogram-MatchedFilter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"matchedFilter-based peak detection in purely chromatographic data — findChromPeaks,Chromatogram,MatchedFilterParam-method","text":"","code":"## Loading a test data set with identified chromatographic peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") faahko_sub <- filterRt(faahko_sub, c(2500, 3700)) #> Filter spectra ## od <- as(filterFile(faahko_sub, 1L), \"MsExperiment\") ## Extract chromatographic data for a small m/z range chr <- chromatogram(od, mz = c(272.1, 272.3))[1, 1] ## Identify peaks with default settings xchr <- findChromPeaks(chr, MatchedFilterParam()) ## Plot the identified peaks plot(xchr)"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":null,"dir":"Reference","previous_headings":"","what":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"centWave algorithm perform peak density wavelet based chromatographic peak detection high resolution LC/MS data centroid mode [Tautenhahn 2008]. CentWaveParam class allows specify settings chromatographic peak detection using centWave method. Instances created CentWaveParam constructor. findChromPeaks,OnDiskMSnExp,CentWaveParam method performs chromatographic peak detection using centWave algorithm samples OnDiskMSnExp object. OnDiskMSnExp objects encapsule experiment specific data load spectra data (mz intensity values) fly original files applying also eventual data manipulations. ppm,ppm<-: getter setter ppm slot object. peakwidth,peakwidth<-: getter setter peakwidth slot object. snthresh,snthresh<-: getter setter snthresh slot object. prefilter,prefilter<-: getter setter prefilter slot object. mzCenterFun,mzCenterFun<-: getter setter mzCenterFun slot object. integrate,integrate<-: getter setter integrate slot object. mzdiff,mzdiff<-: getter setter mzdiff slot object. fitgauss,fitgauss<-: getter setter fitgauss slot object. noise,noise<-: getter setter noise slot object. verboseColumns,verboseColumns<-: getter setter verboseColumns slot object. roiList,roiList<-: getter setter roiList slot object. fistBaselineCheck,firstBaselineCheck<-: getter setter firstBaselineCheck slot object. roiScales,roiScales<-: getter setter roiScales slot object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"","code":"CentWaveParam( ppm = 25, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1L, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, roiList = list(), firstBaselineCheck = TRUE, roiScales = numeric(), extendLengthMSW = FALSE, verboseBetaColumns = FALSE ) # S4 method for OnDiskMSnExp,CentWaveParam findChromPeaks( object, param, BPPARAM = bpparam(), return.type = \"XCMSnExp\", msLevel = 1L, ... ) # S4 method for CentWaveParam ppm(object) # S4 method for CentWaveParam ppm(object) <- value # S4 method for CentWaveParam peakwidth(object) # S4 method for CentWaveParam peakwidth(object) <- value # S4 method for CentWaveParam snthresh(object) # S4 method for CentWaveParam snthresh(object) <- value # S4 method for CentWaveParam prefilter(object) # S4 method for CentWaveParam prefilter(object) <- value # S4 method for CentWaveParam mzCenterFun(object) # S4 method for CentWaveParam mzCenterFun(object) <- value # S4 method for CentWaveParam integrate(f) # S4 method for CentWaveParam integrate(object) <- value # S4 method for CentWaveParam mzdiff(object) # S4 method for CentWaveParam mzdiff(object) <- value # S4 method for CentWaveParam fitgauss(object) # S4 method for CentWaveParam fitgauss(object) <- value # S4 method for CentWaveParam noise(object) # S4 method for CentWaveParam noise(object) <- value # S4 method for CentWaveParam verboseColumns(object) # S4 method for CentWaveParam verboseColumns(object) <- value # S4 method for CentWaveParam roiList(object) # S4 method for CentWaveParam roiList(object) <- value # S4 method for CentWaveParam firstBaselineCheck(object) # S4 method for CentWaveParam firstBaselineCheck(object) <- value # S4 method for CentWaveParam roiScales(object) # S4 method for CentWaveParam roiScales(object) <- value # S4 method for CentWaveParam as.list(x, ...)"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"ppm numeric(1) defining maximal tolerated m/z deviation consecutive scans parts per million (ppm) initial ROI definition. peakwidth numeric(2) expected approximate peak width chromatographic space. Given range (min, max) seconds. snthresh numeric(1) defining signal noise ratio cutoff. prefilter numeric(2): c(k, ) specifying prefilter step first analysis step (ROI detection). Mass traces retained contain least k peaks intensity >= . mzCenterFun Name function calculate m/z center chromatographic peak. Allowed : \"wMean\": intensity weighted mean peak's m/z values, \"mean\": mean peak's m/z values, \"apex\": use m/z value peak apex, \"wMeanApex3\": intensity weighted mean m/z value peak apex m/z values left right \"meanApex3\": mean m/z value peak apex m/z values left right . integrate Integration method. integrate = 1 peak limits found descent mexican hat filtered data, integrate = 2 descent done real data. latter method accurate prone noise, former robust, less exact. mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. fitgauss logical(1) whether Gaussian fitted peak. affects mostly retention time position peak. noise numeric(1) allowing set minimum intensity required centroids considered first analysis step (centroids intensity < noise omitted ROI detection). verboseColumns logical(1) whether additional peak meta data columns returned. roiList optional list regions--interest (ROI) representing detected mass traces. ROIs submitted first analysis step omitted chromatographic peak detection performed submitted ROIs. ROI expected following elements specified: scmin (start scan index), scmax (end scan index), mzmin (minimum m/z), mzmax (maximum m/z), length (number scans), intensity (summed intensity). ROI represented list elements single row data.frame. firstBaselineCheck logical(1). TRUE continuous data within regions interest checked first baseline. detail, first rough estimate noise calculated peak detection performed regions multiple sequential signals higher first estimated baseline/noise level. roiScales Optional numeric vector length equal roiList defining scale region interest roiList used centWave-wavelets. extendLengthMSW Option force centWave use scales running centWave rather truncating EIC length. Uses \"open\" method extend EIC integer base-2 length prior passed convolve rather default \"reflect\" method. See https://github.com/sneumann/xcms/issues/445 information. verboseBetaColumns Option calculate two additional metrics peak quality via comparison idealized bell curve. Adds beta_cor beta_snr chromPeaks output, corresponding Pearson correlation coefficient bell curve several degrees skew well estimate signal--noise using residuals best-fitting bell curve. See https://github.com/sneumann/xcms/pull/685 https://doi.org/10.1186/s12859-023-05533-4 information. object findChromPeaks: OnDiskMSnExp object containing MS- experiment-relevant data. methods: parameter object. param CentWaveParam object containing settings centWave algorithm. BPPARAM parameter class specifying parallel processing performed. defaults bpparam. See documentation BiocParallel details. parallel processing enabled, peak detection performed parallel several input samples. return.type Character specifying type object method return. Can either \"XCMSnExp\" (default), \"list\" \"xcmsSet\". msLevel integer(1) defining MS level peak detection performed. Defaults msLevel = 1. ... ignored. value value slot. f integrate: CentWaveParam object. x parameter object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"CentWaveParam function returns CentWaveParam class instance settings specified chromatographic peak detection centWave method. findChromPeaks: return.type = \"XCMSnExp\" XCMSnExp object results peak detection. return.type = \"list\" list length equal number samples matrices specifying identified peaks. return.type = \"xcmsSet\" xcmsSet object results peak detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"centWave algorithm suitable high resolution LC/{TOF,OrbiTrap,FTICR}-MS data centroid mode. first phase method identifies regions interest (ROIs) representing mass traces characterized regions less ppm m/z deviation consecutive scans LC/MS map. detail, starting single m/z, ROI extended m/z can found next scan (spectrum) difference mean m/z ROI smaller user defined ppm m/z. mean m/z ROI updated considering also newly included m/z value. ROIs , cleanup, analyzed using continuous wavelet transform (CWT) locate chromatographic peaks different scales. first analysis step skipped, regions interest passed via param parameter. Parallel processing (one process per sample) supported can configured either BPPARAM parameter globally defining parallel processing mode using register method BiocParallel package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"ppm,peakwidth,snthresh,prefilter,mzCenterFun,integrate,mzdiff,fitgauss,noise,verboseColumns,roiList,firstBaselineCheck,roiScales,extendLengthMSW,verboseBetaColumns See corresponding parameter . Slots values exclusively accessed via corresponding getter setter methods listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"methods classes part updated modernized xcms user interface eventually replace findPeaks methods. supports peak detection OnDiskMSnExp objects (defined MSnbase package). settings centWave algorithm can passed CentWaveParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"Ralf Tautenhahn, Christoph Böttcher, Steffen Neumann \"Highly sensitive feature detection high resolution LC/MS\" BMC Bioinformatics 2008, 9:504","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"Ralf Tautenhahn, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWave.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Chromatographic peak detection using the centWave method — findChromPeaks-centWave","text":"","code":"## Create a CentWaveParam object. Note that the noise is set to 10000 to ## speed up the execution of the example - in a real use case the default ## value should be used, or it should be set to a reasonable value. cwp <- CentWaveParam(ppm = 20, noise = 10000, prefilter = c(3, 10000)) ## Change snthresh parameter snthresh(cwp) <- 25 cwp #> Object of class: CentWaveParam #> Parameters: #> - ppm: [1] 20 #> - peakwidth: [1] 20 50 #> - snthresh: [1] 25 #> - prefilter: [1] 3 10000 #> - mzCenterFun: [1] \"wMean\" #> - integrate: [1] 1 #> - mzdiff: [1] -0.001 #> - fitgauss: [1] FALSE #> - noise: [1] 10000 #> - verboseColumns: [1] FALSE #> - roiList: list() #> - firstBaselineCheck: [1] TRUE #> - roiScales: numeric(0) #> - extendLengthMSW: [1] FALSE #> - verboseBetaColumns: [1] FALSE ## Perform the peak detection using centWave on some of the files from the ## faahKO package. Files are read using the `readMsExperiment` function ## from the MsExperiment package library(faahKO) library(xcms) library(MsExperiment) fls <- dir(system.file(\"cdf/KO\", package = \"faahKO\"), recursive = TRUE, full.names = TRUE) raw_data <- readMsExperiment(fls[1]) ## Perform the peak detection using the settings defined above. res <- findChromPeaks(raw_data, param = cwp) head(chromPeaks(res)) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP001 453.2 453.2 453.2 2506.073 2501.378 2527.982 1007409.0 1007380.8 38152 #> CP002 302.0 302.0 302.0 2617.185 2595.275 2640.659 687146.6 671297.8 30552 #> CP003 344.0 344.0 344.0 2679.783 2646.919 2709.517 5210015.9 5135916.9 152320 #> CP004 381.0 381.0 381.0 2678.218 2637.529 2720.472 2180565.2 2023571.9 52504 #> CP005 430.1 430.1 430.1 2681.348 2639.094 2712.647 2395840.3 2299899.6 65752 #> CP006 366.0 366.0 366.0 2679.783 2642.224 2718.907 3365174.0 3279468.3 79928 #> sn sample #> CP001 38151 1 #> CP002 46 1 #> CP003 68 1 #> CP004 37 1 #> CP005 42 1 #> CP006 49 1"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":null,"dir":"Reference","previous_headings":"","what":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"method performs two-step centWave-based chromatographic peak detection: first centWave run peaks identified location potential isotopes mz-retention time predicted. second centWave run performed regions interest (ROIs). final list chromatographic peaks comprises non-overlapping peaks centWave runs. CentWavePredIsoParam class allows specify settings two-step centWave-based peak detection considering also predicted isotopes peaks identified first centWave run. Instances created CentWavePredIsoParam constructor. See also documentation CentWaveParam methods arguments class inherits. findChromPeaks,OnDiskMSnExp,CentWavePredIsoParam method performs two-step centWave-based chromatographic peak detection samples OnDiskMSnExp object. OnDiskMSnExp objects encapsule experiment specific data load spectra data (mz intensity values) fly original files applying also eventual data manipulations. snthreshIsoROIs,snthreshIsoROIs<-: getter setter snthreshIsoROIs slot object. maxCharge,maxCharge<-: getter setter maxCharge slot object. maxIso,maxIso<-: getter setter maxIso slot object. mzIntervalExtension,mzIntervalExtension<-: getter setter mzIntervalExtension slot object. polarity,polarity<-: getter setter polarity slot object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"","code":"CentWavePredIsoParam( ppm = 25, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1L, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, roiList = list(), firstBaselineCheck = TRUE, roiScales = numeric(), extendLengthMSW = FALSE, verboseBetaColumns = FALSE, snthreshIsoROIs = 6.25, maxCharge = 3, maxIso = 5, mzIntervalExtension = TRUE, polarity = \"unknown\" ) # S4 method for OnDiskMSnExp,CentWavePredIsoParam findChromPeaks( object, param, BPPARAM = bpparam(), return.type = \"XCMSnExp\", msLevel = 1L, ... ) # S4 method for CentWavePredIsoParam snthreshIsoROIs(object) # S4 method for CentWavePredIsoParam snthreshIsoROIs(object) <- value # S4 method for CentWavePredIsoParam maxCharge(object) # S4 method for CentWavePredIsoParam maxCharge(object) <- value # S4 method for CentWavePredIsoParam maxIso(object) # S4 method for CentWavePredIsoParam maxIso(object) <- value # S4 method for CentWavePredIsoParam mzIntervalExtension(object) # S4 method for CentWavePredIsoParam mzIntervalExtension(object) <- value # S4 method for CentWavePredIsoParam polarity(object) # S4 method for CentWavePredIsoParam polarity(object) <- value"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"ppm numeric(1) defining maximal tolerated m/z deviation consecutive scans parts per million (ppm) initial ROI definition. peakwidth numeric(2) expected approximate peak width chromatographic space. Given range (min, max) seconds. snthresh numeric(1) defining signal noise ratio cutoff. prefilter numeric(2): c(k, ) specifying prefilter step first analysis step (ROI detection). Mass traces retained contain least k peaks intensity >= . mzCenterFun Name function calculate m/z center chromatographic peak. Allowed : \"wMean\": intensity weighted mean peak's m/z values, \"mean\": mean peak's m/z values, \"apex\": use m/z value peak apex, \"wMeanApex3\": intensity weighted mean m/z value peak apex m/z values left right \"meanApex3\": mean m/z value peak apex m/z values left right . integrate Integration method. integrate = 1 peak limits found descent mexican hat filtered data, integrate = 2 descent done real data. latter method accurate prone noise, former robust, less exact. mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. fitgauss logical(1) whether Gaussian fitted peak. affects mostly retention time position peak. noise numeric(1) allowing set minimum intensity required centroids considered first analysis step (centroids intensity < noise omitted ROI detection). verboseColumns logical(1) whether additional peak meta data columns returned. roiList optional list regions--interest (ROI) representing detected mass traces. ROIs submitted first analysis step omitted chromatographic peak detection performed submitted ROIs. ROI expected following elements specified: scmin (start scan index), scmax (end scan index), mzmin (minimum m/z), mzmax (maximum m/z), length (number scans), intensity (summed intensity). ROI represented list elements single row data.frame. firstBaselineCheck logical(1). TRUE continuous data within regions interest checked first baseline. detail, first rough estimate noise calculated peak detection performed regions multiple sequential signals higher first estimated baseline/noise level. roiScales Optional numeric vector length equal roiList defining scale region interest roiList used centWave-wavelets. extendLengthMSW Option force centWave use scales running centWave rather truncating EIC length. Uses \"open\" method extend EIC integer base-2 length prior passed convolve rather default \"reflect\" method. See https://github.com/sneumann/xcms/issues/445 information. verboseBetaColumns Option calculate two additional metrics peak quality via comparison idealized bell curve. Adds beta_cor beta_snr chromPeaks output, corresponding Pearson correlation coefficient bell curve several degrees skew well estimate signal--noise using residuals best-fitting bell curve. See https://github.com/sneumann/xcms/pull/685 https://doi.org/10.1186/s12859-023-05533-4 information. snthreshIsoROIs numeric(1) defining signal noise ratio cutoff used second centWave run identify peaks predicted isotope ROIs. maxCharge integer(1) defining maximal isotope charge. Isotopes defined charges 1:maxCharge. maxIso integer(1) defining number isotope peaks predicted peak identified first centWave run. mzIntervalExtension logical(1) whether mz range predicted isotope ROIs extended increase detection low intensity peaks. polarity character(1) specifying polarity data. Currently used, \"positive\", \"negative\" \"unknown\" provided. object findChromPeaks: OnDiskMSnExp object containing MS- experiment-relevant data. methods: parameter object. param CentWavePredIsoParam object settings chromatographic peak detection algorithm. BPPARAM parameter class specifying parallel processing performed. defaults bpparam. See documentation BiocParallel details. parallel processing enabled, peak detection performed parallel several input samples. return.type Character specifying type object method return. Can either \"XCMSnExp\" (default), \"list\" \"xcmsSet\". msLevel integer(1) defining MS level peak detection performed. Defaults msLevel = 1. ... ignored. value value slot.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"CentWavePredIsoParam function returns CentWavePredIsoParam class instance settings specified two-step centWave-based peak detection considering also isotopes. findChromPeaks: return.type = \"XCMSnExp\" XCMSnExp object results peak detection. return.type = \"list\" list length equal number samples matrices specifying identified peaks. return.type = \"xcmsSet\" xcmsSet object results peak detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"See centWave details centWave method. Parallel processing (one process per sample) supported can configured either BPPARAM parameter globally defining parallel processing mode using register method BiocParallel package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"ppm,peakwidth,snthresh,prefilter,mzCenterFun,integrate,mzdiff,fitgauss,noise,verboseColumns,roiList,firstBaselineCheck,roiScales,extendLengthMSW,verboseBetaColumns,snthreshIsoROIs,maxCharge,maxIso,mzIntervalExtension,polarity See corresponding parameter .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"methods classes part updated modernized xcms user interface eventually replace findPeaks methods. supports chromatographic peak detection OnDiskMSnExp objects (defined MSnbase package). settings algorithm can passed CentWavePredIsoParam object.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"Hendrik Treutler, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-centWaveWithPredIsoROIs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Two-step centWave peak detection considering also isotopes — findChromPeaks-centWaveWithPredIsoROIs","text":"","code":"## Create a param object p <- CentWavePredIsoParam(maxCharge = 4) ## Change snthresh parameter snthresh(p) <- 25 p #> Object of class: CentWavePredIsoParam #> Parameters: #> - snthreshIsoROIs: [1] 6.25 #> - maxCharge: [1] 4 #> - maxIso: [1] 5 #> - mzIntervalExtension: [1] TRUE #> - polarity: [1] \"unknown\" #> - ppm: [1] 25 #> - peakwidth: [1] 20 50 #> - snthresh: [1] 25 #> - prefilter: [1] 3 100 #> - mzCenterFun: [1] \"wMean\" #> - integrate: [1] 1 #> - mzdiff: [1] -0.001 #> - fitgauss: [1] FALSE #> - noise: [1] 0 #> - verboseColumns: [1] FALSE #> - roiList: list() #> - firstBaselineCheck: [1] TRUE #> - roiScales: numeric(0) #> - extendLengthMSW: [1] FALSE #> - verboseBetaColumns: [1] FALSE"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":null,"dir":"Reference","previous_headings":"","what":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"Massifquant Kalman filter (KF)-based chromatographic peak detection XC-MS data centroid mode. identified peaks can refined centWave method (see findChromPeaks-centWave details centWave) specifying withWave = TRUE. MassifquantParam class allows specify settings chromatographic peak detection using massifquant method eventually combination centWave algorithm. Instances created MassifquantParam constructor. findChromPeaks,OnDiskMSnExp,MassifquantParam method performs chromatographic peak detection using massifquant algorithm samples OnDiskMSnExp object. OnDiskMSnExp objects encapsule experiment specific data load spectra data (mz intensity values) fly original files applying also eventual data manipulations. ppm,ppm<-: getter setter ppm slot object. peakwidth,peakwidth<-: getter setter peakwidth slot object. snthresh,snthresh<-: getter setter snthresh slot object. prefilter,prefilter<-: getter setter prefilter slot object. mzCenterFun,mzCenterFun<-: getter setter mzCenterFun slot object. integrate,integrate<-: getter setter integrate slot object. mzdiff,mzdiff<-: getter setter mzdiff slot object. fitgauss,fitgauss<-: getter setter fitgauss slot object. noise,noise<-: getter setter noise slot object. verboseColumns,verboseColumns<-: getter setter verboseColumns slot object. criticalValue,criticalValue<-: getter setter criticalValue slot object. consecMissedLimit,consecMissedLimit<-: getter setter consecMissedLimit slot object. unions,unions<-: getter setter unions slot object. checkBack,checkBack<-: getter setter checkBack slot object. withWave,withWave<-: getter setter withWave slot object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"","code":"MassifquantParam( ppm = 25, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), mzCenterFun = \"wMean\", integrate = 1L, mzdiff = -0.001, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, criticalValue = 1.125, consecMissedLimit = 2, unions = 1, checkBack = 0, withWave = FALSE ) # S4 method for OnDiskMSnExp,MassifquantParam findChromPeaks( object, param, BPPARAM = bpparam(), return.type = \"XCMSnExp\", msLevel = 1L, ... ) # S4 method for MassifquantParam ppm(object) # S4 method for MassifquantParam ppm(object) <- value # S4 method for MassifquantParam peakwidth(object) # S4 method for MassifquantParam peakwidth(object) <- value # S4 method for MassifquantParam snthresh(object) # S4 method for MassifquantParam snthresh(object) <- value # S4 method for MassifquantParam prefilter(object) # S4 method for MassifquantParam prefilter(object) <- value # S4 method for MassifquantParam mzCenterFun(object) # S4 method for MassifquantParam mzCenterFun(object) <- value # S4 method for MassifquantParam integrate(f) # S4 method for MassifquantParam integrate(object) <- value # S4 method for MassifquantParam mzdiff(object) # S4 method for MassifquantParam mzdiff(object) <- value # S4 method for MassifquantParam fitgauss(object) # S4 method for MassifquantParam fitgauss(object) <- value # S4 method for MassifquantParam noise(object) # S4 method for MassifquantParam noise(object) <- value # S4 method for MassifquantParam verboseColumns(object) # S4 method for MassifquantParam verboseColumns(object) <- value # S4 method for MassifquantParam criticalValue(object) # S4 method for MassifquantParam criticalValue(object) <- value # S4 method for MassifquantParam consecMissedLimit(object) # S4 method for MassifquantParam consecMissedLimit(object) <- value # S4 method for MassifquantParam unions(object) # S4 method for MassifquantParam unions(object) <- value # S4 method for MassifquantParam checkBack(object) # S4 method for MassifquantParam checkBack(object) <- value # S4 method for MassifquantParam withWave(object) # S4 method for MassifquantParam withWave(object) <- value"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"ppm numeric(1) defining maximal tolerated m/z deviation consecutive scans parts per million (ppm) initial ROI definition. peakwidth numeric(2). first element used massifquant, specifices minimum peak length time scans. withWave = TRUE second argument represents maximum peak length subject greater mininum peak length (see also documentation do_findChromPeaks_centWave). snthresh numeric(1) defining signal noise ratio cutoff. prefilter numeric(2). first argument used (withWave = TRUE); see findChromPeaks-centWave details. second argument specifies minimum threshold maximum intensity chromatographic peak must met. mzCenterFun Name function calculate m/z center chromatographic peak. Allowed : \"wMean\": intensity weighted mean peak's m/z values, \"mean\": mean peak's m/z values, \"apex\": use m/z value peak apex, \"wMeanApex3\": intensity weighted mean m/z value peak apex m/z values left right \"meanApex3\": mean m/z value peak apex m/z values left right . integrate Integration method. integrate = 1 peak limits found descent mexican hat filtered data, integrate = 2 descent done real data. latter method accurate prone noise, former robust, less exact. mzdiff numeric(1) representing minimum difference m/z dimension required peaks overlapping retention times; can negative allow overlap. peak post-processing, peaks defined overlapping reduced one peak largest signal. fitgauss logical(1) whether Gaussian fitted peak. affects mostly retention time position peak. noise numeric(1) allowing set minimum intensity required centroids considered first analysis step (centroids intensity < noise omitted ROI detection). verboseColumns logical(1) whether additional peak meta data columns returned. criticalValue numeric(1). Suggested values: (0.1-3.0). setting helps determine Kalman Filter prediciton margin error. real centroid belonging bonafide peak must fall within KF prediction margin error. Much like construction confidence interval, criticalVal loosely translates multiplier standard error prediction reported Kalman Filter. peak XC-MS sample small mass deviance ppm error, smaller critical value might better vice versa. consecMissedLimit integer(1) Suggested values: (1,2,3). peak proces detected Kalman Filter, Kalman Filter may find predicted centroid every scan. 1 consecutive failed predictions, setting informs Massifquant stop Kalman Filter following candidate peak. unions integer(1) set 1 apply t-test union segmentation; set 0 t-test applied chromatographically continous peaks sharing m/z range. Explanation: data points, sometimes Kalman Filter stops tracking peak prematurely. Another Kalman Filter instantiated begins following rest signal. tracking done backwards forwards, algorithmic defect leaves real peak divided two segments . option turned , program identifies segmented peaks combines (merges ) one two sample t-test. potential danger option truly distinct peaks may merged. checkBack integer(1) set 1 turned ; set 0 turned . convergence Kalman Filter peak's precise m/z mapping fast, sometimes incorporates erroneous centroids part peak (especially early ). scanBack option attempt remove occasional outlier lies beyond converged bounds Kalman Filter. option directly affect identification peak postprocessing measure; shown extremely useful thus far default set turned . withWave logical(1) TRUE, peaks identified first Massifquant subsequently filtered second step centWave algorithm, includes wavelet estimation. object findChromPeaks: OnDiskMSnExp object containing MS- experiment-relevant data. methods: parameter object. param MassifquantParam object containing settings massifquant algorithm. BPPARAM parameter class specifying parallel processing performed. defaults bpparam. See documentation BiocParallel details. parallel processing enabled, peak detection performed parallel several input samples. return.type Character specifying type object method return. Can either \"XCMSnExp\" (default), \"list\" \"xcmsSet\". msLevel integer(1) defining MS level peak detection performed. Defaults msLevel = 1. ... ignored. value value slot. f integrate: MassifquantParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"MassifquantParam function returns MassifquantParam class instance settings specified chromatographic peak detection massifquant method. findChromPeaks: return.type = \"XCMSnExp\" XCMSnExp object results peak detection. return.type = \"list\" list length equal number samples matrices specifying identified peaks. return.type = \"xcmsSet\" xcmsSet object results peak detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"algorithm's performance tested rigorously high resolution LC/(OrbiTrap, TOF)-MS data centroid mode. Simultaneous kalman filters identify chromatographic peaks calculate area curve. default parameters set operate complex LC-MS Orbitrap sample. Users find useful simple exploratory data analysis find set minimum intensity, identify many scans average peak spans. consecMissedLimit parameter yielded good performance Orbitrap data set (2) TOF data found best (1). may change algorithm yet tested many samples. criticalValue parameter perhaps dificult dial appropriately visual inspection peak identification best suggested tool quick optimization. ppm checkBack parameters shown less influence parameters exist give users flexibility better accuracy. Parallel processing (one process per sample) supported can configured either BPPARAM parameter globally defining parallel processing mode using register method BiocParallel package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"ppm,peakwidth,snthresh,prefilter,mzCenterFun,integrate,mzdiff,fitgauss,noise,verboseColumns,criticalValue,consecMissedLimit,unions,checkBack,withWave See corresponding parameter . Slots values exclusively accessed via corresponding getter setter methods listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"methods classes part updated modernized xcms user interface eventually replace findPeaks methods. supports chromatographic peak detection OnDiskMSnExp objects (defined MSnbase package). settings massifquant centWave algorithm can passed MassifquantParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"Conley CJ, Smith R, Torgrip RJ, Taylor RM, Tautenhahn R Prince JT \"Massifquant: open-source Kalman filter-based XC-MS isotope trace feature detection\" Bioinformatics 2014, 30(18):2636-43.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"Christopher Conley, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-massifquant.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Chromatographic peak detection using the massifquant method — findChromPeaks-massifquant","text":"","code":"## Create a MassifquantParam object. mqp <- MassifquantParam() ## Change snthresh prefilter parameters snthresh(mqp) <- 30 prefilter(mqp) <- c(6, 10000) mqp #> Object of class: MassifquantParam #> Parameters: #> - ppm: [1] 25 #> - peakwidth: [1] 20 50 #> - snthresh: [1] 30 #> - prefilter: [1] 6 10000 #> - mzCenterFun: [1] \"wMean\" #> - integrate: [1] 1 #> - mzdiff: [1] -0.001 #> - fitgauss: [1] FALSE #> - noise: [1] 0 #> - verboseColumns: [1] FALSE #> - criticalValue: [1] 1.125 #> - consecMissedLimit: [1] 2 #> - unions: [1] 1 #> - checkBack: [1] 0 #> - withWave: [1] FALSE ## Perform the peak detection using massifquant on the files from the ## faahKO package. Files are read using the readMSData from the MSnbase ## package library(faahKO) library(MSnbase) fls <- dir(system.file(\"cdf/KO\", package = \"faahKO\"), recursive = TRUE, full.names = TRUE) raw_data <- readMSData(fls[1], mode = \"onDisk\") #> Polarity can not be extracted from netCDF files, please set manually the polarity with the 'polarity' method. ## Perform the peak detection using the settings defined above. res <- findChromPeaks(raw_data, param = mqp) #> #> Massifquant, Copyright (C) 2013 Brigham Young University. #> Massifquant comes with ABSOLUTELY NO WARRANTY. See LICENSE for details. #> #> Detecting mass traces at 25ppm ... #> OK #> 334 Peaks. head(chromPeaks(res)) #> mz mzmin mzmax rtmin rtmax rt into maxo sample #> CP001 578.4 578.4 578.4 4103.890 4141.449 4119.540 1748295 187328 1 #> CP002 577.3 577.3 577.3 4100.760 4130.495 4114.845 3854210 457024 1 #> CP003 367.2 367.2 367.2 4099.196 4164.924 4122.670 140753 11330 1 #> CP004 459.1 459.1 459.1 4099.196 4128.930 4113.280 144739 15874 1 #> CP005 401.2 401.2 401.2 4083.546 4221.262 4147.709 472407 11783 1 #> CP006 412.3 412.3 412.3 4072.591 4111.715 4089.806 2192350 183936 1"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"matchedFilter algorithm identifies peaks chromatographic time domain described [Smith 2006]. intensity values binned cutting LC/MS data slices (bins) mass unit (binSize m/z) wide. Within bin maximal intensity selected. chromatographic peak detection performed bin extending based steps parameter generate slices comprising bins current_bin - steps +1 current_bin + steps - 1. slices filtered matched filtration using second-derative Gaussian model peak shape. filtration peaks detected using signal--ratio cut-. details illustrations see [Smith 2006]. MatchedFilterParam class allows specify settings chromatographic peak detection using matchedFilter method. Instances created MatchedFilterParam constructor. findChromPeaks,OnDiskMSnExp,MatchedFilterParam method performs peak detection using matchedFilter algorithm samples OnDiskMSnExp object. OnDiskMSnExp objects encapsule experiment specific data load spectra data (mz intensity values) fly original files applying also eventual data manipulations. binSize,binSize<-: getter setter binSize slot object. impute,impute<-: getter setter impute slot object. baseValue,baseValue<-: getter setter baseValue slot object. distance,distance<-: getter setter distance slot object. fwhm,fwhm<-: getter setter fwhm slot object. sigma,sigma<-: getter setter sigma slot object. max,max<-: getter setter max slot object. snthresh,snthresh<-: getter setter snthresh slot object. steps,steps<-: getter setter steps slot object. mzdiff,mzdiff<-: getter setter mzdiff slot object. index,index<-: getter setter index slot object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"","code":"MatchedFilterParam( binSize = 0.1, impute = \"none\", baseValue = numeric(), distance = numeric(), fwhm = 30, sigma = fwhm/2.3548, max = 5, snthresh = 10, steps = 2, mzdiff = 0.8 - binSize * steps, index = FALSE ) # S4 method for OnDiskMSnExp,MatchedFilterParam findChromPeaks( object, param, BPPARAM = bpparam(), return.type = \"XCMSnExp\", msLevel = 1L, ... ) # S4 method for MatchedFilterParam binSize(object) # S4 method for MatchedFilterParam binSize(object) <- value # S4 method for MatchedFilterParam impute(object) # S4 method for MatchedFilterParam impute(object) <- value # S4 method for MatchedFilterParam baseValue(object) # S4 method for MatchedFilterParam baseValue(object) <- value # S4 method for MatchedFilterParam distance(object) # S4 method for MatchedFilterParam distance(object) <- value # S4 method for MatchedFilterParam fwhm(object) # S4 method for MatchedFilterParam fwhm(object) <- value # S4 method for MatchedFilterParam sigma(object) # S4 method for MatchedFilterParam sigma(object) <- value # S4 method for MatchedFilterParam max(x) # S4 method for MatchedFilterParam max(object) <- value # S4 method for MatchedFilterParam snthresh(object) # S4 method for MatchedFilterParam snthresh(object) <- value # S4 method for MatchedFilterParam steps(object) # S4 method for MatchedFilterParam steps(object) <- value # S4 method for MatchedFilterParam mzdiff(object) # S4 method for MatchedFilterParam mzdiff(object) <- value # S4 method for MatchedFilterParam index(object) # S4 method for MatchedFilterParam index(object) <- value"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"binSize numeric(1) specifying width bins/slices m/z dimension. impute Character string specifying method used missing value imputation. Allowed values \"none\" (linear interpolation), \"lin\" (linear interpolation), \"linbase\" (linear interpolation within certain bin-neighborhood) \"intlin\". See imputeLinInterpol details. baseValue base value empty elements set. considered method = \"linbase\" corresponds profBinLinBase's baselevel argument. distance method = \"linbase\": number non-empty neighboring element empty element considered linear interpolation. See details section information. fwhm numeric(1) specifying full width half maximum matched filtration gaussian model peak. used calculate actual sigma, see . sigma numeric(1) specifying standard deviation (width) matched filtration model peak. max numeric(1) representing maximum number peaks expected/identified per slice. snthresh numeric(1) defining signal noise cutoff used chromatographic peak detection step. steps numeric(1) defining number bins merged filtration (.e. number neighboring bins joined slice filtration peak detection performed). mzdiff numeric(1) defining minimum difference m/z peaks overlapping retention times index logical(1) specifying whether indicies returned instead values m/z retention times. object findChromPeaks: OnDiskMSnExp object containing MS- experiment-relevant data. methods: parameter object. param MatchedFilterParam object containing settings matchedFilter algorithm. BPPARAM parameter class specifying parallel processing performed. defaults bpparam. See documentation BiocParallel details. parallel processing enabled, peak detection performed parallel several input samples. return.type Character specifying type object method return. Can either \"XCMSnExp\" (default), \"list\" \"xcmsSet\". msLevel integer(1) defining MS level peak detection performed. Defaults msLevel = 1. ... ignored. value value slot. x max: MatchedFilterParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"MatchedFilterParam function returns MatchedFilterParam class instance settings specified chromatographic detection matchedFilter method. findChromPeaks: return.type = \"XCMSnExp\" XCMSnExp object results peak detection. return.type = \"list\" list length equal number samples matrices specifying identified peaks. return.type = \"xcmsSet\" xcmsSet object results peak detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"intensities binned provided m/z values within spectrum (scan). Binning performed bins centered around m/z values (.e. first bin includes m/z values min(mz) - bin_size/2 min(mz) + bin_size/2). details binning missing value imputation see binYonX imputeLinInterpol methods. Parallel processing (one process per sample) supported can configured either BPPARAM parameter globally defining parallel processing mode using register method BiocParallel package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"binSize,impute,baseValue,distance,fwhm,sigma,max,snthresh,steps,mzdiff,index See corresponding parameter . Slots values exclusively accessed via corresponding getter setter methods listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"methods classes part updated modernized xcms user interface eventually replace findPeaks methods. supports chromatographic peak detection OnDiskMSnExp objects (defined MSnbase package). settings matchedFilter algorithm can passed MatchedFilterParam object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"Colin . Smith, Elizabeth J. Want, Grace O'Maille, Ruben Abagyan Gary Siuzdak. \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 2006, 78:779-787.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"Colin Smith, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks-matchedFilter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Peak detection in the chromatographic time domain — findChromPeaks-matchedFilter","text":"","code":"## Create a MatchedFilterParam object. Note that we use a unnecessarily large ## binSize parameter to reduce the run-time of the example. mfp <- MatchedFilterParam(binSize = 5) ## Change snthresh parameter snthresh(mfp) <- 15 mfp #> Object of class: MatchedFilterParam #> Parameters: #> - binSize: [1] 5 #> - impute: [1] \"none\" #> - baseValue: numeric(0) #> - distance: numeric(0) #> - fwhm: [1] 30 #> - sigma: [1] 12.73994 #> - max: [1] 5 #> - snthresh: [1] 15 #> - steps: [1] 2 #> - mzdiff: [1] -9.2 #> - index: [1] FALSE ## Perform the peak detection using matchecFilter on the files from the ## faahKO package. Files are read using the readMSData from the MSnbase ## package library(faahKO) library(MSnbase) fls <- dir(system.file(\"cdf/KO\", package = \"faahKO\"), recursive = TRUE, full.names = TRUE) raw_data <- readMSData(fls[1], mode = \"onDisk\") #> Polarity can not be extracted from netCDF files, please set manually the polarity with the 'polarity' method. ## Perform the chromatographic peak detection using the settings defined ## above. Note that we are also disabling parallel processing in this ## example by registering a \"SerialParam\" res <- findChromPeaks(raw_data, param = mfp) head(chromPeaks(res)) #> mz mzmin mzmax rt rtmin rtmax into intf maxo #> CP001 205.0000 205.0 205.0 2784.635 2770.550 2800.284 1778568.9 3580020 84280 #> CP002 205.0000 205.0 205.0 2784.635 2770.550 2800.284 1778568.9 3577971 84280 #> CP003 241.1460 241.1 241.2 3662.574 3646.924 3682.918 1465988.7 2234510 49728 #> CP004 241.1460 241.1 241.2 3662.574 3646.924 3682.918 1465988.7 2234510 49728 #> CP005 244.1000 244.1 244.1 2828.453 2814.369 2842.538 598990.3 1145078 31312 #> CP006 249.1591 249.1 249.2 3659.444 3643.794 3678.223 1435000.7 2367467 49040 #> maxf i sn sample #> CP001 194233.12 1 63.28090 1 #> CP002 194213.46 1 66.00099 1 #> CP003 96022.23 1 25.42409 1 #> CP004 96022.23 1 25.42643 1 #> CP005 64181.64 2 16.99513 1 #> CP006 104291.09 1 36.83500 1"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Chromatographic Peak Detection — findChromPeaks","title":"Chromatographic Peak Detection — findChromPeaks","text":"findChromPeaks method performs chromatographic peak detection LC/GC-MS data. peak detection algorithm can selected, configured, using param argument. Supported param objects : CentWaveParam(): chromatographic peak detection using centWave algorithm. CentWavePredIsoParam(): centWave predicted isotopes. Peak detection uses two-step centWave-based approach considering also feature isotopes. MatchedFilterParam(): peak detection using matched filter algorithm. MassifquantParam(): peak detection using Kalman filter-based massifquant method. MSWParam(): single-spectrum non-chromatography MS data peak detection. specific examples see help pages individual parameter classes listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Chromatographic Peak Detection — findChromPeaks","text":"","code":"findChromPeaks(object, param, ...) # S4 method for MsExperiment,Param findChromPeaks( object, param, msLevel = 1L, chunkSize = 2L, ..., BPPARAM = bpparam() ) # S4 method for XcmsExperiment,Param findChromPeaks( object, param, msLevel = 1L, chunkSize = 2L, add = FALSE, ..., BPPARAM = bpparam() )"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Chromatographic Peak Detection — findChromPeaks","text":"object data object perform peak detection. Can OnDiskMSnExp(), XCMSnExp(), MChromatograms() MsExperiment() object. param parameter object selecting configuring algorithm. ... Optional parameters. msLevel integer(1) defining MS level chromatographic peak detection performed. chunkSize integer(1) object MsExperiment XcmsExperiment(): defines number files (samples) full peaks data (m/z intensity values) loaded memory time. Peak detection performed parallel (per sample) subset loaded data. setting thus allows balance memory demand speed (due parallel processing) peak detection. parallel processing can performed subset data loaded currently memory (iteration), value chunkSize match defined parallel setting setup. Using parallel processing setup using 4 CPUs (separate processes) using chunkSize = 1will perform parallel processing, data one sample loaded memory time. hand, settingchunkSizeto total number samples experiment load full MS data memory thus settings cause --memory error. settingchunkSize = -1the peak detection performed separately, parallel, sample. however work allSpectra` backends (see eventually Spectra() details). BPPARAM Parallel processing setup. Uses default system-wide default setup. See bpparam() details. add logical(1) (object contains already chromatographic peaks, .e. either XCMSnExp XcmsExperiment) whether chromatographic peak detection results added existing results. default (add = FALSE) additional findChromPeaks call result object remove previous results.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Chromatographic Peak Detection — findChromPeaks","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaksIsolationWindow.html","id":null,"dir":"Reference","previous_headings":"","what":"Data independent acquisition (DIA): peak detection in isolation windows — findChromPeaksIsolationWindow","title":"Data independent acquisition (DIA): peak detection in isolation windows — findChromPeaksIsolationWindow","text":"findChromPeaksIsolationWindow function allows perform chromatographic peak detection MS level > 1 spectra certain isolation windows (e.g. SWATH pockets). function performs peak detection, separately spectra belonging isolation window adds chromPeaks() matrix result object. Information isolation window detected added chromPeakData() data frame. Note peak detection method remove previously identified chromatographic peaks (e.g. MS1 level using findChromPeaks() function adds newly identified peaks existing chromPeaks() matrix. Isolation windows can defined isolationWindow parameter, default uses definition isolationWindowTargetMz(), .e. chromatographic peak detection performed spectra isolation window target m/z (seprarately file). parameter param allows define configure peak detection algorithm (see findChromPeaks() information).","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaksIsolationWindow.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Data independent acquisition (DIA): peak detection in isolation windows — findChromPeaksIsolationWindow","text":"","code":"findChromPeaksIsolationWindow(object, ...) # S4 method for MsExperiment findChromPeaksIsolationWindow( object, param, msLevel = 2L, isolationWindow = isolationWindowTargetMz(spectra(object)), chunkSize = 2L, ..., BPPARAM = bpparam() ) # S4 method for OnDiskMSnExp findChromPeaksIsolationWindow( object, param, msLevel = 2L, isolationWindow = isolationWindowTargetMz(object), ... )"},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaksIsolationWindow.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Data independent acquisition (DIA): peak detection in isolation windows — findChromPeaksIsolationWindow","text":"object MsExperiment, XcmsExperiment, OnDiskMSnExp XCMSnExp object DIA data. ... currently used. param Peak detection parameter object, CentWaveParam object defining configuring chromographic peak detection algorithm. See also findChromPeaks() details. msLevel integer(1) specifying MS level peak detection performed. default msLevel = 2L. isolationWindow factor similar defining isolation windows peak detection performed length equal number spectra object. chunkSize object MsExperiment XcmsExperiment: integer(1) defining number files (samples) loaded memory processed time. See findChromPeaks() information. BPPARAM object MsExperiment XcmsExperiment: parallel processing setup. See bpparam() information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaksIsolationWindow.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Data independent acquisition (DIA): peak detection in isolation windows — findChromPeaksIsolationWindow","text":"XcmsExperiment XCMSnExp object chromatographic peaks identified spectra isolation window file added chromPeaks matrix. Isolation window definition identified peak stored additional columns chromPeakData().","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findChromPeaksIsolationWindow.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Data independent acquisition (DIA): peak detection in isolation windows — findChromPeaksIsolationWindow","text":"Johannes Rainer, Michael Witting","code":""},{"path":"https://sneumann.github.io/xcms/reference/findEqualGreater.html","id":null,"dir":"Reference","previous_headings":"","what":"Find values in sorted vectors — findEqualGreater","title":"Find values in sorted vectors — findEqualGreater","text":"Find values sorted vectors.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findEqualGreater.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find values in sorted vectors — findEqualGreater","text":"","code":"findEqualGreater(x, value) findEqualLess(x, value) findEqualGreaterM(x, values) findRange(x, values, NAOK = FALSE)"},{"path":"https://sneumann.github.io/xcms/reference/findEqualGreater.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find values in sorted vectors — findEqualGreater","text":"x numeric vector sorted increasing order value value find x values numeric values find x NAOK check NA values x","code":""},{"path":"https://sneumann.github.io/xcms/reference/findEqualGreater.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find values in sorted vectors — findEqualGreater","text":"findEqualGreater finds index first value x equal greater value. findEqualLess except finds equal less. findEqualGreaterM creates index vector finding specified values. findRange locates start stop indicides range two x values. things save time point findeEqualGreaterM (length values approaches lenght x) findRange (NAOK set TRUE). run log(N) N time, respectively.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findEqualGreater.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find values in sorted vectors — findEqualGreater","text":"integer vector position(s) values(s).","code":""},{"path":"https://sneumann.github.io/xcms/reference/findEqualGreater.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find values in sorted vectors — findEqualGreater","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":null,"dir":"Reference","previous_headings":"","what":"Find fragment ions in xcmsFragment objects — findMZ","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"method find fragment mass ppm window xcmsFragment object","code":""},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"","code":"findMZ(object, find, ppmE=25, print=TRUE)"},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"object xcmsFragment object type find fragment ion found ppmE ppm error window searching print print nice little report","code":""},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"method simply searches given fragment ion xcmsFragment object type given certain ppm error window","code":""},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"data frame following columns: PrecursorMz precursor m/z fragment MSnParentPeakID index ID location precursor peak xcmsFragment object msLevel level found fragment ion rt Retention time found ion mz actual m/z found fragment ion intensity intensity fragment ion sample sample fragment ion came GroupPeakMSn ID peaks grouped xcmsSet grouping CollisionEnergy collision energy precursor scan","code":""},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"H. Paul Benton, D.M. Wong, S..Strauger, G. Siuzdak \"XC\\(MS^2\\)\" Analytical Chemistry 2008","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"H. Paul Benton, hpaul.beonton08@imperial.ac.uk","code":""},{"path":"https://sneumann.github.io/xcms/reference/findMZ.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find fragment ions in xcmsFragment objects — findMZ","text":"","code":"if (FALSE) { library(msdata) mzMLpath <- system.file(\"iontrap\", package = \"msdata\") mzMLfiles<-list.files(mzMLpath, pattern = \"extracted.mzML\", recursive = TRUE, full.names = TRUE) xs <- xcmsSet(mzMLfiles, method = \"MS1\") ##takes only one file from the file set xfrag <- xcmsFragments(xs) found<-findMZ(xfrag, 657.3433, 50) }"},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":null,"dir":"Reference","previous_headings":"","what":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"Perform peak detection mass spectrometry direct injection spectrum using wavelet based algorithm. MSWParam class allows specify settings peak detection using MSW method. Instances created MSWParam constructor. findChromPeaks,OnDiskMSnExp,MSWParam method performs peak detection single-spectrum non-chromatography MS data using functionality MassSpecWavelet package samples OnDiskMSnExp object. OnDiskMSnExp objects encapsule experiment specific data load spectra data (mz intensity values) fly original files applying also eventual data manipulations. snthresh,snthresh<-: getter setter snthresh slot object. verboseColumns,verboseColumns<-: getter setter verboseColumns slot object. scales,scales<-: getter setter scales slot object. nearbyPeak,nearbyPeak<-: getter setter nearbyPeak slot object. peakScaleRange,peakScaleRange<-: getter setter peakScaleRange slot object. ampTh,ampTh<-: getter setter ampTh slot object. minNoiseLevel,minNoiseLevel<-: getter setter minNoiseLevel slot object. ridgeLength,ridgeLength<-: getter setter ridgeLength slot object. peakThr,peakThr<-: getter setter peakThr slot object. tuneIn,tuneIn<-: getter setter tuneIn slot object. addParams,addParams<-: getter setter addParams slot object. slot stores optional additional parameters passed identifyMajorPeaks peakDetectionCWT functions MassSpecWavelet package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"","code":"MSWParam( snthresh = 3, verboseColumns = FALSE, scales = c(1, seq(2, 30, 2), seq(32, 64, 4)), nearbyPeak = TRUE, peakScaleRange = 5, ampTh = 0.01, minNoiseLevel = ampTh/snthresh, ridgeLength = 24, peakThr = NULL, tuneIn = FALSE, ... ) # S4 method for OnDiskMSnExp,MSWParam findChromPeaks( object, param, BPPARAM = bpparam(), return.type = \"XCMSnExp\", msLevel = 1L, ... ) # S4 method for MSWParam snthresh(object) # S4 method for MSWParam snthresh(object) <- value # S4 method for MSWParam verboseColumns(object) # S4 method for MSWParam verboseColumns(object) <- value # S4 method for MSWParam scales(object) # S4 method for MSWParam scales(object) <- value # S4 method for MSWParam nearbyPeak(object) # S4 method for MSWParam nearbyPeak(object) <- value # S4 method for MSWParam peakScaleRange(object) # S4 method for MSWParam peakScaleRange(object) <- value # S4 method for MSWParam ampTh(object) # S4 method for MSWParam ampTh(object) <- value # S4 method for MSWParam minNoiseLevel(object) # S4 method for MSWParam minNoiseLevel(object) <- value # S4 method for MSWParam ridgeLength(object) # S4 method for MSWParam ridgeLength(object) <- value # S4 method for MSWParam peakThr(object) # S4 method for MSWParam peakThr(object) <- value # S4 method for MSWParam tuneIn(object) # S4 method for MSWParam tuneIn(object) <- value # S4 method for MSWParam addParams(object) # S4 method for MSWParam addParams(object) <- value"},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"snthresh numeric(1) defining signal noise ratio cutoff. verboseColumns logical(1) whether additional peak meta data columns returned. scales Numeric defining scales continuous wavelet transform (CWT). nearbyPeak logical(1) whether include nearby peaks major peaks. peakScaleRange numeric(1) defining scale range peak (larger 5 default). ampTh numeric(1) defining minimum required relative amplitude peak (ratio maximum CWT coefficients). minNoiseLevel numeric(1) defining minimum noise level used computing SNR. ridgeLength numeric(1) defining minimum highest scale peak 2-D CWT coefficient matrix. peakThr numeric(1) minimum absolute intensity (baseline) peaks picked. provided, smoothing Savitzky-Golay filter used (MassSpecWavelet) package estimate local intensity. tuneIn logical(1) whther tune parameter estimation detected peaks. ... Additional parameters passed peakDetectionCWT identifyMajorPeaks functions MassSpecWavelet package. object findChromPeaks: OnDiskMSnExp object containing MS- experiment-relevant data. methods: parameter object. param MSWParam object containing settings algorithm. BPPARAM parameter class specifying parallel processing performed. defaults bpparam. See documentation BiocParallel details. parallel processing enabled, peak detection performed parallel several input samples. return.type Character specifying type object method return. Can either \"XCMSnExp\" (default), \"list\" \"xcmsSet\". msLevel integer(1) defining MS level peak detection performed. Defaults msLevel = 1. value value slot.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"MSWParam function returns MSWParam class instance settings specified peak detection MSW method. findChromPeaks: return.type = \"XCMSnExp\" XCMSnExp object results peak detection. return.type = \"list\" list length equal number samples matrices specifying identified peaks. return.type = \"xcmsSet\" xcmsSet object results detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"wrapper peak picker Bioconductor's MassSpecWavelet package calling peakDetectionCWT tuneInPeakInfo functions. See xcmsDirect vignette information. Parallel processing (one process per sample) supported can configured either BPPARAM parameter globally defining parallel processing mode using register method BiocParallel package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"snthresh,verboseColumns,scales,nearbyPeak,peakScaleRange,ampTh,minNoiseLevel,ridgeLength,peakThr,tuneIn,addParams See corresponding parameter .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"methods classes part updated modernized xcms user interface eventually replace findPeaks methods. supports peak detection OnDiskMSnExp objects (defined MSnbase package). settings algorithm can passed MSWParam object.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"Joachim Kutzera, Steffen Neumann, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-MSW.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Single-spectrum non-chromatography MS data peak detection — findPeaks-MSW","text":"","code":"library(MSnbase) ## Create a MSWParam object mp <- MSWParam() ## Change snthresh parameter snthresh(mp) <- 15 mp #> Object of class: MSWParam #> Parameters: #> - snthresh: [1] 15 #> - verboseColumns: [1] FALSE #> - scales: [1] 1 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 36 40 44 48 52 56 60 64 #> - nearbyPeak: [1] TRUE #> - peakScaleRange: [1] 5 #> - amp.Th: [1] 0.01 #> - minNoiseLevel: [1] 0.003333333 #> - ridgeLength: [1] 24 #> - peakThr: numeric(0) #> - tuneIn: [1] FALSE ## Loading a small subset of direct injection, single spectrum files library(msdata) fticrf <- list.files(system.file(\"fticr-mzML\", package = \"msdata\"), recursive = TRUE, full.names = TRUE) fticr <- readMSData(fticrf[1], msLevel. = 1, mode = \"onDisk\") ## Perform the MSW peak detection on these: p <- MSWParam(scales = c(1, 7), peakThr = 80000, ampTh = 0.005, SNR.method = \"data.mean\", winSize.noise = 500) fticr <- findChromPeaks(fticr, param = p) head(chromPeaks(fticr)) #> mz mzmin mzmax rt rtmin rtmax into maxo sn intf #> CP01 403.2367 403.2279 403.2447 -1 -1 -1 4735258 372259.4 22.975342 NA #> CP02 409.1845 409.1755 409.1936 -1 -1 -1 4158404 310572.1 20.597978 NA #> CP03 413.2677 413.2585 413.2769 -1 -1 -1 6099006 435462.6 27.217229 NA #> CP04 414.2719 414.2652 414.2786 -1 -1 -1 1916658 157613.1 8.777433 NA #> CP05 423.2363 423.2266 423.2459 -1 -1 -1 2708391 174252.7 14.745275 NA #> CP06 427.2681 427.2583 427.2779 -1 -1 -1 6302089 461385.6 32.468892 NA #> maxf sample #> CP01 814693.1 1 #> CP02 731557.2 1 #> CP03 1018994.8 1 #> CP04 280826.9 1 #> CP05 435858.5 1 #> CP06 1124549.4 1"},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Feature detection for GC/MS and LC/MS Data - methods — findPeaks-methods","title":"Feature detection for GC/MS and LC/MS Data - methods — findPeaks-methods","text":"number peak pickers exist XCMS. findPeaks generic method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Feature detection for GC/MS and LC/MS Data - methods — findPeaks-methods","text":"object = \"xcmsRaw\" findPeaks(object, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Feature detection for GC/MS and LC/MS Data - methods — findPeaks-methods","text":"object xcmsRaw-class object method Method use peak detection. See details. ... Optional arguments passed along","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Feature detection for GC/MS and LC/MS Data - methods — findPeaks-methods","text":"Different algorithms can used specifying method argument. example use matched filter approach described Smith et al (2006) one use: findPeaks(object, method=\"matchedFilter\"). also default. arguments given ... passed function implementing method. character vector nicknames algorithms available returned getOption(\"BioC\")$xcms$findPeaks.methods. nickname method called \"centWave\", help page specific method can accessed ?findPeaks.centWave.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Feature detection for GC/MS and LC/MS Data - methods — findPeaks-methods","text":"matrix columns: mz weighted (intensity) mean peak m/z across scans mzmin m/z minimum step mzmax m/z maximum step rt retention time peak midpoint rtmin leading edge peak retention time rtmax trailing edge peak retention time integrated area original (raw) peak maxo maximum intensity original (raw) peak additional columns depending choosen method.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MS1-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","title":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","text":"Collecting Tandem MS MS$^n$ Mass Spectrometry precursor peaks annotated XML raw file","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MS1-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","text":"object = \"xcmsRaw\" findPeaks.MS1(object)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MS1-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","text":"mass spectrometers can acquire MS1 MS2 (MS$^n$ scans) quasi simultaneously, e.g. data dependent tandem MS DDIT mode. Since xcmsFragments attaches MS$^n$ peaks MS1 peaks xcmsSet, important findPeaks xcmsSet miss MS1 precursor peak. sure MS1 precursor peaks xcmsSet, findPeaks.MS1 actual peak picking, simply uses annotation stored mzXML, mzData mzML raw files. relies following XML tags: mzData: \t <\/spectrumInstrument> <\/precursor> <\/spectrum> mzXML: 220.1828003<\/precursorMz> <\/scan> Several mzXML mzData converters known create incomplete files, either without intensities (set 0) without precursor retention time (reasonably close rt chosen. NYI).","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MS1-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","text":"object xcmsRaw object","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MS1-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","text":"matrix columns: mz, mzmin, mzmax annotated MS1 precursor selection mass rt, rtmin, rtmax annotated MS1 precursor retention time , maxo, sn annotated MS1 precursor intensity","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MS1-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Collecting MS1 precursor peaks — findPeaks.MS1-methods","text":"Steffen Neumann, sneumann@ipb-halle.de","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MSW-xcmsRaw-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","title":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","text":"method performs peak detection mass spectrometry direct injection spectrum using wavelet based algorithm.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MSW-xcmsRaw-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","text":"","code":"# S4 method for xcmsRaw findPeaks.MSW(object, snthresh = 3, verbose.columns = FALSE, ...)"},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MSW-xcmsRaw-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","text":"object xcmsRaw object peak detection performed. snthresh numeric(1) defining signal noise ratio cutoff. verbose.columns Logical whether additional peak meta data columns returned. ... Additional parameters passed peakDetectionCWT identifyMajorPeaks functions MassSpecWavelet package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MSW-xcmsRaw-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","text":"matrix, row representing intentified peak, columns: mz m/z value peak centroid position. mzmin Minimum m/z peak. mzmax Maximum m/z peak. rt Always -1. rtmin Always -1. rtmax Always -1. Integrated (original) intensity peak. maxo Maximum intensity peak. intf Always NA. maxf Maximum MSW-filter response peak. sn Signal noise ratio.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MSW-xcmsRaw-method.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","text":"wrapper around peak picker Bioconductor's MassSpecWavelet package calling peakDetectionCWT tuneInPeakInfo functions.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.MSW-xcmsRaw-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Peak detection for single-spectrum non-chromatography MS data — findPeaks.MSW,xcmsRaw-method","text":"Joachim Kutzera, Steffen Neumann, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"Peak density wavelet based feature detection aiming isotope peaks high resolution LC/MS data centroid mode","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"object = \"xcmsRaw\" findPeaks.centWave(object, ppm=25, peakwidth=c(20,50), prefilter=c(3,100), mzCenterFun=\"wMean\", integrate=1, mzdiff=-0.001, fitgauss=FALSE, scanrange= numeric(), noise=0, sleep=0, verbose.columns=FALSE, xcmsPeaks, snthresh=6.25, maxcharge=3, maxiso=5, mzIntervalExtension=TRUE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"algorithm suitable high resolution LC/{TOF,OrbiTrap,FTICR}-MS data centroid mode. first phase method isotope ROIs (regions interest) LC/MS map predicted. second phase mass traces analysed. Continuous wavelet transform (CWT) used locate chromatographic peaks different scales. resulting peak list given peak list (xcmsPeaks) merged redundant peaks removed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"object xcmsSet object ppm maxmial tolerated m/z deviation consecutive scans, ppm (parts per million) peakwidth Chromatographic peak width, given range (min,max) seconds prefilter prefilter=c(k,). Prefilter step first phase. Mass traces retained contain least k peaks intensity >= . mzCenterFun Function calculate m/z center feature: wMean intensity weighted mean feature m/z values, mean mean feature m/z values, apex use m/z value peak apex, wMeanApex3 intensity weighted mean m/z value peak apex m/z value left right , meanApex3 mean m/z value peak apex m/z value left right . integrate Integration method. =1 peak limits found descent mexican hat filtered data, =2 descent done real data. Method 2 accurate prone noise, method 1 robust noise less exact. mzdiff minimum difference m/z peaks overlapping retention times, can negative allow overlap fitgauss logical, TRUE Gaussian fitted peak scanrange scan range process noise optional argument useful data centroided without intensity threshold, centroids intensity < noise omitted ROI detection sleep number seconds pause plotting peak finding cycles verbose.columns logical, TRUE additional peak meta data columns returned xcmsPeaks peak list picked using centWave algorithm parameter verbose.columns set TRUE (columns scmin scmax needed) snthresh signal noise ratio cutoff, definition see . maxcharge max. number isotope charge. maxiso max. number isotope peaks predict detected feature. mzIntervalExtension logical, TRUE predicted isotope ROIs (regions interest) extended m/z dimension increase detection low intensity hence noisy peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"matrix columns: mz weighted (intensity) mean peak m/z across scans mzmin m/z peak minimum mzmax m/z peak maximum rt retention time peak midpoint rtmin leading edge peak retention time rtmax trailing edge peak retention time integrated peak intensity intb baseline corrected integrated peak intensity maxo maximum peak intensity sn Signal/Noise ratio, defined (maxo - baseline)/sd, maxo maximum peak intensity, baseline estimated baseline value sd standard deviation local chromatographic noise. egauss RMSE Gaussian fit verbose.columns TRUE additionally : mu Gaussian parameter mu sigma Gaussian parameter sigma h Gaussian parameter h f Region number m/z ROI peak localised dppm m/z deviation mass trace across scans ppm scale Scale peak localised scpos Peak position found wavelet analysis scmin Left peak limit found wavelet analysis (scan number) scmax Right peak limit found wavelet analysis (scan number)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"Ralf Tautenhahn","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.addPredictedIsotopeFeatures-methods.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Feature detection based on predicted isotope features for high resolution LC/MS data — findPeaks.addPredictedIsotopeFeatures-methods","text":"Ralf Tautenhahn, Christoph Böttcher, Steffen Neumann \"Highly sensitive feature detection high resolution LC/MS\" BMC Bioinformatics 2008, 9:504\\ Hendrik Treutler Steffen Neumann. \"Prediction, detection, validation isotope clusters mass spectrometry data\" Submitted Metabolites 2016, Special Issue \"Bioinformatics Data Analysis\"","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"Peak density wavelet based feature detection high resolution LC/MS data centroid mode","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"object = \"xcmsRaw\" findPeaks.centWave(object, ppm=25, peakwidth=c(20,50), snthresh=10, prefilter=c(3,100), mzCenterFun=\"wMean\", integrate=1, mzdiff=-0.001, fitgauss=FALSE, scanrange= numeric(), noise=0, sleep=0, verbose.columns=FALSE, ROI.list=list()), firstBaselineCheck=TRUE, roiScales=NULL","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"algorithm suitable high resolution LC/{TOF,OrbiTrap,FTICR}-MS data centroid mode. first phase method mass traces (characterised regions less ppm m/z deviation consecutive scans) LC/MS map located. second phase mass traces analysed. Continuous wavelet transform (CWT) used locate chromatographic peaks different scales.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"object xcmsSet object ppm maxmial tolerated m/z deviation consecutive scans, ppm (parts per million) peakwidth Chromatographic peak width, given range (min,max) seconds snthresh signal noise ratio cutoff, definition see . prefilter prefilter=c(k,). Prefilter step first phase. Mass traces retained contain least k peaks intensity >= . mzCenterFun Function calculate m/z center feature: wMean intensity weighted mean feature m/z values, mean mean feature m/z values, apex use m/z value peak apex, wMeanApex3 intensity weighted mean m/z value peak apex m/z value left right , meanApex3 mean m/z value peak apex m/z value left right . integrate Integration method. =1 peak limits found descent mexican hat filtered data, =2 descent done real data. Method 2 accurate prone noise, method 1 robust noise less exact. mzdiff minimum difference m/z peaks overlapping retention times, can negative allow overlap fitgauss logical, TRUE Gaussian fitted peak scanrange scan range process noise optional argument useful data centroided without intensity threshold, centroids intensity < noise omitted ROI detection sleep number seconds pause plotting peak finding cycles verbose.columns logical, TRUE additional peak meta data columns returned ROI.list optional list ROIs represents detected mass traces (ROIs). list empty (default) centWave detects mass trace ROIs, otherwise step skipped supplied ROIs used peak detection phase. ROI object list following slots: scmin start scan index, scmax end scan index, mzmin minimum m/z, mzmax maximum m/z, length number scans, intensity summed intensity. firstBaselineCheck logical, TRUE continuous data within ROI checked 1st baseline roiScales numeric, optional vector scales ROI ROI.list used centWave-wavelets","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"matrix columns: mz weighted (intensity) mean peak m/z across scans mzmin m/z peak minimum mzmax m/z peak maximum rt retention time peak midpoint rtmin leading edge peak retention time rtmax trailing edge peak retention time integrated peak intensity intb baseline corrected integrated peak intensity maxo maximum peak intensity sn Signal/Noise ratio, defined (maxo - baseline)/sd, maxo maximum peak intensity, baseline estimated baseline value sd standard deviation local chromatographic noise. egauss RMSE Gaussian fit verbose.columns TRUE additionally : mu Gaussian parameter mu sigma Gaussian parameter sigma h Gaussian parameter h f Region number m/z ROI peak localised dppm m/z deviation mass trace across scans ppm scale Scale peak localised scpos Peak position found wavelet analysis scmin Left peak limit found wavelet analysis (scan number) scmax Right peak limit found wavelet analysis (scan number)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"Ralf Tautenhahn","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWave-methods.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Feature detection for high resolution LC/MS data — findPeaks.centWave-methods","text":"Ralf Tautenhahn, Christoph Böttcher, Steffen Neumann \"Highly sensitive feature detection high resolution LC/MS\" BMC Bioinformatics 2008, 9:504","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"Peak density wavelet based feature detection high resolution LC/MS data centroid mode additional peak picking isotope features basis isotope peak predictions","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"object = \"xcmsRaw\" findPeaks.centWaveWithPredictedIsotopeROIs(object, ppm=25, peakwidth=c(20,50), snthresh=10, prefilter=c(3,100), mzCenterFun=\"wMean\", integrate=1, mzdiff=-0.001, fitgauss=FALSE, scanrange= numeric(), noise=0, sleep=0, verbose.columns=FALSE, ROI.list=list(), firstBaselineCheck=TRUE, roiScales=NULL, snthreshIsoROIs=6.25, maxcharge=3, maxiso=5, mzIntervalExtension=TRUE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"algorithm suitable high resolution LC/{TOF,OrbiTrap,FTICR}-MS data centroid mode. centWave algorithm applied two peak picking steps follows. first peak picking step ROIs (regions interest, characterised regions less ppm m/z deviation consecutive scans) LC/MS map located analysed using continuous wavelet transform (CWT) localization chromatographic peaks different scales. second peak picking step isotope ROIs LC/MS map predicted analysed using continuous wavelet transform (CWT) localization chromatographic peaks different scales. peak lists resulting peak picking steps merged redundant peaks removed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"object xcmsSet object ppm maxmial tolerated m/z deviation consecutive scans, ppm (parts per million) peakwidth Chromatographic peak width, given range (min,max) seconds snthresh signal noise ratio cutoff, definition see . prefilter prefilter=c(k,). Prefilter step first phase. Mass traces retained contain least k peaks intensity >= . mzCenterFun Function calculate m/z center feature: wMean intensity weighted mean feature m/z values, mean mean feature m/z values, apex use m/z value peak apex, wMeanApex3 intensity weighted mean m/z value peak apex m/z value left right , meanApex3 mean m/z value peak apex m/z value left right . integrate Integration method. =1 peak limits found descent mexican hat filtered data, =2 descent done real data. Method 2 accurate prone noise, method 1 robust noise less exact. mzdiff minimum difference m/z peaks overlapping retention times, can negative allow overlap fitgauss logical, TRUE Gaussian fitted peak scanrange scan range process noise optional argument useful data centroided without intensity threshold, centroids intensity < noise omitted ROI detection sleep number seconds pause plotting peak finding cycles verbose.columns logical, TRUE additional peak meta data columns returned ROI.list optional list ROIs represents detected mass traces (ROIs). list empty (default) centWave detects mass trace ROIs, otherwise step skipped supplied ROIs used peak detection phase. ROI object list following slots: scmin start scan index, scmax end scan index, mzmin minimum m/z, mzmax maximum m/z, length number scans, intensity summed intensity. firstBaselineCheck logical, TRUE continuous data within ROI checked 1st baseline roiScales numeric, optional vector scales ROI ROI.list used centWave-wavelets snthreshIsoROIs signal noise ratio cutoff predicted isotope ROIs, definition see . maxcharge max. number isotope charge. maxiso max. number isotope peaks predict detected feature. mzIntervalExtension logical, TRUE predicted isotope ROIs (regions interest) extended m/z dimension increase detection low intensity hence noisy peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"matrix columns: mz weighted (intensity) mean peak m/z across scans mzmin m/z peak minimum mzmax m/z peak maximum rt retention time peak midpoint rtmin leading edge peak retention time rtmax trailing edge peak retention time integrated peak intensity intb baseline corrected integrated peak intensity maxo maximum peak intensity sn Signal/Noise ratio, defined (maxo - baseline)/sd, maxo maximum peak intensity, baseline estimated baseline value sd standard deviation local chromatographic noise. egauss RMSE Gaussian fit verbose.columns TRUE additionally : mu Gaussian parameter mu sigma Gaussian parameter sigma h Gaussian parameter h f Region number m/z ROI peak localised dppm m/z deviation mass trace across scans ppm scale Scale peak localised scpos Peak position found wavelet analysis scmin Left peak limit found wavelet analysis (scan number) scmax Right peak limit found wavelet analysis (scan number)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"Ralf Tautenhahn","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.centWaveWithPredictedIsotopeROIs-methods.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Feature detection with centWave and additional isotope features — findPeaks.centWaveWithPredictedIsotopeROIs-methods","text":"Ralf Tautenhahn, Christoph Böttcher, Steffen Neumann \"Highly sensitive feature detection high resolution LC/MS\" BMC Bioinformatics 2008, 9:504\\ Hendrik Treutler Steffen Neumann. \"Prediction, detection, validation isotope clusters mass spectrometry data\" Submitted Metabolites 2016, Special Issue \"Bioinformatics Data Analysis\"","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"Massifquant Kalman filter (KF) based feature detection XC-MS data centroid mode (currently experimental stage). Optionally allows calling method \"centWave\" features discovered Massifquant refine feature detection; , supply additional parameters specific centWave (even experimental). method may conveniently called xcmsSet(...) method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"object = \"xcmsRaw\" findPeaks.massifquant(object, ppm=10, peakwidth=c(20,50), snthresh=10, prefilter=c(3,100), mzCenterFun=\"wMean\", integrate=1, mzdiff=-0.001, fitgauss=FALSE, scanrange= numeric(), noise=0, sleep=0, verbose.columns=FALSE, criticalValue = 1.125, consecMissedLimit = 2, unions = 1, checkBack = 0, withWave = 0)","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"algorithm's performance tested rigorously high resolution LC/{OrbiTrap, TOF}-MS data centroid mode. Simultaneous kalman filters identify features calculate area curve. default parameters set operate complex LC-MS Orbitrap sample. Users find useful simple exploratory data analysis find set minimum intensity, identify many scans average feature spans. \"consecMissedLimit\" parameter yielded good performance Orbitrap data set (2) TOF data found best (1). may change algorithm yet tested many samples. \"criticalValue\" parameter perhaps dificult dial appropriately visual inspection peak identification best suggested tool quick optimization. \"ppm\" \"checkBack\" parameters shown less influence parameters exist give users flexibility better accuracy.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"following arguments specific Massifquant. additional arguments supplied must correspond specified method findPeaks.centWave. object xcmsRaw object. criticalValue Numeric: Suggested values: (0.1-3.0). setting helps determine Kalman Filter prediciton margin error. real centroid belonging bonafide feature must fall within KF prediction margin error. Much like construction confidence interval, criticalVal loosely translates multiplier standard error prediction reported Kalman Filter. features XC-MS sample small mass deviance ppm error, smaller critical value might better vice versa. consecMissedLimit Integer: Suggested values:(1,2,3). feature proces detected Kalman Filter, Kalman Filter may find predicted centroid every scan. 1 consecutive failed predictions, setting informs Massifquant stop Kalman Filter following candidate feature. prefilter Numeric Vector: (Positive Integer, Positive Numeric): first argument used (withWave = 1); see centWave details. second argument specifies minimum threshold maximum intensity feature must met. peakwidth Integer Vector: (Positive Integer, Positive Integer): first argument used Massifquant, specifices minimum feature length time scans. centWave used, second argument maximum feature length subject greater mininum feature length. ppm minimum estimated parts per million mass resolution feature must possess. unions Integer: set 1 apply t-test union segmentation; set 0 t-test applied chromatographically continous features sharing m/z range. Explanation: data points, sometimes Kalman Filter stops tracking feature prematurely. Another Kalman Filter instantiated begins following rest signal. tracking done backwards forwards, algorithmic defect leaves real feature divided two segments . option turned , program identifies segmented features combines (merges ) one two sample t-test. potential danger option truly distinct features may merged. withWave Integer: set 1 turned ; set 0 turned . Allows user find features first Massifquant filter features second phase centWave, includes wavelet estimation. checkBack Integer: set 1 turned ; set 0 turned . convergence Kalman Filter feature's precise m/z mapping fast, sometimes incorporates erroneous centroids part feature (especially early ). \"scanBack\" option attempt remove occasional outlier lies beyond converged bounds Kalman Filter. option directly affect identification feature postprocessing measure; shown extremely useful thus far default set turned .","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"method findPeaks.massifquant(...) used, matrix returned rows corresponding features, properties features listed following column names. Otherwise, centWave feature used also (withWave = 1), Massifquant called xcmsSet(...) method, corresponding return values used. mz weighted m/z mean (weighted intensity) feature mzmin m/z lower boundary feature mzmax m/z upper boundary feature rtmin starting scan time feature rtmax starting scan time feature raw quantitation (area curve) feature. area feature area normalized scan rate.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"Christopher Conley","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"Submitted review. Christopher Conley, Ralf J .O Torgrip. Ryan Taylor, John T. Prince. \"Massifquant: open-source Kalman filter based XC-MS feature detection\". August 2013.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.massifquant-methods.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Feature detection for XC-MS data. — findPeaks.massifquant-methods","text":"","code":"library(faahKO) library(xcms) #load all the wild type and Knock out samples cdfpath <- system.file(\"cdf\", package = \"faahKO\") ## Subset to only the first 2 files. cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE)[1:2] ## Run the massifquant analysis. Setting the noise level to 10000 to speed up ## execution of the examples - in a real use case it should be set to a reasoable ## value. xset <- xcmsSet(cdffiles, method = \"massifquant\", consecMissedLimit = 1, snthresh = 10, criticalValue = 1.73, ppm = 10, peakwidth= c(30, 60), prefilter= c(1,3000), noise = 10000, withWave = 0) #> #> Massifquant, Copyright (C) 2013 Brigham Young University. #> Massifquant comes with ABSOLUTELY NO WARRANTY. See LICENSE for details. #> #> Detecting mass traces at 10ppm ... #> OK #> 242 Peaks. #> #> Massifquant, Copyright (C) 2013 Brigham Young University. #> Massifquant comes with ABSOLUTELY NO WARRANTY. See LICENSE for details. #> #> Detecting mass traces at 10ppm ... #> OK #> 350 Peaks."},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.matchedFilter-xcmsRaw-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","title":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","text":"Find peaks chromatographic time domain profile matrix. details see do_findChromPeaks_matchedFilter.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.matchedFilter-xcmsRaw-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","text":"","code":"# S4 method for xcmsRaw findPeaks.matchedFilter( object, fwhm = 30, sigma = fwhm/2.3548, max = 5, snthresh = 10, step = 0.1, steps = 2, mzdiff = 0.8 - step * steps, index = FALSE, sleep = 0, scanrange = numeric() )"},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.matchedFilter-xcmsRaw-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","text":"object xcmsRaw object peak detection performed. fwhm numeric(1) specifying full width half maximum matched filtration gaussian model peak. used calculate actual sigma, see . sigma numeric(1) specifying standard deviation (width) matched filtration model peak. max numeric(1) representing maximum number peaks expected/identified per slice. snthresh numeric(1) defining signal noise cutoff used chromatographic peak detection step. step numeric(1) specifying width bins/slices m/z dimension. steps numeric(1) defining number bins merged filtration (.e. number neighboring bins joined slice filtration peak detection performed). mzdiff numeric(1) defining minimum difference m/z peaks overlapping retention times index logical(1) specifying whether indicies returned instead values m/z retention times. sleep (DEPRECATED). use parameter highly discouraged, cause problems parallel processing mode. scanrange Numeric vector defining range scans original object sub-setted peak detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.matchedFilter-xcmsRaw-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","text":"matrix, row representing intentified chromatographic peak, columns: mz Intensity weighted mean m/z values peak across scans. mzmin Minimum m/z peak. mzmax Maximum m/z peak. rt Retention time peak's midpoint. rtmin Minimum retention time peak. rtmax Maximum retention time peak. Integrated (original) intensity peak. intf Integrated intensity filtered peak. maxo Maximum intensity peak. maxf Maximum intensity filtered peak. Rank peak merged EIC (<= max). sn Signal noise ratio peak.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.matchedFilter-xcmsRaw-method.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","text":"Colin . Smith, Elizabeth J. Want, Grace O'Maille, Ruben Abagyan Gary Siuzdak. \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 2006, 78:779-787. @family Old peak detection methods","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findPeaks.matchedFilter-xcmsRaw-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Peak detection in the chromatographic time domain — findPeaks.matchedFilter,xcmsRaw-method","text":"Colin . Smith","code":""},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":null,"dir":"Reference","previous_headings":"","what":"Find neutral losses in xcmsFragment objects — findneutral","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"method find neutral loss ppm window xcmsFragment object","code":""},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"","code":"findneutral(object, find, ppmE=25, print=TRUE)"},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"object xcmsFragment object type find neutral loss found ppmE ppm error window searching print print nice little report","code":""},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"method searches given neutral loss xcmsFragment object type given certain ppm error window. neutral losses generated neighbouring ions. resulting data frame shows whole scan neutral loss found.","code":""},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"data frame following columns: PrecursorMz precursor m/z neutral losses MSnParentPeakID index ID location precursor peak xcmsFragment object msLevel level found fragment ion rt Retention time found ion mz actual m/z found fragment ion intensity intensity fragment ion sample sample fragment ion came GroupPeakMSn ID peaks grouped xcmsSet grouping CollisionEnergy collision energy precursor scan","code":""},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"H. Paul Benton, D.M. Wong, S..Strauger, G. Siuzdak \"XC\\(MS^2\\)\" Analytical Chemistry 2008","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"H. Paul Benton, hpbenton@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/findneutral.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find neutral losses in xcmsFragment objects — findneutral","text":"","code":"if (FALSE) { library(msdata) mzMLpath <- system.file(\"iontrap\", package = \"msdata\") mzMLfiles<-list.files(mzMLpath, pattern = \"extracted.mzML\", recursive = TRUE, full.names = TRUE) xs <- xcmsSet(mzMLfiles, method = \"MS1\") ##takes only one file from the file set xfrag <- xcmsFragments(xs) found<-findneutral(xfrag, 58.1455, 50) }"},{"path":"https://sneumann.github.io/xcms/reference/getEIC-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get extracted ion chromatograms for specified m/z ranges — getEIC-methods","title":"Get extracted ion chromatograms for specified m/z ranges — getEIC-methods","text":"Generate multiple extracted ion chromatograms m/z values interest. xcmsSet objects, reread original raw data apply precomputed retention time correction, applicable. Note method always return profile, raw data (profile data binned data along M/Z). See details information.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getEIC-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get extracted ion chromatograms for specified m/z ranges — getEIC-methods","text":"object = \"xcmsRaw\" getEIC(object, mzrange, rtrange = NULL, step = 0.1) object = \"xcmsSet\" getEIC(object, mzrange, rtrange = 200, groupidx, sampleidx = sampnames(object), rt = c(\"corrected\", \"raw\"))","code":""},{"path":"https://sneumann.github.io/xcms/reference/getEIC-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get extracted ion chromatograms for specified m/z ranges — getEIC-methods","text":"object xcmsRaw xcmsSet object mzrange Either two column matrix minimum maximum m/z matrix dimensions containing columns mzmin mzmax. specified, method xcmsRaw returns base peak chromatogram (BPC, .e. intense signal RT across m/z). xcmsSet objects group data used mzrange provided. rtrange two column matrix size mzrange minimum maximum retention times return EIC data points. specified, method returns chromatogram full RT range. xcmsSet objects, may also single number specifying time window around peak return EIC data points step step (bin) size use profile generation. Note value step = 0 supported. groupidx either character vector names integer vector indicies peak groups get EICs sampleidx either character vector names integer vector indicies samples get EICs rt \"corrected\" using corrected retention times, \"raw\" using raw retention times","code":""},{"path":"https://sneumann.github.io/xcms/reference/getEIC-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get extracted ion chromatograms for specified m/z ranges — getEIC-methods","text":"contrast rawEIC method, extracts actual raw values, method extracts object's profile matrix (provided step argument match profStep object profile matrix calculated fly values returned).","code":""},{"path":"https://sneumann.github.io/xcms/reference/getEIC-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get extracted ion chromatograms for specified m/z ranges — getEIC-methods","text":"xcmsSet xcmsRaw objects, xcmsEIC object.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/getPeaks-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get peak intensities for specified regions — getPeaks-methods","title":"Get peak intensities for specified regions — getPeaks-methods","text":"Integrate extracted ion chromatograms pre-defined defined regions. Return output similar findPeaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getPeaks-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get peak intensities for specified regions — getPeaks-methods","text":"object = \"xcmsRaw\" getPeaks(object, peakrange, step = 0.1)","code":""},{"path":"https://sneumann.github.io/xcms/reference/getPeaks-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get peak intensities for specified regions — getPeaks-methods","text":"object xcmsSet object peakrange matrix data frame 4 columns: mzmin, mzmax, rtmin, rtmax (must order named) step step size use profile generation","code":""},{"path":"https://sneumann.github.io/xcms/reference/getPeaks-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get peak intensities for specified regions — getPeaks-methods","text":"matrix columns: rank peak identified merged EIC (<= max), always NA mz weighted (intensity) mean peak m/z across scans mzmin m/z minimum step mzmax m/z maximum step ret retention time peak midpoint retmin leading edge peak retention time retmax trailing edge peak retention time integrated area original (raw) peak intf integrated area filtered peak, always NA maxo maximum intensity original (raw) peak maxf maximum intensity filtered peak, always NA","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/getScan-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get m/z and intensity values for a single mass scan — getScan-methods","title":"Get m/z and intensity values for a single mass scan — getScan-methods","text":"Return data single mass scan using numeric index scan reference.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getScan-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get m/z and intensity values for a single mass scan — getScan-methods","text":"object = \"xcmsRaw\" getScan(object, scan, mzrange = numeric()) getMsnScan(object, scan, mzrange = numeric())","code":""},{"path":"https://sneumann.github.io/xcms/reference/getScan-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get m/z and intensity values for a single mass scan — getScan-methods","text":"object xcmsRaw object scan integer index scan. negative, index numbered end mzrange limit data points returned range, range(mzrange)","code":""},{"path":"https://sneumann.github.io/xcms/reference/getScan-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get m/z and intensity values for a single mass scan — getScan-methods","text":"matrix two columns: mz m/z values intensity intensity values","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/getSpec-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get average m/z and intensity values for multiple mass scans — getSpec-methods","title":"Get average m/z and intensity values for multiple mass scans — getSpec-methods","text":"Return full-resolution averaged data multiple mass scans.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getSpec-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get average m/z and intensity values for multiple mass scans — getSpec-methods","text":"object = \"xcmsRaw\" getSpec(object, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/getSpec-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get average m/z and intensity values for multiple mass scans — getSpec-methods","text":"object xcmsRaw object ... arguments passed profRange used sepecify spectral segments interest averaging","code":""},{"path":"https://sneumann.github.io/xcms/reference/getSpec-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get average m/z and intensity values for multiple mass scans — getSpec-methods","text":"Based mass points spectra selected, master unique list masses generated. Every spectra interpolated masses averaged.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getSpec-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get average m/z and intensity values for multiple mass scans — getSpec-methods","text":"matrix two columns: mz m/z values intensity intensity values","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/getXcmsRaw-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Load the raw data for one or more files in the xcmsSet — getXcmsRaw-methods","title":"Load the raw data for one or more files in the xcmsSet — getXcmsRaw-methods","text":"Reads raw data applies evential retention time corrections waters Lock mass correction returns xcmsRaw object (list xcmsRaw objects) one files xcmsSet object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getXcmsRaw-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Load the raw data for one or more files in the xcmsSet — getXcmsRaw-methods","text":"object = \"xcmsSet\" getXcmsRaw(object, sampleidx=1, profmethod=profinfo(object)$method, profstep=profinfo(object)$step, rt=c(\"corrected\", \"raw\"), ... )","code":""},{"path":"https://sneumann.github.io/xcms/reference/getXcmsRaw-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Load the raw data for one or more files in the xcmsSet — getXcmsRaw-methods","text":"object xcmsSet object sampleidx index sample raw data returned. Can single number numeric vector indices. Alternatively, file name can specified. profmethod profile method. profstep profile step. rt Whether corrected raw retention times returned. ... Additional arguments submitted xcmsRaw function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getXcmsRaw-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Load the raw data for one or more files in the xcmsSet — getXcmsRaw-methods","text":"single xcmsRaw object list xcmsRaw objects.","code":""},{"path":"https://sneumann.github.io/xcms/reference/getXcmsRaw-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Load the raw data for one or more files in the xcmsSet — getXcmsRaw-methods","text":"Johannes Rainer, johannes.rainer@eurac.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/group-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Group peaks from different samples together — group-methods","title":"Group peaks from different samples together — group-methods","text":"number grouping (alignment) methods exist XCMS. group generic method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/group-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Group peaks from different samples together — group-methods","text":"object = \"xcmsSet\" group(object, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/group-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group peaks from different samples together — group-methods","text":"object xcmsSet-class object method Method use grouping. See details. ... Optional arguments passed along","code":""},{"path":"https://sneumann.github.io/xcms/reference/group-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Group peaks from different samples together — group-methods","text":"Different algorithms can used specifying method argument. example use density-based approach described Smith et al (2006) one use: group(object, method=\"density\"). also default. arguments given ... passed function implementing method. character vector nicknames algorithms available returned getOption(\"BioC\")$xcms$group.methods. nickname method called \"mzClust\", help page specific method can accessed ?group.mzClust.","code":""},{"path":"https://sneumann.github.io/xcms/reference/group-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Group peaks from different samples together — group-methods","text":"xcmsSet object peak group assignments statistics.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/group.density.html","id":null,"dir":"Reference","previous_headings":"","what":"Group peaks from different samples together — group.density","title":"Group peaks from different samples together — group.density","text":"Group peaks together across samples using overlapping m/z bins calculation smoothed peak distributions chromatographic time.","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.density.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Group peaks from different samples together — group.density","text":"object = \"xcmsSet\" group(object, bw = 30, minfrac = 0.5, minsamp = 1, mzwid = 0.25, max = 50, sleep = 0)","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.density.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group peaks from different samples together — group.density","text":"object xcmsSet object minfrac minimum fraction samples necessary least one sample groups valid group minsamp minimum number samples necessary least one sample groups valid group bw bandwidth (standard deviation half width half maximum) gaussian smoothing kernel apply peak density chromatogram mzwid width overlapping m/z slices use creating peak density chromatograms grouping peaks across samples max maximum number groups identify single m/z slice sleep seconds pause plotting successive steps peak grouping algorithm. peaks plotted points showing relative intensity. identified groups flanked dotted vertical lines.","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.density.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Group peaks from different samples together — group.density","text":"xcmsSet object peak group assignments statistics.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/group.mzClust.html","id":null,"dir":"Reference","previous_headings":"","what":"Group Peaks via High Resolution Alignment — group.mzClust","title":"Group Peaks via High Resolution Alignment — group.mzClust","text":"Runs high resolution alignment single spectra samples stored \tgiven xcmsSet.","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.mzClust.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Group Peaks via High Resolution Alignment — group.mzClust","text":"object = \"xcmsSet\" group(object, method=\"mzClust\", mzppm = 20, mzabs = 0, minsamp = 1, minfrac=0)","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.mzClust.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group Peaks via High Resolution Alignment — group.mzClust","text":"object xcmsSet peaks mzppm relative error used clustering/grouping ppm (parts per million) mzabs absolute error used clustering/grouping minsamp set minimum number samples one bin minfrac set minimum fraction class one bin","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.mzClust.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Group Peaks via High Resolution Alignment — group.mzClust","text":"Returns xcmsSet slots groups groupindex set.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/group.mzClust.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Group Peaks via High Resolution Alignment — group.mzClust","text":"Saira . Kazmi, Samiran Ghosh, Dong-Guk Shin, \tDennis W. Hill David F. GrantAlignment high resolution mass spectra: development heuristic \tapproach metabolomics. \tMetabolomics, Vol. 2, . 2, 75-83 (2006)","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.mzClust.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Group Peaks via High Resolution Alignment — group.mzClust","text":"","code":"if (FALSE) { library(msdata) mzMLpath <- system.file(\"fticr-mzML\", package = \"msdata\") mzMLfiles <- list.files(mzMLpath, recursive = TRUE, full.names = TRUE) xs <- xcmsSet(method=\"MSW\", files=mzMLfiles, scales=c(1,7), SNR.method='data.mean' , winSize.noise=500, peakThr=80000, amp.Th=0.005) xsg <- group(xs, method=\"mzClust\") }"},{"path":"https://sneumann.github.io/xcms/reference/group.nearest.html","id":null,"dir":"Reference","previous_headings":"","what":"Group peaks from different samples together — group.nearest","title":"Group peaks from different samples together — group.nearest","text":"Group peaks together across samples creating master peak list assigning corresponding peaks samples. inspired alignment algorithm mzMine. details check http://mzmine.sourceforge.net/ Katajamaa M, Miettinen J, Oresic M: MZmine: Toolbox processing visualization mass spectrometry based molecular profile data. Bioinformatics (Oxford, England) 2006, 22:634?636. Currently, equivalent minfrac minsamp.","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.nearest.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Group peaks from different samples together — group.nearest","text":"object = \"xcmsSet\" group(object, mzVsRTbalance=10, mzCheck=0.2, rtCheck=15, kNN=10)","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.nearest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group peaks from different samples together — group.nearest","text":"object xcmsSet object mzVsRTbalance Multiplicator mz value calculating (euclidean) distance two peaks. mzCheck Maximum tolerated distance mz. rtCheck Maximum tolerated distance RT. kNN Number nearest Neighbours check","code":""},{"path":"https://sneumann.github.io/xcms/reference/group.nearest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Group peaks from different samples together — group.nearest","text":"xcmsSet object peak group assignments statistics.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/group.nearest.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Group peaks from different samples together — group.nearest","text":"","code":"if (FALSE) library(xcms) library(faahKO) ## These files do not have this problem to correct for ## but just for an example cdfpath <- system.file(\"cdf\", package = \"faahKO\") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE) xset<-xcmsSet(cdffiles) gxset<-group(xset, method=\"nearest\") #> Processing sample number 8 ... #> OK #> Processing sample number 1 ... #> OK #> Processing sample number 7 ... #> OK #> Processing sample number 3 ... #> OK #> Processing sample number 12 ... #> OK #> Processing sample number 9 ... #> OK #> Processing sample number 6 ... #> OK #> Processing sample number 5 ... #> OK #> Processing sample number 4 ... #> OK #> Processing sample number 11 ... #> OK #> Processing sample number 10 ... #> OK nrow(gxset@groups) == 1096 ## the number of features before minFrac #> [1] FALSE post.minFrac<-function(object, minFrac=0.5){ ix.minFrac<-sapply(1:length(unique(sampclass(object))), function(x, object, mf){ meta<-groups(object) minFrac.idx<-numeric(length=nrow(meta)) idx<-which( meta[,levels(sampclass(object))[x]] >= mf*length(which(levels(sampclass(object))[x] == sampclass(object)) )) minFrac.idx[idx]<-1 return(minFrac.idx) }, object, minFrac) ix.minFrac<-as.logical(apply(ix.minFrac, 1, sum)) ix<-which(ix.minFrac == TRUE) return(ix) } ## using the above function we can get a post processing minFrac idx<-post.minFrac(gxset) gxset.post<-gxset ## copy the xcmsSet object gxset.post@groupidx<-gxset@groupidx[idx] gxset.post@groups<-gxset@groups[idx,] nrow(gxset.post@groups) == 465 ## number of features after minFrac #> [1] FALSE"},{"path":"https://sneumann.github.io/xcms/reference/groupChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","title":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","text":"groupChromPeaks method performs correspondence analysis .e., groups chromatographic peaks across samples define LC-MS features. correspondence algorithm can selected, configured, using param argument. See documentation XcmsExperiment() XCMSnExp() information access extract correspondence results. correspondence analysis can performed chromatographic peaks MS level (present chromatographic peak detection performed MS level) defining features combining peaks. MS level can selected parameter msLevel. default, calling groupChromPeaks remove previous correspondence results. can disabled add = TRUE, add newly defined features already present feature definitions. Supported param objects : PeakDensityParam: correspondence using peak density method (Smith 2006) groups chromatographic peaks along retention time axis within slices (partially overlapping) m/z ranges. default, m/z ranges (bins) constant size. setting ppm value larger 0, m/z dependent bin sizes can used instead (better representing m/z dependent measurement error MS instruments). peaks (different samples) apex position close retention time axis grouped LC-MS feature. See addition do_groupChromPeaks_density() core API function. NearestPeaksParam: performs peak grouping based proximity chromatographic peaks different samples m/z - rt space similar correspondence method mzMine (Katajamaa 2006). method creates first master peak list consisting chromatographic peaks sample detected peaks iteratively calculates distances peaks sample next number peaks grouping peaks together distance smaller provided thresholds. See addition do_groupChromPeaks_nearest() core API function. MzClustParam: performs high resolution peak grouping single spectrum metabolomics data (Kazmi 2006). method used data retention time considered correspondence analysis. See addition do_groupPeaks_mzClust() core API function. specific examples description method settings see help pages individual parameter classes listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","text":"","code":"groupChromPeaks(object, param, ...) # S4 method for XcmsExperiment,Param groupChromPeaks(object, param, msLevel = 1L, add = FALSE) PeakDensityParam( sampleGroups = numeric(), bw = 30, minFraction = 0.5, minSamples = 1, binSize = 0.25, ppm = 0, maxFeatures = 50 ) MzClustParam( sampleGroups = numeric(), ppm = 20, absMz = 0, minFraction = 0.5, minSamples = 1 ) NearestPeaksParam( sampleGroups = numeric(), mzVsRtBalance = 10, absMz = 0.2, absRt = 15, kNN = 10 ) # S4 method for PeakDensityParam sampleGroups(object) # S4 method for PeakDensityParam sampleGroups(object) <- value # S4 method for PeakDensityParam bw(object) # S4 method for PeakDensityParam bw(object) <- value # S4 method for PeakDensityParam minFraction(object) # S4 method for PeakDensityParam minFraction(object) <- value # S4 method for PeakDensityParam minSamples(object) # S4 method for PeakDensityParam minSamples(object) <- value # S4 method for PeakDensityParam binSize(object) # S4 method for PeakDensityParam binSize(object) <- value # S4 method for PeakDensityParam maxFeatures(object) # S4 method for PeakDensityParam maxFeatures(object) <- value # S4 method for PeakDensityParam ppm(object) # S4 method for MzClustParam sampleGroups(object) # S4 method for MzClustParam sampleGroups(object) <- value # S4 method for MzClustParam ppm(object) # S4 method for MzClustParam ppm(object) <- value # S4 method for MzClustParam absMz(object) # S4 method for MzClustParam absMz(object) <- value # S4 method for MzClustParam minFraction(object) # S4 method for MzClustParam minFraction(object) <- value # S4 method for MzClustParam minSamples(object) # S4 method for MzClustParam minSamples(object) <- value # S4 method for NearestPeaksParam sampleGroups(object) # S4 method for NearestPeaksParam sampleGroups(object) <- value # S4 method for NearestPeaksParam mzVsRtBalance(object) # S4 method for NearestPeaksParam mzVsRtBalance(object) <- value # S4 method for NearestPeaksParam absMz(object) # S4 method for NearestPeaksParam absMz(object) <- value # S4 method for NearestPeaksParam absRt(object) # S4 method for NearestPeaksParam absRt(object) <- value # S4 method for NearestPeaksParam kNN(object) # S4 method for NearestPeaksParam kNN(object) <- value # S4 method for PeakDensityParam as.list(x, ...) # S4 method for XCMSnExp,PeakDensityParam groupChromPeaks(object, param, msLevel = 1L, add = FALSE) # S4 method for XCMSnExp,MzClustParam groupChromPeaks(object, param, msLevel = 1L) # S4 method for XCMSnExp,NearestPeaksParam groupChromPeaks(object, param, msLevel = 1L, add = FALSE)"},{"path":"https://sneumann.github.io/xcms/reference/groupChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","text":"object data object correspondence analysis performed. Can XCMSnExp(), XcmsExperiment() object. param parameter object selecting configuring algorithm. ... Optional parameters. msLevel integer(1) defining MS level chromatographic peak detection performed. add logical(1) (object contains already chromatographic peaks, .e. either XCMSnExp XcmsExperiment) whether chromatographic peak detection results added existing results. default (add = FALSE) additional findChromPeaks call result object remove previous results. sampleGroups PeakDensityParam: vector length samples defining sample group assignments (.e. samples belong sample group). parameter mandatory PeakDensityParam provided also sample grouping experiment (case samples assigned group). bw PeakDensityParam: numeric(1) defining bandwidth (standard deviation ot smoothing kernel) used. argument passed [density() method. minFraction PeakDensityParam: numeric(1) defining minimum fraction samples least one sample group peaks present considered peak group (feature). minSamples PeakDensityParam: numeric(1) minimum number samples least one sample group peaks detected considered peak group (feature). binSize PeakDensityParam: numeric(1) defining size overlapping slices m/z dimension. ppm MzClustParam: numeric(1) representing relative m/z error clustering/grouping (parts per million). PeakDensityParam: numeric(1) define m/z-dependent, increasing m/z bin sizes. ppm = 0 (default) m/z bins defined sequence values smallest larges m/z value constant bin size binSize. ppm > 0 size bin increased addition ppm (upper) m/z boundary bin. maximal bin size (used largest m/z values) binSize plus ppm parts-per-million largest m/z value peaks data set. maxFeatures PeakDensityParam: numeric(1) maximum number peak groups identified single mz slice. absMz NearestPeaksParam MzClustParam: numeric(1) maximum tolerated distance m/z values. mzVsRtBalance NearestPeaksParam: numeric(1) representing factor m/z values multiplied calculating (euclician) distance two peaks. absRt NearestPeaksParam: numeric(1) maximum tolerated distance retention times. kNN NearestPeaksParam: integer(1) representing number nearest neighbors check. value value slot. x parameter object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupChromPeaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","text":"groupChromPeaks: either XcmsExperiment() XCMSnExp() object correspondence result.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupChromPeaks.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","text":"Smith, C.., Want E.J., O'Maille G., Abagyan R., Siuzdak G. (2006) \"XCMS: Processing Mass Spectrometry Data Metabolite Profiling Using Nonlinear Peak Alignment, Matching, Identification\" Anal. Chem. 78:779-787. Katajamaa, M., Miettinen, J., Oresic, M. (2006) \"MZmine: Toolbox processing visualization mass spectrometry based molecular profile data\". Bioinformatics, 22:634-636. Kazmi S. ., Ghosh, S., Shin, D., Hill, D.W., Grant, D.F. (2006) \"Alignment high resolution mass spectra: development heuristic approach metabolomics. Metabolomics Vol. 2, . 2, 75-83.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correspondence: group chromatographic peaks across samples — groupChromPeaks","text":"Colin Smith, Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-abundance-correlation.html","id":null,"dir":"Reference","previous_headings":"","what":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","title":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","text":"Features originating compound expected similar intensities across samples. method thus groups features based similarity abundances (.e. feature values) across samples data set. See also AbundanceSimilarityParam() additional information details. help page lists parameters specific xcms result objects (.e. XcmsExperiment() XCMSnExp() objects). Documentation parameters similarity calculation available AbundanceSimilarityParam() help page MsFeatures package.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-abundance-correlation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","text":"","code":"# S4 method for XcmsResult,AbundanceSimilarityParam groupFeatures( object, param, msLevel = 1L, method = c(\"medret\", \"maxint\", \"sum\"), value = \"into\", intensity = \"into\", filled = TRUE, ... )"},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-abundance-correlation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","text":"object XcmsExperiment() XCMSnExp() object containing LC-MS pre-processing results. param AbudanceSimilarityParam object settings method. See AbundanceSimilarityParam() details grouping method parameters. msLevel integer(1) defining MS level features grouped. method character(1) passed featureValues call. See featureValues() details. Defaults method = \"medret\". value character(1) passed featureValues call. See featureValues() details. Defaults value = \"\". intensity character(1) passed featureValues call. See featureValues() details. Defaults intensity = \"\". filled logical(1) whether filled-values included correlation analysis. Defaults filled = TRUE. ... additional parameters passed groupFeatures method matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-abundance-correlation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","text":"input object feature group definitions added (updated ) column \"feature_group\" featureDefinitions data frame.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-abundance-correlation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-abundance-correlation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compounding/feature grouping based on similarity of abundances across samples — groupFeatures-abundance-correlation","text":"","code":"library(MsFeatures) library(MsExperiment) ## Load a test data set with detected peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Group chromatographic peaks across samples xodg <- groupChromPeaks(faahko_sub, param = PeakDensityParam(sampleGroups = rep(1, 3))) ## Group features based on correlation of feature values (integrated ## peak area) across samples. Note that there are many missing values ## in the feature value which influence grouping of features in the present ## data set. xodg_grp <- groupFeatures(xodg, param = AbundanceSimilarityParam(threshold = 0.8)) table(featureDefinitions(xodg_grp)$feature_group) #> #> FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 #> 8 8 8 6 12 3 1 1 ## Group based on the maximal peak intensity per feature xodg_grp <- groupFeatures(xodg, param = AbundanceSimilarityParam(threshold = 0.8, value = \"maxo\")) table(featureDefinitions(xodg_grp)$feature_group) #> #> FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 #> 8 8 8 6 12 3 1 1"},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":null,"dir":"Reference","previous_headings":"","what":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"Features originating compound expected share elution pattern (.e. chromatographic peak shape) . Thus, methods allows group features based similarity extracted ion chromatograms (EICs). similarity calculation performed separately sample similarity score aggregated across samples final generation similarity matrix grouping (considering parameter threshold) performed. compareChromatograms() function used similarity calculation default calculates Pearson's correlation coefficient. settings compareChromatograms can specified parameters ALIGNFUN, ALIGNFUNARGS, FUN FUNARGS. ALIGNFUN defaults alignRt() function used align chromatograms comparison. ALIGNFUNARGS allows specify additional arguments ALIGNFUN function. defaults ALIGNFUNARGS = list(tolerance = 0, method = \"closest\") ensures data points spectrum (scan, .e. retention time) compared EICs sample. Parameter FUN defines function calculate similarity score defaults FUN = cor FUNARGS allows pass additional arguments function (defaults FUNARGS = list(use = \"pairwise.complete.obs\"). See also compareChromatograms() information. grouping features based EIC similarity matrix performed function specified parameter groupFun defaults groupFun = groupSimilarityMatrix groups rows (features) similarity matrix similarity score larger threshold cluster. creates clusters features features similarity score >= threshold feature cluster. See groupSimilarityMatrix() details. Additional parameters function can passed ... argument. feature grouping called initial feature grouping retention time (see SimilarRtimeParam()). feature groups defined columns \"feature_group\" featureDefinitions(object) (features matching msLevel) used refined method. Features value NA featureDefinitions(object)$feature_group skipped/considered feature grouping.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"","code":"EicSimilarityParam( threshold = 0.9, n = 1, onlyPeak = TRUE, value = c(\"maxo\", \"into\"), groupFun = groupSimilarityMatrix, ALIGNFUN = alignRt, ALIGNFUNARGS = list(tolerance = 0, method = \"closest\"), FUN = cor, FUNARGS = list(use = \"pairwise.complete.obs\"), ... ) # S4 method for XcmsResult,EicSimilarityParam groupFeatures(object, param, msLevel = 1L)"},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"threshold numeric(1) minimal required similarity score group featues. passed groupFun function. n numeric(1) defining total number samples per feature group similarity calculation performed. value rounded next larger integer value. onlyPeak logical(1) whether correlation performed signals within identified chromatographic peaks (onlyPeak = TRUE, default) signal extracted ion chromatogram. value character(1) defining whether samples grouped based sum maximal peak intensity (value = \"maxo\", default) integrated peak area (value = \"\") feature. groupFun function defining function used group rows based pairwise similarity matrix. Defaults groupSimilarityMatrix(). ALIGNFUN function defining function used align chromatograms prior similarity calculation. Defaults ALIGNFUN = alignRt. See alignRt() compareChromatograms() information. ALIGNFUNARGS named list arguments ALIGNFUN. Defaults ALIGNFUNARGS = list(tolerance = 0, method = \"closest\"). FUN function defining function used calculate similarity (aligned) chromatograms. Defaults FUN = cor. See cor() compareChromatograms() information. FUNARGS named list arguments FUN. Defaults FUN = list(use = \"pairwise.complete.obs\"). ... EicSimilarityParam: additional arguments passed groupFun featureChromatograms (expandRt expand retention time range feature). object XcmsExperiment() XCMSnExp() object LC-MS pre-processing results. param EicSimilarityParam object settings method. msLevel integer(1) defining MS level features grouped.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"input object feature groups added (.e. column \"feature_group\" featureDefinitions data frame.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"present featureChromatograms() function used extract EICs feature, however use one m/z rt range feature EICs thus exactly represent identified chromatographic peaks sample (.e. specific m/z retention time ranges). possible performed full data set without prior feature grouping, suggested following reasons: ) selection top n samples highest signal feature group biased abundant compounds performed full data set (.e. samples highest overall intensities used correlation features) II) computationally much expensive pairwise correlation features performed. also suggested perform correlation subset samples per feature highest intensities peaks (feature) although also possible run correlation samples setting n equal total number samples data set. EIC correlation however performed ideally samples original compound highly abundant avoid correlation missing values noisy peak shapes much possible. default also signal outside identified chromatographic peaks excluded correlation.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-eic-similarity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compounding/feature grouping based on similarity of extracted ion chromatograms — groupFeatures-eic-similarity","text":"","code":"library(MsFeatures) library(MsExperiment) ## Load a test data set with detected peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Group chromatographic peaks across samples xodg <- groupChromPeaks(faahko_sub, param = PeakDensityParam(sampleGroups = rep(1, 3))) ## Performing a feature grouping based on EIC similarities on a single ## sample xodg_grp <- groupFeatures(xodg, param = EicSimilarityParam(n = 1)) table(featureDefinitions(xodg_grp)$feature_group) #> #> FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 FG.009 FG.010 FG.011 #> 2 2 2 3 4 2 3 2 1 1 1 #> FG.012 FG.013 FG.014 FG.015 FG.016 FG.017 FG.018 FG.019 FG.020 FG.021 FG.022 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.023 FG.024 FG.025 FG.026 FG.027 FG.028 FG.029 FG.030 FG.031 FG.032 FG.033 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.034 FG.035 #> 1 1 ## Usually it is better to perform this correlation on pre-grouped features ## e.g. based on similar retention time. xodg_grp <- groupFeatures(xodg, param = SimilarRtimeParam(diffRt = 4)) xodg_grp <- groupFeatures(xodg_grp, param = EicSimilarityParam(n = 1)) table(featureDefinitions(xodg_grp)$feature_group) #> #> FG.001.001 FG.002.001 FG.003.001 FG.003.002 FG.004.001 FG.004.002 FG.005.001 #> 2 2 2 1 3 1 3 #> FG.006.001 FG.006.002 FG.007.001 FG.008.001 FG.009.001 FG.009.002 FG.010.001 #> 1 1 2 2 1 1 2 #> FG.011.001 FG.012.001 FG.013.001 FG.014.001 FG.015.001 FG.016.001 FG.017.001 #> 1 1 1 1 1 1 1 #> FG.018.001 FG.019.001 FG.020.001 FG.021.001 FG.022.001 FG.023.001 FG.024.001 #> 1 1 1 1 1 1 1 #> FG.025.001 FG.026.001 FG.027.001 FG.028.001 FG.029.001 FG.030.001 FG.031.001 #> 1 1 1 1 1 1 1 #> FG.032.001 FG.033.001 #> 1 1"},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-similar-rtime.html","id":null,"dir":"Reference","previous_headings":"","what":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","title":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","text":"Group features based similar retention time. method supposed used initial crude grouping features based median retention time chromatographic peaks. features difference retention time <= parameter diffRt parameter object grouped together. column \"feature_group\" found featureDefinitions() sub-grouped method. See MsFeatures::SimilarRtimeParam() MsFeatures details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-similar-rtime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","text":"","code":"# S4 method for XcmsResult,SimilarRtimeParam groupFeatures(object, param, msLevel = 1L, ...)"},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-similar-rtime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","text":"object XcmsExperiment() XCMSnExp() object containing also correspondence results. param SimilarRtimeParam object settings method. See MsFeatures::SimilarRtimeParam() details options. msLevel integer(1) defining MS level features grouped. ... passed groupFeatures function numeric values.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-similar-rtime.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","text":"input object feature groups added (.e. column \"feature_group\" featureDefinitions data frame.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-similar-rtime.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupFeatures-similar-rtime.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compounding/feature grouping based on similar retention times — groupFeatures-similar-rtime","text":"","code":"library(MsFeatures) library(MsExperiment) ## Load a test data set with detected peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Group chromatographic peaks across samples xodg <- groupChromPeaks(faahko_sub, param = PeakDensityParam(sampleGroups = rep(1, 3))) ## Group features based on similar retention time (i.e. difference <= 2 seconds) xodg_grp <- groupFeatures(xodg, param = SimilarRtimeParam(diffRt = 2)) ## Feature grouping get added to the featureDefinitions in column \"feature_group\" head(featureDefinitions(xodg_grp)$feature_group) #> [1] \"FG.004\" \"FG.009\" \"FG.003\" \"FG.004\" \"FG.010\" \"FG.011\" table(featureDefinitions(xodg_grp)$feature_group) #> #> FG.001 FG.002 FG.003 FG.004 FG.005 FG.006 FG.007 FG.008 FG.009 FG.010 FG.011 #> 2 2 3 3 3 2 2 2 1 1 1 #> FG.012 FG.013 FG.014 FG.015 FG.016 FG.017 FG.018 FG.019 FG.020 FG.021 FG.022 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.023 FG.024 FG.025 FG.026 FG.027 FG.028 FG.029 FG.030 FG.031 FG.032 FG.033 #> 1 1 1 1 1 1 1 1 1 1 1 #> FG.034 FG.035 FG.036 #> 1 1 1 length(unique(featureDefinitions(xodg_grp)$feature_group)) #> [1] 36 ## Using an alternative groupiing method that creates larger groups xodg_grp <- groupFeatures(xodg, param = SimilarRtimeParam(diffRt = 2, groupFun = MsCoreUtils::group)) length(unique(featureDefinitions(xodg_grp)$feature_group)) #> [1] 35"},{"path":"https://sneumann.github.io/xcms/reference/groupOverlaps.html","id":null,"dir":"Reference","previous_headings":"","what":"Group overlapping ranges — groupOverlaps","title":"Group overlapping ranges — groupOverlaps","text":"groupOverlaps identifies overlapping ranges input data groups returning indices xmin xmax.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupOverlaps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Group overlapping ranges — groupOverlaps","text":"","code":"groupOverlaps(xmin, xmax)"},{"path":"https://sneumann.github.io/xcms/reference/groupOverlaps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Group overlapping ranges — groupOverlaps","text":"xmin numeric (length xmax) lower boundary range. xmax numeric (length xmin) upper boundary range.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupOverlaps.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Group overlapping ranges — groupOverlaps","text":"list indices grouped elements.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupOverlaps.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Group overlapping ranges — groupOverlaps","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupOverlaps.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Group overlapping ranges — groupOverlaps","text":"","code":"x <- c(2, 12, 34.2, 12.4) y <- c(3, 16, 35, 36) groupOverlaps(x, y) #> [[1]] #> [1] 1 #> #> [[2]] #> [1] 2 3 4 #>"},{"path":"https://sneumann.github.io/xcms/reference/groupnames-XCMSnExp.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate unique group (feature) names based on mass and retention time — groupnames,XCMSnExp-method","title":"Generate unique group (feature) names based on mass and retention time — groupnames,XCMSnExp-method","text":"groupnames generates names identified features correspondence analysis based mass retention time. generates feature names equivalent group names old user interface (aka xcms1).","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupnames-XCMSnExp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate unique group (feature) names based on mass and retention time — groupnames,XCMSnExp-method","text":"","code":"# S4 method for XCMSnExp groupnames(object, mzdec = 0, rtdec = 0, template = NULL)"},{"path":"https://sneumann.github.io/xcms/reference/groupnames-XCMSnExp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate unique group (feature) names based on mass and retention time — groupnames,XCMSnExp-method","text":"object XCMSnExp object containing correspondence results. mzdec integer(1) number decimal places use m/z ( defaults 0). rtdec integer(1) number decimal places use retention time (defaults 0). template character existing group names whose format emulated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupnames-XCMSnExp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate unique group (feature) names based on mass and retention time — groupnames,XCMSnExp-method","text":"character unique names feature object. format M(m/z)T(time seconds).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/groupnames-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate unque names for peak groups — groupnames-methods","title":"Generate unque names for peak groups — groupnames-methods","text":"Allow linking peak group data classes using unique group names remain long re-grouping occurs.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupnames-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Generate unque names for peak groups — groupnames-methods","text":"object = \"xcmsSet\" (object, mzdec = 0, rtdec = 0, template = NULL) object = \"xcmsEIC\" (object)","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupnames-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate unque names for peak groups — groupnames-methods","text":"object xcmsSet xcmsEIC object mzdec number decimal places use m/z rtdec number decimal places use retention time template character vector existing group names whose format emulated","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupnames-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate unque names for peak groups — groupnames-methods","text":"character vector unique names peak group object. format M[m/z]T[time seconds].","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/groupval-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract a matrix of peak values for each group — groupval-methods","title":"Extract a matrix of peak values for each group — groupval-methods","text":"Generate matrix peak values rows every group columns every sample. value included matrix can columns xcmsSet peaks slot matrix. Collisions one peak single sample group get resolved one several user-selectable methods.","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupval-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Extract a matrix of peak values for each group — groupval-methods","text":"object = \"xcmsSet\" groupval(object, method = c(\"medret\", \"maxint\"), value = \"index\", intensity = \"\")","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupval-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract a matrix of peak values for each group — groupval-methods","text":"object xcmsSet object method conflict resolution method, \"medret\" use peak closest median retention time \"maxint\" use peak highest intensity value name peak column enter returned matrix, \"index\" index corresponding row peaks slot matrix intensity method == \"maxint\", name peak column use intensity","code":""},{"path":"https://sneumann.github.io/xcms/reference/groupval-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract a matrix of peak values for each group — groupval-methods","text":"matrix rows every group columns every sample. Missing peaks NA values.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/highlightChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Add definition of chromatographic peaks to an extracted chromatogram plot — highlightChromPeaks","title":"Add definition of chromatographic peaks to an extracted chromatogram plot — highlightChromPeaks","text":"highlightChromPeaks function adds chromatographic peak definitions existing plot, one created plot method Chromatogram MChromatograms object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/highlightChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add definition of chromatographic peaks to an extracted chromatogram plot — highlightChromPeaks","text":"","code":"highlightChromPeaks( x, rt, mz, peakIds = character(), border = rep(\"00000040\", length(fileNames(x))), lwd = 1, col = NA, type = c(\"rect\", \"point\", \"polygon\"), whichPeaks = c(\"any\", \"within\", \"apex_within\"), ... )"},{"path":"https://sneumann.github.io/xcms/reference/highlightChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add definition of chromatographic peaks to an extracted chromatogram plot — highlightChromPeaks","text":"x highlightChromPeaks: XCMSnExp object detected peaks. rt highlightChromPeaks: numeric(2) retention time range peaks extracted plotted. mz numeric(2) mz range peaks extracted plotted. peakIds character defining IDs (.e. rownames peak chromPeaks table) chromatographic peaks highlighted plot. border colors used color border rectangles/peaks. equal number samples x. lwd numeric(1) defining width line/border. col highlightChromPeaks: color used fill rectangle (type = \"rect\") peak (type = \"polygon\"). type plotting type. See plot base grapics details. highlightChromPeaks: character(1) defining peak highlighted: type = \"rect\" draws rectangle representing peak definition, type = \"point\" indicates chromatographic peak single point position peak's \"rt\" \"maxo\" type = \"polygon\" highlight peak shape. type = \"polygon\" color border area can defined parameters \"border\" \"col\", respectively. whichPeaks character(1) specifying peaks called located within region defined mz rt. Can one \"\", \"within\", \"apex_within\" peaks even partially overlapping region, peaks completely within region, peaks apex within region. parameter passed type argument chromPeaks function. See related documentation information examples. ... additional parameters matplot plot function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/highlightChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Add definition of chromatographic peaks to an extracted chromatogram plot — highlightChromPeaks","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/highlightChromPeaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add definition of chromatographic peaks to an extracted chromatogram plot — highlightChromPeaks","text":"","code":"## Load a test data set with detected peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) ## Extract the ion chromatogram for one chromatographic peak in the data. chrs <- chromatogram(faahko_sub, rt = c(2700, 2900), mz = 335) plot(chrs) ## Extract chromatographic peaks for the mz/rt range (if any). chromPeaks(faahko_sub, rt = c(2700, 2900), mz = 335) #> mz mzmin mzmax rt rtmin rtmax into intb maxo sn sample #> CP095 335 335 335 2786.199 2764.29 2812.803 1496244 1451652 58736 55 2 ## Highlight the chromatographic peaks in the area ## Show the peak definition with a rectangle highlightChromPeaks(faahko_sub, rt = c(2700, 2900), mz = 335) ## Color the actual peak highlightChromPeaks(faahko_sub, rt = c(2700, 2900), mz = 335, col = c(\"#ff000020\", \"#00ff0020\"), type = \"polygon\")"},{"path":"https://sneumann.github.io/xcms/reference/image.xcmsRaw.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot log intensity image of a xcmsRaw object — image-methods","title":"Plot log intensity image of a xcmsRaw object — image-methods","text":"Create log intensity false-color image xcmsRaw object plotted m/z retention time axes","code":""},{"path":"https://sneumann.github.io/xcms/reference/image.xcmsRaw.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot log intensity image of a xcmsRaw object — image-methods","text":"x = \"xcmsRaw\" image(x, col = rainbow(256), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/image.xcmsRaw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot log intensity image of a xcmsRaw object — image-methods","text":"x xcmsRaw object col vector colors use image ... arguments profRange","code":""},{"path":"https://sneumann.github.io/xcms/reference/image.xcmsRaw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot log intensity image of a xcmsRaw object — image-methods","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"function provides missing value imputation based linear interpolation resembles functionality profBinLin profBinLinBase functions deprecated version 1.51 .","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"","code":"imputeLinInterpol( x, baseValue, method = \"lin\", distance = 1L, noInterpolAtEnds = FALSE )"},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"x numeric vector eventual missing (NA) values. baseValue base value empty elements set. considered method = \"linbase\" corresponds profBinLinBase's baselevel argument. method One \"none\", \"lin\" \"linbase\". distance method = \"linbase\": number non-empty neighboring element empty element considered linear interpolation. See details section information. noInterpolAtEnds method = \"lin\": Logical indicating whether linear interpolation also performed ends data vector (.e. missing values present beginning end vector).","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"numeric vector empty values imputed based selected method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"Values NAs input vector x can imputed using methods \"lin\" \"linbase\": impute = \"lin\" uses simple linear imputation derive value empty element input vector x neighboring non-empty elements. method equivalent linear interpolation profBinLin method. Whether interpolation performed missing values present beginning end x can set argument noInterpolAtEnds. default interpolation also performed ends interpolating 0 beginning towards 0 end. noInterpolAtEnds = TRUE interpolation performed ends replacing missing values beginning /end x 0. impute = \"linbase\" uses linear interpolation impute values empty elements within user-definable proximity non-empty elements setting element's value baseValue otherwise. default baseValue half smallest value x (NAs removed). Whether linear interpolation based imputation performed missing value depends distance argument. Interpolation performed one next distance closest neighbors current empty element value NA. interpolation takes place distance = 0, distance = 1 means value empty element interpolated directly adjacent non-empty elements , next neighbors current empty element also NA, vale set baseValue. corresponds linear interpolation performed profBinLinBase method. details see examples .","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeLinInterpol.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute values for empty elements in a vector using linear interpolation — imputeLinInterpol","text":"","code":"####### ## Impute missing values by linearly interpolating from neighboring ## non-empty elements x <- c(3, NA, 1, 2, NA, NA, 4, NA, NA, NA, 3, NA, NA, NA, NA, 2) imputeLinInterpol(x, method = \"lin\") #> [1] 3.000000 2.000000 1.000000 2.000000 2.666667 3.333333 4.000000 3.750000 #> [9] 3.500000 3.250000 3.000000 2.800000 2.600000 2.400000 2.200000 2.000000 ## visualize the interpolation: plot(x = 1:length(x), y = x) points(x = 1:length(x), y = imputeLinInterpol(x, method = \"lin\"), type = \"l\", col = \"grey\") ## If the first or last elements are NA, interpolation is performed from 0 ## to the first non-empty element. x <- c(NA, 2, 1, 4, NA) imputeLinInterpol(x, method = \"lin\") #> [1] 1 2 1 4 2 ## visualize the interpolation: plot(x = 1:length(x), y = x) points(x = 1:length(x), y = imputeLinInterpol(x, method = \"lin\"), type = \"l\", col = \"grey\") ## If noInterpolAtEnds is TRUE no interpolation is performed at both ends imputeLinInterpol(x, method = \"lin\", noInterpolAtEnds = TRUE) #> [1] 0 2 1 4 0 ###### ## method = \"linbase\" ## \"linbase\" performs imputation by interpolation for empty elements based on ## 'distance' adjacent non-empty elements, setting all remaining empty elements ## to the baseValue x <- c(3, NA, 1, 2, NA, NA, 4, NA, NA, NA, 3, NA, NA, NA, NA, 2) ## Setting distance = 0 skips imputation by linear interpolation imputeLinInterpol(x, method = \"linbase\", distance = 0) #> [1] 3.0 0.5 1.0 2.0 0.5 0.5 4.0 0.5 0.5 0.5 3.0 0.5 0.5 0.5 0.5 2.0 ## With distance = 1 for all empty elements next to a non-empty element the value ## is imputed by linear interpolation. xInt <- imputeLinInterpol(x, method = \"linbase\", distance = 1L) xInt #> [1] 3.000000 2.000000 1.000000 2.000000 2.666667 3.333333 4.000000 2.250000 #> [9] 0.500000 1.750000 3.000000 1.750000 0.500000 0.500000 1.250000 2.000000 plot(x = 1:length(x), y = x, ylim = c(0, max(x, na.rm = TRUE))) points(x = 1:length(x), y = xInt, type = \"l\", col = \"grey\") ## Setting distance = 2L would cause that for all empty elements for which the ## distance to the next non-empty element is <= 2 the value is imputed by ## linear interpolation: xInt <- imputeLinInterpol(x, method = \"linbase\", distance = 2L) xInt #> [1] 3.000000 2.000000 1.000000 2.000000 2.666667 3.333333 4.000000 3.750000 #> [9] 3.500000 3.250000 3.000000 2.800000 2.600000 2.400000 2.200000 2.000000 plot(x = 1:length(x), y = x, ylim = c(0, max(x, na.rm = TRUE))) points(x = 1:length(x), y = xInt, type = \"l\", col = \"grey\")"},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMin.html","id":null,"dir":"Reference","previous_headings":"","what":"Replace missing values with a proportion of the row minimum — imputeRowMin","title":"Replace missing values with a proportion of the row minimum — imputeRowMin","text":"imputeRowMin imputes missing values x replacing NAs row proportion minimal value row (.e. min_fraction * min(x[, ])).","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMin.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Replace missing values with a proportion of the row minimum — imputeRowMin","text":"","code":"imputeRowMin(x, min_fraction = 1/2)"},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMin.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Replace missing values with a proportion of the row minimum — imputeRowMin","text":"x matrix abundances, rows features/metabolites columns samples. min_fraction numeric(1) fraction row minimum used replace NA values row.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMin.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Replace missing values with a proportion of the row minimum — imputeRowMin","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMin.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Replace missing values with a proportion of the row minimum — imputeRowMin","text":"","code":"library(MSnbase) library(faahKO) data(\"faahko\") xset <- group(faahko) mat <- groupval(xset, value = \"into\") mat_imp <- imputeRowMin(mat) head(mat) #> ko15 ko16 ko18 ko19 ko21 ko22 #> 200.1/2926 147887.5 451600.7 65290.38 NA 91635.45 162012.4 #> 205/2791 1778568.9 1567038.1 1482796.38 1039129.8 1223132.35 1072037.7 #> 206/2790 237993.6 269714.0 201393.42 150107.3 176989.65 156797.0 #> 207.1/2719 380873.0 460629.7 351750.14 219288.0 286848.56 235022.6 #> 219.1/2525 235544.9 173623.4 NA NA 185792.43 174458.8 #> 231/2517 NA NA 222609.07 286232.1 435094.49 NA #> wt15 wt16 wt18 wt19 wt21 wt22 #> 200.1/2926 175177.1 82619.48 NA 69198.22 153273.5 98144.28 #> 205/2791 1950287.5 1466780.60 1572679.16 1275312.76 1356014.3 1231442.16 #> 206/2790 276541.8 222366.15 211717.71 186850.88 188285.9 172348.76 #> 207.1/2719 417169.6 324892.46 277990.70 220972.35 252874.0 236728.16 #> 219.1/2525 244584.5 161184.05 72029.38 NA 238194.4 173829.95 #> 231/2517 NA NA NA 240261.21 201316.2 179437.72 head(mat_imp) #> ko15 ko16 ko18 ko19 ko21 ko22 #> 200.1/2926 147887.53 451600.71 65290.38 32645.19 91635.45 162012.44 #> 205/2791 1778568.94 1567038.14 1482796.38 1039129.82 1223132.35 1072037.70 #> 206/2790 237993.62 269713.98 201393.42 150107.31 176989.65 156797.04 #> 207.1/2719 380873.05 460629.74 351750.14 219287.97 286848.56 235022.63 #> 219.1/2525 235544.92 173623.38 36014.69 36014.69 185792.43 174458.77 #> 231/2517 89718.86 89718.86 222609.07 286232.15 435094.49 89718.86 #> wt15 wt16 wt18 wt19 wt21 wt22 #> 200.1/2926 175177.08 82619.48 32645.19 69198.22 153273.5 98144.28 #> 205/2791 1950287.49 1466780.60 1572679.16 1275312.76 1356014.3 1231442.16 #> 206/2790 276541.85 222366.15 211717.71 186850.88 188285.9 172348.76 #> 207.1/2719 417169.58 324892.46 277990.70 220972.35 252874.0 236728.16 #> 219.1/2525 244584.47 161184.05 72029.38 36014.69 238194.4 173829.95 #> 231/2517 89718.86 89718.86 89718.86 240261.21 201316.2 179437.72 ## Replace with 1/8 of the row mimimum head(imputeRowMin(mat, min_fraction = 1/8)) #> ko15 ko16 ko18 ko19 ko21 ko22 #> 200.1/2926 147887.53 451600.71 65290.385 8161.298 91635.45 162012.44 #> 205/2791 1778568.94 1567038.14 1482796.385 1039129.818 1223132.35 1072037.70 #> 206/2790 237993.62 269713.98 201393.415 150107.310 176989.65 156797.04 #> 207.1/2719 380873.05 460629.74 351750.138 219287.968 286848.56 235022.63 #> 219.1/2525 235544.92 173623.38 9003.672 9003.672 185792.43 174458.77 #> 231/2517 22429.72 22429.72 222609.068 286232.146 435094.49 22429.72 #> wt15 wt16 wt18 wt19 wt21 wt22 #> 200.1/2926 175177.08 82619.48 8161.298 69198.222 153273.5 98144.28 #> 205/2791 1950287.49 1466780.60 1572679.161 1275312.758 1356014.3 1231442.16 #> 206/2790 276541.85 222366.15 211717.713 186850.878 188285.9 172348.76 #> 207.1/2719 417169.58 324892.46 277990.701 220972.352 252874.0 236728.16 #> 219.1/2525 244584.47 161184.05 72029.378 9003.672 238194.4 173829.95 #> 231/2517 22429.72 22429.72 22429.715 240261.212 201316.2 179437.72"},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMinRand.html","id":null,"dir":"Reference","previous_headings":"","what":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","title":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","text":"Replace missing values random numbers. using method = \"mean_sd\", random numbers generated normal distribution based (fraction ) row min standard deviation estimated linear relationship row standard deviation mean full data set. Parameter sd_fraction allows reduce estimated standard deviation. using method method = \"from_to\", random numbers 2 specific values generated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMinRand.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","text":"","code":"imputeRowMinRand( x, method = c(\"mean_sd\", \"from_to\"), min_fraction = 1/2, min_fraction_from = 1/1000, sd_fraction = 1, abs = TRUE )"},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMinRand.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","text":"x matrix abundances, rows features/metabolites columns samples. method method character(1) defining imputation method. See description details. Defaults method = \"mean_sd\". min_fraction numeric(1) fraction row minimum used replace NA values row case mean_sd method specified. using from_to method, value one used calculate maximum value replace NA values row. min_fraction_from numeric(1) fraction row minimum used calculate minimum value replace NA values row. parameter used case from_to method specified. sd_fraction numeric(1) factor reduce estimated standard deviation. parameter used case mean_sd method specified. abs logical(1) force imputed values strictly positive.","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMinRand.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","text":"method mean_sd, imputed values taken normal distribution mean user defined fraction row minimum standard deviation estimated mean based linear relationship row standard deviations row means full matrix x. largely avoid imputed values negative larger real values, standard deviation random number generation estimated ignoring intercept linear model estimating relationship standard deviation mean. abs = TRUE NA values replaced absolute value random values. method from_to, imputed values taken 2 user defined fractions row minimum.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMinRand.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","text":"Johannes Rainer, Mar Garcia-Aloy","code":""},{"path":"https://sneumann.github.io/xcms/reference/imputeRowMinRand.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Impute missing values with random numbers based on the row minimum — imputeRowMinRand","text":"","code":"library(faahKO) library(MSnbase) data(\"faahko\") xset <- group(faahko) mat <- groupval(xset, value = \"into\") ## Estimate the relationship between row sd and mean. The standard deviation ## of the random distribution is estimated on this relationship. mns <- rowMeans(mat, na.rm = TRUE) sds <- apply(mat, MARGIN = 1, sd, na.rm = TRUE) plot(mns, sds) abline(lm(sds ~ mns)) mat_imp_meansd <- imputeRowMinRand(mat, method = \"mean_sd\") mat_imp_fromto <- imputeRowMinRand(mat, method = \"from_to\") head(mat) #> ko15 ko16 ko18 ko19 ko21 ko22 #> 200.1/2926 147887.5 451600.7 65290.38 NA 91635.45 162012.4 #> 205/2791 1778568.9 1567038.1 1482796.38 1039129.8 1223132.35 1072037.7 #> 206/2790 237993.6 269714.0 201393.42 150107.3 176989.65 156797.0 #> 207.1/2719 380873.0 460629.7 351750.14 219288.0 286848.56 235022.6 #> 219.1/2525 235544.9 173623.4 NA NA 185792.43 174458.8 #> 231/2517 NA NA 222609.07 286232.1 435094.49 NA #> wt15 wt16 wt18 wt19 wt21 wt22 #> 200.1/2926 175177.1 82619.48 NA 69198.22 153273.5 98144.28 #> 205/2791 1950287.5 1466780.60 1572679.16 1275312.76 1356014.3 1231442.16 #> 206/2790 276541.8 222366.15 211717.71 186850.88 188285.9 172348.76 #> 207.1/2719 417169.6 324892.46 277990.70 220972.35 252874.0 236728.16 #> 219.1/2525 244584.5 161184.05 72029.38 NA 238194.4 173829.95 #> 231/2517 NA NA NA 240261.21 201316.2 179437.72 head(mat_imp_meansd) #> ko15 ko16 ko18 ko19 ko21 ko22 #> 200.1/2926 147887.5 451600.71 65290.38 25418.38 91635.45 162012.44 #> 205/2791 1778568.9 1567038.14 1482796.38 1039129.82 1223132.35 1072037.70 #> 206/2790 237993.6 269713.98 201393.42 150107.31 176989.65 156797.04 #> 207.1/2719 380873.0 460629.74 351750.14 219287.97 286848.56 235022.63 #> 219.1/2525 235544.9 173623.38 24880.01 32149.76 185792.43 174458.77 #> 231/2517 101238.9 76327.08 222609.07 286232.15 435094.49 85929.56 #> wt15 wt16 wt18 wt19 wt21 wt22 #> 200.1/2926 175177.1 82619.48 22707.20 69198.22 153273.5 98144.28 #> 205/2791 1950287.5 1466780.60 1572679.16 1275312.76 1356014.3 1231442.16 #> 206/2790 276541.8 222366.15 211717.71 186850.88 188285.9 172348.76 #> 207.1/2719 417169.6 324892.46 277990.70 220972.35 252874.0 236728.16 #> 219.1/2525 244584.5 161184.05 72029.38 49169.00 238194.4 173829.95 #> 231/2517 124602.4 99186.90 79848.59 240261.21 201316.2 179437.72 head(mat_imp_fromto) #> ko15 ko16 ko18 ko19 ko21 ko22 #> 200.1/2926 147887.53 451600.7 65290.38 7359.863 91635.45 162012.44 #> 205/2791 1778568.94 1567038.1 1482796.38 1039129.818 1223132.35 1072037.70 #> 206/2790 237993.62 269714.0 201393.42 150107.310 176989.65 156797.04 #> 207.1/2719 380873.05 460629.7 351750.14 219287.968 286848.56 235022.63 #> 219.1/2525 235544.92 173623.4 11044.23 27016.589 185792.43 174458.77 #> 231/2517 44911.84 49671.3 222609.07 286232.146 435094.49 11386.76 #> wt15 wt16 wt18 wt19 wt21 wt22 #> 200.1/2926 175177.08 82619.48 4396.818 69198.22 153273.5 98144.28 #> 205/2791 1950287.49 1466780.60 1572679.161 1275312.76 1356014.3 1231442.16 #> 206/2790 276541.85 222366.15 211717.713 186850.88 188285.9 172348.76 #> 207.1/2719 417169.58 324892.46 277990.701 220972.35 252874.0 236728.16 #> 219.1/2525 244584.47 161184.05 72029.378 15814.95 238194.4 173829.95 #> 231/2517 14954.11 74724.08 9623.735 240261.21 201316.2 179437.72"},{"path":"https://sneumann.github.io/xcms/reference/isolationWindowTargetMz-OnDiskMSnExp-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract isolation window target m/z definition — isolationWindowTargetMz,OnDiskMSnExp-method","title":"Extract isolation window target m/z definition — isolationWindowTargetMz,OnDiskMSnExp-method","text":"isolationWindowTargetMz extracts isolation window target m/z definition spectrum object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/isolationWindowTargetMz-OnDiskMSnExp-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract isolation window target m/z definition — isolationWindowTargetMz,OnDiskMSnExp-method","text":"","code":"# S4 method for OnDiskMSnExp isolationWindowTargetMz(object)"},{"path":"https://sneumann.github.io/xcms/reference/isolationWindowTargetMz-OnDiskMSnExp-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract isolation window target m/z definition — isolationWindowTargetMz,OnDiskMSnExp-method","text":"object OnDiskMSnExp object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/isolationWindowTargetMz-OnDiskMSnExp-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract isolation window target m/z definition — isolationWindowTargetMz,OnDiskMSnExp-method","text":"numeric length equal number spectra object isolation window target m/z NA specified/available.","code":""},{"path":"https://sneumann.github.io/xcms/reference/isolationWindowTargetMz-OnDiskMSnExp-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract isolation window target m/z definition — isolationWindowTargetMz,OnDiskMSnExp-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/levelplot.xcmsRaw.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot log intensity image of a xcmsRaw object — levelplot-methods","title":"Plot log intensity image of a xcmsRaw object — levelplot-methods","text":"Create image raw (profile) data m/z retention time, intensity color coded.","code":""},{"path":"https://sneumann.github.io/xcms/reference/levelplot.xcmsRaw.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot log intensity image of a xcmsRaw object — levelplot-methods","text":"x = \"xcmsRaw\" levelplot(x, log=TRUE, col.regions=colorRampPalette(brewer.pal(9, \"YlOrRd\"))(256), ...) x = \"xcmsSet\" levelplot(x, log=TRUE, col.regions=colorRampPalette(brewer.pal(9, \"YlOrRd\"))(256), rt=\"raw\", ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/levelplot.xcmsRaw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot log intensity image of a xcmsRaw object — levelplot-methods","text":"x xcmsRaw object. log Whether intensity log transformed. col.regions color ramp used encoding intensity. rt wheter original (rt=\"raw\") corrected (rt=\"corrected\") retention times used. ... Arguments profRange.","code":""},{"path":"https://sneumann.github.io/xcms/reference/levelplot.xcmsRaw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot log intensity image of a xcmsRaw object — levelplot-methods","text":"Johannes Rainer, johannes.rainer@eurac.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/loadRaw-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Read binary data from a source — loadRaw-methods","title":"Read binary data from a source — loadRaw-methods","text":"function extracts raw data used xcmsRaw object. processing data done xcmsRaw constructor.","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadRaw-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Read binary data from a source — loadRaw-methods","text":"signature(object = \"xcmsSource\") Uses loadRaw,xcmsSource-method extract raw data. Subclasses xcmsSource can provide different ways fetching data.","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadRaw-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read binary data from a source — loadRaw-methods","text":"object Specification data source (file name database query)","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadRaw-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read binary data from a source — loadRaw-methods","text":"implementing methods decide gather data.","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadRaw-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read binary data from a source — loadRaw-methods","text":"list containing elements describing data source. rt, scanindex, tic, acquisitionNum components one entry per scan. parallel sense rt[1], scanindex[1], acquisitionNum[1] refer scan. list containst following components: rt Numeric vector acquisition time (seconds) scan tic Numeric vector Total Ion Count scan scanindex Integer vector starting positions scan mz intensity components. exclusive offset, scanindex[] offset mz intensity beginning scan . means mz (respectively intensity) values scan scanindex[] + 1 scanindex[+ 1] mz Concatenated vector m/z values scans intensity Concatenated vector intensity values scans","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadRaw-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read binary data from a source — loadRaw-methods","text":"Daniel Hackney, dan@haxney.org","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/loadXcmsData.html","id":null,"dir":"Reference","previous_headings":"","what":"LC-MS preprocessing result test data sets — loadXcmsData","title":"LC-MS preprocessing result test data sets — loadXcmsData","text":"Data sets `xcms` preprocessing results provided within `xcms` package can loaded `loadXcmsData` function. available Test data sets : - `xdata`: [XCMSnExp()] object results `xcms`-based pre-processing LC-MS untargeted metabolomics data set. raw data files provided `faahKO` R package. - `xmse`: [XcmsExperiment()] object results `xcms`-based pre-processing LC-MS untargeted metabolomics data set (original data set pre-processing settings `xdata` data set). pre-processing data set described detail *xcms* vignette `xcms` package. - `faahko_sub`: [XCMSnExp()] object identified chromatographic peaks 3 samples data files `faahKO` R package. - `faahko_sub2`: [XcmsExperiment()] object identified chromatographic peaks 3 samples data files `faahKO` R package. Data sets can also loaded using `data`, however require update objects point location raw data files. `loadXcmsData` loads data ensures paths updated accordingly.","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadXcmsData.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"LC-MS preprocessing result test data sets — loadXcmsData","text":"","code":"loadXcmsData(x = c(\"xmse\", \"xdata\", \"faahko_sub\", \"faahko_sub2\"))"},{"path":"https://sneumann.github.io/xcms/reference/loadXcmsData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"LC-MS preprocessing result test data sets — loadXcmsData","text":"x `loadXcmsData`: `character(1)` name data file (object) load.","code":""},{"path":"https://sneumann.github.io/xcms/reference/loadXcmsData.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"LC-MS preprocessing result test data sets — loadXcmsData","text":"","code":"library(xcms) xdata <- loadXcmsData()"},{"path":"https://sneumann.github.io/xcms/reference/manualChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Manual peak integration and feature definition — manualChromPeaks","title":"Manual peak integration and feature definition — manualChromPeaks","text":"manualChromPeaks function allows manually define chromatographic peaks, integrate intensities within specified peak area add object's chromPeaks matrix. peak added sample signal found respective data file. chromatographic peaks added eventually previously identified peaks, suggested run refineChromPeaks() MergeNeighboringPeaksParam() approach merge potentially overlapping peaks. manualFeatures function allows manually group identified chromatographic peaks features providing index object's chromPeaks matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/manualChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Manual peak integration and feature definition — manualChromPeaks","text":"","code":"manualChromPeaks(object, ...) manualFeatures(object, ...) # S4 method for MsExperiment manualChromPeaks( object, chromPeaks = matrix(numeric()), samples = seq_along(object), msLevel = 1L, chunkSize = 2L, BPPARAM = bpparam() ) # S4 method for XcmsExperiment manualChromPeaks( object, chromPeaks = matrix(numeric()), samples = seq_along(object), msLevel = 1L, chunkSize = 2L, BPPARAM = bpparam() ) # S4 method for XcmsExperiment manualFeatures(object, peakIdx = list(), msLevel = 1L) # S4 method for OnDiskMSnExp manualChromPeaks( object, chromPeaks = matrix(), samples = seq_along(fileNames(object)), msLevel = 1L, BPPARAM = bpparam() ) # S4 method for XCMSnExp manualChromPeaks( object, chromPeaks = matrix(), samples = seq_along(fileNames(object)), msLevel = 1L, BPPARAM = bpparam() ) # S4 method for XCMSnExp manualFeatures(object, peakIdx = list(), msLevel = 1L)"},{"path":"https://sneumann.github.io/xcms/reference/manualChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Manual peak integration and feature definition — manualChromPeaks","text":"object XcmsExperiment, XCMSnExp OnDiskMSnExp object. ... ignored. chromPeaks manualChromPeaks: matrix defining boundaries chromatographic peaks one row per chromatographic peak columns \"mzmin\", \"mzmax\", \"rtmin\" \"rtmax\" defining m/z retention time region peak. samples manualChromPeaks: optional integer defining individual samples peak integration performed. Defaults samples. msLevel integer(1) defining MS level peak integration performed. single MS level time supported. Defaults msLevel = 1L. chunkSize integer(1) defining number files (samples) loaded memory processed time. Peak integration performed parallel (per sample) subset data. setting thus allows balance memory demand speed (due parallel processing). parallel processing can performed subset data currently loaded memory iteration, value chunkSize match defined parallel setting setup. Using parallel processing setup using 4 CPUs (separate processes) using chunkSize = 1will perform parallel processing, data one sample loaded memory time. hand, settingchunkSize` total number samples experiment load full MS data memory thus settings cause --memory error. BPPARAM parallel processing settings (see bpparam() details). peakIdx manualFeatures: list integer vectors indices chromatographic peaks object's chromPeaks matrix grouped features.","code":""},{"path":"https://sneumann.github.io/xcms/reference/manualChromPeaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Manual peak integration and feature definition — manualChromPeaks","text":"XcmsExperiment XCMSnExp manually added chromatographic peaks features.","code":""},{"path":"https://sneumann.github.io/xcms/reference/manualChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Manual peak integration and feature definition — manualChromPeaks","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/manualChromPeaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Manual peak integration and feature definition — manualChromPeaks","text":"","code":"## Read a test dataset. fls <- c(system.file(\"microtofq/MM14.mzML\", package = \"msdata\"), system.file(\"microtofq/MM8.mzML\", package = \"msdata\")) ## Define a data frame with some sample annotations ann <- data.frame( injection_index = 1:2, sample_id = c(\"MM14\", \"MM8\")) ## Import the data library(MsExperiment) mse <- readMsExperiment(fls) ## Define some arbitrary peak areas pks <- cbind( mzmin = c(512, 234.3), mzmax = c(513, 235), rtmin = c(10, 33), rtmax = c(19, 50) ) pks #> mzmin mzmax rtmin rtmax #> [1,] 512.0 513 10 19 #> [2,] 234.3 235 33 50 res <- manualChromPeaks(mse, pks) chromPeaks(res) #> mz mzmin mzmax rt rtmin rtmax into sample maxo sn #> CP1 512.6294 512.0 513 18.66000 10 19 848.4231 2 85 NA #> CP2 234.8539 234.3 235 41.54298 33 50 2690.4200 2 245 NA ## Peaks were only found in the second file."},{"path":"https://sneumann.github.io/xcms/reference/medianFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply a median filter to a matrix — medianFilter","title":"Apply a median filter to a matrix — medianFilter","text":"element matix, replace median values around .","code":""},{"path":"https://sneumann.github.io/xcms/reference/medianFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply a median filter to a matrix — medianFilter","text":"","code":"medianFilter(x, mrad, nrad)"},{"path":"https://sneumann.github.io/xcms/reference/medianFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply a median filter to a matrix — medianFilter","text":"x numeric matrix median filter mrad number rows either side value use median calculation nrad number rows either side value use median calculation","code":""},{"path":"https://sneumann.github.io/xcms/reference/medianFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply a median filter to a matrix — medianFilter","text":"matrix whose values median filtered","code":""},{"path":"https://sneumann.github.io/xcms/reference/medianFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Apply a median filter to a matrix — medianFilter","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/medianFilter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Apply a median filter to a matrix — medianFilter","text":"","code":"mat <- matrix(1:25, nrow=5) mat #> [,1] [,2] [,3] [,4] [,5] #> [1,] 1 6 11 16 21 #> [2,] 2 7 12 17 22 #> [3,] 3 8 13 18 23 #> [4,] 4 9 14 19 24 #> [5,] 5 10 15 20 25 medianFilter(mat, 1, 1) #> [,1] [,2] [,3] [,4] [,5] #> [1,] 4.0 6.5 11.5 16.5 19.0 #> [2,] 4.5 7.0 12.0 17.0 19.5 #> [3,] 5.5 8.0 13.0 18.0 20.5 #> [4,] 6.5 9.0 14.0 19.0 21.5 #> [5,] 7.0 9.5 14.5 19.5 22.0"},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":null,"dir":"Reference","previous_headings":"","what":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"MS2 MSn data stored separate slots, can directly used e.g. findPeaks(). msn2xcmsRaw() copy MSn spectra \"normal\" xcmsRaw slots.","code":""},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"","code":"msn2xcmsRaw(xmsn)"},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"xmsn object class xcmsRaw contains spectra read includeMSn=TRUE","code":""},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"default gap value determined 90th percentile pair-wise differences adjacent mass values.","code":""},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"xcmsRaw object","code":""},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"Steffen Neumann sneumann@ipb-halle.de","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/msn2xcmsRaw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Copy MSn data in an xcmsRaw to the MS slots — msn2xcmsRaw","text":"","code":"msnfile <- system.file(\"microtofq/MSMSpos20_6.mzML\", package = \"msdata\") xrmsn <- xcmsRaw(msnfile, includeMSn=TRUE) #> Create profile matrix with method 'bin' and step 1 ... #> OK xr <- msn2xcmsRaw(xrmsn) p <- findPeaks(xr, method=\"centWave\") #> Detecting mass traces at 25 ppm ... #> OK #> Detecting chromatographic peaks in 10 regions of interest ... #> OK: 10 found."},{"path":"https://sneumann.github.io/xcms/reference/na.flatfill.html","id":null,"dir":"Reference","previous_headings":"","what":"Fill in NA values at the extremes of a vector — na.flatfill","title":"Fill in NA values at the extremes of a vector — na.flatfill","text":"Extend first last real values vector fill NA values present.","code":""},{"path":"https://sneumann.github.io/xcms/reference/na.flatfill.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fill in NA values at the extremes of a vector — na.flatfill","text":"","code":"na.flatfill(x)"},{"path":"https://sneumann.github.io/xcms/reference/na.flatfill.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fill in NA values at the extremes of a vector — na.flatfill","text":"x numeric vector NA values","code":""},{"path":"https://sneumann.github.io/xcms/reference/na.flatfill.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fill in NA values at the extremes of a vector — na.flatfill","text":"Modified vector.","code":""},{"path":"https://sneumann.github.io/xcms/reference/na.flatfill.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Fill in NA values at the extremes of a vector — na.flatfill","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/overlappingFeatures.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify overlapping features — overlappingFeatures","title":"Identify overlapping features — overlappingFeatures","text":"overlappingFeatures identifies features overlapping close m/z - rt space.","code":""},{"path":"https://sneumann.github.io/xcms/reference/overlappingFeatures.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify overlapping features — overlappingFeatures","text":"","code":"overlappingFeatures(x, expandMz = 0, expandRt = 0, ppm = 0)"},{"path":"https://sneumann.github.io/xcms/reference/overlappingFeatures.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify overlapping features — overlappingFeatures","text":"x XcmsExperiment() XCMSnExp() object features. expandMz numeric(1) value expand feature (side) m/z dimension identifying overlapping features. resulting \"mzmin\" feature thus mzmin - expandMz \"mzmax\" mzmax + expandMz. expandRt numeric(1) value expand feature (side) retention time dimension identifying overlapping features. resulting \"rtmin\" feature thus rtmin - expandRt \"rtmax\" rtmax + expandRt. ppm numeric(1) grow m/z width feature relative value: mzmin - mzmin * ppm / 2e6, mzmax + mzmax * ppm / 2e6. feature thus expanded m/z dimension ppm/2 side identifying overlapping features.","code":""},{"path":"https://sneumann.github.io/xcms/reference/overlappingFeatures.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify overlapping features — overlappingFeatures","text":"list indices features (featureDefinitions()) overlapping.","code":""},{"path":"https://sneumann.github.io/xcms/reference/overlappingFeatures.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify overlapping features — overlappingFeatures","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/overlappingFeatures.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify overlapping features — overlappingFeatures","text":"","code":"## Load a test data set with detected peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Disable parallel processing for this example register(SerialParam()) ## Correspondence analysis xdata <- groupChromPeaks(faahko_sub, param = PeakDensityParam(sampleGroups = c(1, 1, 1))) ## Identify overlapping features overlappingFeatures(xdata) #> list() ## Identify features that are separated on retention time by less than ## 2 minutes overlappingFeatures(xdata, expandRt = 60) #> [[1]] #> [1] 5 6 #> #> [[2]] #> [1] 31 32 #>"},{"path":"https://sneumann.github.io/xcms/reference/panel.cor.html","id":null,"dir":"Reference","previous_headings":"","what":"Correlation coefficient panel for pairs function — panel.cor","title":"Correlation coefficient panel for pairs function — panel.cor","text":"Correlation coefficient panel pairs function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/panel.cor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Correlation coefficient panel for pairs function — panel.cor","text":"","code":"panel.cor(x, y, digits = 2, prefix = \"\", cex.cor)"},{"path":"https://sneumann.github.io/xcms/reference/panel.cor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correlation coefficient panel for pairs function — panel.cor","text":"x first data series y second data series digits number digits plot prefix text prefix coefficients cex.cor character expansion factor","code":""},{"path":"https://sneumann.github.io/xcms/reference/panel.cor.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correlation coefficient panel for pairs function — panel.cor","text":"Colin . Smith, csmith@scripps.edu, based pairs example code","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/peakPlots-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot a grid of a large number of peaks — peakPlots-methods","title":"Plot a grid of a large number of peaks — peakPlots-methods","text":"Plot extracted ion chromatograms many peaks simultaneously, indicating peak integration start end points vertical grey lines.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakPlots-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot a grid of a large number of peaks — peakPlots-methods","text":"signature(object = \"xcmsSet\") plotPeaks(object, peaks, figs, width = 200)","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakPlots-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot a grid of a large number of peaks — peakPlots-methods","text":"object xcmsRaw object peaks matrix peak information produced findPeaks figs two-element vector describing number rows number columns peaks plot, missing approximately square grid fit number peaks supplied width width chromatogram retention time plot peak","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakPlots-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot a grid of a large number of peaks — peakPlots-methods","text":"function intended help graphically analyze results peak picking. can help estimate number false positives improper integration start end points. output compact tries waste little space possible. plot labeled rounded m/z retention time separated space.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/peakTable-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Create report of aligned peak intensities — peakTable-methods","title":"Create report of aligned peak intensities — peakTable-methods","text":"Create report showing aligned peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakTable-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Create report of aligned peak intensities — peakTable-methods","text":"object = \"xcmsSet\" peakTable(object, filebase = character(), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakTable-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create report of aligned peak intensities — peakTable-methods","text":"object xcmsSet object filebase base file name save report, .tsv file _eic appended name tabular report EIC directory, respectively. blank nothing saved ... arguments passed groupval, provides actual intensities.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakTable-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create report of aligned peak intensities — peakTable-methods","text":"method handles creation summary reports similar diffreport. returns summary report can optionally written tab-separated file. base file name provided, report (see Value section) saved tab separated file.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peakTable-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create report of aligned peak intensities — peakTable-methods","text":"data frame following columns: mz median m/z peaks group mzmin minimum m/z peaks group mzmax maximum m/z peaks group rt median retention time peaks group rtmin minimum retention time peaks group rtmax maximum retention time peaks group npeaks number peaks assigned group Sample Classes number samples sample class represented group ... one column every sample class Sample Names integrated intensity value every sample ... one column every sample","code":""},{"path":[]},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"peaksWithCentWave identifies (chromatographic) peaks purely chromatographic data, .e. based intensity retention time values without m/z values.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"","code":"peaksWithCentWave( int, rt, peakwidth = c(20, 50), snthresh = 10, prefilter = c(3, 100), integrate = 1, fitgauss = FALSE, noise = 0, verboseColumns = FALSE, firstBaselineCheck = TRUE, extendLengthMSW = FALSE, ... )"},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"int numeric intensity values. rt numeric retention time intensities. Length equal length(int). peakwidth numeric(2) lower upper bound expected peak width. snthresh numeric(1) defining signal noise ratio cutoff. Peaks signal noise ratio < snthresh omitted. prefilter numeric(2) (c(k, )): regions interest least k centroids signal >= returned first step. integrate numeric(1), integration method. integrate = 1 peak limits found descending mexican hat filtered data, integrate = 2 descend done real data. latter method accurate prone noise, former robust, less exact. fitgauss logical(1) whether Gaussian fitted peak. noise numeric(1) defining minimum required intensity centroids considered first analysis step (definition regions interest). verboseColumns logical(1): whether additional peak meta data columns returned. firstBaselineCheck logical(1). TRUE continuous data within regions interest checked first baseline. detail, first rough estimate noise calculated peak detection performed regions multiple sequential signals higher first estimated baseline/noise level. extendLengthMSW logical(1). TRUE \"open\" method EIC extension used, rather default \"reflect\" method. ... currently ignored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"matrix, row representing identified chromatographic peak, columns: \"rt\": retention time peak's midpoint (time maximum signal). \"rtmin\": minimum retention time peak. \"rtmax\": maximum retention time peak. \"\": integrated (original) intensity peak. \"intb\": per-peak baseline corrected integrated peak intensity. \"maxo\": maximum (original) intensity peak. \"sn\": signal noise ratio peak defined (maxo - baseline)/sd sd standard deviation local chromatographic noise. Additional columns verboseColumns = TRUE: \"mu\": gaussian parameter mu. \"sigma\": gaussian parameter sigma. \"h\": gaussian parameter h. \"f\": region number m/z ROI peak localized. \"dppm\": m/z deviation mass trace across scans ppm (always NA). \"scale\": scale peak localized. \"scpos\": peak position found wavelet analysis (index int). \"scmin\": left peak limit found wavelet analysis (index int). \"scmax\": right peak limit found wavelet analysis (index int).","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"method uses algorithm peak detection centWave, employs however different approach identify initial regions peak detection performed (.e. regions interest ROI). method first identifies local maxima chromatographic data defines corresponding positions +/- peakwidth[2] ROIs. Noise estimation bases also ROIs can thus different centWave resulting different signal noise ratios.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithCentWave.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify peaks in chromatographic data using centWave — peaksWithCentWave","text":"","code":"## Reading a file library(MsExperiment) library(xcms) od <- readMsExperiment(system.file(\"cdf/KO/ko15.CDF\", package = \"faahKO\")) ## Extract chromatographic data for a small m/z range mzr <- c(272.1, 272.2) chr <- chromatogram(od, mz = mzr, rt = c(3000, 3300))[1, 1] int <- intensity(chr) rt <- rtime(chr) ## Plot the region plot(chr, type = \"h\") ## Identify peaks in the chromatographic data pks <- peaksWithCentWave(intensity(chr), rtime(chr)) pks #> rt rtmin rtmax into intb maxo sn #> [1,] 3119.535 3097.625 3127.359 247211.6 227217.9 16496 24 ## Highlight the peaks rect(xleft = pks[, \"rtmin\"], xright = pks[, \"rtmax\"], ybottom = rep(0, nrow(pks)), ytop = pks[, \"maxo\"], col = \"#ff000040\", border = \"#00000040\")"},{"path":"https://sneumann.github.io/xcms/reference/peaksWithMatchedFilter.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","title":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","text":"function performs peak detection using matchedFilter algorithm chromatographic data (.e. intensities retention time).","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithMatchedFilter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","text":"","code":"peaksWithMatchedFilter( int, rt, fwhm = 30, sigma = fwhm/2.3548, max = 20, snthresh = 10, ... )"},{"path":"https://sneumann.github.io/xcms/reference/peaksWithMatchedFilter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","text":"int numeric intensity values. rt numeric retention time intensities. Length equal length(int). fwhm numeric(1) specifying full width half maximum matched filtration gaussian model peak. used calculate actual sigma, see . sigma numeric(1) specifying standard deviation (width) matched filtration model peak. max numeric(1) maximal number peaks expected/ bbe detected data snthresh numeric(1) defining signal noise cut-used peak detection step. ... currently ignored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithMatchedFilter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","text":"matrix, row representing identified chromatographic peak, columns: \"rt\": retention time peak's midpoint (time maximum signal). \"rtmin\": minimum retention time peak. \"rtmax\": maximum retention time peak. \"\": integrated (original) intensity peak. \"intf\": integrated intensity filtered peak. \"maxo\": maximum (original) intensity peak. \"maxf\"\" maximum intensity filtered peak. \"sn\": signal noise ratio peak.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/peaksWithMatchedFilter.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/peaksWithMatchedFilter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Identify peaks in chromatographic data using matchedFilter — peaksWithMatchedFilter","text":"","code":"## Load the test file faahko_sub <- loadXcmsData(\"faahko_sub\") ## Subset to one file and drop identified chromatographic peaks data <- dropChromPeaks(filterFile(faahko_sub, 1)) ## Extract chromatographic data for a small m/z range chr <- chromatogram(data, mz = c(272.1, 272.3), rt = c(3000, 3200))[1, 1] pks <- peaksWithMatchedFilter(intensity(chr), rtime(chr)) pks #> rt rtmin rtmax into intf maxo maxf sn #> [1,] 3119.535 3105.45 3133.619 332583.6 668444.6 16496 36129.39 12.33813 ## Plotting the data plot(rtime(chr), intensity(chr), type = \"h\") rect(xleft = pks[, \"rtmin\"], xright = pks[, \"rtmax\"], ybottom = c(0, 0), ytop = pks[, \"maxo\"], border = \"red\")"},{"path":"https://sneumann.github.io/xcms/reference/phenoDataFromPaths.html","id":null,"dir":"Reference","previous_headings":"","what":"Derive experimental design from file paths — phenoDataFromPaths","title":"Derive experimental design from file paths — phenoDataFromPaths","text":"phenoDataFromPaths function builds data.frame representing experimental design folder structure files experiment located.","code":""},{"path":"https://sneumann.github.io/xcms/reference/phenoDataFromPaths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Derive experimental design from file paths — phenoDataFromPaths","text":"","code":"phenoDataFromPaths(paths)"},{"path":"https://sneumann.github.io/xcms/reference/phenoDataFromPaths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Derive experimental design from file paths — phenoDataFromPaths","text":"paths character representing file names (including full path) experiment's files.","code":""},{"path":"https://sneumann.github.io/xcms/reference/phenoDataFromPaths.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Derive experimental design from file paths — phenoDataFromPaths","text":"function used old xcmsSet function guess experimental design (.e. group assignment files) folders files experiment can found.","code":""},{"path":"https://sneumann.github.io/xcms/reference/phenoDataFromPaths.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Derive experimental design from file paths — phenoDataFromPaths","text":"","code":"## List the files available in the faahKO package base_dir <- system.file(\"cdf\", package = \"faahKO\") cdf_files <- list.files(base_dir, recursive = TRUE, full.names = TRUE)"},{"path":"https://sneumann.github.io/xcms/reference/plot.xcmsEIC.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot extracted ion chromatograms from multiple files — plot.xcmsEIC","title":"Plot extracted ion chromatograms from multiple files — plot.xcmsEIC","text":"Batch plot list extracted ion chromatograms current graphics device.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plot.xcmsEIC.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot extracted ion chromatograms from multiple files — plot.xcmsEIC","text":"x = \"xcmsEIC\" plot.xcmsEIC(x, y, groupidx = groupnames(x), sampleidx = sampnames(x), rtrange = x@rtrange, col = rep(1, length(sampleidx)), legtext = NULL, peakint = TRUE, sleep = 0, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plot.xcmsEIC.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot extracted ion chromatograms from multiple files — plot.xcmsEIC","text":"xcmsSet object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plot.xcmsEIC.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot extracted ion chromatograms from multiple files — plot.xcmsEIC","text":"x xcmsEIC object y optional xcmsSet object peak integration data groupidx either character vector names integer vector indicies peak groups plot EICs sampleidx either character vector names integer vector indicies samples plot EICs rtrange two column matrix minimum maximum retention times return EIC data points number rows number groups xcmsEIC object, sampleidx used subset . otherwise, repeated length sampleidx may also single number specifying time window around peak plot EIC data col color use plotting extracted ion chromatograms. missing y specified, colors taken unclass(sampclass(y)) default palette length number groups xcmsEIC object, sampleidx used subset . otherwise, repeated length sampleidx legtext text use legend. NULL y specified, legend text taken sample class information found xcmsSet peakint logical, plot integrated peak area darkened lines (requires y also specified) sleep seconds pause plotting EICs ... graphical parameters","code":""},{"path":"https://sneumann.github.io/xcms/reference/plot.xcmsEIC.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot extracted ion chromatograms from multiple files — plot.xcmsEIC","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotAdjustedRtime.html","id":null,"dir":"Reference","previous_headings":"","what":"Visualization of Alignment Results — plotAdjustedRtime","title":"Visualization of Alignment Results — plotAdjustedRtime","text":"`plotAdjustedRtime` function plots difference adjusted *raw* retention times y-axis raw retention times x-axis. line represents results one sample (file). alignment performed using *peak groups* method (see [adjustRtime()] infromation) also peak groups used alignment visualized.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotAdjustedRtime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Visualization of Alignment Results — plotAdjustedRtime","text":"","code":"plotAdjustedRtime( object, col = \"#00000080\", lty = 1, lwd = 1, type = \"l\", adjustedRtime = TRUE, xlab = ifelse(adjustedRtime, yes = expression(rt[adj]), no = expression(rt[raw])), ylab = expression(rt[adj] - rt[raw]), peakGroupsCol = \"#00000060\", peakGroupsPch = 16, peakGroupsLty = 3, ylim, ... )"},{"path":"https://sneumann.github.io/xcms/reference/plotAdjustedRtime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Visualization of Alignment Results — plotAdjustedRtime","text":"object [XcmsExperiment()] [XCMSnExp()] object alignment results. col color(s) individual lines. length 1 equal number samples. lty line type lines individual samples. lwd line width lines individual samples. type plot *type* (see [par()] options; defaults `type = \"l\"`). adjustedRtime `logical(1)` whether adjusted raw retention times shown x-axis. xlab label x-axis. ylab label y-axis. peakGroupsCol color used peak groups (alignment performed using *peak groups* method. peakGroupsPch point character (`pch`) used peak groups (alignment performed using *peak groups* method. peakGroupsLty line type (`lty`) used connect points peak groups (alignment performed using *peak groups* method. ylim optional `numeric(2)` upper lower limits y-axis.b ... Additional arguments passed `plot` function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotAdjustedRtime.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Visualization of Alignment Results — plotAdjustedRtime","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotAdjustedRtime.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Visualization of Alignment Results — plotAdjustedRtime","text":"","code":"## Load a test data set with detected peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) ## Performing the peak grouping using the \"peak density\" method. p <- PeakDensityParam(sampleGroups = c(1, 1, 1)) res <- groupChromPeaks(faahko_sub, param = p) ## Perform the retention time adjustment using peak groups found in both ## files. fgp <- PeakGroupsParam(minFraction = 1) res <- adjustRtime(res, param = fgp) #> Performing retention time correction using 19 peak groups. #> Warning: Span too small for 'loess' and the available number of peak groups, resetting to 0.21 #> Warning: Adjusted retention times had to be re-adjusted for some files to ensure them being in the same order than the raw retention times. A call to 'dropAdjustedRtime' might thus fail to restore retention times of chromatographic peaks to their original values. Eventually consider to increase the value of the 'span' parameter. ## Visualize the impact of the alignment. plotAdjustedRtime(res, adjusted = FALSE) grid()"},{"path":"https://sneumann.github.io/xcms/reference/plotChrom-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot extracted ion chromatograms from the profile matrix — plotChrom-methods","title":"Plot extracted ion chromatograms from the profile matrix — plotChrom-methods","text":"Uses pre-generated profile mode matrix plot averaged base peak extracted ion chromatograms specified mass range.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChrom-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot extracted ion chromatograms from the profile matrix — plotChrom-methods","text":"object = \"xcmsRaw\" plotChrom(object, base = FALSE, ident = FALSE, fitgauss = FALSE, vline = numeric(0), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChrom-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot extracted ion chromatograms from the profile matrix — plotChrom-methods","text":"object xcmsRaw object base logical, plot base-peak chromatogram ident logical, use mouse identify label peaks fitgauss logical, fit gaussian largest peak vline numeric vector locations vertical lines ... arguments passed profRange","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChrom-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot extracted ion chromatograms from the profile matrix — plotChrom-methods","text":"ident == TRUE, integer vector indecies points identified. fitgauss == TRUE, nls model fitted gaussian. Otherwise two-column matrix plotted points.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"Plot density chromatographic peaks along retention time axis indicate peaks () grouped feature based using peak density correspondence method. Settings peak density method can passed PeakDensityParam object parameter param. object contains correspondence results correspondence performed peak groups method, results correspondence can visualized setting simulate = FALSE.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"","code":"# S4 method for XCMSnExp plotChromPeakDensity( object, mz, rt, param, simulate = TRUE, col = \"#00000080\", xlab = \"retention time\", ylab = \"sample\", xlim = range(rt), main = NULL, type = c(\"any\", \"within\", \"apex_within\"), ... )"},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"object XCMSnExp object identified chromatographic peaks. mz numeric(2) defining mz range peak density plotted. rt numeric(2) defining optional rt range peak density plotted. Defaults absolute retention time range object. param PeakDensityParam parameters peak density correspondence algorithm can extracted. provided object contains feature definitions correspondence/ peak grouping performed peak density method, corresponding parameter class stored object used. simulate logical(1) defining whether correspondence simulated within specified m/z / rt region (simulate = FALSE) whether results already performed correspondence shown. col Color used individual samples. Length 1 equal number samples object. xlab character(1) label x-axis. ylab character(1) label y-axis. xlim numeric(2) representing limits x-axis. Defaults range rt parameter. main character(1) defining title plot. default (main = NULL) mz-range used. type character(1) specifying peaks called located within region defined mz rt. Can one \"\", \"within\", \"apex_within\" peaks even partially overlapping region, peaks completely within region, peaks apex within region. parameter passed chromPeaks function. See related documentation information examples. ... Additional parameters passed plot function. Data point specific parameters bg pch length 1 equal number samples.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"function called side effect, .e. create plot.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"plotChromPeakDensity function allows evaluate different settings peak density mz slice interest (e.g. containing chromatographic peaks corresponding known metabolite). plot shows individual peaks detected within specified mz slice retention time (x-axis) sample detected (y-axis). density function plotted black line. Parameters density function taken param object. Grey rectangles indicate chromatographic peaks grouped feature peak density correspondence method. Parameters algorithm also taken param. See groupChromPeaks() information algorithm supported settings.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeakDensity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot chromatographic peak density along the retention time axis — plotChromPeakDensity,XCMSnExp-method","text":"","code":"## Load a test data set with detected peaks library(MSnbase) data(faahko_sub) ## Update the path to the files for the local system dirname(faahko_sub) <- system.file(\"cdf/KO\", package = \"faahKO\") ## Plot the chromatographic peak density for a specific mz range to evaluate ## different peak density correspondence settings. mzr <- c(305.05, 305.15) plotChromPeakDensity(faahko_sub, mz = mzr, pch = 16, param = PeakDensityParam(sampleGroups = rep(1, length(fileNames(faahko_sub))))) #> Warning: Use of 'plotChromPeakDensity' on 'XCMSnExp' isdiscouraged. Please extract chromatographic data first and call 'plotChromPeakDensity' directly on the 'XChromatograms' object. See ?XChromatograms, section 'Correspondence analysis' for more details."},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"General visualizations of peak detection results — plotChromPeaks","title":"General visualizations of peak detection results — plotChromPeaks","text":"`plotChromPeaks` plots identified chromatographic peaks one file plane spanned retention time (x-axis) m/z (y-axis) dimension. chromatographic peak plotted rectangle representing width RT m/z dimension. `plotChromPeakImage` plots number detected peaks sample along retention time axis *image* plot, .e. number peaks detected bin along retention time represented color respective cell.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"General visualizations of peak detection results — plotChromPeaks","text":"","code":"plotChromPeaks( x, file = 1, xlim = NULL, ylim = NULL, add = FALSE, border = \"#00000060\", col = NA, xlab = \"retention time\", ylab = \"mz\", main = NULL, msLevel = 1L, ... ) plotChromPeakImage( x, binSize = 30, xlim = NULL, log = FALSE, xlab = \"retention time\", yaxt = par(\"yaxt\"), main = \"Chromatographic peak counts\", msLevel = 1L, ... )"},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"General visualizations of peak detection results — plotChromPeaks","text":"x [XcmsExperiment()] [XCMSnExp()] object. file `plotChromPeaks`: `integer(1)` specifying index file within `x` plot created. Defaults `file = 1`. xlim `numeric(2)` specifying x-axis limits (retention time dimension). Defaults `xlim = NULL` case full retention time range file used. ylim `plotChromPeaks`: `numeric(2)` specifying y-axis limits (m/z dimension). Defaults `ylim = NULL` case full m/z range file used. add `plotChromPeaks`: `logical(1)` whether plot added existing plot new plot created. border `plotChromPeaks`: color rectangles' border. col `plotChromPeaks`: color used fill rectangles. xlab `character(1)` defining x-axis label. ylab `plotChromPeaks`: `character(1)` defining y-axis label. main `character(1)` defining plot title. default (.e. `main = NULL`) name file used title. msLevel `integer(1)` defining MS level peaks visualized. ... Additional arguments passed `plot` (`plotChromPeaks`) `image` (`plotChromPeakImage`) functions. Ignored `add = TRUE`. binSize `plotChromPeakImage`: `numeric(1)` defining size bins along x-axis (retention time). Defaults `binSize = 30`, peaks within 30 seconds thus counted plotted. log `plotChromPeakImage`: `logical(1)` whether peak counts log2 transformed plotting. yaxt `plotChromPeakImage`: `character(1)` defining whether y-axis labels added. disable y-axis use `yaxt = \"n\"`. value `yaxt` axis drawn. See [par()] help page details.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"General visualizations of peak detection results — plotChromPeaks","text":"width line type rectangles indicating detected chromatographic peaks `plotChromPeaks` function can specified using `par` function, .e. `par(lwd = 3)` `par(lty = 2)`, respectively.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"General visualizations of peak detection results — plotChromPeaks","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromPeaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"General visualizations of peak detection results — plotChromPeaks","text":"","code":"## Load a test data set with detected peaks faahko_sub <- loadXcmsData(\"faahko_sub2\") ## plotChromPeakImage: plot an image for the identified peaks per file plotChromPeakImage(faahko_sub) ## Show all detected chromatographic peaks from the first file plotChromPeaks(faahko_sub) ## Plot all detected peaks from the second file and restrict the plot to a ## mz-rt slice plotChromPeaks(faahko_sub, file = 2, xlim = c(3500, 3600), ylim = c(400, 600))"},{"path":"https://sneumann.github.io/xcms/reference/plotChromatogramsOverlay.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","title":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","text":"plotOverlay draws chromatographic peak data multiple (different) extracted ion chromatograms (EICs) plot. allows directly compare peak shape EICs sample. contrast plot function MChromatograms() object, draws data EIC across multiple samples plot, function draws different EICs sample plot. plotChromatogramsOverlay called XChromatograms object present chromatographic peaks also highlighted/drawn depending parameters peakType, peakCol, peakBg peakPch (see also help plot function XChromatogram() object details).","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromatogramsOverlay.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","text":"","code":"# S4 method for MChromatograms plotChromatogramsOverlay( object, col = \"#00000060\", type = \"l\", main = NULL, xlab = \"rtime\", ylab = \"intensity\", xlim = numeric(), ylim = numeric(), stacked = 0, transform = identity, ... ) # S4 method for XChromatograms plotChromatogramsOverlay( object, col = \"#00000060\", type = \"l\", main = NULL, xlab = \"rtime\", ylab = \"intensity\", xlim = numeric(), ylim = numeric(), peakType = c(\"polygon\", \"point\", \"rectangle\", \"none\"), peakBg = NULL, peakCol = NULL, peakPch = 1, stacked = 0, transform = identity, ... )"},{"path":"https://sneumann.github.io/xcms/reference/plotChromatogramsOverlay.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","text":"object MChromatograms() XChromatograms() object. col definition color chromatograms drawn. Can length 1 equal nrow(object) plot overlayed chromatogram different color. type character(1) defing type plot. default (type = \"l\") chromatogram drawn line. main optional title plot. defined, range m/z values used. xlab character(1) defining x-axis label. ylab character(1) defining y-axis label. xlim optional numeric(2) defining x-axis limits. ylim optional numeric(2) defining y-axis limits. stacked numeric(1) defining part (proportion) y-axis use stack EICs depending m/z values. stacked = 0 (default) stacking performed. stacked = 1 half y-axis used stacking half intensity y-axis (.e. ratio stacking intensity y-axis 1:1). Note stacking different 0 y-axis label drawn. transform function transform intensity values plotting. Defaults transform = identity plots data . transform = log10 intensity values log10 transformed plotting. ... optional arguments passed plotting functions (see help base R plot function. peakType object XChromatograms object: chromatographic peaks drawn: peakType = \"polygon\" (default): label full chromatographic peak area, peakType = \"rectangle\": indicate chromatographic peak rectangle peakType = \"point\": label chromatographic peaks' apex position point. peakBg object XChromatograms object: definition background color(s) chromatographic peak. either length 1 equal number peaks object. specified, peak drawn color defined col. peakCol object XChromatograms object: definition color(s) chromatographic peak. either length 1 equal number peaks object. specified, peak drawn color defined col. peakPch object XChromatograms object: point character used label apex position chromatographic peak peakType = \"point\".","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromatogramsOverlay.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","text":"silently returns list (length equal ncol(object) numeric (length equal nrow(object)) y position EIC.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromatogramsOverlay.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotChromatogramsOverlay.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot multiple chromatograms into the same plot — plotChromatogramsOverlay","text":"","code":"## Load preprocessed data and extract EICs for some features. library(xcms) library(MSnbase) xdata <- loadXcmsData() data(xdata) ## Update the path to the files for the local system dirname(xdata) <- c(rep(system.file(\"cdf\", \"KO\", package = \"faahKO\"), 4), rep(system.file(\"cdf\", \"WT\", package = \"faahKO\"), 4)) #> Error: unable to find an inherited method for function ‘path’ for signature ‘object = \"XcmsExperiment\"’ ## Subset to the first 3 files. xdata <- filterFile(xdata, 1:3, keepFeatures = TRUE) ## Define features for which to extract EICs fts <- c(\"FT097\", \"FT163\", \"FT165\") chrs <- featureChromatograms(xdata, features = fts) plotChromatogramsOverlay(chrs) ## plot the overlay of EICs in the first sample plotChromatogramsOverlay(chrs[, 1]) ## Define a different color for each feature (row in chrs). By default, also ## all chromatographic peaks of a feature is labeled in the same color. plotChromatogramsOverlay(chrs[, 1], col = c(\"#ff000040\", \"#00ff0040\", \"#0000ff40\")) ## Alternatively, we can define a color for each individual chromatographic ## peak and provide this with the `peakBg` and `peakCol` parameters. chromPeaks(chrs[, 1]) #> mz mzmin mzmax rt rtmin rtmax into intb maxo #> CP2975 354.1357 354.1 354.2 2790.288 2755.843 2826.772 298657.9 NA 9700 #> CP0312 413.1000 413.1 413.1 3643.850 3620.732 3672.298 879851.5 852195.3 30920 #> CP0089 414.2000 414.2 414.2 3066.209 3038.494 3089.233 234308.5 218923.4 9669 #> sn sample row column #> CP2975 NA 1 1 1 #> CP0312 34 1 2 1 #> CP0089 15 1 3 1 ## Use a color for each of the two identified peaks in that sample plotChromatogramsOverlay(chrs[, 1], col = c(\"#ff000040\", \"#00ff0040\", \"#0000ff40\"), peakBg = c(\"#ffff0020\", \"#00ffff20\")) ## Plotting the data in all samples. plotChromatogramsOverlay(chrs, col = c(\"#ff000040\", \"#00ff0040\", \"#0000ff40\")) ## Creating a \"stacked\" EIC plot: the EICs are placed along the y-axis ## relative to their m/z value. With `stacked = 1` the y-axis is split in ## half, the lower half being used for the stacking of the EICs, the upper ## half being used for the *original* intensity axis. res <- plotChromatogramsOverlay(chrs[, 1], stacked = 1, col = c(\"#ff000040\", \"#00ff0040\", \"#0000ff40\")) ## add horizontal lines for the m/z values of each EIC abline(h = res[[1]], col = \"grey\", lty = 2) ## Note that this type of visualization is different than the conventional ## plot function for chromatographic data, which will draw the EICs for ## multiple samples into the same plot plot(chrs) ## Converting the object to a MChromatograms without detected peaks chrs <- as(chrs, \"MChromatograms\") plotChromatogramsOverlay(chrs, col = c(\"#ff000040\", \"#00ff0040\", \"#0000ff40\"))"},{"path":"https://sneumann.github.io/xcms/reference/plotEIC-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot extracted ion chromatograms for specified m/z range — plotEIC-methods","title":"Plot extracted ion chromatograms for specified m/z range — plotEIC-methods","text":"Plot extracted ion chromatogram m/z values interest. raw data used contrast plotChrom uses data profile matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotEIC-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot extracted ion chromatograms for specified m/z range — plotEIC-methods","text":"object = \"xcmsRaw\" plotEIC(object, mzrange = numeric(), rtrange = numeric(), scanrange = numeric(), mzdec=2, type=\"l\", add=FALSE, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotEIC-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot extracted ion chromatograms for specified m/z range — plotEIC-methods","text":"object xcmsRaw object mzrange m/z range EIC. Uses full m/z range default. rtrange retention time range EIC. Uses full retention time range default. scanrange scan range EIC mzdec Number decimal places title m/z values eic plot. type Speficies data plotted (default line). add EIC added existing plot. ... Additional parameters passed plotting function (e.g. col etc).","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotEIC-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot extracted ion chromatograms for specified m/z range — plotEIC-methods","text":"two-column matrix plotted points.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotEIC-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot extracted ion chromatograms for specified m/z range — plotEIC-methods","text":"Ralf Tautenhahn","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotFeatureGroups.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot feature groups in the m/z-retention time space — plotFeatureGroups","title":"Plot feature groups in the m/z-retention time space — plotFeatureGroups","text":"plotFeatureGroups visualizes defined feature groups m/z retention time space. Features indicated points features feature group connected line. See featureGroups() details options feature grouping.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotFeatureGroups.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot feature groups in the m/z-retention time space — plotFeatureGroups","text":"","code":"plotFeatureGroups( x, xlim = numeric(), ylim = numeric(), xlab = \"retention time\", ylab = \"m/z\", pch = 4, col = \"#00000060\", type = \"o\", main = \"Feature groups\", featureGroups = character(), ... )"},{"path":"https://sneumann.github.io/xcms/reference/plotFeatureGroups.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot feature groups in the m/z-retention time space — plotFeatureGroups","text":"x XcmsExperiment XCMSnExp() object grouped features (.e. calling groupFeatures(). xlim numeric(2) lower upper limit x-axis. ylim numeric(2) lower upper limit y-axis. xlab character(1) label x-axis. ylab character(1) label y-axis. pch plotting character. Defaults pch = 4 .e. plotting features crosses. See par() information. col color used draw features. present single color supported. type plotting type (see par()). Defaults type = \"o\" draws feature point connecting features feature group line. main character(1) title plot. featureGroups optional character feature group IDs draw specified feature group(s). provided, feature groups drawn. ... additional parameters passed lines function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotFeatureGroups.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot feature groups in the m/z-retention time space — plotFeatureGroups","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotMsData.html","id":null,"dir":"Reference","previous_headings":"","what":"DEPRECATED: Create a plot that combines a XIC and a mz/rt 2D plot for one sample — plotMsData","title":"DEPRECATED: Create a plot that combines a XIC and a mz/rt 2D plot for one sample — plotMsData","text":"UPDATE: please use plot() MsExperiment plot(x, type = \"XIC\") MSnbase package instead. See examples vignette information. plotMsData creates plot combines (base peak ) extracted ion chromatogram top (rt intensity) plot rt m/z values bottom.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotMsData.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"DEPRECATED: Create a plot that combines a XIC and a mz/rt 2D plot for one sample — plotMsData","text":"","code":"plotMsData( x, main = \"\", cex = 1, mfrow = c(2, 1), grid.color = \"lightgrey\", colramp = colorRampPalette(rev(brewer.pal(9, \"YlGnBu\"))) )"},{"path":"https://sneumann.github.io/xcms/reference/plotMsData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"DEPRECATED: Create a plot that combines a XIC and a mz/rt 2D plot for one sample — plotMsData","text":"x data.frame returned extractMsData() function. single data.frame supported. main character(1) specifying title. cex numeric(1) defining size points. Passed directly plot function. mfrow numeric(2) defining plot layout. passed directly par(mfrow = mfrow). See par information. Setting mfrow = NULL avoids calling par(mfrow = mfrow) hence allowing pre-define plot layout. grid.color color definition grid line (NA skip creating ). colramp color ramp palette used color data points based intensity. See argument col.regions lattice::level.colors documentation.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotMsData.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"DEPRECATED: Create a plot that combines a XIC and a mz/rt 2D plot for one sample — plotMsData","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotPeaks-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot a grid of a large number of peaks — plotPeaks-methods","title":"Plot a grid of a large number of peaks — plotPeaks-methods","text":"Plot extracted ion chromatograms many peaks simultaneously, indicating peak integration start end points vertical grey lines.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotPeaks-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot a grid of a large number of peaks — plotPeaks-methods","text":"object = \"xcmsRaw\" plotPeaks(object, peaks, figs, width = 200)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotPeaks-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot a grid of a large number of peaks — plotPeaks-methods","text":"object xcmsRaw object peaks matrix peak information produced findPeaks figs two-element vector describing number rows number columns peaks plot, missing approximately square grid fit number peaks supplied width width chromatogram retention time plot peak","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotPeaks-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot a grid of a large number of peaks — plotPeaks-methods","text":"function intended help graphically analyze results peak picking. can help estimate number false positives improper integration start end points. output compact tries waste little space possible. plot labeled rounded m/z retention time separated space.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"Use \"democracy\" determine average m/z RT deviations grouped xcmsSet, dependency sample absolute m/z","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"","code":"plotQC(object, sampNames, sampColors, sampOrder, what)"},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"object grouped xcmsSet sampNames Override sample names (e.g. simplified names) sampColors Provide set colors (default: monochrome ?) sampOrder Override order samples, e.g. bring order measurement detect time drift vector QC plots generate. \"mzdevhist\": histogram mz deviations. gaussian shaped. multimodal, peaks seem systematically higher m/z deviation \"rtdevhist\": histogram RT deviations. gaussian shaped. multimodal, peaks seem systematically higher RT deviation \"mzdevmass\": Shows whether m/z deviations absolute m/z dependent, indicate miscalibration \"mzdevtime\": Shows whether m/z deviations RT dependent, indicate instrument drift \"mzdevsample\": median mz deviation sample, indicates outliers \"rtdevsample\": median RT deviation sample, indicates outliers","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"List four matrices, dimension features * samples: \"mz\": median mz deviation sample \"mzdev\": median mz deviation sample \"rt\": median RT deviation sample \"rtdev\": median RT deviation sample","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"plotQC() warpper create set diagnostic plots. m/z deviations, median m/z withon one group assumed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"Michael Wenk, Michael Wenk ","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotQC.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot m/z and RT deviations for QC purposes without external reference data — plotQC","text":"","code":"library(faahKO) xsg <- group(faahko) plotQC(xsg, what=\"mzdevhist\") plotQC(xsg, what=\"rtdevhist\") plotQC(xsg, what=\"mzdevmass\") plotQC(xsg, what=\"mzdevtime\") plotQC(xsg, what=\"mzdevsample\") plotQC(xsg, what=\"rtdevsample\")"},{"path":"https://sneumann.github.io/xcms/reference/plotRaw-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Scatterplot of raw data points — plotRaw-methods","title":"Scatterplot of raw data points — plotRaw-methods","text":"Produce scatterplot showing raw data point location retention time m/z. plot useful centroided data continuum data.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotRaw-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Scatterplot of raw data points — plotRaw-methods","text":"object = \"xcmsRaw\" plotRaw(object, mzrange = numeric(), rtrange = numeric(), scanrange = numeric(), log=FALSE, title='Raw Data')","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotRaw-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Scatterplot of raw data points — plotRaw-methods","text":"object xcmsRaw object mzrange numeric vector length >= 2 whose range used select masses plot rtrange numeric vector length >= 2 whose range used select retention times plot scanrange numeric vector length >= 2 whose range used select scans plot log logical, log transform intensity title main title plot","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotRaw-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Scatterplot of raw data points — plotRaw-methods","text":"matrix points plotted.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotScan-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot a single mass scan — plotScan-methods","title":"Plot a single mass scan — plotScan-methods","text":"Plot single mass scan using impulse representation. useful centroided data.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotScan-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot a single mass scan — plotScan-methods","text":"object = \"xcmsRaw\" plotScan(object, scan, mzrange = numeric(), ident = FALSE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotScan-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot a single mass scan — plotScan-methods","text":"object xcmsRaw object scan integer number scan plot mzrange numeric vector length >= 2 whose range used select masses plot ident logical, use mouse interactively identify label individual masses","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotSpec-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot mass spectra from the profile matrix — plotSpec-methods","title":"Plot mass spectra from the profile matrix — plotSpec-methods","text":"Uses pre-generated profile mode matrix plot mass spectra specified retention time range.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotSpec-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot mass spectra from the profile matrix — plotSpec-methods","text":"object = \"xcmsRaw\" plotSpec(object, ident = FALSE, vline = numeric(0), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotSpec-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot mass spectra from the profile matrix — plotSpec-methods","text":"object xcmsRaw object ident logical, use mouse identify label peaks vline numeric vector locations vertical lines ... arguments passed profRange","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotSpec-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot mass spectra from the profile matrix — plotSpec-methods","text":"ident == TRUE, integer vector indecies points identified. Otherwise two-column matrix plotted points.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotSurf-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot profile matrix 3D surface using OpenGL — plotSurf-methods","title":"Plot profile matrix 3D surface using OpenGL — plotSurf-methods","text":"method uses rgl package create interactive three dimensonal representations profile matrix. uses terrain color scheme.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotSurf-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot profile matrix 3D surface using OpenGL — plotSurf-methods","text":"object = \"xcmsRaw\" plotSurf(object, log = FALSE, aspect = c(1, 1, .5), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotSurf-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot profile matrix 3D surface using OpenGL — plotSurf-methods","text":"object xcmsRaw object log logical, log transform intensity aspect numeric vector aspect ratio m/z, retention time intensity components plot ... arguments passed profRange","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotSurf-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot profile matrix 3D surface using OpenGL — plotSurf-methods","text":"rgl package still development imposes limitations output format. bug axis label code means axis labels go 0 aspect ratio constant axis. Additionally axes labeled . important plot small portion profile matrix. Large portions can quickly overwhelm CPU memory.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotTIC-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot total ion count — plotTIC-methods","title":"Plot total ion count — plotTIC-methods","text":"Plot chromatogram total ion count. Optionally allow identification target peaks viewing/identification individual spectra.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotTIC-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot total ion count — plotTIC-methods","text":"object = \"xcmsRaw\" plotTIC(object, ident = FALSE, msident = FALSE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotTIC-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot total ion count — plotTIC-methods","text":"object xcmsRaw object ident logical, use mouse identify label chromatographic peaks msident logical, use mouse identify label spectral peaks","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotTIC-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot total ion count — plotTIC-methods","text":"ident == TRUE, integer vector indecies points identified. Otherwise two-column matrix plotted points.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/plotrt-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot retention time deviation profiles — plotrt-methods","title":"Plot retention time deviation profiles — plotrt-methods","text":"Use corrected retention times sample calculate retention time deviation profiles plot graph.","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotrt-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Plot retention time deviation profiles — plotrt-methods","text":"object = \"xcmsSet\" plotrt(object, col = NULL, ty = NULL, leg = TRUE, densplit = FALSE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/plotrt-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot retention time deviation profiles — plotrt-methods","text":"object xcmsSet object col vector colors plotting sample ty vector line point types plotting sample leg logical plot legend sample labels densplit logical, also plot peak overall peak density","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":null,"dir":"Reference","previous_headings":"","what":"Generation of profile data — profGenerate","title":"Generation of profile data — profGenerate","text":"Generates profile (binned) data given range indexed pair vectors.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generation of profile data — profGenerate","text":"","code":"profBin(x, y, num, xstart = min(x), xend = max(x), param = list()) profBinM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list()) profBinLin(x, y, num, xstart = min(x), xend = max(x), param = list()) profBinLinM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list()) profBinLinBase(x, y, num, xstart = min(x), xend = max(x), param = list()) profBinLinBaseM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list()) profIntLin(x, y, num, xstart = min(x), xend = max(x), param = list()) profIntLinM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list()) profMaxIdx(x, y, num, xstart = min(x), xend = max(x), param = list()) profMaxIdxM(x, y, zidx, num, xstart = min(x), xend = max(x), NAOK = FALSE, param = list())"},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generation of profile data — profGenerate","text":"x numeric vector value positions y numeric vector values bin zidx starting position new segment num number equally spaced x bins xstart starting x value xend ending x value NAOK allow NA values (faster) param parameters profile generation","code":""},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Generation of profile data — profGenerate","text":"functions take vector unequally spaced y values transform either vector matrix, depending whether index . point vector matrix represents data point centered corresponding x value, plus minus half x step size (xend-xstart/(num-1)). Bin functions set matrix vector value maximal point gets binned . BinLin functions except linearly interpolate values nothing binned. BinLinBase functions except populate empty parts spectra base value. take two parameters: 1) baselevel, intensity level fill empty parts spectra. defaluts half minimum intensity. 2) basespace, m/z length signal drop base level. Linear interpolation used consecuitive data points falling within 2*basespace eachother. defaluts 0.075. IntLin functions set matrix vector value integral linearly interpolated data plus minus half step size. MaxIdx functions work similarly Bin functions execpt return integer index x,y pair placed particular cell.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Generation of profile data — profGenerate","text":"issues profBinLin method, see https://github.com/sneumann/xcms/issues/46 https://github.com/sneumann/xcms/issues/49. Thus suggested use functions binYonX combination imputeLinInterpol instead.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generation of profile data — profGenerate","text":"prof*, numeric vector length num. prof*M, matrix dimensions num length(zidx). MaxIdx, data type integer, others double.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generation of profile data — profGenerate","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/profGenerate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generation of profile data — profGenerate","text":"","code":"if (FALSE) { library(faahKO) cdfpath <- system.file(\"cdf\", package = \"faahKO\") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE) xraw <- xcmsRaw(cdffiles[1]) image(xraw) ## not how with intLin the intensity's blur profMethod(xraw) <- \"bin\" image(xraw) ## now with 'bin' there is no blurring good for centroid data ##try binlinbase for profile data }"},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":null,"dir":"Reference","previous_headings":"","what":"The profile matrix — profMat,MsExperiment-method","title":"The profile matrix — profMat,MsExperiment-method","text":"profile matrix n x m matrix, n (rows) representing equally spaced m/z values (bins) m (columns) retention time corresponding scans. cell contains maximum intensity measured specific scan m/z values falling within m/z bin.","code":"The `profMat` method creates a new profile matrix or returns the profile matrix within the object's `@env` slot, if available. Settings for the profile matrix generation, such as `step` (the bin size), `method` or additional settings are extracted from the respective slots of the `xcmsRaw` object. Alternatively it is possible to specify all of the settings as additional parameters. For [MsExperiment()] or [XcmsExperiment()] objects, the method returns a `list` of profile matrices, one for each sample in `object`. Using parameter `fileIndex` it is also possible to create a profile matrix only for selected samples (files)."},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The profile matrix — profMat,MsExperiment-method","text":"","code":"# S4 method for MsExperiment profMat( object, method = \"bin\", step = 0.1, baselevel = NULL, basespace = NULL, mzrange. = NULL, fileIndex = seq_along(object), chunkSize = 1L, msLevel = 1L, BPPARAM = bpparam(), ... ) # S4 method for xcmsRaw profMat(object, method, step, baselevel, basespace, mzrange.)"},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"The profile matrix — profMat,MsExperiment-method","text":"object xcmsRaw, OnDiskMSnExp, XCMSnExp, MsExperiment XcmsExperiment object. method character(1) defining profile matrix generation method. Allowed \"bin\", \"binlin\", \"binlinbase\" \"intlin\". See details section information. step numeric(1) representing m/z bin size. baselevel numeric(1) representing base value empty elements (.e. m/z bins without measured intensity) set. considered method = \"binlinbase\". See baseValue parameter imputeLinInterpol() details. basespace numeric(1) representing m/z length signal drop base level. Linear interpolation used consecutive data points falling within 2 * basespace . considered method = \"binlinbase\". specified, defaults 0.075. Internally parameter translated distance parameter imputeLinInterpol() function distance = floor(basespace / step). See distance parameter imputeLinInterpol() details. mzrange. Optional numeric(2) manually specifying mz value range used binnind. provided, whole m/z value range used. fileIndex MsExperiment XcmsExperiment: integer defining idex (indices) sample(s) profile matrix created. chunkSize MsExperiment XcmsExperiment: integer(1) defining number files data loaded processed one iteration. default one file time processed chunkSize = 1L requires less memory. parallel processing, chunkSize >= number parallel processes used. msLevel MsExperiment XcmsExperiment: integer(1) defining MS level profile matrix generated. BPPARAM MsExperiment XcmsExperiment: parallel processing setup. See bpparam() details. Defaults BPPARAM = bpparam(). ... ignored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"The profile matrix — profMat,MsExperiment-method","text":"profMat returns profile matrix (rows representing scans, columns equally spaced m/z values). object MsExperiment XcmsExperiment, method returns list profile matrices, one file (sample).","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The profile matrix — profMat,MsExperiment-method","text":"Profile matrix generation methods: \"bin\": default profile matrix generation method simple binning, .e. aggregating intensity values falling within m/z bin. \"binlin\": Binning followed linear interpolation impute missing values. value m/z bins without measured intensity inferred linear interpolation neighboring bins measured intensity. \"binlinbase\": Binning followed linear interpolation impute values empty elements (m/z bins) within user-definable proximity non-empty elements stetting element's value baselevel otherwise. See impute = \"linbase\" parameter imputeLinInterpol() details. \"intlin\": Set elements' values integral linearly interpolated data plus minus half step size.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"The profile matrix — profMat,MsExperiment-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMat-xcmsSet.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"The profile matrix — profMat,MsExperiment-method","text":"","code":"file <- system.file('cdf/KO/ko15.CDF', package = \"faahKO\") ## Load the data without generating the profile matrix (profstep = 0) xraw <- xcmsRaw(file, profstep = 0) ## Extract the profile matrix profmat <- profMat(xraw, step = 0.3) #> Create profile matrix with method 'bin' and step 0.3 ... #> OK dim(profmat) #> [1] 1335 1278 ## If not otherwise specified, the settings from the xraw object are used: profinfo(xraw) #> $method #> [1] \"bin\" #> #> $step #> [1] 0 #> ## To extract a profile matrix with linear interpolation use profmat <- profMat(xraw, step = 0.3, method = \"binlin\") #> Create profile matrix with method 'binlin' and step 0.3 ... #> OK ## Alternatively, the profMethod of the xraw objects could be changed profMethod(xraw) <- \"binlin\" profmat_2 <- profMat(xraw, step = 0.3) #> Create profile matrix with method 'binlin' and step 0.3 ... #> OK all.equal(profmat, profmat_2) #> [1] TRUE"},{"path":"https://sneumann.github.io/xcms/reference/profMedFilt-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Median filtering of the profile matrix — profMedFilt-methods","title":"Median filtering of the profile matrix — profMedFilt-methods","text":"Apply median filter given size profile matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMedFilt-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Median filtering of the profile matrix — profMedFilt-methods","text":"object = \"xcmsRaw\" profMedFilt(object, massrad = 0, scanrad = 0)","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMedFilt-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Median filtering of the profile matrix — profMedFilt-methods","text":"object xcmsRaw object massrad number m/z grid points either side use median calculation scanrad number scan grid points either side use median calculation","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/profMethod-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get and set method for generating profile data — profMethod-methods","title":"Get and set method for generating profile data — profMethod-methods","text":"methods get set method generating profile (matrix) data raw mass spectral data. can currently bin, binlin, binlinbase, intlin.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profMethod-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get and set method for generating profile data — profMethod-methods","text":"object = \"xcmsRaw\" profMethod(object)","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/profRange-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Specify a subset of profile mode data — profRange-methods","title":"Specify a subset of profile mode data — profRange-methods","text":"Specify subset profile mode matrix given mass, time, scan range. Allow flexible user entry functions.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profRange-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Specify a subset of profile mode data — profRange-methods","text":"object = \"xcmsRaw\" profRange(object, mzrange = numeric(), rtrange = numeric(), scanrange = numeric(), ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/profRange-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Specify a subset of profile mode data — profRange-methods","text":"object xcmsRaw object mzrange single numeric mass vector masses rtrange single numeric time (seconds) vector times scanrange single integer scan index vector indecies ... arguments functions","code":""},{"path":"https://sneumann.github.io/xcms/reference/profRange-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Specify a subset of profile mode data — profRange-methods","text":"function handles selection mass/time subsets profile matrix functions. allows user specify subsets variety flexible ways minimal typing. R partial argument matching, mzrange, scanrange, rtrange can specified short form using m=, s=, t=, respectively. scanrange rtrange specified, rtrange specification takes precedence. specifying ranges, may either enter single number numeric vector. single number entered, closest single scan mass value selected. vector entered, range set range() values entered. allows specification ranges using shortened, slightly non-standard syntax. example, one specify 400 500 seconds using following: t=c(400,500), t=c(500,400), t=400:500. Use sequence operator (:) can save several keystrokes specifying ranges. However, sequence operator works well specifying integer ranges, fractional ranges always work well.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profRange-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Specify a subset of profile mode data — profRange-methods","text":"list folloing items: mzrange numeric vector start end mass masslab textual label mass range massidx integer vector mass indecies scanrange integer vector stat ane end scans scanlab textual label scan range scanidx integer vector scan range rtrange numeric vector start end times timelab textual label time range","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/profStep-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get and set m/z step for generating profile data — profStep-methods","title":"Get and set m/z step for generating profile data — profStep-methods","text":"methods get set m/z step generating profile (matrix) data raw mass spectral data. Smaller steps yield precision cost greater memory usage.","code":""},{"path":"https://sneumann.github.io/xcms/reference/profStep-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get and set m/z step for generating profile data — profStep-methods","text":"object = \"xcmsRaw\" profStep(object)","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/profStep-methods.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get and set m/z step for generating profile data — profStep-methods","text":"","code":"if (FALSE) { library(faahKO) cdfpath <- system.file(\"cdf\", package = \"faahKO\") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE) xset <- xcmsRaw(cdffiles[1]) xset plotSurf(xset, mass=c(200,500)) profStep(xset)<-0.1 ## decrease the bin size to get better resolution plotSurf(xset, mass=c(200, 500)) ##works nicer on high resolution data. }"},{"path":"https://sneumann.github.io/xcms/reference/pval.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate p-values for a vector of t-statistics — pval","title":"Generate p-values for a vector of t-statistics — pval","text":"Generate p-values vector Welch's two-sample t-statistics based t distribution.","code":""},{"path":"https://sneumann.github.io/xcms/reference/pval.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate p-values for a vector of t-statistics — pval","text":"","code":"pval(X, classlabel, teststat)"},{"path":"https://sneumann.github.io/xcms/reference/pval.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate p-values for a vector of t-statistics — pval","text":"X original data matrix classlabel integer vector classlabel teststat numeric vector Welch's two-sample t-statistics","code":""},{"path":"https://sneumann.github.io/xcms/reference/pval.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate p-values for a vector of t-statistics — pval","text":"numeric vector p-values.","code":""},{"path":"https://sneumann.github.io/xcms/reference/pval.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Generate p-values for a vector of t-statistics — pval","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawEIC-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get extracted ion chromatograms for specified m/z range — rawEIC-methods","title":"Get extracted ion chromatograms for specified m/z range — rawEIC-methods","text":"Generate extracted ion chromatogram m/z values interest. raw data used contrast getEIC uses data profile matrix (.e. values binned along M/Z dimension).","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawEIC-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get extracted ion chromatograms for specified m/z range — rawEIC-methods","text":"object = \"xcmsRaw\" rawEIC(object, mzrange = numeric(), rtrange = numeric(), scanrange = numeric())","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawEIC-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get extracted ion chromatograms for specified m/z range — rawEIC-methods","text":"object xcmsRaw object mzrange m/z range EIC rtrange retention time range EIC scanrange scan range EIC","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawEIC-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get extracted ion chromatograms for specified m/z range — rawEIC-methods","text":"list : scan scan number intensity added intensity values","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawEIC-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get extracted ion chromatograms for specified m/z range — rawEIC-methods","text":"Ralf Tautenhahn","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/rawMat-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a raw data matrix — rawMat-methods","title":"Get a raw data matrix — rawMat-methods","text":"Returns matrix columns time, m/z, intensity represents raw data chromatography mass spectrometry experiment.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawMat-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get a raw data matrix — rawMat-methods","text":"object = \"xcmsRaw\" rawMat(object, mzrange = numeric(), rtrange = numeric(), scanrange = numeric(), log=FALSE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawMat-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get a raw data matrix — rawMat-methods","text":"object container raw data mzrange Subset m/z range rtrange Subset retention time range scanrange Subset scan index range log Whether log transform intensities","code":""},{"path":"https://sneumann.github.io/xcms/reference/rawMat-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a raw data matrix — rawMat-methods","text":"numeric matrix three columns: time, mz intensity.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/rawMat-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Get a raw data matrix — rawMat-methods","text":"Michael Lawrence","code":""},{"path":"https://sneumann.github.io/xcms/reference/reconstructChromPeakSpectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","title":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","text":"Reconstructs MS2 spectra MS1 chromatographic peak (possible) data independent acquisition (DIA) data (SWATH). See LC-MS/MS analysis vignette details examples.","code":""},{"path":"https://sneumann.github.io/xcms/reference/reconstructChromPeakSpectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","text":"","code":"reconstructChromPeakSpectra(object, ...) # S4 method for XcmsExperiment reconstructChromPeakSpectra( object, expandRt = 0, diffRt = 2, minCor = 0.8, intensity = \"maxo\", peakId = rownames(chromPeaks(object, msLevel = 1L)), BPPARAM = bpparam() ) # S4 method for XCMSnExp reconstructChromPeakSpectra( object, expandRt = 0, diffRt = 2, minCor = 0.8, intensity = \"maxo\", peakId = rownames(chromPeaks(object, msLevel = 1L)), BPPARAM = bpparam(), return.type = c(\"Spectra\", \"MSpectra\") )"},{"path":"https://sneumann.github.io/xcms/reference/reconstructChromPeakSpectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","text":"object XCMSnExp identified chromatographic peaks. ... ignored. expandRt numeric(1) allowing expand retention time range extracted ion chromatograms constant value (peak shape correlation). Defaults expandRt = 0 hence correlates signal included identified chromatographic peaks. diffRt numeric(1) defining maximal allowed difference retention time chromatographic peak (apex) retention times MS2 chromatographic peaks (apex) consider representing candidate fragments original ion. minCor numeric(1) defining minimal required correlation coefficient MS2 chromatographic peaks considered MS2 spectrum reconstruction. intensity character(1) defining column chromPeaks matrix used intensities reconstructed spectra's peaks. value MS1 chromatographic peaks used precursorIntensity resulting spectra. peakId optional character vector peak IDs (.e. rownames chromPeaks) MS1 peaks MS2 spectra reconstructed. default reconstructed MS1 chromatographic peaks. BPPARAM parallel processing setup. See bpparam() information. return.type character(1) defining type returned object. return.type = \"Spectra\" supported, return.type = \"MSpectra\" deprecated.","code":""},{"path":"https://sneumann.github.io/xcms/reference/reconstructChromPeakSpectra.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","text":"Spectra() object (defined Spectra package) reconstructed MS2 spectra MS1 peaks object. Contains empty spectra (.e. without m/z intensity values) MS1 peaks reconstruction possible (either MS2 signal recorded correlation MS2 chromatographic peaks MS1 chromatographic peak threshold minCor. Spectra variables \"ms2_peak_id\" \"ms2_peak_cor\" (type CharacterList() NumericList() length equal number peaks per reconstructed MS2 spectrum) providing IDs correlation MS2 chromatographic peaks MS2 spectrum reconstructed. retention time median retention times MS2 chromatographic peaks used spectrum reconstruction reported. MS1 chromatographic peak intensity reported reconstructed spectrum's precursorIntensity value (see parameter intensity ).","code":""},{"path":"https://sneumann.github.io/xcms/reference/reconstructChromPeakSpectra.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","text":"detail, function performs MS1 chromatographic peak: Identify MS2 chromatographic peaks isolation window containing m/z ion (.e. MS1 chromatographic peak) approximately retention time MS1 peak (accepted rt shift can specified diffRt parameter). Correlate peak shapes candidate MS2 chromatographic peaks peak shape MS1 peak retaining MS2 chromatographic peaks correlation > minCor. Reconstruct MS2 spectrum using m/z selected MS2 chromatographic peaks intensity (either \"maxo\" \"\"). MS2 chromatographic peak selected MS1 peak thus represent one mass peak reconstructed spectrum. resulting Spectra() object provides also peak IDs MS2 chromatographic peaks spectrum well correlation value spectra variables ms2_peak_id ms2_peak_cor.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/reconstructChromPeakSpectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Data independent acquisition (DIA): reconstruct MS2 spectra — reconstructChromPeakSpectra","text":"Johannes Rainer, Michael Witting","code":""},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"Given matrix rectangular areas, function determines subset rectangles overlap. Rectangles preserved first come, first served basis, user control order rectangles processed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"","code":"rectUnique(m, order = seq(length = nrow(m)), xdiff = 0, ydiff = 0)"},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"m four column matrix defining rectangular areas order order matrix columns scanned xdiff maximum space overlapping rectangles x dimension ydiff maximum space overlapping rectangles y dimension","code":""},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"m matrix must contain four colums defining position rectangle sides folloing order: left, right, bottom, top. function currently implemented C using algorithm quadratic running time.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"logical vector indicating rows kept.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/rectUnique.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Determine a subset of rectangles with unique, non-overlapping areas — rectUnique","text":"","code":"m <- rbind(c(0,4,0,3), c(1,3,2,6), c(3,6,4,6)) plot(0, 0, type = \"n\", xlim=range(m[,1:2]), ylim=range(m[,3:4])) rect(m[,1], m[,3], m[,2], m[,4]) xcms:::rectUnique(m) #> [1] TRUE FALSE TRUE # Changing order of processing xcms:::rectUnique(m, c(2,1,3)) #> [1] FALSE TRUE FALSE # Requiring border spacing xcms:::rectUnique(m, ydiff = 1) #> [1] TRUE FALSE FALSE # Allowing adjacent boxes xcms:::rectUnique(m, c(2,1,3), xdiff = -0.00001) #> [1] FALSE TRUE TRUE # Allowing interpenetration xcms:::rectUnique(m, xdiff = -1.00001, ydiff = -1.00001) #> [1] TRUE TRUE TRUE"},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Refine Identified Chromatographic Peaks — refineChromPeaks","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"refineChromPeaks method performs post-processing chromatographic peak detection step eventually clean improve results. function can applied XcmsExperiment() XCMSnExp() object peak detection findChromPeaks(). type peak refinement cleaning can defined, along settings, using one following parameter objects: CleanPeaksParam: remove chromatographic peaks retention time range larger provided maximal acceptable width (maxPeakwidth). FilterIntensityParam: remove chromatographic peaks intensities specified threshold. default (nValues = 1) values chromPeaks matrix evaluated: peaks value column defined parameter value >= threshold (defined parameter threshold) retained. nValues larger 1, individual peak intensities raw MS files evaluated: chromatographic peaks least nValues mass peaks >= threshold retained. MergeNeighboringPeaksParam: peak detection sometimes fails identify chromatographic peak correctly, especially broad peaks peak shape irregular (mostly HILIC data). cases several smaller peaks reported. Also, peak detection centWave can result partially completely overlapping peaks. method aims reduce peak detection artifacts merging chromatographic peaks overlapping close RT m/z dimension (considering also measured signal ). See section Details MergeNeighboringPeaksParam details comprehensive description approach. refineChromPeaks methods always remove feature definitions, call method can change remove identified chromatographic peaks, may part features.","code":""},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"","code":"refineChromPeaks(object, param, ...) # S4 method for XcmsExperiment,CleanPeaksParam refineChromPeaks(object, param = CleanPeaksParam(), msLevel = 1L) # S4 method for XcmsExperiment,MergeNeighboringPeaksParam refineChromPeaks( object, param, msLevel = 1L, chunkSize = 2L, BPPARAM = bpparam() ) # S4 method for XcmsExperiment,FilterIntensityParam refineChromPeaks( object, param, msLevel = 1L, chunkSize = 2L, BPPARAM = bpparam() ) CleanPeaksParam(maxPeakwidth = 10) MergeNeighboringPeaksParam( expandRt = 2, expandMz = 0, ppm = 10, minProp = 0.75 ) FilterIntensityParam(threshold = 0, nValues = 1L, value = \"maxo\") # S4 method for XCMSnExp,CleanPeaksParam refineChromPeaks(object, param = CleanPeaksParam(), msLevel = 1L) # S4 method for XCMSnExp,MergeNeighboringPeaksParam refineChromPeaks( object, param = MergeNeighboringPeaksParam(), msLevel = 1L, BPPARAM = bpparam() ) # S4 method for XCMSnExp,FilterIntensityParam refineChromPeaks( object, param = FilterIntensityParam(), msLevel = 1L, BPPARAM = bpparam() )"},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"object XCMSnExp XcmsExperiment object identified chromatographic peaks. param Object defining refinement method settings. ... ignored. msLevel integer defining MS level(s) chromatographic peaks cleaned. chunkSize refineChromPeaks object either XcmsExperiment: integer(1) defining number files (samples) loaded memory processed time. Peak refinement performed parallel (per sample) subset data. setting thus allows balance memory demand speed (due parallel processing). parallel processing can performed subset data currently loaded memory iteration, value chunkSize match defined parallel setting setup. Using parallel processing setup using 4 CPUs (separate processes) using chunkSize = 1will perform parallel processing, data one sample loaded memory time. hand, settingchunkSize` total number samples experiment load full MS data memory thus settings cause --memory error. BPPARAM parameter object set parallel processing. Uses default parallel processing setup returned bpparam(). See bpparam() details examples. maxPeakwidth CleanPeaksParam: numeric(1) defining maximal allowed peak width (retention time). expandRt MergeNeighboringPeaksParam: numeric(1) defining many seconds retention time window expanded sides check overlapping peaks. expandMz MergeNeighboringPeaksParam: numeric(1) constant value m/z range chromatographic peak expanded (sides!) check overlapping peaks. ppm MergeNeighboringPeaksParam: numeric(1) defining m/z relative value (parts per million) m/z range chromatographic peak expanded (side) check overlapping peaks. minProp MergeNeighboringPeaksParam: numeric(1) 0 1 representing proporion intensity required peaks joined. See description details. default (minProp = 0.75) peaks joined signal half way larger 75% smallest two peak's \"maxo\" (maximal intensity peak apex). threshold FilterIntensityParam: numeric(1) defining threshold peaks removed. nValues FilterIntensityParam: integer(1) defining number data points (chromatographic peak) >= threshold. Defaults nValues = 1. value FilterIntensityParam: character(1) defining name column chromPeaks contains values used filtering.","code":""},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"XCMSnExp XcmsExperiment object refined chomatographic peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":"details-for-mergeneighboringpeaksparam","dir":"Reference","previous_headings":"","what":"Details for MergeNeighboringPeaksParam","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"peak refinement using MergeNeighboringPeaksParam, chromatographic peaks first expanded m/z retention time dimension (based parameters expandMz, ppm expandRt) subsequently grouped sets merge candidates (expansion) overlapping m/z rt (within sample). Note peak gets expanded expandRt expandMz, thus peaks differing less 2 * expandMz (2 * expandRt) evaluated merging. Peak merging performed along retention time axis, .e., peaks first ordered \"rtmin\" merge candidates defined iteratively starting first peak. Candidate peaks merged average intensity 3 data points middle position (.e., half distance \"rtmax\" first \"rtmin\" second peak) larger certain proportion (minProp) smaller (\"maxo\") intensity peaks. cases calculated mid point located apexes two peaks (e.g., peaks largely overlapping) average signal intensity half way apexes used instead. Candidate peaks merged 3 data points NA intensities. Merged peaks get \"mz\", \"rt\", \"sn\" \"maxo\" values peak largest signal (\"maxo\") well row metadata peak (chromPeakData). \"rtmin\" \"rtmax\" merged peaks updated \"\" recalculated based signal \"rtmin\" \"rtmax\" newly defined \"mzmin\" \"mzmax\" (range \"mzmin\" \"mzmax\" merged peaks expanding expandMz ppm). reported \"mzmin\" \"mzmax\" merged peak represents m/z range non-NA intensities used calculation peak signal (\"\").","code":""},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"Johannes Rainer, Mar Garcia-Aloy","code":""},{"path":"https://sneumann.github.io/xcms/reference/refineChromPeaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Refine Identified Chromatographic Peaks — refineChromPeaks","text":"","code":"## Load a test data set with detected peaks library(xcms) library(MsExperiment) faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Disable parallel processing for this example register(SerialParam()) #### ## CleanPeaksParam: ## Distribution of chromatographic peak widths quantile(chromPeaks(faahko_sub)[, \"rtmax\"] - chromPeaks(faahko_sub)[, \"rtmin\"]) #> 0% 25% 50% 75% 100% #> 6.259 29.734 43.819 57.903 173.710 ## Remove all chromatographic peaks with a width larger 60 seconds data <- refineChromPeaks(faahko_sub, param = CleanPeaksParam(60)) #> Removed 54 of 248 chromatographic peaks. quantile(chromPeaks(data)[, \"rtmax\"] - chromPeaks(data)[, \"rtmin\"]) #> 0% 25% 50% 75% 100% #> 6.259 23.475 39.906 46.949 59.469 #### ## FilterIntensityParam: ## Remove all peaks with a maximal intensity below 50000 res <- refineChromPeaks(faahko_sub, param = FilterIntensityParam(threshold = 50000)) #> Reduced from 248 to 155 chromatographic peaks. nrow(chromPeaks(faahko_sub)) #> [1] 248 nrow(chromPeaks(res)) #> [1] 155 #### ## MergeNeighboringPeaksParam: ## Subset to a single file xd <- filterFile(faahko_sub, file = 1) ## Example of a split peak that will be merged mzr <- 305.1 + c(-0.01, 0.01) chr <- chromatogram(xd, mz = mzr, rt = c(2700, 3700)) #> Processing chromatographic peaks plot(chr) ## Combine the peaks res <- refineChromPeaks(xd, param = MergeNeighboringPeaksParam(expandRt = 4)) #> Reduced from 87 to 70 chromatographic peaks. chr_res <- chromatogram(res, mz = mzr, rt = c(2700, 3700)) #> Processing chromatographic peaks plot(chr_res) ## Example of a peak that was not merged, because the signal between them ## is lower than the cut-off minProp mzr <- 496.2 + c(-0.01, 0.01) chr <- chromatogram(xd, mz = mzr, rt = c(3200, 3500)) #> Processing chromatographic peaks plot(chr) chr_res <- chromatogram(res, mz = mzr, rt = c(3200, 3500)) #> Processing chromatographic peaks plot(chr_res)"},{"path":"https://sneumann.github.io/xcms/reference/removeIntensity-Chromatogram.html","id":null,"dir":"Reference","previous_headings":"","what":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","title":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","text":"removeIntensities allows remove intensities chromatographic data matching certain conditions (depending parameter ). intensities actually removed replaced NA_real_. actually remove intensities (associated retention times) use clean() afterwards. Parameter allows specify intensities replaced NA_real_. default (= \"below_threshod\" intensities threshold removed. x XChromatogram XChromatograms object (hence provides also chromatographic peak definitions within object) = \"outside_chromPeak\" can selected removes intensity outside boundaries identified chromatographic peak(s) chromatographic data. Note filterIntensity() might better approach subset/filter chromatographic data.","code":""},{"path":"https://sneumann.github.io/xcms/reference/removeIntensity-Chromatogram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","text":"","code":"# S4 method for Chromatogram removeIntensity(object, which = \"below_threshold\", threshold = 0) # S4 method for MChromatograms removeIntensity(object, which = \"below_threshold\", threshold = 0) # S4 method for XChromatogram removeIntensity( object, which = c(\"below_threshold\", \"outside_chromPeak\"), threshold = 0 )"},{"path":"https://sneumann.github.io/xcms/reference/removeIntensity-Chromatogram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","text":"object object representing chromatographic data. Can Chromatogram(), MChromatograms(), XChromatogram() XChromatograms() object. character(1) defining condition remove intensities. See description details options. threshold numeric(1) defining threshold intensities removed (= \"below_threshold\").","code":""},{"path":"https://sneumann.github.io/xcms/reference/removeIntensity-Chromatogram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","text":"input object matching intensities replaced NA.","code":""},{"path":"https://sneumann.github.io/xcms/reference/removeIntensity-Chromatogram.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/removeIntensity-Chromatogram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Remove intensities from chromatographic data — removeIntensity,Chromatogram-method","text":"","code":"library(MSnbase) chr <- Chromatogram(rtime = 1:10 + rnorm(n = 10, sd = 0.3), intensity = c(5, 29, 50, NA, 100, 12, 3, 4, 1, 3)) ## Remove all intensities below 20 res <- removeIntensity(chr, threshold = 20) intensity(res) #> [1] NA 29 50 NA 100 NA NA NA NA NA"},{"path":"https://sneumann.github.io/xcms/reference/retcor-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Correct retention time from different samples — retcor-methods","title":"Correct retention time from different samples — retcor-methods","text":"correct differences retention times different samples, number methods exist XCMS. retcor generic method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Correct retention time from different samples — retcor-methods","text":"object = \"xcmsSet\" retcor(object, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correct retention time from different samples — retcor-methods","text":"object xcmsSet-class object method Method use retention time correction. See details. ... Optional arguments passed along","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correct retention time from different samples — retcor-methods","text":"Different algorithms can used specifying method argument. example use approach described Smith et al (2006) one use: retcor(object, method=\"loess\"). also default. arguments given ... passed function implementing method. character vector nicknames algorithms available returned getOption(\"BioC\")$xcms$retcor.methods. nickname method called \"loess\", help page specific method can accessed ?retcor.loess.","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correct retention time from different samples — retcor-methods","text":"xcmsSet object corrected retntion times.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/retcor.obiwarp-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Align retention times across samples with Obiwarp — retcor.obiwarp","title":"Align retention times across samples with Obiwarp — retcor.obiwarp","text":"Calculate retention time deviations sample. based code http://obi-warp.sourceforge.net/. However, function able align multiple samples, center-star strategy. original publication see Chromatographic Alignment ESI-LC-MS Proteomics Data Sets Ordered Bijective Interpolated Warping John T. Prince , Edward M. Marcotte Analytical Chemistry 2006 78 (17), 6140-6152","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor.obiwarp-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Align retention times across samples with Obiwarp — retcor.obiwarp","text":"object = \"xcmsSet\" retcor(object, method=\"obiwarp\", plottype = c(\"none\", \"deviation\"), profStep=1, center=NULL, col = NULL, ty = NULL, response=1, distFunc=\"cor_opt\", gapInit=NULL, gapExtend=NULL, factorDiag=2, factorGap=1, localAlignment=0, initPenalty=0)","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor.obiwarp-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Align retention times across samples with Obiwarp — retcor.obiwarp","text":"object xcmsSet object plottype deviation plot retention time deviation profStep step size (m/z) use profile generation raw data files center index sample others aligned . center==NULL, sample peaks chosen default. col vector colors plotting sample ty vector line point types plotting sample response Responsiveness warping. 0 give linear warp based start end points. 100 use bijective anchors distFunc DistFunc function: cor (Pearson's R) cor_opt (default, calculate 10% diagonal band distance matrix, better runtime), cov (covariance), prd (product), euc (Euclidean distance) gapInit Penalty Gap opening, see gapExtend Penalty Gap enlargement, see factorDiag Local weighting applied diagonal moves alignment. factorGap Local weighting applied gap moves alignment. localAlignment Local rather global alignment initPenalty Penalty initiating alignment (local alignment ) Default: 0 Default gap penalties: (gapInit, gapExtend) [distFunc type]: 'cor' = '0.3,2.4' 'cov' = '0,11.7' 'prd' = '0,7.8' 'euc' = '0.9,1.8'","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor.obiwarp-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Align retention times across samples with Obiwarp — retcor.obiwarp","text":"xcmsSet object","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/retcor.peakgroups-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Align retention times across samples — retcor.peakgroups-methods","title":"Align retention times across samples — retcor.peakgroups-methods","text":"two methods use ``well behaved'' peak groups calculate retention time deviations every time point sample. Use smoothed deviations align retention times.","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor.peakgroups-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Align retention times across samples — retcor.peakgroups-methods","text":"object = \"xcmsSet\" retcor(object, missing = 1, extra = 1, smooth = c(\"loess\", \"linear\"), span = .2, family = c(\"gaussian\", \"symmetric\"), plottype = c(\"none\", \"deviation\", \"mdevden\"), col = NULL, ty = NULL)","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor.peakgroups-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Align retention times across samples — retcor.peakgroups-methods","text":"object xcmsSet object missing number missing samples allow retention time correction groups extra number extra peaks allow retention time correction correction groups smooth either \"loess\" non-linear alignment \"linear\" linear alignment span degree smoothing local polynomial regression fitting family gaussian fitting least-squares outlier removal, symmetric re-descending M estimator used Tukey's biweight function, allowing outlier removal plottype deviation plot retention time deviation points regression fit, mdevden also plot peak overall peak density retention time correction peak density col vector colors plotting sample ty vector line point types plotting sample","code":""},{"path":"https://sneumann.github.io/xcms/reference/retcor.peakgroups-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Align retention times across samples — retcor.peakgroups-methods","text":"xcmsSet object","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/retexp.html","id":null,"dir":"Reference","previous_headings":"","what":"Set retention time window to a specified width — retexp","title":"Set retention time window to a specified width — retexp","text":"Expands (contracts) retention time window row matrix defined retmin retmax columns.","code":""},{"path":"https://sneumann.github.io/xcms/reference/retexp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set retention time window to a specified width — retexp","text":"","code":"retexp(peakrange, width = 200)"},{"path":"https://sneumann.github.io/xcms/reference/retexp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set retention time window to a specified width — retexp","text":"peakrange maxtrix columns retmin retmax width new width window","code":""},{"path":"https://sneumann.github.io/xcms/reference/retexp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set retention time window to a specified width — retexp","text":"altered matrix.","code":""},{"path":"https://sneumann.github.io/xcms/reference/retexp.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Set retention time window to a specified width — retexp","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate relative log abundances — rla","title":"Calculate relative log abundances — rla","text":"rla calculates relative log abundances (RLA, see reference) numeric vector.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate relative log abundances — rla","text":"","code":"rla(x, group, log.transform = TRUE) rowRla(x, group, log.transform = TRUE)"},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate relative log abundances — rla","text":"x numeric (rla) matrix (rowRla) abundances (natural scale) RLA calculated. group factor, numeric character length x groups values x. omitted values considered group. log.transform logical(1) whether x log2 transformed. Set log.transform = FALSE x already log scale.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate relative log abundances — rla","text":"numeric length x (rla) matrix dimensions x (rowRla).","code":""},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate relative log abundances — rla","text":"RLA defines (log) abundance analyte relative median across abundances group.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate relative log abundances — rla","text":"De Livera , Dias DA, De Souza D, Rupasinghe T, Pyke J, Tull D, Roessner U, McConville M, Speed TP. Normalizing integrating metabolomics data. Anal Chem 2012 Dec 18;84(24):10768-76.","code":""},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate relative log abundances — rla","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/rla.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate relative log abundances — rla","text":"","code":"x <- c(3, 4, 5, 1, 2, 3, 7, 8, 9) grp <- c(1, 1, 1, 2, 2, 2, 3, 3, 3) rla(x, grp) #> 1 1 1 2 2 2 3 #> -0.4150375 0.0000000 0.3219281 -1.0000000 0.0000000 0.5849625 -0.1926451 #> 3 3 #> 0.0000000 0.1699250"},{"path":"https://sneumann.github.io/xcms/reference/sampnames-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Get sample names — sampnames-methods","title":"Get sample names — sampnames-methods","text":"Return sample names object","code":""},{"path":"https://sneumann.github.io/xcms/reference/sampnames-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Get sample names — sampnames-methods","text":"object = \"xcmsEIC\" sampnames(object) object = \"xcmsSet\" sampnames(object)","code":""},{"path":"https://sneumann.github.io/xcms/reference/sampnames-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get sample names — sampnames-methods","text":"character vector sample names.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/showError-xcmsSet-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract processing errors — showError,xcmsSet-method","title":"Extract processing errors — showError,xcmsSet-method","text":"peak detection performed findPeaks setting argument stopOnError = FALSE eventual errors process cause stop processing recorded inside resulting xcmsSet object. errors can accessed showError method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/showError-xcmsSet-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract processing errors — showError,xcmsSet-method","text":"","code":"# S4 method for xcmsSet showError(object, message. = TRUE, ...)"},{"path":"https://sneumann.github.io/xcms/reference/showError-xcmsSet-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract processing errors — showError,xcmsSet-method","text":"object xcmsSet object. message. Logical indicating whether error message, error returned. ... Additional arguments.","code":""},{"path":"https://sneumann.github.io/xcms/reference/showError-xcmsSet-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract processing errors — showError,xcmsSet-method","text":"list error messages (message. = TRUE) errors empty list errors present.","code":""},{"path":"https://sneumann.github.io/xcms/reference/showError-xcmsSet-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Extract processing errors — showError,xcmsSet-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","title":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","text":"several methods calculating distance two sets peaks xcms. specDist generic method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","text":"object = \"xcmsSet\" specDist(object, peakIDs1, peakIDs2,...) object = \"xsAnnotate\" specDist(object, PSpec1, PSpec2,...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","text":"object xcmsSet xcmsRaw. method Method use distance calculation. See details. ... mzabs, mzppm parameters distance function.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","text":"Different algorithms can used specifying method argument. example use \"meanMZmatch\" approach xcmsSet one use: specDist(object, peakIDs1, peakIDs2, method=\"meanMZmatch\"). also default. arguments given ... passed function implementing method. character vector nicknames algorithms available returned getOption(\"BioC\")$xcms$specDist.methods. nickname method called \"meanMZmatch\", help page specific method can accessed ?specDist.meanMZmatch.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","text":"mzabs maximum absolute deviation two matching peaks mzppm relative deviations ppm two matching peaks symmetric use symmetric pairwise m/z-matches , match","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Distance methods for xcmsSet, xcmsRaw and xsAnnotate — specDist-methods","text":"Joachim Kutzera, jkutzer@ipb-halle.de","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.cosine-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"a Distance function based on matching peaks — specDist.cosine","title":"a Distance function based on matching peaks — specDist.cosine","text":"method calculates distance two sets peaks using cosine-distance.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.cosine-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"a Distance function based on matching peaks — specDist.cosine","text":"","code":"specDist.cosine(peakTable1, peakTable2, mzabs=0.001, mzppm=10, mzExp=0.6, intExp=3, nPdiff=2, nPmin=8, symmetric=FALSE)"},{"path":"https://sneumann.github.io/xcms/reference/specDist.cosine-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"a Distance function based on matching peaks — specDist.cosine","text":"peakTable1 = \"matrix\", peakTable2 = \"matrix\" specDist.cosine(peakTable1, peakTable2, mzabs = 0.001, mzppm = 10, mzExp = 0.6, intExp = 3, nPdiff = 2, nPmin = 8, symmetric = FALSE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.cosine-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"a Distance function based on matching peaks — specDist.cosine","text":"result cosine-distance product weighted factors mz intensity matching peaks two peaktables. factors calculated wFact = mz^mzExp * int^intExp. distance calculated (example matching peaks found) return-value NA.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.cosine-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"a Distance function based on matching peaks — specDist.cosine","text":"peakTable1 Matrix containing least m/z-values, \trow must called \"mz\" peakTable2 matrix mz-values mzabs maximum absolute deviation two matching peaks mzppm relative deviations ppm two matching peaks symmetric use symmetric pairwise m/z-matches , match mzExp exponent used mz intExp exponent used intensity nPdiff maximum nrow-difference two peaktables nPmin minimum absolute sum peaks praktables","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.cosine-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"a Distance function based on matching peaks — specDist.cosine","text":"Joachim Kutzera, jkutzer@ipb-halle.de","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.meanMZmatch-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"a Distance function based on matching peaks — specDist.meanMZmatch","title":"a Distance function based on matching peaks — specDist.meanMZmatch","text":"method calculates distance two sets peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.meanMZmatch-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"a Distance function based on matching peaks — specDist.meanMZmatch","text":"","code":"specDist.meanMZmatch(peakTable1, peakTable2, matchdist=1, matchrate=1, mzabs=0.001, mzppm=10, symmetric=TRUE)"},{"path":"https://sneumann.github.io/xcms/reference/specDist.meanMZmatch-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"a Distance function based on matching peaks — specDist.meanMZmatch","text":"peakTable1 = \"matrix\", peakTable2 = \"matrix\" specDist.meanMZmatch(peakTable1, peakTable2, matchdist=1, matchrate=1, mzabs=0.001, mzppm=10, symmetric=TRUE)","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.meanMZmatch-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"a Distance function based on matching peaks — specDist.meanMZmatch","text":"result calculation weighted sum two values. Value one mean absolute difference matching peaks, value two relation matching peaks non matching peaks. distance calculated (example matching peaks found) return-value NA.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.meanMZmatch-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"a Distance function based on matching peaks — specDist.meanMZmatch","text":"peakTable1 Matrix containing least m/z-values, \trow must called \"mz\" peakTable2 matrix mz-values mzabs maximum absolute deviation two matching peaks mzppm relative deviations ppm two matching peaks symmetric use symmetric pairwise m/z-matches , match matchdist weight value one (see details) matchrate weight value two","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.meanMZmatch-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"a Distance function based on matching peaks — specDist.meanMZmatch","text":"Joachim Kutzera, jkutzer@ipb-halle.de","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.peakCount-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"a Distance function based on matching peaks — specDist.peakCount-methods","title":"a Distance function based on matching peaks — specDist.peakCount-methods","text":"method calculates distance two sets peaks just returning number matching peaks (m/z-values).","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.peakCount-methods.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"a Distance function based on matching peaks — specDist.peakCount-methods","text":"","code":"specDist.peakCount(peakTable1, peakTable2, mzabs=0.001, mzppm=10, symmetric=FALSE)"},{"path":"https://sneumann.github.io/xcms/reference/specDist.peakCount-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"a Distance function based on matching peaks — specDist.peakCount-methods","text":"peakTable1 = \"matrix\", peakTable2 = \"matrix\" specDist.peakCount(peakTable1, peakTable2, mzppm=10,symmetric=FALSE )","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.peakCount-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"a Distance function based on matching peaks — specDist.peakCount-methods","text":"peakTable1 Matrix containing least m/z-values, \trow must called \"mz\" peakTable2 matrix mz-values mzabs maximum absolute deviation two matching peaks mzppm relative deviations ppm two matching peaks symmetric use symmetric pairwise m/z-matches , match","code":""},{"path":"https://sneumann.github.io/xcms/reference/specDist.peakCount-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"a Distance function based on matching peaks — specDist.peakCount-methods","text":"Joachim Kutzera, jkutzer@ipb-halle.de","code":""},{"path":"https://sneumann.github.io/xcms/reference/specNoise.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate noise for a sparse continuum mass spectrum — specNoise","title":"Calculate noise for a sparse continuum mass spectrum — specNoise","text":"Given sparse continuum mass spectrum, determine regions signal present, substituting half minimum intensity regions. Calculate noise level weighted mean regions signal regions without signal. one raw peak, return zero.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specNoise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate noise for a sparse continuum mass spectrum — specNoise","text":"","code":"specNoise(spec, gap = quantile(diff(spec[, \"mz\"]), 0.9))"},{"path":"https://sneumann.github.io/xcms/reference/specNoise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate noise for a sparse continuum mass spectrum — specNoise","text":"spec matrix named columns mz intensity gap threshold data points considerd separated blank region bridged interpolating line","code":""},{"path":"https://sneumann.github.io/xcms/reference/specNoise.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate noise for a sparse continuum mass spectrum — specNoise","text":"default gap value determined 90th percentile pair-wise differences adjacent mass values.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specNoise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate noise for a sparse continuum mass spectrum — specNoise","text":"numeric noise level","code":""},{"path":"https://sneumann.github.io/xcms/reference/specNoise.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate noise for a sparse continuum mass spectrum — specNoise","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/specPeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Identify peaks in a sparse continuum mode spectrum — specPeaks","title":"Identify peaks in a sparse continuum mode spectrum — specPeaks","text":"Given spectrum, identify list significant peaks determined several criteria.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specPeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Identify peaks in a sparse continuum mode spectrum — specPeaks","text":"","code":"specPeaks(spec, sn = 20, mzgap = 0.2)"},{"path":"https://sneumann.github.io/xcms/reference/specPeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Identify peaks in a sparse continuum mode spectrum — specPeaks","text":"spec matrix named columns mz intensity sn minimum signal noise ratio mzgap minimal distance adjacent peaks, smaller peaks excluded","code":""},{"path":"https://sneumann.github.io/xcms/reference/specPeaks.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Identify peaks in a sparse continuum mode spectrum — specPeaks","text":"Peaks must meet two criteria considered peaks: 1) s/n ratio must exceed certain threshold. 2) must within given distance greater intensity peaks.","code":""},{"path":"https://sneumann.github.io/xcms/reference/specPeaks.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Identify peaks in a sparse continuum mode spectrum — specPeaks","text":"matrix columns: mz m/z maximum peak intensity intensity maximum intensity peak fwhm full width half max peak","code":""},{"path":"https://sneumann.github.io/xcms/reference/specPeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Identify peaks in a sparse continuum mode spectrum — specPeaks","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsRaw.html","id":null,"dir":"Reference","previous_headings":"","what":"Divide an xcmsRaw object — split.xcmsRaw","title":"Divide an xcmsRaw object — split.xcmsRaw","text":"Divides scans xcmsRaw object list multiple objects. MS$^n$ data discarded.","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsRaw.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Divide an xcmsRaw object — split.xcmsRaw","text":"xr = \"xcmsRaw\" split(x, f, drop = TRUE, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsRaw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Divide an xcmsRaw object — split.xcmsRaw","text":"x xcmsRaw object f factor factor(f) defines scans go new xcmsRaw objects drop logical indicating levels occur dropped ('f' 'factor' list). ... potential arguments passed methods.","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsRaw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Divide an xcmsRaw object — split.xcmsRaw","text":"list xcmsRaw objects.","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsRaw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Divide an xcmsRaw object — split.xcmsRaw","text":"Steffen Neumann, sneumann@ipb-halle.de","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsSet.html","id":null,"dir":"Reference","previous_headings":"","what":"Divide an xcmsSet object — split.xcmsSet","title":"Divide an xcmsSet object — split.xcmsSet","text":"Divides samples peaks xcmsSet object list multiple objects. Group data discarded.","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsSet.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Divide an xcmsSet object — split.xcmsSet","text":"xs = \"xcmsSet\" split(x, f, drop = TRUE, ...)","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsSet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Divide an xcmsSet object — split.xcmsSet","text":"xs xcmsSet object f factor factor(f) defines grouping drop logical indicating levels occur dropped ('f' 'factor' list). ... potential arguments passed methods.","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsSet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Divide an xcmsSet object — split.xcmsSet","text":"list xcmsSet objects.","code":""},{"path":"https://sneumann.github.io/xcms/reference/split.xcmsSet.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Divide an xcmsSet object — split.xcmsSet","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Correct gaps in data — stitch-methods","title":"Correct gaps in data — stitch-methods","text":"Fixes gaps data due calibration scans lock mass. Automatically detects file type calls relevant method. mzXML file keeps data length time overwrites lock mass scans. netCDF version adds scans back data thereby increasing length data correcting unseen gap.","code":""},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Correct gaps in data — stitch-methods","text":"object = \"xcmsRaw\" stitch(object, lockMass=numeric()) object = \"xcmsRaw\" makeacqNum(object, freq=numeric(), start=1)","code":""},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Correct gaps in data — stitch-methods","text":"object xcmsRaw-class object lockMass dataframe locations gaps freq intervals lock mass scans start starting lock mass scan location, default 1","code":""},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Correct gaps in data — stitch-methods","text":"makeacqNum takes locates gap using starting lock mass scan intervals. data frame used \tstitch correct gap caused lock mass. Correction works using scans either side gap fill .","code":""},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Correct gaps in data — stitch-methods","text":"stitch corrected xcmsRaw-class object makeacqNum numeric vector scan locations corresponding lock Mass scans","code":""},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Correct gaps in data — stitch-methods","text":"Paul Benton, hpaul.benton08@imperial.ac.uk","code":""},{"path":"https://sneumann.github.io/xcms/reference/stitch-methods.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Correct gaps in data — stitch-methods","text":"","code":"if (FALSE) library(xcms) library(faahKO) ## These files do not have this problem to correct for but just ## for an example cdfpath <- system.file(\"cdf\", package = \"faahKO\") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE) xr<-xcmsRaw(cdffiles[1]) #> Create profile matrix with method 'bin' and step 1 ... #> OK xr #> An \"xcmsRaw\" object with 1278 mass spectra #> #> Time range: 2501.4-4499.8 seconds (41.7-75 minutes) #> Mass range: 200-600 m/z #> Intensity range: 70-1373180 #> #> MSn data on 0 mass(es) #> \twith 0 MSn spectra #> Profile method: bin #> Profile step: 1 m/z (401 grid points from 200 to 600 m/z) #> #> Memory usage: 10.8 MB ##Lets assume that the lockmass starts at 1 and is every 100 scans lockMass<-xcms:::makeacqNum(xr, freq=100, start=1) ## these are equcal lockmass<-AutoLockMass(xr) #> Warning: #> Lock mass frequency wasn't detected ob<-stitch(xr, lockMass) ob #> An \"xcmsRaw\" object with 1304 mass spectra #> #> Time range: 1.6-2040.7 seconds (0-34 minutes) #> Mass range: 200-600 m/z #> Intensity range: 70-1373180 #> #> MSn data on 0 mass(es) #> \twith 0 MSn spectra #> Profile method: bin #> Profile step: no profile data #> #> Memory usage: 6.96 MB ## plot the old data before correction foo<-rawEIC(xr, m=c(200,210), scan=c(80,140)) plot(foo$scan, foo$intensity, type=\"h\") ## plot the new corrected data to see what changed foo<-rawEIC(ob, m=c(200,210), scan=c(80,140)) plot(foo$scan, foo$intensity, type=\"h\")"},{"path":"https://sneumann.github.io/xcms/reference/storeResults.html","id":null,"dir":"Reference","previous_headings":"","what":"Save xcms result objects in a specified format — storeResults","title":"Save xcms result objects in a specified format — storeResults","text":"storeResults function saves object resulting processing xcms package (mainly XcmsExperiment). Multiple formats storing exporting available can defined param argument. Supported param objects : RDataParam: Save .RData format file. name file can specified fileName argument. PlainTextParam: Store MsExperiment XcmsExperiment objects folder plain text files, folder path defined path argument. MzTabMParam: Save MzTab format (defined). specific examples, see help pages individual parameter classes listed .","code":""},{"path":"https://sneumann.github.io/xcms/reference/storeResults.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save xcms result objects in a specified format — storeResults","text":"","code":"storeResults(object, param, ...)"},{"path":"https://sneumann.github.io/xcms/reference/storeResults.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save xcms result objects in a specified format — storeResults","text":"object MsExperiment XcmsExperiment data object needs saved. param parameter object selecting configuring format saving. can one following classes: RDataParam, PlainTextParam, MzTabMParam. ... Optional parameters.","code":""},{"path":"https://sneumann.github.io/xcms/reference/storeResults.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Save xcms result objects in a specified format — storeResults","text":"Philippine Louail","code":""},{"path":"https://sneumann.github.io/xcms/reference/storeResults.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save xcms result objects in a specified format — storeResults","text":"","code":"## Load a test data set with detected peaks library(xcms) library(MsExperiment) faahko_sub <- loadXcmsData(\"faahko_sub2\") ## Set up parameter to save as .RData file param <- RDataParam(fileName = \"example_xcms_results\") ## save as .RData storeResults(object = faahko_sub, param = param) ## Set up parameter to save as a collection of plain text file param <- PlainTextParam(path = \"test/path/\") ## Save as a collection of plain text files storeResults(object = faahko_sub, param = param)"},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"Subset xcmsRaw object scans. returned xcmsRaw object contains values scans specified argument . Note scanrange slot returned xcmsRaw c(1, length(object@scantime)) hence range().","code":""},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"","code":"# S4 method for xcmsRaw,logicalOrNumeric,missing,missing [(x, i, j, drop)"},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"x xcmsRaw object sub-setted. Integer logical vector specifying scans/spectra x sub-setted. j supported. drop supported.","code":""},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"sub-setted xcmsRaw object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"subsetting scan index increasing order logical vector supported. ordered, argument sorted automatically. Indices larger total number scans discarded.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/sub-xcmsRaw-logicalOrNumeric-missing-missing-method.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Subset an xcmsRaw object by scans — [,xcmsRaw,logicalOrNumeric,missing,missing-method","text":"","code":"## Load a test file file <- system.file('cdf/KO/ko15.CDF', package = \"faahKO\") xraw <- xcmsRaw(file, profstep = 0) ## The number of scans/spectra: length(xraw@scantime) #> [1] 1278 ## Subset the object to scans with a scan time from 3500 to 4000. xsub <- xraw[xraw@scantime >= 3500 & xraw@scantime <= 4000] range(xsub@scantime) #> [1] 3501.383 3999.039 ## The number of scans: length(xsub@scantime) #> [1] 319 ## The number of values of the subset: length(xsub@env$mz) #> [1] 130569"},{"path":"https://sneumann.github.io/xcms/reference/updateObject-xcmsSet-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Update an xcmsSet object — updateObject,xcmsSet-method","title":"Update an xcmsSet object — updateObject,xcmsSet-method","text":"method updates old xcmsSet object latest definition.","code":""},{"path":"https://sneumann.github.io/xcms/reference/updateObject-xcmsSet-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update an xcmsSet object — updateObject,xcmsSet-method","text":"","code":"# S4 method for xcmsSet updateObject(object, ..., verbose = FALSE)"},{"path":"https://sneumann.github.io/xcms/reference/updateObject-xcmsSet-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update an xcmsSet object — updateObject,xcmsSet-method","text":"object xcmsSet object update. ... Optional additional arguments. Currently ignored. verbose Currently ignored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/updateObject-xcmsSet-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update an xcmsSet object — updateObject,xcmsSet-method","text":"updated xcmsSet containing data input object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/updateObject-xcmsSet-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Update an xcmsSet object — updateObject,xcmsSet-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":null,"dir":"Reference","previous_headings":"","what":"Enable usage of old xcms code — useOriginalCode","title":"Enable usage of old xcms code — useOriginalCode","text":"function allows enable usage old, partially deprecated code xcms setting corresponding global option. See details functions affected.","code":""},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Enable usage of old xcms code — useOriginalCode","text":"","code":"useOriginalCode(x)"},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Enable usage of old xcms code — useOriginalCode","text":"x logical(1) specify whether original old code used corresponding functions. provided function simply returns value global option.","code":""},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Enable usage of old xcms code — useOriginalCode","text":"logical(1) indicating whether old code used.","code":""},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Enable usage of old xcms code — useOriginalCode","text":"functions/methods affected option : do_findChromPeaks_matchedFilter: use original code iteratively creates subset binned (profile) matrix. helpful computers limited memory matchedFilter settings small bin size. getPeaks","code":""},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Enable usage of old xcms code — useOriginalCode","text":"parallel processing using SOCKS method (e.g. SnowParam() Windows computers) option might passed individual R processes performing calculations. cases suggested specify option manually system-wide adding line options(XCMSuseOriginalCode = TRUE) file called .Rprofile folder new R processes started (usually user's home directory; ensure option correctly read add new line file ). See also Startup base R documentation specify system-wide options R. Usage old code strongly dicouraged. function thought used mainly transition phase xcms xcms version 3.","code":""},{"path":"https://sneumann.github.io/xcms/reference/useOriginalCode.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Enable usage of old xcms code — useOriginalCode","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/verify.mzQuantML.html","id":null,"dir":"Reference","previous_headings":"","what":"Verify an mzQuantML file — verify.mzQuantM","title":"Verify an mzQuantML file — verify.mzQuantM","text":"Export XML data formats: verify written data","code":""},{"path":"https://sneumann.github.io/xcms/reference/verify.mzQuantML.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Verify an mzQuantML file — verify.mzQuantM","text":"","code":"verify.mzQuantML(filename, xsdfilename)"},{"path":"https://sneumann.github.io/xcms/reference/verify.mzQuantML.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Verify an mzQuantML file — verify.mzQuantM","text":"filename filename (may include full path) output file. Pipes URLs allowed. xsdfilename Filename XSD verify (may include full path)","code":""},{"path":"https://sneumann.github.io/xcms/reference/verify.mzQuantML.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Verify an mzQuantML file — verify.mzQuantM","text":"verify.mzQuantML() function verify PSI standard format mzQuantML document XSD schemda, see http://www.psidev.info/mzquantml","code":""},{"path":"https://sneumann.github.io/xcms/reference/verify.mzQuantML.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Verify an mzQuantML file — verify.mzQuantM","text":"None.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/write.cdf-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Save an xcmsRaw object to file — write.cdf-methods","title":"Save an xcmsRaw object to file — write.cdf-methods","text":"Write raw data (simple) CDF file.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.cdf-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Save an xcmsRaw object to file — write.cdf-methods","text":"object = \"xcmsRaw\" write.cdf(object, filename)","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.cdf-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save an xcmsRaw object to file — write.cdf-methods","text":"object xcmsRaw object filename filename (may include full path) CDF file. Pipes URLs allowed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.cdf-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save an xcmsRaw object to file — write.cdf-methods","text":"Currently application known read resulting file XCMS. Others, especially build AndiMS library, refuse load output.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.cdf-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save an xcmsRaw object to file — write.cdf-methods","text":"None.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/write.mzQuantML.html","id":null,"dir":"Reference","previous_headings":"","what":"Save an xcmsSet object to an PSI mzQuantML file — write.mzQuantML-methods","title":"Save an xcmsSet object to an PSI mzQuantML file — write.mzQuantML-methods","text":"Export XML data formats: Write processed data xcmsSet mzQuantML.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzQuantML.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Save an xcmsSet object to an PSI mzQuantML file — write.mzQuantML-methods","text":"object = \"xcmsSet\" write.mzQuantML(object, filename)","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzQuantML.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save an xcmsSet object to an PSI mzQuantML file — write.mzQuantML-methods","text":"object xcmsRaw xcmsSet object filename filename (may include full path) output file. Pipes URLs allowed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzQuantML.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save an xcmsSet object to an PSI mzQuantML file — write.mzQuantML-methods","text":"write.mzQuantML() function write (grouped) xcmsSet PSI standard format mzQuantML, see http://www.psidev.info/mzquantml","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzQuantML.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save an xcmsSet object to an PSI mzQuantML file — write.mzQuantML-methods","text":"None.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/write.mzdata-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Save an xcmsRaw object to a file — write.mzdata-methods","title":"Save an xcmsRaw object to a file — write.mzdata-methods","text":"Write raw data (simple) mzData file.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzdata-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Save an xcmsRaw object to a file — write.mzdata-methods","text":"object = \"xcmsRaw\" write.mzdata(object, filename)","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzdata-methods.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save an xcmsRaw object to a file — write.mzdata-methods","text":"object xcmsRaw object filename filename (may include full path) mzData file. Pipes URLs allowed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzdata-methods.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save an xcmsRaw object to a file — write.mzdata-methods","text":"function export given xcmsRaw object mzData file. mzData file contain containing mass intensity values 32 bit precision. formats currently supported. header information (e.g. additional information ) lost. Currently, also MSn information stored.","code":""},{"path":"https://sneumann.github.io/xcms/reference/write.mzdata-methods.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save an xcmsRaw object to a file — write.mzdata-methods","text":"None.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/writeMSData-XCMSnExp-character-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Export MS data to mzML/mzXML files — writeMSData,XCMSnExp,character-method","title":"Export MS data to mzML/mzXML files — writeMSData,XCMSnExp,character-method","text":"writeMSData exports mass spectrometry data mzML mzXML format. adjusted retention times present, used retention time exported spectra.","code":""},{"path":"https://sneumann.github.io/xcms/reference/writeMSData-XCMSnExp-character-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Export MS data to mzML/mzXML files — writeMSData,XCMSnExp,character-method","text":"","code":"# S4 method for XCMSnExp,character writeMSData( object, file, outformat = c(\"mzml\", \"mzxml\"), copy = FALSE, software_processing = NULL, ... )"},{"path":"https://sneumann.github.io/xcms/reference/writeMSData-XCMSnExp-character-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Export MS data to mzML/mzXML files — writeMSData,XCMSnExp,character-method","text":"object XCMSnExp object mass spectrometry data. file character file name(s). length parameter match number files/samples object. outformat character(1) defining format output files ( either \"mzml\" \"mzxml\"). copy logical(1) metadata (data processing, software used, original file names etc) copied original files. software_processing optionally provide specific data processing steps. See documentation software_processing parameter mzR::writeMSData(). ... Additional parameters pass writeMSData() function MSnbase package, outformat specify output format (\"mzml\" \"mzxml\") copy specify whether general information original MS data files (data processing, software etc) copied new files.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/writeMSData-XCMSnExp-character-method.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Export MS data to mzML/mzXML files — writeMSData,XCMSnExp,character-method","text":"Johannes Rainer","code":""},{"path":"https://sneumann.github.io/xcms/reference/writeMzTab.html","id":null,"dir":"Reference","previous_headings":"","what":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","title":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","text":"Write grouped xcmsSet mzTab file.","code":""},{"path":"https://sneumann.github.io/xcms/reference/writeMzTab.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","text":"object = \"xcmsSet\" writeMzTab(object, filename)","code":""},{"path":"https://sneumann.github.io/xcms/reference/writeMzTab.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","text":"object xcmsSet object filename filename (may include full path) mzTab file. Pipes URLs allowed.","code":""},{"path":"https://sneumann.github.io/xcms/reference/writeMzTab.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","text":"mzTab file format MS-based metabolomics (proteomics) lightweight supplement existing standard XML-based file formats (mzML, mzIdentML, mzQuantML), providing comprehensive summary, similar concept supplemental material scientific publication. mzTab files xcms contain small molecule sections together experimental metadata basic quantitative information. format intended store simple summary final results.","code":""},{"path":"https://sneumann.github.io/xcms/reference/writeMzTab.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","text":"None.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/writeMzTab.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save a grouped xcmsSet object in mzTab-1.1 format file — writeMzTab","text":"","code":"library(faahKO) xs <- group(faahko) mzt <- data.frame(character(0)) mzt <- xcms:::mzTabHeader(mzt, version=\"1.1.0\", mode=\"Complete\", type=\"Quantification\", description=\"faahKO\", xset=xs) mzt <- xcms:::mzTabAddSME(mzt, xs) xcms:::writeMzTab(mzt, \"faahKO.mzTab\")"},{"path":"https://sneumann.github.io/xcms/reference/xcms-deprecated.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecated functions in package ‘xcms’ — xcms-deprecated","title":"Deprecated functions in package ‘xcms’ — xcms-deprecated","text":"functions provided compatibility older versions ‘xcms’ , defunct next release.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcms-deprecated.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Deprecated functions in package ‘xcms’ — xcms-deprecated","text":"following functions/methods deprecated. profBin, profBinM, profBinLin, profBinLinM, profBinLinBase, profBinLinBaseM deprecated binYonX combination imputeLinInterpol used instead. extractMsData: replaced (x, \"data.frame\"). plotMsData: replaced plot(x, type = \"XIC\").","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsEIC-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","title":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","text":"class used store plot parallel extracted ion chromatograms multiple sample files. integrates xcmsSet class display peak area integrated peak identification fill-.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsEIC-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","text":"Objects can created getEIC method xcmsSet class. Objects can also created calls form new(\"xcmsEIC\", ...).","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsEIC-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","text":"eic: list containing named entries every sample. entry, list two column EIC matricies retention time intensity mzrange: two column matrix containing starting ending m/z EIC rtrange: two column matrix containing starting ending time EIC rt: either \"raw\" \"corrected\" specify retention times contained object groupnames: group names xcmsSet object used generate EICs","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsEIC-class.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","text":"groupnames signature(object = \"xcmsEIC\"): get groupnames slot mzrange signature(object = \"xcmsEIC\"): get mzrange slot plot signature(x = \"xcmsEIC\"): plot extracted ion chromatograms rtrange signature(object = \"xcmsEIC\"): get rtrange slot sampnames signature(object = \"xcmsEIC\"): get sample names","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsEIC-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsEIC-class.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Class xcmsEIC, a class for multi-sample extracted ion chromatograms — xcmsEIC-class","text":"notes yet.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsFileSource-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Base class for loading raw data from a file — xcmsFileSource-class","title":"Base class for loading raw data from a file — xcmsFileSource-class","text":"Data sources read data file inherit class. xcms package provides classes read netCDF, mzData, mzXML, mzML files using xcmsFileSource. class considered virtual work passed loadRaw-methods. reason explicitly virtual appear way class virtual data part (lets functions treat objects character strings). class validates file exists path given.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFileSource-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"Base class for loading raw data from a file — xcmsFileSource-class","text":"xcmsFileSource objects instantiated directly. Instead, create subclasses instantiate .","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFileSource-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Base class for loading raw data from a file — xcmsFileSource-class","text":".Data: Object class \"character\". File path file read raw data object's data part","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFileSource-class.html","id":"extends","dir":"Reference","previous_headings":"","what":"Extends","title":"Base class for loading raw data from a file — xcmsFileSource-class","text":"Class \"character\", data part. Class \"xcmsSource\", directly.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFileSource-class.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Base class for loading raw data from a file — xcmsFileSource-class","text":"xcmsSource signature(object = \"character\"): Create xcmsFileSource object referencing given file name.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFileSource-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Base class for loading raw data from a file — xcmsFileSource-class","text":"Daniel Hackney dan@haxney.org","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class xcmsFragments, a class for handling Tandem MS and MS$^n$ data — xcmsFragments-class","title":"Class xcmsFragments, a class for handling Tandem MS and MS$^n$ data — xcmsFragments-class","text":"class similar xcmsSet stores peaks number individual files. However, xcmsFragments keeps Tandem MS e.g. Ion Trap Orbitrap MS$^n$ peaks, including parent ion relationships.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"Class xcmsFragments, a class for handling Tandem MS and MS$^n$ data — xcmsFragments-class","text":"Objects can created xcmsFragments constructor filled peaks using collect method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Class xcmsFragments, a class for handling Tandem MS and MS$^n$ data — xcmsFragments-class","text":"peaks: matrix colmns peakID (MS1 parent corresponding xcmsSet), MSnParentPeakID (parent peak within xcmsFragments), msLevel (e.g. 2 Tandem MS), rt (retention time case LC data), mz (fragment mass--charge), intensity (peak intensity extracted original xcmsSet), sample (index rawData-file). MS2spec: list matrixes. matrix list single collected spectra collect. column ID's mz, intensity, full width half maximum(fwhm). fwhm column relevant spectra came profile data. specinfo: matrix reference data spectra MS2spec. column id's preMZ, AccMZ, rtmin, rtmax, ref, CollisionEnergy. preMZ precursor mass MS1 scan. mass given XML file. instruments mass given nominal mass, therefore AccMZ given weighted average mass MS1 scan collected spectra. retention time given rtmin rtmax. ref column pointer MS2spec matrix spectra. collisionEnergy column collision Energy spectra.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments-class.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Class xcmsFragments, a class for handling Tandem MS and MS$^n$ data — xcmsFragments-class","text":"collect signature(object = \"xcmsFragments\"): gets xcmsSet-object, collects ms1-peaks msn-peaks corresponding xcmsRaw-files. plotTree signature(object = \"xcmsFragments\"): prints (text based) pseudo-tree peaktable display dependencies peaks among . show signature(object = \"xcmsFragments\"): print human-readable description object console.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Class xcmsFragments, a class for handling Tandem MS and MS$^n$ data — xcmsFragments-class","text":"S. Neumann, J. Kutzera","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments.html","id":null,"dir":"Reference","previous_headings":"","what":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","title":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","text":"EXPERIMANTAL FEATURE xcmsFragments object similar xcmsSet, holds peaks picked (collected) one several xcmsRaw objects. still discussions going exact API MS$^n$ data, likely change future. code yet pipeline-ified.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","text":"","code":"xcmsFragments(xs, ...)"},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","text":"xs xcmsSet-class object contains picked ms1-peaks one several experiments ... arguments collect method","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","text":"running collect(xFragments,xSet) peaktable xcmsFragments includes ms1Peaks experinemts stored xcmsSet-object. contains relevant MSn-peaks xcmsRaw-objects, created temporarily paths xcmsSet.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","text":"xcmsFragments object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsFragments.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Constructor for xcmsFragments objects which holds Tandem MS peaks — xcmsFragments","text":"Joachim Kutzera, Steffen Neumann, sneumann@ipb-halle.de","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsPeaks-class.html","id":null,"dir":"Reference","previous_headings":"","what":"A matrix of peaks — xcmsPeaks-class","title":"A matrix of peaks — xcmsPeaks-class","text":"matrix peak information. actual columns depend generated (.e. findPeaks method).","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsPeaks-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"A matrix of peaks — xcmsPeaks-class","text":"Objects can created calls form new(\"xcmsPeaks\", ...).","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsPeaks-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"A matrix of peaks — xcmsPeaks-class","text":".Data: matrix holding peak information","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsPeaks-class.html","id":"extends","dir":"Reference","previous_headings":"","what":"Extends","title":"A matrix of peaks — xcmsPeaks-class","text":"Class \"matrix\", data part. Class \"array\", class \"matrix\", distance 2. Class \"structure\", class \"matrix\", distance 3. Class \"vector\", class \"matrix\", distance 4, explicit coerce.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsPeaks-class.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"A matrix of peaks — xcmsPeaks-class","text":"None yet. utilities working peak data nice.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsPeaks-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"A matrix of peaks — xcmsPeaks-class","text":"Michael Lawrence","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class xcmsRaw, a class for handling raw data — xcmsRaw-class","title":"Class xcmsRaw, a class for handling raw data — xcmsRaw-class","text":"class handles processing visualization raw data single LC/MS GS/MS run. includes methods producing standard suite plots including individual spectra, multi-scan average spectra, TIC, EIC. also produce feature list significant peaks using matched filtration.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"Class xcmsRaw, a class for handling raw data — xcmsRaw-class","text":"Objects can created xcmsRaw constructor reads data NetCDF file new object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Class xcmsRaw, a class for handling raw data — xcmsRaw-class","text":"acquisitionNum: Numeric representing acquisition number individual scans/spectra. Length acquisitionNum equal number spectra/scans object hence equal scantime slot. Note however information available mzML files. env: environment three variables: mz - concatenated m/z values scans, intensity - corresponding signal intensity m/z value, profile - matrix represention intensity values columns representing scans rows representing equally spaced m/z values. profile matrix extracted profMat method. filepath: Path raw data file gradient: matrix first row, time, containing time point interpolation successive columns representing solvent fractions point msnAcquisitionNum: scan unique acquisition number reported via \"spectrum id\" (mzData) \"\" \"\" (mzXML) msnCollisionEnergy: \"CollisionEnergy\" (mzData) \"collisionEnergy\" (mzXML) msnLevel: scan \"msLevel\" (mzData mzXML) msnPrecursorCharge: \"ChargeState\" (mzData) \"precursorCharge\" (mzXML) msnPrecursorIntensity: \"Intensity\" (mzData) \"precursorIntensity\" (mzXML) msnPrecursorMz: \"MassToChargeRatio\" (mzData) \"precursorMz\" (mzXML) msnPrecursorScan: \"spectrumRef\" (mzData mzXML) msnRt: Retention time scan msnScanindex: msnScanindex mzrange: numeric vector length 2 minimum maximum m/z values represented profile matrix polarity: polarity profmethod: characer value name method used generating profile matrix. profparam: list store additional profile matrix generation settings. Use profinfo method extract profile matrix creation relevant information. scanindex: integer vector starting positions scan mz intensity variables (note index values based 0 initial position instead 1). scantime: numeric vector acquisition time (seconds) scan. tic: numeric vector total ion count (intensity) scan mslevel: Numeric representing MS level present MS1 slot. slot accessed getter method mslevel. scanrange: Numeric length 2 specifying scan range (NULL full range). slot accessed getter method scanrange. Note scanrange always 1 number scans within xcmsRaw object, necessarily match scan index original mzML file (e.g. original data sub-setted). acquisitionNum information can used track original position scan mzML file.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw-class.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Class xcmsRaw, a class for handling raw data — xcmsRaw-class","text":"findPeaks signature(object = \"xcmsRaw\"): feature detection using matched filtration chromatographic time domain getEIC signature(object = \"xcmsRaw\"): get extracted ion chromatograms specified m/z ranges. return total ion chromatogram (TIC) m/z range corresponds full m/z range (.e. sum signals per retention time across m/z). getPeaks signature(object = \"xcmsRaw\"): get data peaks specified m/z time ranges getScan signature(object = \"xcmsRaw\"): get m/z intensity values single mass scan getSpec signature(object = \"xcmsRaw\"): get average m/z intensity values multiple mass scans image signature(x = \"xcmsRaw\"): get data peaks specified m/z time ranges levelplot Create image raw (profile) data m/z retention time, intensity color coded. mslevel Getter method mslevel slot. plotChrom signature(object = \"xcmsRaw\"): plot chromatogram profile data plotRaw signature(object = \"xcmsRaw\"): plot locations raw intensity data points plotScan signature(object = \"xcmsRaw\"): plot mass spectrum individual scan raw data plotSpec signature(object = \"xcmsRaw\"): plot mass spectrum profile data plotSurf signature(object = \"xcmsRaw\"): experimental method plotting 3D surface profile data rgl. plotTIC signature(object = \"xcmsRaw\"): plot total ion count chromatogram profinfo signature(object = \"xcmsRaw\"): returns list containing profile generation method step (profile m/z step size) eventual additional parameters profile function. profMedFilt signature(object = \"xcmsRaw\"): median filter profile data time m/z dimensions profMethod<- signature(object = \"xcmsRaw\"): change method generating profile matrix profMethod signature(object = \"xcmsRaw\"): get method generating profile matrix profMz signature(object = \"xcmsRaw\"): get vector m/z values row profile matrix profRange signature(object = \"xcmsRaw\"): interpret flexible ways specifying subsets profile matrix profStep<- signature(object = \"xcmsRaw\"): change m/z step used generating profile matrix profStep signature(object = \"xcmsRaw\"): get m/z step used generating profile matrix revMz signature(object = \"xcmsRaw\"): reverse order data points scan scanrange Getter method scanrange slot. See slot description information. sortMz signature(object = \"xcmsRaw\"): sort data points increasing m/z scan stitch signature(object = \"xcmsRaw\"): Raw data correction lock mass calibration gaps. findmzROI signature(object = \"xcmsRaw\"): \tinternal function identify regions interest raw \tdata part first step centWave-based peak detection.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Class xcmsRaw, a class for handling raw data — xcmsRaw-class","text":"Colin . Smith, csmith@scripps.edu, Johannes Rainer johannes.rainer@eurac.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":null,"dir":"Reference","previous_headings":"","what":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"function handles task reading NetCDF/mzXML file containing LC/MS GC/MS data new xcmsRaw object. also transforms data profile (maxrix) mode efficient plotting data exploration.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"","code":"xcmsRaw(filename, profstep = 1, profmethod = \"bin\", profparam = list(), includeMSn=FALSE, mslevel=NULL, scanrange=NULL) deepCopy(object)"},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"filename path name NetCDF mzXML file read profstep step size (m/z) use profile generation profmethod method use profile generation. See profile-matrix details supported values. profparam extra parameters use profile generation includeMSn XML file formats: also read MS$^n$ (Tandem-MS Ion-/Orbi- Trap spectra) mslevel move data mslevel normal MS1 slots, e.g. peak picking visualisation scanrange scan range read object xcmsRaw object","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"See profile-matrix details profile matrix generation methods settings. scanrange import can restricted, otherwise MS1 data read. profstep set 0, profile matrix generated. Unless includeMSn = TRUE first level MS data read, MS/MS, etc. deepCopy(xraw) create copy xcmsRaw object copy mz intensity data xraw@env.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"xcmsRaw object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"NetCDF file format: https://www.unidata.ucar.edu/software/netcdf/ http://www.astm.org/Standards/E2077.htm http://www.astm.org/Standards/E2078.htm mzXML file format: http://sashimi.sourceforge.net/software_glossolalia.html PSI-MS working group developed mzData mzML file formats: http://www.psidev.info/index.php?q=node/80 Parser used XML file formats: http://tools.proteomecenter.org/wiki/index.php?title=Software:RAMP","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsRaw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Constructor for xcmsRaw objects which reads NetCDF/mzXML files — xcmsRaw","text":"","code":"if (FALSE) { library(xcms) library(faahKO) cdfpath <- system.file(\"cdf\", package = \"faahKO\") cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE) xr<-xcmsRaw(cdffiles[1]) xr ##This gives some information about the file names(attributes(xr)) ## Lets have a look at the structure of the object str(xr) ##same but with a preview of each slot in the object ##SO... lets have a look at how this works head(xr@scanindex) ##[1] 0 429 860 1291 1718 2140 xr@env$mz[425:430] ##[1] 596.3 597.0 597.3 598.1 599.3 200.1 ##We can see that the 429 index is the last mz of scan 1 therefore... mz.scan1<-xr@env$mz[(1+xr@scanindex[1]):xr@scanindex[2]] intensity.scan1<-xr@env$intensity[(1+xr@scanindex[1]):xr@scanindex[2]] plot(mz.scan1, intensity.scan1, type=\"h\", main=paste(\"Scan 1 of file\", basename(cdffiles[1]), sep=\"\")) ##the easier way :p scan1<-getScan(xr, 1) head(scan1) plotScan(xr, 1) }"},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","title":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","text":"class transforms set peaks multiple LC/MS GC/MS samples matrix preprocessed data. groups peaks nonlinear retention time correction without internal standards. fills missing peak values raw data. Lastly, generates extracted ion chromatograms ions interest.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","text":"Objects can created xcmsSet constructor gathers peaks set NetCDF files. Objects can also created calls form new(\"xcmsSet\", ...).","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","text":"peaks matrix containing peak data. filled vector peak indices peaks added fillPeaks method. groups Matrix containing statistics peak groups. groupidx List containing indices peaks group. phenoData data.frame containing experimental design factors. rt list containing two lists, raw corrected, containing retention times every scan every sample. filepaths Character vector absolute path name NetCDF file. profinfo list containing values method - profile generation method, step - profile m/z step size eventual additional parameters profile function. dataCorrection logical vector filled waters Lock mass correction parameter used. polarity string (\"positive\" \"negative\" NULL) describing whether positive negative scans used reading raw data. progressInfo Progress informations xcms functions (GUI). progressCallback Function called, progressInfo changes (GUI). mslevel Numeric representing MS level peak picking performed (default MS1). slot accessed getter method mslevel. scanrange Numeric length 2 specifying scan range (NULL full range). slot accessed getter method scanrange. scan range provided slot represents scans whole raw data subsetted. .processHistory Internal slot used keep track performed processing steps. slot directly accessed user.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet-class.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","text":"c signature(\"xcmsSet\"): combine objects together filepaths<- signature(object = \"xcmsSet\"): set filepaths slot filepaths signature(object = \"xcmsSet\"): get filepaths slot diffreport signature(object = \"xcmsSet\"): create report differentially regulated ions including EICs fillPeaks signature(object = \"xcmsSet\"): fill peak data groups missing peaks getEIC signature(object = \"xcmsSet\"): get list EICs sample set getXcmsRaw signature(object = \"xcmsSet\", sampleidx = 1, \tprofmethod = profMethod(object), profstep = profStep(object), \tprofparam=profinfo(object), mslevel = NULL, scanrange = NULL, \trt=c(\"corrected\", \"raw\"), BPPARAM = bpparam()): read raw data one files xcmsSet return . default parameters apply settings used original xcmsSet call generate xcmsSet object applied also raw data. Parameter sampleidx allows specify raw file(s) loaded. Argument BPPARAM allows setup parallel processing. groupidx<- signature(object = \"xcmsSet\"): set groupidx slot groupidx signature(object = \"xcmsSet\"): get groupidx slot groupnames signature(object = \"xcmsSet\"): get textual names peak groups groups<- signature(object = \"xcmsSet\"): set groups slot groups signature(object = \"xcmsSet\"): get groups slot groupval signature(object = \"xcmsSet\"): get matrix values peak data row peak group group signature(object = \"xcmsSet\"): find groups peaks across samples share similar m/z retention times mslevel Getter method mslevel slot. peaks<- signature(object = \"xcmsSet\"): set peaks slot peaks signature(object = \"xcmsSet\"): get peaks slot plotrt signature(object = \"xcmsSet\"): plot retention time deviation profiles profinfo<- signature(object = \"xcmsSet\"): set profinfo slot profinfo signature(object = \"xcmsSet\"): get profinfo slot profMethod signature(object = \"xcmsSet\"): extract method used generate profile matrix. profStep signature(object = \"xcmsSet\"): extract profile step used generation profile matrix. retcor signature(object = \"xcmsSet\"): use initial grouping peaks nonlinear loess retention time correction sampclass<- signature(object = \"xcmsSet\"): Replaces column “class” phenoData slot. See details information. sampclass signature(object = \"xcmsSet\"): Returns content column “class” phenoData slot , present, interaction experimental design factors (.e. phenoData data.frame). See details information. phenoData<- signature(object = \"xcmsSet\"): set phenoData slot phenoData signature(object = \"xcmsSet\"): get phenoData slot progressCallback<- signature(object = \"xcmsSet\"): set progressCallback slot progressCallback signature(object = \"xcmsSet\"): get progressCallback slot scanrange Getter method scanrange slot. See scanrange slot description details. sampnames<- signature(object = \"xcmsSet\"): set rownames phenoData slot sampnames signature(object = \"xcmsSet\"): get rownames phenoData slot split signature(\"xcmsSet\"): divide xcmsSet list xcmsSet objects depending provided factor. Note peak data preserved, .e. eventual peak grouping information lost. object$name, object$name<-value Access set name column phenoData object[, ] Conducts subsetting xcmsSet instance. subsetting columns, .e. samples, supported. Subsetting performed slots, also groups groupidx. Parameter can integer vector, logical vector character vector sample names (matching sampnames).","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet-class.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","text":"phenoData slot (phenoData parameter xcmsSet function) intended contain data.frame describing experimental factors, .e. samples along properties. data.frame contains column named “class”, returned sampclass method thus used methods determine sample grouping/class assignment (e.g. define colors various plots group method). sampclass<- method adds replaces “class” column phenoData slot. data.frame submitted method, interaction columns stored “class” column. Also, similar classes Bioconductor, $ method can used directly access columns phenoData slot (e.g. use xset$name xcmsSet object called “xset” extract values column named “name” phenoData slot).","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Class xcmsSet, a class for preprocessing peak data — xcmsSet-class","text":"Colin . Smith, csmith@scripps.edu, Johannes Rainer johannes.rainer@eurac.edu","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":null,"dir":"Reference","previous_headings":"","what":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"function handles construction xcmsSet objects. finds peaks batch mode pre-sorts files subdirectories different classes suitable grouping.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"","code":"xcmsSet(files = NULL, snames = NULL, sclass = NULL, phenoData = NULL, profmethod = \"bin\", profparam = list(), polarity = NULL, lockMassFreq=FALSE, mslevel=NULL, nSlaves=0, progressCallback=NULL, scanrange = NULL, BPPARAM = bpparam(), stopOnError = TRUE, ...)"},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"files path names NetCDF/mzXML files read snames sample names. default file name without extension used. sclass sample classes. phenoData data.frame AnnotatedDataFrame defining sample names classes sample related properties. provided, argument sclass subdirectories samples stored used specify sample grouping. profmethod Method use profile generation. Supported values \"bin\", \"binlin\", \"binlinbase\" \"intlin\" (methods profBin, profBinLin, profBinLinBase profIntLin, respectively). See help profBin complete list available methods supported parameters. profparam parameters use profile generation. polarity filter raw data positive/negative scans lockMassFreq Performs correction Waters LockMass function mslevel perform peak picking data given mslevel nSlaves DEPRECATED, use BPPARAM argument instead. progressCallback function called, progressInfo changes (useful GUIs) scanrange scan range read BPPARAM BiocParallel parameter object control parallel processing performed. objects can created SerialParam, MulticoreParam SnowParam functions. stopOnError Logical specifying whether feature detection call stop first encountered error (default), whether feature detection performed files regardless eventual failures individual files case errors reported warnings. ... arguments findPeaks method xcmsRaw class","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"default values files, snames, sclass, phenoData arguments cause function recursively search readable files. filename without extention used sample name. subdirectory path used sample class. files contain positive negative spectra, polarity can selected explicitly. default (NULL) read scans. phenoData provided, stored phenoData slot returned xcmsSet class. data.frame contains column named “class”, content returned sampclass method thus used group/class assignment individual files (e.g. peak grouping etc.). details see help xcmsSet-class. step size (m/z) use profile generation can submitted either using profparam argument (e.g. profparam=list(step=0.1)) submitting step=0.1. specifying value 0 profile matrix generation can skipped. feature/peak detection algorithm can specified method argument defaults \"matchFilter\" method (findPeaks.matchedFilter). Possible values returned getOption(\"BioC\")$xcms$findPeaks.methods. lock mass correction allows lock mass scan added back last working scan. correction gives better reproducibility sample sets.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"xcmsSet object.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"Colin . Smith, csmith@scripps.edu","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSet.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Constructor for xcmsSet objects which finds peaks in NetCDF/mzXML files — xcmsSet","text":"arguments profmethod profparam influence feature/peak detection. step size parameter step profile generation findPeaks.matchedFilter peak detection algorithm can passed using ....","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsSource-class.html","id":null,"dir":"Reference","previous_headings":"","what":"Virtual class for raw data sources — xcmsSource-class","title":"Virtual class for raw data sources — xcmsSource-class","text":"virtual class provides implementation-independent way load mass spectrometer data various sources use xcmsRaw object. Subclasses can defined enable data loaded user-specified sources. virtual class xcmsFileSource included box contains file name character string. implementing child classes xcmsSource, corresponding loadRaw-methods method must provided accepts xcmsSource child class returns list format described loadRaw-methods.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSource-class.html","id":"objects-from-the-class","dir":"Reference","previous_headings":"","what":"Objects from the Class","title":"Virtual class for raw data sources — xcmsSource-class","text":"virtual Class: objects may created .","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSource-class.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Virtual class for raw data sources — xcmsSource-class","text":"Daniel Hackney, dan@haxney.org","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/reference/xcmsSource-methods.html","id":null,"dir":"Reference","previous_headings":"","what":"Create an xcmsSource object in a flexible way — xcmsSource-methods","title":"Create an xcmsSource object in a flexible way — xcmsSource-methods","text":"Users can define alternate means reading data xcmsRaw objects creating new implementations method.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSource-methods.html","id":"methods","dir":"Reference","previous_headings":"","what":"Methods","title":"Create an xcmsSource object in a flexible way — xcmsSource-methods","text":"signature(object = \"xcmsSource\") Pass object unmodified.","code":""},{"path":"https://sneumann.github.io/xcms/reference/xcmsSource-methods.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create an xcmsSource object in a flexible way — xcmsSource-methods","text":"Daniel Hackney, dan@haxney.org","code":""},{"path":[]},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.12","title":"xcms 4.1","text":"Implementation LamaParama class method adjustRtime() function. Allowing alignment dataset based landmarks (lamas) external reference dataset. Implementation related user-level function matchLamasChromPeaks(), summarizeMatchLama() plot(LamaParama) allows evaluation matching lamas chromPeaks.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-1","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.11","title":"xcms 4.1","text":"Clean required suggested packages namespace imports. Re-creation bundled data objects.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-2","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.10","title":"xcms 4.1","text":"Ensure backward compatibility parameter objects gained additional slots.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-3","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.9","title":"xcms 4.1","text":"Fix bug filterFeatures,PercentMissingFilter.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-4","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.8","title":"xcms 4.1","text":"Fixing issue #716: edit .empty_chrom_peaks function sn column returned. Fixes extracting plotting peaks using manualChromPeaks","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-5","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.7","title":"xcms 4.1","text":"Implementation filterFeatures function filter parameters: RsdFilter, DratioFilter, PercentMissingFilter, BlankFlag. can used ot filter features XcmsResult SummarizedExperiment objects. Addition section main xcms vignette describe use .","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-6","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.6","title":"xcms 4.1","text":"Import filterSpectra MsExperiment. Import breaks_ppm MsCoreUtils. Update featureArea function consider chromatographic peaks per feature, one highest intensity. consequence, returned m/z rt ranges might higher influence featureChromatograms, EIC-based feature grouping , lesser extent also gap-filling. Related documentation updated. Improve performance featureArea function (related PeakAreaParam-based gap filling). Add parameter ppm PeakDensityParam enable peak-density-based correspondence throgh m/z-dependent bins along m/z.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-7","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.5","title":"xcms 4.1","text":"Improve performance chromatogram call XcmsExperiment objects. Remove internal (exported) normalization functions. transferred MetaboCoreUtils package. Support subsetting XcmsExperiment negative indices.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-8","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.4","title":"xcms 4.1","text":"Rename variable data vignette faahko. Fix issue adjustRtime resulting corrupt processHistory. Add support perform peakGroups alignment using pre-defined anchor peak matrix (.e., numeric matrix retention times anchor peaks samples can used align samples). Fix errors related invalid Chromatogram objects extracted xcms results: ensure MS level chromPeaksMatrix integer. Fix definition anchor peaks peakGroups alignment subset (issue #702). Add filterMsLevel method MsExperiment XcmsExperiment. Ensure chunk-wise processing Spectra (introduced version 1.13.2) disabled xcms using chunk-wise processing.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-9","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.3","title":"xcms 4.1","text":"Add parameter verboseBetaColumns CentWaveParam enable calculation additional peak quality metrics comparing EIC idealized bell curve.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-10","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.2","title":"xcms 4.1","text":"Add param = generic function storeResults: PlainTextParam save XcmsExperiment MsExperiment object colleciton plain text files.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-4-1-11","dir":"Changelog","previous_headings":"","what":"Changes in version 4.1.1","title":"xcms 4.1","text":"Add method storeResults one param =: RDataParam save XcmsExperiment object .RData file.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.6","title":"xcms 3.99","text":"Add method coerce XcmsExperiment xcmsSet (issue #696). Support providing mz rt also chromatogram,MsExperiment.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.5","title":"xcms 3.99","text":"mz rt need provided chromatogram.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.4","title":"xcms 3.99","text":"Add chromPeakChromatograms function extract (EIC) chromatograms chromatographic peaks.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.3","title":"xcms 3.99","text":"Small fixes direct injection vignette. Add parameter isolationWindowTargetMz chromatogram function MsExperiment XcmsExperiment ensure MS2 chromatographic data extracted MS2 spectra containing fragments compound interest.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.2","title":"xcms 3.99","text":"Add xmse data set representing XcmsExperiment object. Update compounding vignette use new objects. Add loadXcmsData load test data objects (fix/update paths). Add groupFeatures methods XcmsExperiment. Fix issue featureArea XcmsExperiment. Update main vignette use describe new data objects. Add findChromPeaksIsolationWindow method MsExperiment XcmsExperiment. Make reconstructChromPeakSpectra method. Add reconstructChromPeakSpectra implementation XcmsExperiment. Add filterIsolationWindow MsExperiment XcmsExperiment filter spectra (eventually chromatographic peaks) based isolation window. Update LC-MS/MS vignette adding also example deisotope SWATH MS2 spectra.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99-5","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.1","title":"xcms 3.99","text":"featureSummary overlappingFeatures gain support XcmsExperiment. Fix featureChromatograms ensure valid object returned.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-99-6","dir":"Changelog","previous_headings":"","what":"Changes in version 3.99.0","title":"xcms 3.99","text":"Add XcmsExperiment support MsExperiment/Spectra: add functionality full xcms processing MsExperiment object. Fix issue refineChromPeaks MergeNeighboringPeaksParam wrong apex position considered evaluation whether candidate peaks merged (happen merging > 2 candidate peaks). Re-write reconstructChromPeakSpectra DIA data analysis fix issue chromatographic peaks overlapping SWATH isolation windows generally improve performance.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-21","dir":"Changelog","previous_headings":"","what":"Changes in version 3.21.5","title":"xcms 3.21","text":"Fix issue chromatogram filtering result object (issue #511).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-21-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.21.4","title":"xcms 3.21","text":"Move multtest Suggests Imports dependencies","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-21-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.21.3","title":"xcms 3.21","text":"fixes long running tests","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-21-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.21.1","title":"xcms 3.21","text":"Fix error fillChromPeaks sparse data (many empty spectra) peak detection performed MatchedFilterParam (issue #653). Update newer function names rgl package (issue #654).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-19","dir":"Changelog","previous_headings":"","what":"Changes in version 3.19.2","title":"xcms 3.19","text":"Update/expand documentation firstBaselineCheck parameter centWave.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-19-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.19.1","title":"xcms 3.19","text":"Update documentation reference updates MassSpecWavelet package.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-17","dir":"Changelog","previous_headings":"","what":"Changes in version 3.17.6","title":"xcms 3.17","text":"Rewrite code subset features chromatographic peaks. results perfomance improvement filterFile similar functions. Add parameter expandMz featureChromatograms https://github.com/sneumann/xcms/issues/612.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-17-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.17.5","title":"xcms 3.17","text":"Change way m/z value chromatographic peak determined centWave: ROI contains one peak one scan (spectrum) intensity-weighted m/z reported scan. m/z chromatographic peak calculated based reported m/z values scan (spectrum). original version mean m/z scan reported instead. result, m/z values chromatographic peaks now slightly different expected accurate. See https://github.com/sneumann/xcms/issues/590 details.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-17-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.17.4","title":"xcms 3.17","text":"Add transformIntensity method. Fix issue calling chromPeakSpectra featureSpectra object contains also files MS1 spectra (https://github.com/sneumann/xcms/issues/603).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-17-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.17.2","title":"xcms 3.17","text":"Use mzML instead mzData files testing vignettes, since mzR drop mzData reading msdata package drop mzData files well","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-17-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.17.1","title":"xcms 3.17","text":"Fix bug feature grouping EIC correlation return non-symmetric similarity matrix. Fix error message issue 584.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-15","dir":"Changelog","previous_headings":"","what":"Changes in version 3.15.5","title":"xcms 3.15","text":"Disable testing windows i386, providing speedup Disable parallel processing Windows, causing issue testthat BioC build check","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-15-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.15.4","title":"xcms 3.15","text":"Fix plot type = \"XIC\" plot empty plot data present. Skip re-indexing peaks features necessary. results performance improvements MS1 data.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-15-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.15.3","title":"xcms 3.15","text":"Add manualFeatures allowing manually define add features XCMSnExp object. Add plotChromatogramsOverlay function support plotting multiple EICs sample plot (eventually stacked). Add feature grouping EIC similarity: EicSimilarityParam. Import compareChromatograms MSnbase. Add feature grouping similar retention time: `SimilarRtimeParams. Add feature grouping similarity feature abundances across samples: AbundanceSimilarityParam. Add feature grouping methodology based MsFeatures.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-15-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.15.2","title":"xcms 3.15","text":"Fix LC-MS/MS vignette.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-15-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.15.1","title":"xcms 3.15","text":"Compatibility fix nls() R >= 4.1, contributed Rick Helmus.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.8","title":"xcms 3.13","text":"Fix plotQC() XCMSnExp objects","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.7","title":"xcms 3.13","text":"Add featureArea function extract m/z-rt region features. Fix featureSpectra function. Re-add LC-MS/MS vignette. Feature: plotQC() supports XCMSnExp objects now","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.6","title":"xcms 3.13","text":"Fix issue #545: skip second centWave run CentWavePredIsoParam regions interest undefined peak boundaries/scan ranges. Temporarily remove LC-MS/MS vignette (MsBackendMgf added Bioconductor).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.5","title":"xcms 3.13","text":"Add filterChromPeaks method filter chromatographic peaks XChromatogram XChromatograms object. Add filterChromPeaks method XCMSnExp (issue #541). Support return Spectra objects chromPeakSpectra, featureSpectra reconstructChromPeakSpectra. Support extraction MS1 spectra chromPeakSpectra. Support extraction spectrum largest total signal largest base peak signal chromPeakSpectra. Add support extraction spectra selected/individual peaks/features using peaks features parameter chromPeakSpectra featureSpectra, respectively.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.4","title":"xcms 3.13","text":"Import Param object ProtGenerics. Import filterIntensity, normalize alignRt Chromatogram MChromatograms MSnbase.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-5","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.3","title":"xcms 3.13","text":"align,Chromatogram gains new method \"none\" keep values identical retention times. method = \"matchRtime\" (much faster) matching function closest MsCoreUtils package used. Method correlate,Chromatogram gains parameter useIntensitiesAbove perform correlation values larger threshold (avoiding thus high correlation many 0-values). Add method filterIntensity,Chromatogram allows filter chromatogram object keeping data points intensity user provided threshold.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-6","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.2","title":"xcms 3.13","text":"Add new function manualChromPeaks allowing manually add integrate chromatographic peaks.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-13-7","dir":"Changelog","previous_headings":"","what":"Changes in version 3.13.1","title":"xcms 3.13","text":"Support subsetting XChromatograms drop = FALSE.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.8","title":"xcms 3.11","text":"Disable parallel processing vignettes.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.7","title":"xcms 3.11","text":"efficient splitting data per file especially larger data sets. Disable parallel processing examples.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.6","title":"xcms 3.11","text":"Add FilterIntensityParam filter chromatographic peaks intensity (issue #502). Add estimatePrecursorIntensity function determine precursor intensity MS2 spectra neighboring MS1 spectra.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.4","title":"xcms 3.11","text":"Change Spectra Chromatograms MSpectra MChromatograms MSnbase version >= 2.15.3.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.3","title":"xcms 3.11","text":"reconstructChromPeakSpectra: report also polarity precusorIntensity. reconstructChromPeakSpectra: ensure retention time reported reconstructed MS2 spectra (issue #485). Change default expandRt 0 reconstructChromPeakSpectra. Fix error refineChromPeaks,MergeNeighboringPeaksParam peaks found merged.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11-5","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.2","title":"xcms 3.11","text":"Add fillChromPeaks,ChromPeakAreaParam base area missing peak data filled-actually detected chromatographic peaks feature. Potential fix issue #481: function longer throw error retention times length 0. efficient splitting processing increase speed findChromPeaks, refineChromPeaks, reconstructChromPeakSpectra chromPeakSpectra calls.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-11-6","dir":"Changelog","previous_headings":"","what":"Changes in version 3.11.1","title":"xcms 3.11","text":"Fix issue #471: conversion XCMSnExp xcmsSet looses phenodata (thanks Andris Jankevics reporting providing solution). Add normalize method Chromatogram Chromatograms objects. featureChromatograms gets new parameter n value extract EICs top n samples highest intensities. filterFile gets new parameter keepFeatures support retaining correspondence results even data set filtered file. Export virtual Param class. Add filterColumnsIntensityAbove method Chromatograms object allows select columns (samples) Chromatograms object intensities chromatographic data higher threshold. Add removeIntensity method Chromatogram, Chromatograms, XChromatogram XChromatograms objects allowing remove intensities based different criteria. Add correlate method Chromatograms allowing correlate multiple chromatograms .","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-9","dir":"Changelog","previous_headings":"","what":"Changes in version 3.9.4","title":"xcms 3.9","text":"Fix issue centWave skips peak detection depending minimum peakwidth (issue #445): add parameter extendLengthMSW CentWaveParam. Thanks William Kumler contributing fix. Tentatively reduce memory requirements fillChromPeaks. Fix issue #467 fillPeaks() xcmsSet converted XCMSnSet","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-9-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.9.3","title":"xcms 3.9","text":"Move multtest Imports Suggests avoid duplicated method definition plot (issue #459). Add support peak filling MS level > 1 fillChromPeaks. featureValues gains parameter msLevel extract feature values features , specific MS level. refineChromPeaks supports different MS levels. Added support perform correspondence analysis MS level > 1 add respective results already present feature definitions. hasChromPeaks hasFeatures gain parameter msLevel check presence chromatographic peaks features specific MS level.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-9-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.9.2","title":"xcms 3.9","text":"Fix featureChromatograms chromatograms XCMSnExp object features: features can duplicated across rows (EICs). findChromPeaks: add parameter add allow several rounds peak detections object. Small performance enhancement fillChromPeaks. Better support MS > 1 data fillChromPeaks: skip MS level 2 spectra filling . Add refineChromPeaks XChromatogram XChromatograms objects. Add groupOverlaps function group arbitrary ranges. Add quantify,XCMSnExp object quantify XCMSnExp SummarizedExperiment. Fine-tune MergeNeighboringPeaks peak refinement method: average 3 data points candidate peaks used evaluate whether peaks merged making approach robust outliers. addition, ion chromatogram candidate peaks extracted m/z range expanded depending expandMz ppm setting ensuring low intensity data points candidate peaks missed (m/z might slightly shifted ToF instruments). mzmin mzmax merged peak represents also minimum maximum m/z data points extracted ion chromatogram.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-9-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.9.1","title":"xcms 3.9","text":"Fix problem shown/plotted peak positions plotChromPeakSpectra experiments peaks detected first sample(s). Add method from_to missing value imputation method imputeRowMinRand. Show warning findChromPeaks empty spectra detected. Add refineChromPeaks method CleanPeaksParam class allow removal chromatographic peaks exceeding user-definable maximal peak width. Add MergeNeighboringPeaksParam refineChromPeaks allow merging chromatographic peaks close m/z retention time signal higher certain threshold (issue #414). Fix misspelled parameter mzd LC-MS/MS vignette.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-7","dir":"Changelog","previous_headings":"","what":"Changes in version 3.7.5","title":"xcms 3.7","text":"Remove xcmsMSn vignette (based old xcms).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-7-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.7.4","title":"xcms 3.7","text":"mzClust correspondence analysis: check fix missing values column mz peaks matrix (issue #416).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-7-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.7.3","title":"xcms 3.7","text":"plot type = “XIC” XCMSnExp object draw rectangles indicating identified chromatographic peaks. Add vignette describing LC-MS/MS data analysis xcms.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-7-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.7.2","title":"xcms 3.7","text":"Fix documentation (issue #401). Add support SWATH data analysis.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-7-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.7.1","title":"xcms 3.7","text":"Add correlate method Chromatogram objects. Add parameter lwd plotAdjustedRtime. Add align method Chromatogram objects. Add findChromPeaksIsolationWindow enable chromatographic peak detection isolation windows. Fix issue chromPeakSpectra method = “signal”. chromPeakSpectra featureSpectra return now MS2 spectra precursor m/z >= mzmin, <= mzmax retention time >= rtmin, <= rtmax. Improve performance chromPeakSpectra featureSpectra.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-5","dir":"Changelog","previous_headings":"","what":"Changes in version 3.5.5","title":"xcms 3.5","text":"Add dirname dirname<- methods OnDiskMSnExp change path raw data files. Add section “Subset-based alignment” xcms vignette describe alignment possibility perform alignments based subset samples (e.g. QC samples).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-5-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.5.4","title":"xcms 3.5","text":"Fix problem featureChromatograms include = “feature_only” return non-valid object. Ensure XCMSnExp objects updated necessary analysis methods.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-5-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.5.3","title":"xcms 3.5","text":"Fix unit tests.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-5-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.5.2","title":"xcms 3.5","text":"Small changes fillChromPeaks,XCMSnExp reduce memory demand. Fix issue #359. Fix issue #360: rawEIC skipped last scan/spectrum rtrange provided. filterMsLevel keeps now chromatographic peaks feature definitions specified MS levels (issue #362). Fix bug xcmsRaw leads netCDF error message (issue #363). Add parameter msLevel chromPeaks XCMSnExp objects. Add chromPeakData allow adding arbitrary annotation chromatographic peaks. Change default parameter value featureValues value = “index” value = “”. Add parameter isFilledColumn chromPeaks allowing old behaviour include is_filled column chromatographic peak matrix.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-5-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.5.1","title":"xcms 3.5","text":"Fix issue #349. Add updateObject function XCMSnExp objects (issue #347). Add dropFilledChromPeaks methods XChromatogram XChromatograms objects. Add parameter filled = FALSE chromatogram featureChromatograms functions. Fix matchedFilter peak detection problems empty spectra (issue #325). featureChromatograms extracts default chromatographic peaks associated feature. chromatogram,XCMSnExp extracts XChromatogram containing also chromatographic peaks feature definitions. Add featureValues method XChromatograms objects (issue #336). Add correspondence analysis (peak grouping) chromatographic data (now PeakDensity method; issue #336). Add featureDefinitions slot XChromatograms object related accessor methods. Add subset alignment option subsetAdjust = “average” adjust left-samples (blanks simply non-subset samples) based interpolation results previous subsequent subset sample. Add parameter subsetAdjust PeakGroupsParam allowing switch different methods adjust samples left alignment process. Alignment based sample subset peak groups method (issue #335): sample subset can defined subset parameter, samples included subset aligned based adjusted retention times closest sample subset. Add findChromPeaks,XChromatograms (issue #332). Add processHistory,XChromatograms. Add plot,XChromatograms method automatic peak highlighting (issue #334). Add hasChromPeaks,XChromatograms method. Add XChromatograms class constructor function coercing method. Add hasChromPeaks,XChromatogram method. Add filterRt,XChromatogram, filterMz,XChromatogram. Add plot,XChromatogram function supporting highlighting/drawing identified chromatographic peaks. findChromPeaks,Chromatogram returns XChromatogram object (issue #329). Add chromPeaks,XChromatogram (issue #329). Add XChromatogram object (issue #329). Fix higlightChromPeaks type = “polygon”: peak filling represents now full detected peak longer cut provided rt. Add argument peakIds highlightChromPeaks allowing specify IDs peaks highlighted. Add example clustering base peak chromatograms vignette (issue #328). Small fix vignette (issue #327). Add parameter groupval exportMetaboAnalyst (issue #296). Fix bug show,XCMSnExp throw error process history present.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.3.6","title":"xcms 3.3","text":"Add type = “polygon” highlightChromPeaks allowing fill actual signal area identified chromatographic peaks.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-3-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.3.5","title":"xcms 3.3","text":"Performance enhancement chromPeakSpectra featureSpectra functions.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-3-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.3.4","title":"xcms 3.3","text":"Add featureChromatograms extract ion chromatograms feature. Add hasFilledChromPeaks function. Add argument skipFilled featureSummary function.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-3-3","dir":"Changelog","previous_headings":"","what":"Changes in version 3.3.3","title":"xcms 3.3","text":"Add chromPeakSpectra featureSpectra functions extract MS2 spectra chromatographic peaks features, respectively (issue #321). Fix profMat handle also data files empty spectra (issue #312). Add argument ylim plotAdjustedRtime (issue #314). Add imputeRowMin imputeRowMinRand, two simple missing value imputation helper functions. Fix additional problem mentioned issue #301 obiwarp retention time correction spectra m/z values NA. Fix issue #300 avoiding chromatographic peaks rtmin > rtmax. Fixes issues #291, #296. Add parameter ‘missing’ diffreport allowing replace NA arbitrary numbers. Add exportMetaboAnalyst function export feature matrix MetaboAnalyst format. Add parameter missing featureValues allowing specify handle/ report missing values. chromPeaks matrix now rownames uniquely identify chromatographic peaks experiment. Chromatographic peak IDs start “CP” followed number.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-3-4","dir":"Changelog","previous_headings":"","what":"Changes in version 3.3.2","title":"xcms 3.3","text":"Add writeMSData method XCMSnExp allowing write mzML/mzXML files adjusted retention times (issue #294). Fix profEIC call single-scan-peak (pull request #287 @trljcl). Fix centWave avoiding peak reported multiple times fitgauss = TRUE used (issue #284). featureSummary reports also RSD (relative standard deviations) features across samples (issue #286). Add parameters fixedMz fixedRt FillChromPeaksParam allow increase features’ m/z rt widths constant factor. Add option “sum” featureValues’ method parameter allowing sum intensities peaks assigned feature file/sample.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-3-5","dir":"Changelog","previous_headings":"","what":"Changes in version 3.3.1","title":"xcms 3.3","text":"Add overlappingFeatures function identify overlapping close features. Add support type = “apex_within” featureDefinitions. Fix bug fillChromPeaks return integrated signal Inf. Fix issue #267: error fillChromPeaks retention time peaks outside retention time range certain files. New featureSummary function calculate basic feature summaries (number samples peaks found etc). Parameter ‘type’ added plotChromPeakDensity ‘whichPeaks’ highlightChromPeaks. parameters passed ‘type’ argument chromPeaks. Parameter ‘type’ chromPeaks gets additional option “apex_within” return chromatographic peaks apex within defined rt /m/z range. Add functions rla rowRla calculate RLA (relative log abundances). Add peaksWithMatchedFilter perform peak detection chromatographic (MRM/SRM) data (issues #277 #278). Add peaksWithCentWave perform centWave peak detection chromatographic (MRM/SRM) data (issue #279). Add findChromPeaks,Chromatogram methods CentWaveParam MatchedFilterParam (issue #280).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.1.3","title":"xcms 3.1","text":"Fix misplaced parenthesis check multiple spectra findChromPeaks,OnDiskMSnExp,MSWParam. Thanks @RonanDaly (PR #276). Update link correct metlin page diffreport result (issue #204).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-1-1","dir":"Changelog","previous_headings":"","what":"Changes in version 3.1.2","title":"xcms 3.1","text":"Add filterFeatureDefinitions function. Fix #273: better error message case single feature defined groupChromPeaks.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-3-1-2","dir":"Changelog","previous_headings":"","what":"Changes in version 3.1.1","title":"xcms 3.1","text":"Reading raw files using xcmsSet xcmsRaw uses now automatic file type detection feature mzR. c function concatenate XCMSnExp objects. groupnames method XCMSnExp objects (issue #250). Fix #237: findPeaks.MSW throwing error applied multi-spectrum MS file. Fix #249: quantile call adjustRtime PeakGroups without na.rm = TRUE. Fix #259","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.10","title":"xcms 2.99","text":"Fix #230: Failing vignettes Windows.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-1","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.9","title":"xcms 2.99","text":"Chromatographic peak detection uses adjusted retention times aligned XCMSnExp object (issue #213, #208). New parameter msLevel processHistory,XCMSnExp. New parameter keepAdjustedRtime filterMsLevel,XCMSnExp, dropChromPeaks, XCMSnExp dropFeatureDefinitions,XCMSnExp. Add parameter msLevel chromatogram,XCMSnExp method (issue #205). Obiwarp alignment now performed one MS level adjustment applied MS levels (issue #214). Add function plotMsData plot intensity retention time m/z retention time MS slice one sample. Add argument msLevel = 1L extractMsData method (issue #223). New applyAdjustedRtime function consolidate alignment results, .e. replace raw retention times XCMSnExp adjusted retention times. [,XCMSnExp method gains argument keepAdjustedRtime allow keeping adjusted retention times sub-setting. Implement spectrapply,XCMSnExp ensure returned results use adjusted retention times (present). [[,XCMSnExp method returns Spectrum object adjusted retention time, XCMSnExp contains adjusted retention times. Argument ‘sampleGroups’ mandatory ‘PeakDensityParam’ (issue #228). Fix #191: Excessive memory use fillPeaks. Fix #220: peaks matrix missing column “sample” peaks found first sample. Fix #222: findChromPeaks return XCMSnExp object filtered single MS level despite peak detection performed single level. Fix problem plotMsData causing wrong colors used label data points.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-2","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.8","title":"xcms 2.99","text":"Replace xcmsMSn Rnw Rmd vignette fix Windows build errors.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-3","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.7","title":"xcms 2.99","text":"Fix #201: Warnings: ‘readMSData2’ deprecated, thanks L. Gatto. Merge BioC git transition","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-4","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.6","title":"xcms 2.99","text":"calibrate,XCMSnExp method allows calibrate chromatographic peaks. Export phenoDataFromPaths function (issue $195). Add arguments mz rt featureDefinitions method allowing extract features within specified ranges. Increase n density function call group density-based correspondence 2. Replace xcmsDirect.Rnw rmarkdown-based vignette using new user interface. issue #196: removed unnecessary requirement -dimension profile matrices adjustRtime,XCMSnExp,ObiwarpParam. mz range two files aligned differ, expand correctly. Depending profStep mz values/ranges matrices expanded correctly. Potential problems plotChromPeakDensity function.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-5","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.5","title":"xcms 2.99","text":"Re-enable sleep parameter findPeaks.centWave findPeaks.matchedFilter.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-6","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.4","title":"xcms 2.99","text":"Add plotChromPeaks function plot definition (rt mz range) detected chromatographic peaks one file mz-rt plane. Add plotChromPeakImage function plot number detected peaks along retention time axis per file image plot. Move Chromatogram class functionality MSnbase package Add argument msLevel findChromPeaks method allow (chromatographic) peak detection also MS level > 1. Polarity information read mzXML files (issue #192).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-7","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.3","title":"xcms 2.99","text":"issue #188: determine file type file content file ending known.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-8","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.2","title":"xcms 2.99","text":"issue #181: problem isCentroided,Spectrum method returns NA peaks spectrum. Fixed checking cases spectra file. issue #184: add parameter sleep do_groupChromPeaks_density function backwards compatible old group.density code.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-9","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.1","title":"xcms 2.99","text":"extractMsData extract raw MS data data.frame (issue #120). issue #175: error now thrown peak group identified peak group retention time correction. issue #178: scanrange collapsed adjusted range reported (pull request Jan Stanstrup). issue #180: error parameters method smooth provided retcor method.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-2-99-10","dir":"Changelog","previous_headings":"","what":"Changes in version 2.99.0","title":"xcms 2.99","text":"plotChromatogram highlightChromPeaks functions. plotChromPeakDensity function. clean method Chromatogram classes. Change default ppm parameter chromPeaks method 0. extractChromatograms supports extraction multiple rt mz ranges. New parameter missing extractChromatograms allowing specify intensity value used rts signal available within mz range. extractChromatograms returns Chromatograms length equal number scans within specified rt range, even signals measured (intensity values NA).","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-53","dir":"Changelog","previous_headings":"","what":"Changes in version 1.53.1","title":"xcms 1.53","text":"Increase parameter n density call peak density correspondence method. enables separate neighboring peaks using small n (issue #161). Thanks Jan Stanstrup.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.11","title":"xcms 1.51","text":"Parameter “filled” featureValues (issue #157). Parameters “rt” “mz” chromPeaks method allowing extract chromatographic peaks specified ranges (issue #156). Fixed possible memory problem obiwarp (issue #159). Update getPeaks use non-deprecated API (issue #163).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.10","title":"xcms 1.51","text":"filterRt Chromatogram class (issue #142). adjustRtimePeakGroups function (issue #147). adjustRtime,XCMSnExp,PeakGroupsParam do_adjustRtime_peakGroups support use pre-defined matrix perform alignment (issue #153). plotAdjustedRtime visualize alignment results (issue #141). featureDefinitions featureValues return DataFrame matrix rownames corresponding arbitrary feature IDs (issue #148). New peakGroupsMatrix slot PeakGroupsParam class (issue #153). Issue #146: ensure adjusted retention times returned peakGroups method order raw retention times.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.9","title":"xcms 1.51","text":"fillChromPeaks, dropFilledChromPeaks methods FillChromPeaksParam class. featureValues method. Extended new_functionality vignette. Change default backend reading mzML files pwiz. Issue #135: fix peak signal integration centWave. Issue #139: problem expand.mz expand.rt fillPeaks.chrom. Issue #137: Error findChromPeaks peaks found.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.8","title":"xcms 1.51","text":"Add Chromatogram class extractChromatograms method. Issue #118: failing unit test Windows build machine. Issue #133: error c() xcmsSet without peaks. Issue #134: xcmsSet constructor endless loop.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-4","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.7","title":"xcms 1.51","text":"chromatographic peak (chromPeak): peaks identified rt dimension. feature: mz-rt feature, grouped chromatographic peaks within across samples. Issue #127: failing unit test Windows build machine.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-5","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.6","title":"xcms 1.51","text":"groupFeatures adjustRtime methods XCMSnExp objects. New Param classes groupFeatures adjustRtime analysis methods: FeatureDensityParam, MzClustParam, NearestFeaturesParam, FeatureGroupsParam ObiwarpParam. Issue #124 (filterRt,XCMSnExp returned empty object).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-6","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.5","title":"xcms 1.51","text":"MsFeatureData XCMSnExp objects. features, features<-, adjustedRtime, adjustedRtime<-, featureGroups, featureGroups<-, hasAlignedFeatures, hasAdjustedRtime hasDetectedFeatures methods. dropFeatures, dropFeatureGroups dropAdjustedRtime methods. filterMz, filterRt, filterFile etc implemented. mz, intensity rtime methods XCMSnExp allowing return values grouped sample. Issue #99 (rtrange outside retention time range getEIC,xcmsSet). Issue #101 (xcmsRaw function returns NULL mslevel = 1 specified). Issue #102 (centWave returns empty matrix scales OK). Thanks J. Stanstrup. Issue #91 (warning instead error peaks ROI). Thanks J. Stanstrup.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-7","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.4","title":"xcms 1.51","text":"added deepCopy avoid corrupting original object, thanks J. Stanstrup, closes #93","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-8","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.3","title":"xcms 1.51","text":"binYonX binning function. imputeLinInterpol function providing linear interpolation missing values. breaks_on_binSize breaks_on_nBins functions calculate breaks defining bins. New vignette “new_functionality.Rmd” describing new modified functionality xcms. Add do_detectFeatures_matchedFilter function. Add do_detectFeatures_centWave function. Add do_detectFeatures_centWaveWithPredIsoROIs function unit test. Implement new data import function. Add do_detectFeatures_MSW function unit test. Argument stopOnError xcmsSet function allows perform feature detection files without stopping errors. Method showError xcmsSet objects list errors feature detection (stopOnError = FALSE xcmsSet function). [ method subset xcmsRaw objects scans. profMat method extract/create profile matrix /xcmsRaw. Add new detectFeatures methods MSnExp OnDiskMSnExp objects MSnbase package. Add new CentWaveParam, MatchedFilterParam, MassifquantParam, MSWParam CentWavePredIsoParam parameter class perform method dispatch detectFeatures method. retcor.obiwarp uses new binning methods profile matrix generation. scanrange,xcmsRaw reports always scanrange 1 length(object@scantime). scanrange,xcmsSet reports scanrange eventually specified user xcmsSet function. Fixed bug rawMat (issue #58). Fix issue #60: findPeaks.massifquant always returns xcmsPeaks object.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-9","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.2","title":"xcms 1.51","text":"suggested Jan Stanstrup, error centWave ROI contains data, closes #90","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-51-10","dir":"Changelog","previous_headings":"","what":"Changes in version 1.51.1","title":"xcms 1.51","text":"Fix incorrrect indexing getEIC function reported Edmands, closes #92","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.7","title":"xcms 1.49","text":"Fix documentation warnings.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.6","title":"xcms 1.49","text":"Peak Picking function findPeaks.centWaveWithPredictedIsotopeROIs() findPeaks.addPredictedIsotopeFeatures(), allow sensitive detection isotope features.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.5","title":"xcms 1.49","text":"documentation updates. Preparation new binning function","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.4","title":"xcms 1.49","text":"Fix getXcmsRaw prevent retention time correction applied (issue #44 reported Aleksandr).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49-4","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.3","title":"xcms 1.49","text":"updateObject method xcmsSet. xcms uses now BiocParallel parallel processing. parallel processing functions deprecated. Added missing package imports. Fix bug fillPeaksChromPar referencing non-existing variables object. Fix bug group.nearest: variable scoreList mis-spelled (coreList). Remove DUP = FALSE .C calls ignored anyways. Re-organization class, function method definitions R-files. Use roxygen2 manage DESCRIPTION’s collate field.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49-5","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.2","title":"xcms 1.49","text":"Initial support exporint mzTab format. Since Changes still expected, xcms:::writeMzTab() yet exported.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-49-6","dir":"Changelog","previous_headings":"","what":"Changes in version 1.49.1","title":"xcms 1.49","text":"raw CDF/mzXML/mzData/mzML assumed scans sorted m/z. Instead throwing “m/z sort assumption violated !” error, data re-read -demand sorted m/z.","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-47","dir":"Changelog","previous_headings":"","what":"Changes in version 1.47.3","title":"xcms 1.47","text":"Disable parallel processing unit tests causing timeout BioC build machines","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-47-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.47.2","title":"xcms 1.47","text":"Fix problem getEIC xcmsSet objects reported Alan Smith issue #7 add RUnit test case test (test.issue7 runit.getEIC.R). Changed unnecessary warnings messages.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-47-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.47.2","title":"xcms 1.47","text":"Disabled parallel processing unit tests migrate dependencies ncdf -> ncdf4","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.7","title":"xcms 1.45","text":"Disabled Rmpi support usage Windows","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.6","title":"xcms 1.45","text":"J. Rainer implemented [ method allows subset xcmsSet. Fixed problem split.xcmsSet split phenoData properly. Added details documentation xcmsSet-class.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.5","title":"xcms 1.45","text":"sampclass method xcmsSet now return content column “class” data.frame phenoData slot, present, interaction factors (columns) data.frame. sampclass<- method replaces content “class” column phenoData data.frame. data.frame submitted, interaction columns calculated stored “class” column. Fixed bug resulted cryptic error message input files available xcmsSet function.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.4","title":"xcms 1.45","text":"Fixed bug levelplot method xcmsSet.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45-4","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.3","title":"xcms 1.45","text":"xcmsSet now allows phenoData AnnotatedDataFrame. mslevel: store mslevel parameter submitted xcmsRaw. scanrange: store scanrange parameter submitted xcmsRaw. mslevel: stores mslevel argument xcmsSet method. scanrange: keep track scanrange argument xcmsSet method. levelplot: similar image method, plots m/z vs RT color coded intensities. mslevel: returns value .mslevel slot. downstream compatibility, method returns NULL object named slot. profinfo: functionality profinfo method xcmsSet. scanrange: returns value scanrange slot. downstream compatibility, method returns NULL object named slot. getXcmsRaw: returns xcmsRaw object one files xcmsSet, eventually applying retention time correction etc. levelplot: similar image method, plots m/z vs RT color coded intensities. Allows addition highlight identified peaks. mslevel: returns value mslevel slot. downstream compatibility, method returns NULL object named slot. profMethod: functionality profMethod method xcmsRaw. profStep: functionality profStep method xcmsRaw. scanrange: returns value scanrange slot. downstream compatibility, method returns NULL object named slot. show method xcmsSet updated display also informations mslevel scanrange. Elaborated documentation entries. rtrange mzrange xcmsRaw method plotEIC use default full RT m/z range. Added arguments “lty” “add” plotEIC method xcmsRaw. getEIC without specifying mzrange returns ion chromatogram full m/z range (.e. base peak chromatogram). Checking phenoData data.frame AnnotatedDataFrame throw error otherwise. xcmsSet getEIC method water Lock mass corrected files subset files evaluate whether specified files corrected.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45-5","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.2","title":"xcms 1.45","text":"xcms split() function now accepts factors shorter number samples xcmsSet, following closely standard split() behaviour","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-45-6","dir":"Changelog","previous_headings":"","what":"Changes in version 1.45.1","title":"xcms 1.45","text":"plotrt now allows col vector color definition, plots retcor methods. Added $ method access phenoData columns eSet/ExpressionSet like manner. Allow use “parallel” package parallel processing functions xcmsSet fillPeaks.chrom. Thanks J. Rainer!","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-43","dir":"Changelog","previous_headings":"","what":"Changes in version 1.43.3","title":"xcms 1.43","text":"Give verbose error message file found","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-43-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.43.2","title":"xcms 1.43","text":"Use ProtGenerics, adapted xcms peaks()","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-43-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.43.1","title":"xcms 1.43","text":"function plotQC() plotting various QC plots RT m/z","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-41","dir":"Changelog","previous_headings":"","what":"Changes in version 1.41.1","title":"xcms 1.41","text":"fix sampclass generation phenoData combinations factors don’t exist disable parallel code manpages avoid issues BioC windows build farm machines","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-39","dir":"Changelog","previous_headings":"","what":"Changes in version 1.39.6","title":"xcms 1.39","text":"Massifquant reports maximum intensity isotope trace (peak). useful interactive parameter optimization. Major memory reduction parallel fillPeaks() thanks Jan Stanstrup. Now using environment mirror gvals list item large argList.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-39-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.39.4","title":"xcms 1.39","text":"Fixed write.cdf(), intensity offset +1, added unit test","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-39-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.39.3","title":"xcms 1.39","text":"New R-devel check unload better. Lingering ramp code removed, import mzR. Cleaned errors package check.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-39-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.39.1","title":"xcms 1.39","text":"Updated doubleMatrix c code allow larger profile matrixes Moved inst/doc vignettes","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-37","dir":"Changelog","previous_headings":"","what":"Changes in version 1.37.6","title":"xcms 1.37","text":"Introducing write.mzQuantML(xcmsSet) export peak list grouped matrix PSI format mzQuantML (see http://www.psidev.info/mzquantml) Add Brigham Young University LICENSE file copyright purposes. Add copyright information display running findPeaks.massifquant() within xcmsRaw.R Clean update documentation findPeaks.massifquant-methods.Rd Remove unused parameters findKalmanROIs() within xcmsRaw.R","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-37-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.37.5","title":"xcms 1.37","text":"fixed bug retcor.obiwarp scanrange first sample checked instead center sample","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-37-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.37.4","title":"xcms 1.37","text":"Skip t-test diffreport() one class less 2 samples.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-37-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.37.3","title":"xcms 1.37","text":"fixed bug patternVsRowScore (group.nearest) introduced modifications rev 65169 caused features aligned far outside given m/z retention time windows.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-37-4","dir":"Changelog","previous_headings":"","what":"Changes in version 1.37.1","title":"xcms 1.37","text":"fixed fillPeaks, 1) dropped non-standard columns 2) failed nothing , based patches Tony Larson.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-37-5","dir":"Changelog","previous_headings":"","what":"Changes in version 1.37.1","title":"xcms 1.37","text":"Introducing msn2xcmsRaw, allow findPeaks() MS2 MSn data","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-35","dir":"Changelog","previous_headings":"","what":"Changes in version 1.35.7","title":"xcms 1.35","text":"fixed indexing bug group.nearest, certain circumstances caused peaks first sample ignored (reported Tony Larson)","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-35-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.35.6","title":"xcms 1.35","text":"Obiwarp retention time alignment error-ed scanrange used parameter setting xcmsSet/peak detection method now tries automatically find set scanrange uses range alignment.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-35-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.35.4","title":"xcms 1.35","text":"Introducing parallel fillPeaks Replace snow requirement minimum R version 2.14.0","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-35-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.35.3","title":"xcms 1.35","text":"group.density used low minfrac settings (< 0.5) return feature groups, include features least 50% samples group. limitation removed.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-35-4","dir":"Changelog","previous_headings":"","what":"Changes in version 1.35.2","title":"xcms 1.35","text":"Behind scenes xcms now uses xcmsSource class read raw data. allows e.g. write class pulls raw data e.g. database massifquant: simplified logic structure Tracker::claimDataIdx resolved failure new test case. massifquant: reporting features data structure compatible multiple sample comparison within XCMS.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-35-5","dir":"Changelog","previous_headings":"","what":"Changes in version 1.35.1","title":"xcms 1.35","text":"mzData export now much faster uses less memory","code":""},{"path":[]},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.16","title":"xcms 1.33","text":"diffreport plotEIC new parameter mzdec, number decimal places m/z values EIC plot title","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33-1","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.16","title":"xcms 1.33","text":"Lock mass gap filler now works netCDF lock mass function file find exact times scans works newer Waters MS instruments.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33-2","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.15","title":"xcms 1.33","text":"scanrage now honoured xcmsSet, also parallel mode","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33-3","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.14","title":"xcms 1.33","text":"scanrage now honoured xcmsRaw, consequently also xcmsSet(matchedFilter), previously ignored.","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33-4","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.13","title":"xcms 1.33","text":"write.cdf() fixed write files AMDIS can read","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33-5","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.12","title":"xcms 1.33","text":"write.mzData adds Polarity file available","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changes-in-version-1-33-6","dir":"Changelog","previous_headings":"","what":"Changes in version 1.33.11","title":"xcms 1.33","text":"centWave uses new method estimate local noise improves detection closely spaced peaks group.mzClust failing result one peak","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"xcms-132-and-before","dir":"Changelog","previous_headings":"","what":"xcms 1.32 and before","title":"xcms 1.32 and before","text":"details changes May 2012 please see (now discontinued) CHANGELOG source package (inst/ folder).","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changed-behaviour-since-version-1-32","dir":"Changelog","previous_headings":"","what":"CHANGED BEHAVIOUR since Version 1.32:","title":"xcms 1.32 and before","text":"Changes since Version 1.32: - improved mzData writing, now includes MSn spectra less verbose. - improved netCDF writing, yet good enough AMDIS","code":""},{"path":"https://sneumann.github.io/xcms/news/index.html","id":"changed-behaviour-since-version-1-32-1","dir":"Changelog","previous_headings":"","what":"CHANGED BEHAVIOUR since Version 1.14:","title":"xcms 1.32 and before","text":"centWave may report smaller set peaks, due small bug ROI algorithm features mass deviation > ppm retained. Changes since Version 1.14: New method grouping: algorithm inspired mzMine group(method=“nearest”) implemented. slower group(method=“density”). can individually group close-eluting peaks similar mass New method retention time correction: retcor(method=“obiwarp”) algorithm operates raw data, thus allows correct runs without well-behaving peak groups, without peak picking . fillPeaks(method=“MSW”) now also available direct infusion spectra. findPeaks(method=“MSW”) now returns several intensities, correctly reports mzmin mzmax peaks. centWave now uses dynamic memory allocation, needs much less memory, BUF related errors thing past. centWave gains optional argument “noise”, useful data centroided without intensity threshold, centroids intensity < “noise” omitted ROI detection fillPeaks() methods now remember observed, “filled” peak. direct infusion spectra diffreport() now shows raw peak shapes, also indicated “real” “filled” peaks. xcmsRaw can now filter positive/negative spectra, file includes polarities. xcmsSet() can pass polarity contain positive/negative peaks .","code":""}]