Skip to contents

This function assigns each valid m/z peak with one/multiple metabolite names based on the mass difference between the observed value and the theoretical value documented in the reference database. SpaMTP contains 4 cleaned reference databases to choose from these include HMDB, Lipid Maps, ChEBI and GNPS. These databases can also be combined for increased coverage.

Usage

AnnotateSM(
  data,
  db,
  assay = "Spatial",
  raw.mz.column = "raw_mz",
  ppm_error = NULL,
  adducts = NULL,
  polarity = "positive",
  tof_resolution = 30000,
  filepath = NULL,
  return.only.annotated = TRUE,
  save.intermediate = TRUE,
  verbose = TRUE
)

Arguments

data

Seurat Spatial Metabolomic Object containing m/z values for annotation.

db

Reference metabolite dataset in the form of a Data.Frame.

assay

Character string defining the Seurat assay which contains the mz counts being annotated (default = "Spatial").

raw.mz.column

Character string defining the Seurat assay slot which contains the raw mz values, this is without the 'mz-' and are a vector of integers. This is setup by default when running the cardinal_to_seurat() function (default = "raw_mz").

ppm_error

Numeric value indicating the size of the ppm error allowed when matching molecular weights between Seurat object and reference dataset. If only want exact matches set ppm = 0 (default = NULL).

adducts

List of adducts to use for searching the database (e.g. "M+NH4","M+Na","M+CH3OH+H","M+K" etc.). For all possible adducts please visit here. If NULL will take the full list of adducts (default = NULL).

polarity

Character string defining the polarity of adducts to use, either "positive", "negative" or "neutral" (default = "positive").

tof_resolution

is the tof resolution of the instrument used for MALDI run, calculated by ion [ion mass,m/z]/[Full width at half height]. This value is used to estimate ppm_error when set to NULL (default = 30000).

filepath

Character string of the directory to store the _annotated_mz_peaks.csv. If set to NULL no dataframe will be saved (default = NULL).

return.only.annotated

Boolean value indicating if the annotated Seurat Object should only include m/z values that were successfully annotated (default = TRUE).

save.intermediate

Boolean indicating whether to save an intermediate file in the @tools slot of the SpaMTP object required for later analysis functions such as FindRegionalPathways() (default = TRUE).

verbose

Boolean indicating whether to show the message. If TRUE the message will be show, else the message will be suppressed (default = TRUE).

Value

A Seurat Object with m/z values annotated. These annotations are stored in the relative assay's meta.data (e.g. SeuratObj[["Spatial"]][[]])

Examples

# HMDB_db <- load("data/HMDB_1_names.rds")
# Annotated_SeuratObj <- AnnotateSM(SeuratObj, HMDB_db)