README.md

Spatial Probabilistic Mapping of Metabolite Ensembles in Mass Spectrometry Imaging

The moleculaR R package provides a computational framework that introduces probabilistic mapping and point-for-point statistical testing of metabolites in tissue via Mass spectrometry imaging. It enables collective projections of metabolites and consequently spatially-resolved investigation of ion milieus, lipid pathways or user-defined biomolecular ensembles within the same image.

moleculaR comes pre-loaded with the SwissLipids database and with is capable of importing metabolite annotation results from the METASPACE platform to compute FDR-verified moleculaR probabilistic maps (MPMs) and collective projection probabilistic maps (CPPMs). moleculaR could also be deployed and hosted on a centralized server and is equipped with a web-based GUI based on Shiny.

For more information about this package and its applications please refer to the associated published article.

Installation

The devtools package could be used to install the development version of moleculaR. By using build_vignettes=TRUE, the vignettes provided with the package will be automatically build, but keep in mind that this will prolong the package installation processes.

install.packages("devtools")
devtools::install_github("CeMOS-Mannheim/moleculaR", build_vignettes=TRUE)

Note that moleculaR was created with renvto help manage R package dependencies and computational reproducibility. for more info, check the renv guide page.

Troubleshooting

XML Installation Issues on Windows

The package MALDIquantForeign is a suggested dependency of moleculaR, which in turn depends on the XML package. On Windows systems, XML may fail to compile from source. To avoid this issue, it is recommended to install XML as a binary package:

install.packages("XML", type = "binary")

Alternatively, when using renv, use the following:

renv::install("XML", type = "binary")

Due to this compilation issue, MALDIquantForeign has been moved from the Imports to the Suggests section of the package dependencies.

GDAL Dependency on Linux

On Linux-based systems, the R package terra (a dependency of moleculaR) requires GDAL-related system libraries. These may not be pre-installed and could cause installation issues. On Debian-based systems (e.g., Ubuntu), you can install the required libraries via:

sudo apt install gdal-bin libgdal-dev

Make sure these system dependencies are in place before attempting to install moleculaR.

Data availability

Example MSI data could be downloaded in imzML fomat via this link (not yet public).

Vignettes

Vignettes are provided with the package to illustrate basic functionality. You can see all installed vignettes by calling browseVignettes("moleculaR"). To read a speficic vignette use, for example, vignette("moleculaR-walkthrough") and to view its code use edit(vignette("moleculaR-walkthrough")).

moleculaR Shiny-Apps

moleculaR provides an R Shiny web app package-app with intuitive web-based GUI. It contains an example section which comes pre-loaded with an examplary reduced MALDI MSI dataset (see citation below) and a main section which lets the user upload her own centroided imzML data and apply spatial probabilistic mapping through Molecular probabilistic Maps (MPMs) and Collective Projection probabilistic Maps (CPPMs).

Deplyoing on a Local Server

moleculaR comes pre-loaded with two R Shiny-apps which could also be hosted on a local server by downloading and installing Shiny Server with which a user could run these apps from a local (or possibly remote) network from their browser. For more info please refer to the Shiny Server download page and installation instruction and server management.

Citing moleculaR

Please cite the associated published article Abu Sammour et al., 2023, Nature Communications.

Contact

You are welcome to:

License

See license document.



CeMOS-Mannheim/moleculaR documentation built on April 14, 2025, 8:27 a.m.