
Validate the Format and Consistency of a Microbiome Dataset
Source:R/validation_microbiome_dataset.R
check_microbiome_dataset.RdThis function checks the structure and consistency of various components of a microbiome dataset, including expression data, sample information, variable information, and their respective notes.
Usage
check_microbiome_dataset(
expression_data,
sample_info,
variable_info,
otu_tree,
taxa_tree,
otu_tree_link,
taxa_tree_link,
ref_seq,
sample_info_note,
variable_info_note
)Arguments
- expression_data
A data frame representing expression data.
- sample_info
A data frame containing sample information.
- variable_info
A data frame containing variable information.
- otu_tree
An optional parameter for OTU tree data.
- taxa_tree
An optional parameter for taxa tree data.
- otu_tree_link
An optional explicit mapping between
variable_idandotu_treelabels.- taxa_tree_link
An optional explicit mapping between
variable_idandtaxa_treelabels.- ref_seq
An optional parameter for reference sequence data.
- sample_info_note
A data frame containing notes on sample information.
- variable_info_note
A data frame containing notes on variable information.
Value
A string "all good." if all checks pass, otherwise returns a descriptive error message indicating the issue found.
Details
The function performs a series of checks to ensure:
Required data frames (expression_data, sample_info, variable_info) are provided.
All data frames are of the correct class.
Key columns exist and there are no duplicated items in critical fields.
The dimensions of the data frames are consistent with each other. Errors in these checks will result in descriptive error messages.
Author
Xiaotao Shen xiaotao.shen@outlook.com
Examples
data("global_patterns", package = "microbiomedataset")
check_microbiome_dataset(
expression_data = global_patterns@expression_data,
sample_info = global_patterns@sample_info,
variable_info = global_patterns@variable_info,
otu_tree = global_patterns@otu_tree,
taxa_tree = global_patterns@taxa_tree,
ref_seq = global_patterns@ref_seq,
sample_info_note = global_patterns@sample_info_note,
variable_info_note = global_patterns@variable_info_note
)
#> [1] "all good."