Package | Version | Citation |
---|---|---|
base | 4.5.1 | R Core Team (2025) |
BiocManager | 1.30.26 | Morgan and Ramos (2025) |
BiocParallel | 1.42.1 | Morgan et al. (2025) |
BiocVersion | 3.21.1 | Morgan (2024) |
CentroidR | 0.0.0.9001 | Rutz and Rainer (2025) |
knitr | 1.50 | Xie (2014); Xie (2015); Xie (2025) |
logger | 0.4.0 | Daróczi and Wickham (2024) |
MsCoreUtils | 1.20.0 | Rainer et al. (2022a) |
mzR | 2.42.0 | Pedrioli et al. (2004); Keller et al. (2005); Kessner et al. (2008); Martens et al. (2010); Chambers et al. (2012) |
optparse | 1.7.5 | Davis (2024) |
rmarkdown | 2.29 | Xie, Allaire, and Grolemund (2018); Xie, Dervieux, and Riederer (2020); Allaire et al. (2024) |
Spectra | 1.18.2 | Rainer et al. (2022b) |
testthat | 3.2.3 | Wickham (2011) |
tidyverse | 2.0.0 | Wickham et al. (2019) |
CentroidR 
Repository to centroid profile spectra.
This repository is experimental. Use it at your own risks. Inspired from the original work at https://github.com/EuracBiomedicalResearch/batch_centroid
Requirements
Here is what you minimally need:
- An mzML file containing profile spectra
Here is a generic command in case:
docker run -it --rm -e WINEDEBUG=-all -v .:/data proteowizard/pwiz-skyline-i-agree-to-the-vendor-licenses wine msconvert "path_to_your/raw/spectra.wiff" --ignoreUnknownInstrumentError
Note: If using Sciex raw format, you can use both the .wiff
and the .wiff2
format for this step.
Installation
As the package is not (yet) available on CRAN, you will need to install with:
install.packages(
"CentroidR",
repos = c(
"https://adafede.r-universe.dev",
"https://bioc.r-universe.dev",
"https://cloud.r-project.org"
) )
Use
Single file
::centroid_one_file(file = "path_to_your/profile/spectra.mzML",
CentroidRpattern = "/profile/",
replacement = "/profile_centroided/")
Rscript inst/scripts/centroiding.R --file "path_to_your/profile/spectra.mzML" --pattern "/profile/" --replacement "/profile_centroided/"
Multiple files
"path_to_your/profiles/" |>
list.files(pattern = ".mzML", full.names = TRUE) |>
::walk(
purrr.f = CentroidR::centroid_one_file,
pattern = "/profiles/",
replacement = "/profiles_centroided/",
.progress = TRUE)
Rscript inst/scripts/centroiding.R --directory "path_to_your/profiles/" --pattern "/profiles/" --replacement "/profiles_centroided/"
Rscript inst/scripts/centroiding.R --help
Docker
docker pull adafede/centroidr
# docker build . -t adafede/centroidr
docker run --rm \
-v path_to_your:/home \
\
adafede/centroidr --file "home/profile/spectra.mzML" --pattern "/profile/" --replacement "/profile_centroided/" Rscript centroiding.R
docker run --rm \
-v path_to_your:/home \
\
adafede/centroidr --directory "home/profiles/" --pattern "/profiles/" --replacement "/profiles_centroided/" Rscript centroiding.R
To see all parameters
docker run --rm \
-v path_to_your:/home \
\
adafede/centroidr --help Rscript centroiding.R
Citation
TODO
Additional software credits
References
Allaire, JJ, Yihui Xie, Christophe Dervieux, Jonathan McPherson, Javier Luraschi, Kevin Ushey, Aron Atkins, et al. 2024. rmarkdown: Dynamic Documents for r. https://github.com/rstudio/rmarkdown.
Chambers, Matthew C., Maclean, Brendan, Burke, Robert, Amodei, et al. 2012. “A cross-platform toolkit for mass spectrometry and proteomics.” Nat Biotech 30 (10): 918–20. https://doi.org/10.1038/nbt.2377.
Daróczi, Gergely, and Hadley Wickham. 2024. logger: A Lightweight, Modern and Flexible Logging Utility. https://daroczig.github.io/logger/.
Davis, Trevor L. 2024. optparse: Command Line Option Parser. https://github.com/trevorld/r-optparse.
Keller, Andrew, Jimmy Eng, Ning Zhang, Xiao-jun Li, and Ruedi Aebersold. 2005. “A Uniform Proteomics MS/MS Analysis Platform Utilizing Open XML File Formats.” Mol Syst Biol.
Kessner, Darren, Matt Chambers, Robert Burke, David Agus, and Parag Mallick. 2008. “ProteoWizard: Open Source Software for Rapid Proteomics Tools Development.” Bioinformatics 24 (21): 2534–36. https://doi.org/10.1093/bioinformatics/btn323.
Martens, Lennart, Matthew Chambers, Marc Sturm, Darren Kessner, Fredrik Levander, Jim Shofstahl, Wilfred H Tang, et al. 2010. “MzML - a Community Standard for Mass Spectrometry Data.” Mol Cell Proteomics. https://doi.org/10.1074/mcp.R110.000133.
Morgan, Martin. 2024. BiocVersion: Set the Appropriate Version of Bioconductor Packages. https://doi.org/10.18129/B9.bioc.BiocVersion.
Morgan, Martin, and Marcel Ramos. 2025. BiocManager: Access the Bioconductor Project Package Repository. https://bioconductor.github.io/BiocManager/.
Morgan, Martin, Jiefei Wang, Valerie Obenchain, Michel Lang, Ryan Thompson, and Nitesh Turaga. 2025. BiocParallel: Bioconductor Facilities for Parallel Evaluation. https://doi.org/10.18129/B9.bioc.BiocParallel.
Pedrioli, Patrick G A, Jimmy K Eng, Robert Hubley, Mathijs Vogelzang, Eric W Deutsch, Brian Raught, Brian Pratt, et al. 2004. “A Common Open Representation of Mass Spectrometry Data and Its Application to Proteomics Research.” Nat Biotechnol 22 (11): 1459–66. https://doi.org/10.1038/nbt1031.
R Core Team. 2025. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.
Rainer, Johannes, Andrea Vicini, Liesa Salzer, Jan Stanstrup, Josep M. Badia, Steffen Neumann, Michael A. Stravs, et al. 2022a. “A Modular and Expandable Ecosystem for Metabolomics Data Annotation in r.” Metabolites 12: 173. https://doi.org/10.3390/metabo12020173.
———, et al. 2022b. “A Modular and Expandable Ecosystem for Metabolomics Data Annotation in r.” Metabolites 12: 173. https://doi.org/10.3390/metabo12020173.
Rutz, Adriano, and Johannes Rainer. 2025. CentroidR: CentroidR Provides the Infrastructure to Centroid Profile Spectra.
Wickham, Hadley. 2011. “testthat: Get Started with Testing.” The R Journal 3: 5–10. https://journal.r-project.org/archive/2011-1/RJournal_2011-1_Wickham.pdf.
Wickham, Hadley, Mara Averick, Jennifer Bryan, Winston Chang, Lucy D’Agostino McGowan, Romain François, Garrett Grolemund, et al. 2019. “Welcome to the tidyverse.” Journal of Open Source Software 4 (43): 1686. https://doi.org/10.21105/joss.01686.
Xie, Yihui. 2014. “knitr: A Comprehensive Tool for Reproducible Research in R.” In Implementing Reproducible Computational Research, edited by Victoria Stodden, Friedrich Leisch, and Roger D. Peng. Chapman; Hall/CRC.
———. 2015. Dynamic Documents with R and Knitr. 2nd ed. Boca Raton, Florida: Chapman; Hall/CRC. https://yihui.org/knitr/.
———. 2025. knitr: A General-Purpose Package for Dynamic Report Generation in R. https://yihui.org/knitr/.
Xie, Yihui, J. J. Allaire, and Garrett Grolemund. 2018. R Markdown: The Definitive Guide. Boca Raton, Florida: Chapman; Hall/CRC. https://bookdown.org/yihui/rmarkdown.
Xie, Yihui, Christophe Dervieux, and Emily Riederer. 2020. R Markdown Cookbook. Boca Raton, Florida: Chapman; Hall/CRC. https://bookdown.org/yihui/rmarkdown-cookbook.