data: a data.frame with, at least, the classification, abundance and sample information for each phylogenetic unit.
sample_id: string with name of selected sample.
taxa_col: string with name of column with phylogenetic units. Usually OTU or ASV.
plot_all: If TRUE, will make a plot for all samples with mean and standard deviation. If FALSE (default), then the plot will illustrate a single sample, that you have to specifiy in sample_id argument.
samples_col: name of column with sample ID's.
classification_col: string with name of column with classification for each row. Default value is "Classification".
abundance_col: string with name of column with abundance values. Default is "Abundance".
log_scaled: if TRUE then abundance scores will be shown in Log10 scale. Default to FALSE.
colors: vector with colors. Should have the same lenght as the number of classifications.
...: other arguments.
Returns
A ggplot object with clustering results from define_rb().
Details
This works as a sanity check of the results obtained by the unsupervised learning method used to classify species. This is specially important if you used an automatic number of clusters.
The function works for either a single sample (that you specify with sample_id argument), or it can apply a centrality metric for species across all your samples (plot_all = TRUE).
Examples
classified_species <- define_rb(nice_tidy)# Standard plot for a single sampleplot_ulrb_clustering(classified_species, sample_id ="ERR2044669", taxa_col ="OTU", abundance_col ="Abundance", plot_all =FALSE)# All samples in a datasetplot_ulrb_clustering(classified_species, taxa_col ="OTU", abundance_col ="Abundance", plot_all =TRUE)# All samples with a log scaleplot_ulrb_clustering(classified_species, taxa_col ="OTU", abundance_col ="Abundance", plot_all =TRUE, log_scaled =TRUE)