Renames samples across all components of a MicrobiomeStat data object.
Arguments
- data.obj
A MicrobiomeStat data object, which is a list containing at minimum the following components:
feature.tab: A matrix of feature abundances (taxa/genes as rows, samples as columns)meta.dat: A data frame of sample metadata (samples as rows)
Optional components include:
feature.ann: A matrix/data frame of feature annotations (e.g., taxonomy)tree: A phylogenetic tree object (class "phylo")feature.agg.list: Pre-aggregated feature tables by taxonomy
Data objects can be created using converters like
mStat_convert_phyloseq_to_data_objor importers likemStat_import_qiime2_as_data_obj.- new.name
Character vector of new sample names (must match number of samples, no duplicates).
Examples
if (FALSE) { # \dontrun{
# Load the required libraries
library(MicrobiomeStat)
data(peerj32.obj)
# Update sample names
new.names <- paste0("new-", colnames(peerj32.obj$feature.tab))
updated_peerj32.obj <- mStat_update_sample_name(data.obj = peerj32.obj,
new.name = new.names)
} # }
