Skip to contents

The mmo object

The mmo object is a central data structure in the eCOMET package.
It is created by the GetMZmineFeature() function and contains:

  • feature_data: A data frame of metabolite features and their measured values.
  • metadata: Sample metadata, including grouping information.
  • pairwise: (optional) Results of pairwise comparisons between features. Added by PairwiseComp().
  • sirius_annot: (optional) SIRIUS/CANOPUS class annotations. Added by AddSiriusAnnot().
  • custom_annot: (optional) Custom compound annotations. Added by AddCustomAnnot().
  • cos.dissim: (optional) Cosine dissimilarity matrix. Added by AddChemdist().
  • m2ds.dissim: (optional) MS2DeepScore dissimilarity matrix. Added by AddChemdist().
  • dreams.dissim: (optional) DreaMS dissimilarity matrix. Added by AddChemdist().

You can create an mmo object like this:

mmo <- GetMZmineFeature(
  mzmine_dir = "path/to/mzmine_feature.csv",
  metadata_dir = "path/to/metadata.csv",
  group_col = "treatment"
)

Once created, you can use the mmo object for normalization, annotation, statistical analysis, and visualization throughout the package.

Input file requirements

The mendatory input files for creating an mmo object are:

  1. MZmine feature table:
  • This file is generated by MZMine (Feature list methods → Export feature list → CSV). See MZMine_documentation
  1. Metadata file: A CSV file containing sample metadata, with following columns. -sample (___.mzML or equivalent filename used as input of the MZmine), -mass (the sample mass which will be used for normalization. just put 1 if not needed), -and at least one grouping info column (the experimental group for each sample). Use as input for ‘group_col’ argument of GetMZmineFeature().

Refer Inputs_MZMine below for details.

Normalization

The raw peak area values are processed by following steps:

  1. Replacing missing values (NA) with half of the minimum value for each feature or 1.

  2. Normalizing by sample mass (provided in metadata).

  3. Transform the data using Log, Mean-centering, and Z-score scaling.

mmo <- ReplaceZero(mmo, method = 'one') # Replace 0 and NA values by 1
mmo <- MassNormalization(mmo) # Normalize peak area by sample mass in metadata
mmo <- MeancenterNormalization(mmo) # Add mean-centered area
mmo <- LogNormalization(mmo) # Add log-transformed area
mmo <- ZNormalization(mmo) # Add Zscore

Adding Sirius/CANOPUS annotations

The results from SIRIUS/CANOPUS can be added to the mmo object as mmo$sirius_annot These are used for chemical class enrichment analysis and visualization. Two files are needed:

  1. structure_identifications.tsv

  2. canopus_formula_summary.tsv

The above files are generated by SIRIUS/CANOPUS. See SIRIUS documentation and the Inputs_SIRIUS section at the bottom of this page for details.

mmo <- AddSiriusAnnot(
  mmo,
  structure_dir = "path/to/structure_identifications.tsv",
  canopus_dir = "path/to/canopus_formula_summary.tsv"
)

Adding chemical dissimilarity

The chemical dissimilarity matrices (cosine, MS2DeepScore, DreaMS) can be added to the mmo object. These are used for chemical dendrograms and chemical diversity analyses.

mmo <- AddChemdist(
  mmo,
  cos_dir = "path/to/cosine_dissimilarity.csv",
  m2ds_dir = "path/to/ms2deepscore_dissimilarity.csv",
  dreams_dir = "path/to/dreams_dissimilarity.csv"
)

Adding custom annotations

You can add your own custom compound annotations to the mmo object as mmo$custom_annot. This is useful for adding known compound names or classes from other databases. The custom annotation file should be a CSV with three columns: 1. compound: Name of the compound 2. mz: m/z value 3. rt: Retention time (in minutes)

mmo <- AddCustomAnnot(
  mmo,
  custom_annot_dir = "path/to/custom_annotations.csv",
  mztol = 5, # m/z tolerance in ppm
  rttol = 0.2 # RT tolerance in minutes
)

Preparing input files

Inputs_MZMine

Inputs_SIRIUS