Validate and Adjust a MicrobiomeStat Data Object
Source:R/mStat_validate_data.R
mStat_validate_data.Rd
This function is a part of the MicrobiomeStat package. It validates a data object, checks if it meets certain rules, and adjusts it if necessary.
Arguments
- data.obj
A list object in a format specific to MicrobiomeStat, which can include components such as feature.tab (matrix), feature.ann (matrix), meta.dat (data.frame), tree, and feature.agg.list (list). The data.obj can be converted from other formats using several functions from the MicrobiomeStat package, including: 'mStat_convert_DGEList_to_data_obj', 'mStat_convert_DESeqDataSet_to_data_obj', 'mStat_convert_phyloseq_to_data_obj', 'mStat_convert_SummarizedExperiment_to_data_obj', 'mStat_import_qiime2_as_data_obj', 'mStat_import_mothur_as_data_obj', 'mStat_import_dada2_as_data_obj', and 'mStat_import_biom_as_data_obj'. Alternatively, users can construct their own data.obj. Note that not all components of data.obj may be required for all functions in the MicrobiomeStat package.
Details
The function checks if 'meta.dat' is a data frame and converts it to one if it isn't. The function then checks two rules: whether the row names of 'feature.tab' match the row names of 'feature.ann', and whether the column names of 'feature.tab' match the row names of 'meta.dat'. If either of these checks fail, the function adjusts the relevant parts of the data object to meet these rules.
Examples
if (FALSE) { # \dontrun{
# Assume 'data.obj' is your data object
data(peerj32.obj)
mStat_validate_data(peerj32.obj)
mStat_validate_data(mStat_normalize_data(peerj32.obj, "TSS")$data.obj.norm)
} # }