Title: | A Comprehensive Microbiome Data Processing Pipeline |
---|---|
Description: | Provides tools for cleaning, processing, and preparing microbiome sequencing data (e.g., 16S rRNA) for downstream analysis. Supports CSV, TXT, and 'Excel' file formats. The main function, ezclean(), automates microbiome data transformation, including format validation, transposition, numeric conversion, and metadata integration. Also ensures efficient handling of taxonomic levels, resolves duplicated taxa entries, and outputs a well-structured, analysis-ready dataset. |
Authors: | Utsav Lamichhane [aut, cre] |
Maintainer: | Utsav Lamichhane <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.3 |
Built: | 2025-03-04 04:50:12 UTC |
Source: | https://github.com/cran/mbX |
Processes microbiome and metadata files (e.g., 16S rRNA sequencing data) to produce an analysis-ready dataset. Supports CSV, TXT, and 'Excel' file formats. This function validates file formats, reads the data, and merges the datasets by the common column 'SampleID'. If a 'Taxonomy' column exists, the data are filtered to include only rows matching the provided taxonomic level.
ezclean(microbiome_data, metadata, level = "d")
ezclean(microbiome_data, metadata, level = "d")
microbiome_data |
A string specifying the path to the microbiome data file. |
metadata |
A string specifying the path to the metadata file. |
level |
A string indicating the taxonomic level for filtering the data (e.g., "genus"). |
A data frame containing the cleaned and merged dataset.
# Example usage (ensure that 'inst/extdata' contains the appropriate files, # or modify this example to use your own data) microbiome_data <- system.file("extdata", "microbiome.csv", package = "mbX") metadata <- system.file("extdata", "metadata.csv", package = "mbX") if (nzchar(microbiome_data) && nzchar(metadata)) { cleaned_data <- ezclean(microbiome_data, metadata, "genus") head(cleaned_data) } else { message("Sample data files not found.") }
# Example usage (ensure that 'inst/extdata' contains the appropriate files, # or modify this example to use your own data) microbiome_data <- system.file("extdata", "microbiome.csv", package = "mbX") metadata <- system.file("extdata", "metadata.csv", package = "mbX") if (nzchar(microbiome_data) && nzchar(metadata)) { cleaned_data <- ezclean(microbiome_data, metadata, "genus") head(cleaned_data) } else { message("Sample data files not found.") }
Generates publication-ready visualizations for microbiome data. This function first processes the microbiome and metadata files using ezclean(), then creates a bar plot using ggplot2. Supported file formats are CSV, TXT, and 'Excel'. Note: Only one of the parameters top_taxa or threshold should be provided.
ezviz( microbiome_data, metadata, level, selected_metadata, top_taxa = NULL, threshold = NULL )
ezviz( microbiome_data, metadata, level, selected_metadata, top_taxa = NULL, threshold = NULL )
microbiome_data |
A string specifying the path to the microbiome data file. |
metadata |
A string specifying the path to the metadata file. |
level |
A string indicating the taxonomic level for filtering the data (e.g., "genus"). |
selected_metadata |
A string specifying the metadata column used for grouping. |
top_taxa |
An optional numeric value indicating the number of top taxa to keep. Use this OR threshold, but not both. |
threshold |
An optional numeric value indicating the minimum threshold value; taxa below this threshold will be grouped into an "Other" category. |
A ggplot object containing the visualization.
# Example usage (ensure that 'inst/extdata' contains the appropriate files): microbiome_data <- system.file("extdata", "microbiome.csv", package = "mbX") metadata <- system.file("extdata", "metadata.csv", package = "mbX") plot_obj <- ezviz(microbiome_data, metadata, "genus", "sample_type", top_taxa = 20) print(plot_obj)
# Example usage (ensure that 'inst/extdata' contains the appropriate files): microbiome_data <- system.file("extdata", "microbiome.csv", package = "mbX") metadata <- system.file("extdata", "metadata.csv", package = "mbX") plot_obj <- ezviz(microbiome_data, metadata, "genus", "sample_type", top_taxa = 20) print(plot_obj)