Public methods
Method new()
Usage
trans_abund$new(
dataset = NULL,
taxrank = "Phylum",
show = 0,
ntaxa = 10,
groupmean = NULL,
use_percentage = TRUE,
order_x = NULL,
input_taxaname = NULL
)
Arguments
datasetThe microtable class.
taxrankdefault "Phylum"; taxonomic rank.
showdefault 0; the relative abundance threshold.
ntaxadefault 10; how many taxa will be used, ordered by abundance from high to low.
groupmeandefault NULL; for calculating mean abundance, select a group column in sample_table .
use_percentagedefault TRUE; showing the abundance percentage.
order_xdefault NULL; character vector; if x xais is ordered, input the samples or group vector or the column name in sample table.
input_taxanamedefault NULL; if some taxa are selected, input taxa names.
Returns
abund_data and other file for plotting.
Examples
\donttest{
data(dataset)
t1 <- trans_abund$new(dataset = dataset, taxrank = "Phylum", ntaxa = 10)
}
Method plot_bar()
Plot the bar plot with the object of trans_abund Class.
Usage
trans_abund$plot_bar(
use_colors = RColorBrewer::brewer.pal(12, "Paired"),
bar_type = "full",
others_color = "grey90",
facet = NULL,
order_facet = NULL,
barwidth = NULL,
use_alluvium = FALSE,
clustering = FALSE,
facet_color = "grey95",
strip_text = 11,
legend_text_italic = FALSE,
xtext_type_hor = TRUE,
xtext_size = 10,
xtext_keep = TRUE,
xtitle_keep = TRUE,
ytitle_size = 17,
base_font = NULL,
ylab_title = NULL
)
Arguments
use_colorsdefault RColorBrewer::brewer.pal(12, "Paired"); providing the plotting colors.
bar_typedefault "full"; "full" or "notfull"; if full, the total abundance sum to 1 or 100 percentage.
others_colordefault "grey90"; the color for "others" taxa.
facetdefault NULL; if using facet, providing the group name.
order_facetNULL; vector, used to order the facet.
barwidthdefault NULL; bar width, see width in geom_bar.
use_alluviumdefault FALSE; whether add alluvium plot
clusteringdefault FALSE; whether order samples by the clustering
facet_colordefault "grey95"; facet background color.
strip_textdefault 11; facet text size.
legend_text_italicdefault FALSE; whether use italic in legend.
xtext_type_hordefault TRUE; x axis text horizontal, if FALSE; text slant.
xtext_sizedefault 10; x axis text size.
xtext_keepdefault TRUE; whether retain x text.
xtitle_keepdefault TRUE; whether retain x title.
ytitle_sizedefault 17; y axis title size.
base_fontdefault NULL; ggplot font family in the plot.
ylab_titledefault NULL; y axis title.
Returns
ggplot2 plot.
Examples
\donttest{
t1$plot_bar(facet = "Group", xtext_keep = FALSE)
}
Method plot_box()
Plot the box plot with the object of trans_abund Class.
Usage
trans_abund$plot_box(
use_colors = RColorBrewer::brewer.pal(8, "Dark2"),
group = NULL,
show_point = FALSE,
point_color = "black",
point_size = 3,
point_alpha = 0.3,
plot_flip = FALSE,
boxfill = TRUE,
middlecolor = "grey95",
middlesize = 1,
xtext_type_hor = FALSE,
xtext_size = 10,
xtext_keep = TRUE,
xtitle_keep = TRUE,
ytitle_size = 17,
base_font = NULL,
...
)
Arguments
use_colorsdefault RColorBrewer::brewer.pal(12, "Paired"); providing the plotting colors.
groupdefault NULL; sample table column name.
show_pointdefault FALSE; whether show points in plot.
point_colordefault "black"; If show_point TRUE; use the color
point_sizedefault 3; If show_point TRUE; use the size
point_alphadefault .3; If show_point TRUE; use the transparency.
plot_flipdefault FALSE; Whether rotate plot.
boxfilldefault TRUE; Whether fill the box.
middlecolordefault "grey95"; The middle line color.
middlesizedefault 1; The middle line size.
xtext_type_hordefault TRUE; x axis text horizontal, if FALSE; text slant.
xtext_sizedefault 10; x axis text size.
xtext_keepdefault TRUE; whether retain x text.
xtitle_keepdefault TRUE; whether retain x title.
ytitle_sizedefault 17; y axis title size.
base_fontdefault NULL; font in the plot.
...parameters pass to geom_boxplot.
Returns
ggplot2 plot.
Examples
\donttest{
t1$plot_box(group = "Group")
}
Method plot_heatmap()
Plot the heatmap with the object of trans_abund Class.
Usage
trans_abund$plot_heatmap(
use_colors = c("#00008B", "#102D9B", "#215AAC", "#3288BD", "#66C2A5", "#E6F598",
"#FFFFBF", "#FED690", "#FDAE61", "#F46D43", "#D53E4F", "#9E0142"),
withmargin = TRUE,
plot_numbers = FALSE,
plot_text_size = 4,
plot_breaks = NULL,
margincolor = "white",
plot_colorscale = "log10",
min_abundance = 0.01,
max_abundance = NULL,
facet = NULL,
order_facet = NULL,
strip_text = 11,
xtext_size = 10,
ytext_size = 11,
xtext_keep = TRUE,
xtitle_keep = TRUE,
grid_clean = TRUE,
xtext_type_hor = TRUE,
base_font = NULL
)Arguments
use_colorsdefault RColorBrewer::brewer.pal(12, "Paired"); providing the plotting colors.
withmargindefault TRUE; whether retain the tile margin.
plot_numbersdefault FALSE; whether plot the number in heatmap.
plot_text_sizedefault 4; If plot_numbers TRUE, text size in plot.
plot_breaksdefault NULL; The legend breaks.
margincolordefault "white"; If withmargin TRUE, use this as the margin color.
plot_colorscaledefault "log10"; color scale.
min_abundancedefault .01; the minimum abundance percentage in plot.
max_abundancedefault NULL; the maximum abundance percentage in plot, NULL reprensent the max percentage.
facetdefault NULL; if using facet, providing the group name.
order_facetdefault NULL; if reorder facet, provide the vector.
strip_textdefault 11; facet text size.
xtext_sizedefault 10; x axis text size.
ytext_sizedefault 11; y axis text size.
xtext_keepdefault TRUE; whether retain x text.
xtitle_keepdefault TRUE; whether retain x title.
grid_cleandefault TRUE; whether remove grid lines.
xtext_type_hordefault TRUE; x axis text horizontal, if FALSE; text slant.
base_fontdefault NULL; font in the plot.
Returns
ggplot2 plot.
Examples
\donttest{
t1 <- trans_abund$new(dataset = dataset, taxrank = "Genus", ntaxa = 40)
t1$plot_heatmap(facet = "Group", xtext_keep = FALSE, withmargin = FALSE)
}
Method plot_pie()
Plot pie chart with the object of trans_abund Class.
Usage
trans_abund$plot_pie(
use_colors = RColorBrewer::brewer.pal(8, "Dark2"),
facet_nrow = 1,
strip_text = 11,
legend_text_italic = FALSE
)
Arguments
use_colorsdefault RColorBrewer::brewer.pal(8, "Dark2"); providing the plotting colors.
facet_nrowdefault 1; how many rows in the plot.
strip_textdefault 11; sample title size.
legend_text_italicdefault FALSE; whether use italic in legend.
Returns
ggplot2 plot.
Examples
\donttest{
t1 <- trans_abund$new(dataset = dataset, taxrank = "Phylum", ntaxa = 6, groupmean = "Group")
t1$plot_pie(facet_nrow = 1)
}
Method print()
Print the trans_abund object.
Usage
trans_abund$print()
Method clone()
The objects of this class are cloneable with this method.
Usage
trans_abund$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.