MultiAssayExperiment Object Manipulation
License: restricted — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution.
Summary
Construction and management of MultiAssayExperiment objects that integrate assay matrices, sample metadata, and feature annotations into a unified data structure for downstream metabolomic analysis. This skill enables seamless coordination of heterogeneous data layers required for differential metabolomic workflows.
When to use
When you have parsed metabolite measurements into a table (rows = metabolites, columns = samples) and have corresponding sample-level covariates (e.g., disease status, treatment group) and/or feature-level annotations (e.g., metabolite IDs, HMDB identifiers, pathway membership), and you need to perform integrated analysis (imputation, normalization, clustering, correlation network construction) that must track sample traits alongside metabolite data. This skill is essential before applying MetaboDiff workflow functions that expect a unified object.
When NOT to use
- Input assay matrix already embedded in an existing MultiAssayExperiment or SummarizedExperiment object — use direct slot access or subset operations instead.
- Sample metadata and feature annotations are missing or cannot be reliably aligned to assay dimensions — postpone object creation until data QC and alignment are complete.
- Assay dimensions are inconsistent (e.g., colnames of assay matrix do not match rownames of colData) — validate and reconcile before calling
create_mae().
Inputs
- Numeric matrix or data.frame: metabolite measurements (rows = metabolites, columns = samples)
- Data frame: rowData with feature annotations (e.g., metabolite IDs, names, identifiers)
- Data frame: colData with sample metadata (e.g., sample names, disease status, batch)
- Optional: Column indices for KEGG, HMDB, ChEBI identifiers to retrieve SMPDB annotations
Outputs
- MultiAssayExperiment object with integrated assay, rowData, and colData slots
- Annotated MultiAssayExperiment with metabolite pathway/database identifiers (if SMPDB enrichment applied)
How to apply
Use the MetaboDiff create_mae() function to merge three components: (1) a numeric assay matrix with metabolite measurements, (2) a data frame of rowData (feature annotations keyed to metabolite IDs), and (3) a data frame of colData (sample metadata keyed to sample identifiers). The function encapsulates these into a MultiAssayExperiment object that preserves row and column names and enables downstream functions to retrieve the correct assay, annotation, and phenotype layers by name. After object creation, optionally enrich rowData with external metabolite annotations via get_SMPDBanno() by providing column indices for KEGG, HMDB, or ChEBI identifiers. The resulting MAE object serves as the standard input for all subsequent MetaboDiff operations (imputation, normalization, visualization, statistical testing).
Related tools
- MetaboDiff (Provides create_mae() function to construct and manipulate MultiAssayExperiment objects, and get_SMPDBanno() to enrich rowData with metabolite annotations) — https://github.com/andreasmock/MetaboDiff
- MultiAssayExperiment (Core Bioconductor package that defines the MAE class and methods for coordinated manipulation of assay, rowData, and colData layers)
- SMPDB (Small Molecular Pathway Database) (External database queried by get_SMPDBanno() to retrieve metabolite pathway and annotation metadata)
Examples
met <- create_mae(assay_matrix, rowData=feature_annotations, colData=sample_metadata); met <- get_SMPDBanno(met, column_kegg_id=6, column_hmdb_id=7, column_chebi_id=NA)
Evaluation signals
- Verify that the returned MAE object has non-null assay(), rowData(), and colData() slots with correct dimensions: nrow(rowData) == nrow(assay), ncol(assay) == nrow(colData).
- Check that rownames(assay) match rownames(rowData) and colnames(assay) match rownames(colData), confirming correct alignment.
- If SMPDB annotation was applied, confirm that rowData now contains columns for KEGG, HMDB, ChEBI identifiers (or the columns specified in the get_SMPDBanno() call).
- Verify that all downstream MetaboDiff functions (knn_impute, normalize_met, pca_plot, etc.) accept the MAE object without error and return modified MAE objects with same structure.
- Spot-check a subset of sample and metabolite identifiers in the MAE object against the original input tables to confirm no reordering or subsetting occurred unintentionally.
Limitations
- MultiAssayExperiment object construction requires exact alignment of row and column names between assay matrix and metadata data frames; mismatched or missing identifiers will cause create_mae() to fail or produce a malformed object.
- SMPDB annotation enrichment (get_SMPDBanno) requires that metabolite identifiers (KEGG, HMDB, ChEBI) are already present in rowData; identifiers not found in SMPDB will result in NA values in the enriched columns.
- The MAE object does not automatically validate or correct for missing values, batch effects, or outliers in the assay matrix; these must be addressed by subsequent filtering and normalization steps.
Evidence
- [methods] The function
create_mae merges all objects into a so called MultiAssayExperiment object to simplify all downstream analysis.: "The function create_mae merges all objects into a so called MultiAssayExperiment object to simplify all downstream analysis."
- [methods] Metabolite annotation can be retrieved from the Small Molecular Pathway Database (SMPDB) if HMDB, KEGG or ChEBI ids are part of the rowData object: "Metabolite annotation can be retrieved from the Small Molecular Pathway Database (SMPDB) if HMDB, KEGG or ChEBI ids are part of the rowData object"
- [readme] The MetaboDiff packages aims to provide a low-level entry to differential metabolomic analysis with R by starting off with the table of metabolite measurements.: "The MetaboDiff packages aims to provide a low-level entry to differential metabolomic analysis with R by starting off with the table of metabolite measurements."
- [methods] met <- get_SMPDBanno(met, column_kegg_id=6, column_hmdb_id=7, column_chebi_id=NA): "met <- get_SMPDBanno(met, column_kegg_id=6, column_hmdb_id=7, column_chebi_id=NA)"
1---2name: multiassayexperiment-object-manipulation3description: Use when when you have parsed metabolite measurements into a table (rows = metabolites, columns = samples) and have corresponding sample-level covariates (e.g., disease status, treatment group) and/or feature-level annotations (e.4license: CC-BY-4.05---67# MultiAssayExperiment Object Manipulation89> **License: restricted** — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->10## Summary1112Construction and management of MultiAssayExperiment objects that integrate assay matrices, sample metadata, and feature annotations into a unified data structure for downstream metabolomic analysis. This skill enables seamless coordination of heterogeneous data layers required for differential metabolomic workflows.1314## When to use1516When you have parsed metabolite measurements into a table (rows = metabolites, columns = samples) and have corresponding sample-level covariates (e.g., disease status, treatment group) and/or feature-level annotations (e.g., metabolite IDs, HMDB identifiers, pathway membership), and you need to perform integrated analysis (imputation, normalization, clustering, correlation network construction) that must track sample traits alongside metabolite data. This skill is essential before applying MetaboDiff workflow functions that expect a unified object.1718## When NOT to use1920- Input assay matrix already embedded in an existing MultiAssayExperiment or SummarizedExperiment object — use direct slot access or subset operations instead.21- Sample metadata and feature annotations are missing or cannot be reliably aligned to assay dimensions — postpone object creation until data QC and alignment are complete.22- Assay dimensions are inconsistent (e.g., colnames of assay matrix do not match rownames of colData) — validate and reconcile before calling `create_mae()`.2324## Inputs2526- Numeric matrix or data.frame: metabolite measurements (rows = metabolites, columns = samples)27- Data frame: rowData with feature annotations (e.g., metabolite IDs, names, identifiers)28- Data frame: colData with sample metadata (e.g., sample names, disease status, batch)29- Optional: Column indices for KEGG, HMDB, ChEBI identifiers to retrieve SMPDB annotations3031## Outputs3233- MultiAssayExperiment object with integrated assay, rowData, and colData slots34- Annotated MultiAssayExperiment with metabolite pathway/database identifiers (if SMPDB enrichment applied)3536## How to apply3738Use the MetaboDiff `create_mae()` function to merge three components: (1) a numeric assay matrix with metabolite measurements, (2) a data frame of rowData (feature annotations keyed to metabolite IDs), and (3) a data frame of colData (sample metadata keyed to sample identifiers). The function encapsulates these into a MultiAssayExperiment object that preserves row and column names and enables downstream functions to retrieve the correct assay, annotation, and phenotype layers by name. After object creation, optionally enrich rowData with external metabolite annotations via `get_SMPDBanno()` by providing column indices for KEGG, HMDB, or ChEBI identifiers. The resulting MAE object serves as the standard input for all subsequent MetaboDiff operations (imputation, normalization, visualization, statistical testing).3940## Related tools4142- **MetaboDiff** (Provides create_mae() function to construct and manipulate MultiAssayExperiment objects, and get_SMPDBanno() to enrich rowData with metabolite annotations) — https://github.com/andreasmock/MetaboDiff43- **MultiAssayExperiment** (Core Bioconductor package that defines the MAE class and methods for coordinated manipulation of assay, rowData, and colData layers)44- **SMPDB (Small Molecular Pathway Database)** (External database queried by get_SMPDBanno() to retrieve metabolite pathway and annotation metadata)4546## Examples4748```49met <- create_mae(assay_matrix, rowData=feature_annotations, colData=sample_metadata); met <- get_SMPDBanno(met, column_kegg_id=6, column_hmdb_id=7, column_chebi_id=NA)50```5152## Evaluation signals5354- Verify that the returned MAE object has non-null assay(), rowData(), and colData() slots with correct dimensions: nrow(rowData) == nrow(assay), ncol(assay) == nrow(colData).55- Check that rownames(assay) match rownames(rowData) and colnames(assay) match rownames(colData), confirming correct alignment.56- If SMPDB annotation was applied, confirm that rowData now contains columns for KEGG, HMDB, ChEBI identifiers (or the columns specified in the get_SMPDBanno() call).57- Verify that all downstream MetaboDiff functions (knn_impute, normalize_met, pca_plot, etc.) accept the MAE object without error and return modified MAE objects with same structure.58- Spot-check a subset of sample and metabolite identifiers in the MAE object against the original input tables to confirm no reordering or subsetting occurred unintentionally.5960## Limitations6162- MultiAssayExperiment object construction requires exact alignment of row and column names between assay matrix and metadata data frames; mismatched or missing identifiers will cause create_mae() to fail or produce a malformed object.63- SMPDB annotation enrichment (get_SMPDBanno) requires that metabolite identifiers (KEGG, HMDB, ChEBI) are already present in rowData; identifiers not found in SMPDB will result in NA values in the enriched columns.64- The MAE object does not automatically validate or correct for missing values, batch effects, or outliers in the assay matrix; these must be addressed by subsequent filtering and normalization steps.6566## Evidence6768- [methods] The function `create_mae` merges all objects into a so called `MultiAssayExperiment` object to simplify all downstream analysis.: "The function `create_mae` merges all objects into a so called `MultiAssayExperiment` object to simplify all downstream analysis."69- [methods] Metabolite annotation can be retrieved from the Small Molecular Pathway Database (SMPDB) if HMDB, KEGG or ChEBI ids are part of the rowData object: "Metabolite annotation can be retrieved from the Small Molecular Pathway Database (SMPDB) if HMDB, KEGG or ChEBI ids are part of the rowData object"70- [readme] The MetaboDiff packages aims to provide a low-level entry to differential metabolomic analysis with R by starting off with the table of metabolite measurements.: "The MetaboDiff packages aims to provide a low-level entry to differential metabolomic analysis with R by starting off with the table of metabolite measurements."71- [methods] met <- get_SMPDBanno(met, column_kegg_id=6, column_hmdb_id=7, column_chebi_id=NA): "met <- get_SMPDBanno(met, column_kegg_id=6, column_hmdb_id=7, column_chebi_id=NA)"