Convert MultiAssayExperiment Object to a Data Object
Source:R/mStat_convert_MultiAssayExperiment_to_data_obj.R
mStat_convert_MultiAssayExperiment_to_data_obj.Rd
This function converts a MultiAssayExperiment object into a list (data object) containing the assays data, and colData. The returned list represents a dataset with features (OTUs or taxa), metadata, and feature annotations.
Value
A data object (a list) containing the following elements:
feature.tab: A matrix containing the assay data with rows as features and columns as samples.
meta.dat: A data frame containing the colData (metadata).
Details
The function first checks if each component (assays, colData) of the MultiAssayExperiment object is not null. If a component is not null, it is converted to the appropriate format and added to the output list. The assays data is converted to a matrix, while the colData is converted to a data frame. Note that only the rows (features) in the assay data that have a sum > 0 are retained.
Examples
if (FALSE) { # \dontrun{
# Assuming 'mae' is your MultiAssayExperiment object
# data_obj <- mStat_convert_MultiAssayExperiment_to_data_obj(mae, "16S")
# If you have an experiment data available as a MultiAssayExperiment object
# you can convert it to a data object using:
# library(MultiAssayExperiment)
# data(mae)
# data_obj <- mStat_convert_MultiAssayExperiment_to_data_obj(mae, "16S")
} # }