Skip to contents

Goal of this document

In this document, you will find more information describing multiple scenarios about how to use MSconvert in order to transform your raw MS/MS data to .mzMl or mzXML format in order to be imported with MS2extract.

Here, we will explore different scenarios that you might find useful depending on your MS/MS data collection approach. The explained scenarios are:

  • Converting to .mzML the entire run, and
  • Trimming for specific retention time,

Note: this is the fourth vignette for this package and if you find some terms unclear, or are not familiar with the concepts, please visit the previous vignettes (Package introduction, Batch mode introduction, and Importing MS/MS data).

Concept of MS2extract

Before moving to the hands-on application, we would like to clarify some definitions about this software that could help improve the explanation of the following case examples.

The MS2extract concept can be summarized in two main subsequent tasks; (1) look for scans with a specific precursor ion m/z, and (2) extract the MS/MS fragmentation pattern.

Therefore, your data file (.mzML) must contain at least one MS/MS scan with the specified precursor ion to extract the MS/MS data.

Case 1: Converting to .mzML the entire run

In this case, although is not the optimal approach, it will get the job done, if your data meets a requirement.

Requirement 1: the precursor ion of your standard has to produce the most intense MS/MS signal in the entire run.

Requirement 2: If you have compositional isomers in the same run, but they elute at different retention times, you must provide different retention times windows.

Since MS2extract searches for the most intense MS/MS scan, you can only have one metabolite per run if you do not provide different retention time windows.

Since this package only works with MS/MS data, we are only going to keep scans with MS/MS data. Therefore, the MSconvert filters are:

Filter Parameters
peakPicking vendor msLevel=2-2
msLevel 2-2

Case 2: Trimming for specific retention time

This is probably the most efficient approach to convert your raw data files, since you already know the retention time of your metabolite. Then, you can use the scanTime filter. Remember, scan time has to be converted to seconds, not minutes.

We used this approach to build the entire PhenolicsDB repository, where you can find the retention time window for each metabolite.

Filter Parameters
peakPicking vendor msLevel=2-2
msLevel 2-2
scanTime [min rt, max rt]

In the following example, we are using the procyanidin B2 standard data, with a elution time of 138 (s), and the minimum and maximum retention time are 133 and 145 (s), respectively. Therefore, the MSconvert task will look like the following image.

Information about this vignette

Code for creating the vignette

## Create the vignette
library("rmarkdown")
system.time(render("4_msconvert_4_MS2extract.Rmd", "BiocStyle::html_document"))

## Extract the R code
library("knitr")
knit("4_msconvert_4_MS2extract.Rmd", tangle = TRUE)

Date the vignette was generated.

#> [1] "2024-10-23 15:18:04 UTC"

Wallclock time spent generating the vignette.

#> Time difference of 0.5 secs

R session information.

#> ─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.4.1 (2024-06-14)
#>  os       Ubuntu 22.04.5 LTS
#>  system   x86_64, linux-gnu
#>  ui       X11
#>  language en
#>  collate  C.UTF-8
#>  ctype    C.UTF-8
#>  tz       UTC
#>  date     2024-10-23
#>  pandoc   3.1.11 @ /opt/hostedtoolcache/pandoc/3.1.11/x64/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  backports     1.5.0   2024-05-23 [1] RSPM
#>  bibtex        0.5.1   2023-01-26 [1] RSPM
#>  BiocManager   1.30.25 2024-08-28 [1] RSPM
#>  BiocStyle   * 2.32.1  2024-06-16 [1] Bioconduc~
#>  bookdown      0.41    2024-10-16 [1] RSPM
#>  bslib         0.8.0   2024-07-29 [1] RSPM
#>  cachem        1.1.0   2024-05-16 [1] RSPM
#>  cli           3.6.3   2024-06-21 [1] RSPM
#>  desc          1.4.3   2023-12-10 [1] RSPM
#>  digest        0.6.37  2024-08-19 [1] RSPM
#>  evaluate      1.0.1   2024-10-10 [1] RSPM
#>  fastmap       1.2.0   2024-05-15 [1] RSPM
#>  fs            1.6.4   2024-04-25 [1] RSPM
#>  generics      0.1.3   2022-07-05 [1] RSPM
#>  glue          1.8.0   2024-09-30 [1] RSPM
#>  htmltools     0.5.8.1 2024-04-04 [1] RSPM
#>  htmlwidgets   1.6.4   2023-12-06 [1] RSPM
#>  httr          1.4.7   2023-08-15 [1] RSPM
#>  jquerylib     0.1.4   2021-04-26 [1] RSPM
#>  jsonlite      1.8.9   2024-09-20 [1] RSPM
#>  knitr         1.48    2024-07-07 [1] RSPM
#>  lifecycle     1.0.4   2023-11-07 [1] RSPM
#>  lubridate     1.9.3   2023-09-27 [1] RSPM
#>  magrittr      2.0.3   2022-03-30 [1] RSPM
#>  pkgdown       2.1.1   2024-09-17 [1] any (@2.1.1)
#>  plyr          1.8.9   2023-10-02 [1] RSPM
#>  R6            2.5.1   2021-08-19 [1] RSPM
#>  ragg          1.3.3   2024-09-11 [1] RSPM
#>  Rcpp          1.0.13  2024-07-17 [1] RSPM
#>  RefManageR  * 1.4.0   2022-09-30 [1] RSPM
#>  rlang         1.1.4   2024-06-04 [1] RSPM
#>  rmarkdown     2.28    2024-08-17 [1] RSPM
#>  sass          0.4.9   2024-03-15 [1] RSPM
#>  sessioninfo * 1.2.2   2021-12-06 [1] RSPM
#>  stringi       1.8.4   2024-05-06 [1] RSPM
#>  stringr       1.5.1   2023-11-14 [1] RSPM
#>  systemfonts   1.1.0   2024-05-15 [1] RSPM
#>  textshaping   0.4.0   2024-05-24 [1] RSPM
#>  timechange    0.3.0   2024-01-18 [1] RSPM
#>  xfun          0.48    2024-10-03 [1] RSPM
#>  xml2          1.3.6   2023-12-04 [1] RSPM
#>  yaml          2.3.10  2024-07-26 [1] RSPM
#> 
#>  [1] /home/runner/work/_temp/Library
#>  [2] /opt/R/4.4.1/lib/R/site-library
#>  [3] /opt/R/4.4.1/lib/R/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Bibliography

This vignette was generated using BiocStyle (Oleś, 2024) with knitr (Xie, 2024) and rmarkdown (Allaire, Xie, Dervieux, McPherson, Luraschi, Ushey, Atkins, Wickham, Cheng, Chang, and Iannone, 2024) running behind the scenes.

Citations made with RefManageR (McLean, 2017).

[1] J. Allaire, Y. Xie, C. Dervieux, et al. rmarkdown: Dynamic Documents for R. R package version 2.28. 2024. URL: https://github.com/rstudio/rmarkdown.

[2] M. W. McLean. “RefManageR: Import and Manage BibTeX and BibLaTeX References in R”. In: The Journal of Open Source Software (2017). DOI: 10.21105/joss.00338.

[3] A. Oleś. BiocStyle: Standard styles for vignettes and other Bioconductor documents. R package version 2.32.1. 2024. DOI: 10.18129/B9.bioc.BiocStyle. URL: https://bioconductor.org/packages/BiocStyle.

[4] Y. Xie. knitr: A General-Purpose Package for Dynamic Report Generation in R. R package version 1.48. 2024. URL: https://yihui.org/knitr/.