initEnrichment: Generate bmetenrichr enrichment object

View source: R/enrichment_functions.r

initEnrichmentR Documentation

Generate bmetenrichr enrichment object

Description

initEnrichment() creates object to perform bootstrapping metabolite set enrichment analysis

Usage

initEnrichment(
  scmatrix,
  annotations,
  annotation.weights = NULL,
  isobars = FALSE,
  mass_range_ppm = 3,
  polarization_mode = "positive",
  conditions,
  include = NULL,
  pathway = "LION",
  termsOfInterest = "selection",
  condition.x = NULL,
  condition.y = NULL,
  ranking.by = "t.test"
)

Arguments

scmatrix

A numeric matrix of n metabolites (rows) and m cells or measurments (columns).

annotations

Either (i) a list of length n, with each element contains a vector of isomer names, or (ii) a vector of length n containing molecular formulas with ("C44H84NO8P.H") or without adduct ("C44H84NO8P"). In the second case, bmetenrichr uses the CoreMetabolome, LIPIDMAPS, SwissLipids, and HMDB databases from METASPACE (https://metaspace2020.eu/) to generate an annotation list automatically.

annotation.weights

An optional list of length n, each element contains a vector of isomer weights. Only when annotations is provided as list.

isobars

A logical indicating whether to include isobars and isomers (default = FALSE), FALSE will only include isomers. Will be neglected when the annotations are provided as list.

mass_range_ppm

A numeric indicating the mass range in ppm (default: mass_range_ppm = 3). Molecular formulas + adducts within this range will be treated as isobars. Only required when isobars = TRUE.

polarization_mode

A character with either 'positive' (default) or 'negative'. Only required when isobars = TRUE. When set to 'positive', included adducts are '+H', '+Na', and '+K'. When set to 'negative', included adducts are '-H', '+Cl'.

conditions

A vector of length m with condition identifiers.

include

An optional logical vector of length n indicating whether to include the annotations in the analysis.

pathway

A named list with character vectors of metabolite names. When default 'LION' is used, bmetenrichr uses the preset LION metabolite set.

termsOfInterest

A character containing 'selection' (for default LION-term selection), 'all', or a vector of term names (see 'pathway').

condition.x

first condition identifier for pairwise comparison.

condition.y

second condition identifier for pairwise comparison.

ranking.by

A character of either 't.test' or 'wilcox.test', to rank metabolites for the respective statistic.

Value

An object of class bmetenrich.

Examples

myTestRun <-
initEnrichment(scmatrix = scMatrix,
                   annotations = my_annotations,
                   annotation.weights = my_weights,
                   conditions = my_conditions,
                   condition.x = "A",
                   condition.y = "B" )



martijnmolenaar/bmetenrichr documentation built on Aug. 16, 2024, 12:20 a.m.