| trans_venn | R Documentation |
trans_venn object for the Venn diagram, petal plot and UpSet plot.This class is a wrapper for a series of intersection analysis related methods, including 2- to 5-way venn diagram, more than 5-way petal or UpSet plot and intersection transformations based on David et al. (2012) <doi:10.1128/AEM.01459-12>.
new()trans_venn$new(dataset, ratio = NULL, name_joint = "&")
datasetthe object of microtable class or a matrix-like table (data.frame or matrix object).
If dataset is a matrix-like table, features must be rows.
ratiodefault NULL; NULL, "numratio" or "seqratio"; "numratio": calculate the percentage of feature number; "seqratio": calculate the percentage of feature abundance; NULL: no additional percentage.
name_jointdefault "&"; the joint mark for generating multi-sample names.
data_details and data_summary stored in the object.
\donttest{
data(dataset)
t1 <- dataset$merge_samples("Group")
t1 <- trans_venn$new(dataset = t1, ratio = "numratio")
}
plot_venn()Plot venn diagram.
trans_venn$plot_venn( color_circle = RColorBrewer::brewer.pal(8, "Dark2"), fill_color = TRUE, text_size = 4.5, text_name_size = 6, text_name_position = NULL, alpha = 0.3, linesize = 1.1, petal_plot = FALSE, petal_color = "#BEAED4", petal_color_center = "#BEBADA", petal_a = 4, petal_r = 1, petal_use_lim = c(-12, 12), petal_center_size = 40, petal_move_xy = 4, petal_move_k = 2.3, petal_move_k_count = 1.3, petal_text_move = 40, other_text_show = NULL, other_text_position = c(2, 2), other_text_size = 5 )
color_circledefault RColorBrewer::brewer.pal(8, "Dark2"); color pallete.
fill_colordefault TRUE; whether fill the area color.
text_sizedefault 4.5; text size in plot.
text_name_sizedefault 6; name size in plot.
text_name_positiondefault NULL; name position in plot.
alphadefault .3; alpha for transparency.
linesizedefault 1.1; cycle line size.
petal_plotdefault FALSE; whether use petal plot.
petal_colordefault "#BEAED4"; color of the petals; If petal_color only has one color value, all the petals will be assigned with this color value. If petal_color has multiple colors, and the number of color values is smaller than the petal number, the function can append more colors automatically with the color interpolation.
petal_color_centerdefault "#BEBADA"; color of the center in the petal plot.
petal_adefault 4; the length of the ellipse.
petal_rdefault 1; scaling up the size of the ellipse.
petal_use_limdefault c(-12, 12); the width of the plot.
petal_center_sizedefault 40; petal center circle size.
petal_move_xydefault 4; the distance of text to circle.
petal_move_kdefault 2.3; the distance of title to circle.
petal_move_k_countdefault 1.3; the distance of data text to circle.
petal_text_movedefault 40; the distance between two data text.
other_text_showdefault NULL; other characters used to show in the plot.
other_text_positiondefault c(1, 1); the text position for text in other_text_show.
other_text_sizedefault 5; the text size for text in other_text_show.
ggplot.
\donttest{
t1$plot_venn()
}
plot_bar()Plot the intersections using histogram, i.e. UpSet plot. Especially useful when samples > 5.
trans_venn$plot_bar( left_plot = TRUE, sort_samples = FALSE, up_y_title = "Intersection size", up_y_title_size = 15, up_y_text_size = 8, up_bar_fill = "grey70", up_bar_width = 0.9, bottom_y_text_size = 12, bottom_height = 1, bottom_point_size = 3, bottom_point_color = "black", bottom_background_fill = "grey95", bottom_background_alpha = 1, bottom_line_width = 0.5, bottom_line_colour = "black", left_width = 0.3, left_bar_fill = "grey70", left_bar_alpha = 1, left_bar_width = 0.9, left_x_text_size = 10, left_background_fill = "white", left_background_alpha = 1 )
left_plotdefault TRUE; whether add the left bar plot to show the feature number of each sample.
sort_samplesdefault FALSE; TRUE is used to sort samples according to the number of features in each sample.
FALSE means the sample order is same with that in sample_table of the raw dataset.
up_y_titledefault "Intersection set"; y axis title of upper plot.
up_y_title_sizedefault 15; y axis title size of upper plot.
up_y_text_sizedefault 4; y axis text size of upper plot.
up_bar_filldefault "grey70"; bar fill color of upper plot.
up_bar_widthdefault 0.9; bar width of upper plot.
bottom_y_text_sizedefault 12; y axis text size, i.e. sample name size, of bottom sample plot.
bottom_heightdefault 1; bottom plot height relative to the upper bar plot. 1 represents the height of bottom plot is same with the upper bar plot.
bottom_point_sizedefault 3; point size of bottom plot.
bottom_point_colordefault "black"; point color of bottom plot.
bottom_background_filldefault "grey95"; fill color for the striped background in the bottom sample plot. If the parameter length is 1, use "white" to distinguish the color stripes. If the parameter length is greater than 1, use all provided colors.
bottom_background_alphadefault 1; the color transparency for the parameter bottom_background_fill.
bottom_line_widthdefault 0.5; the line width in the bottom plot.
bottom_line_colourdefault "black"; the line color in the bottom plot.
left_widthdefault 0.3; left bar plot width relative to the right bottom plot.
left_bar_filldefault "grey70"; fill color for the left bar plot presenting feature number.
left_bar_alphadefault 1; the color transparency for the parameter left_bar_fill.
left_bar_widthdefault 0.9; bar width of left plot.
left_x_text_sizedefault 10; x axis text size of the left bar plot.
left_background_filldefault "white"; fill color for the striped background in the left plot. If the parameter length is 1, use "white" to distinguish the color stripes. If the parameter length is greater than 1, use all provided colors.
left_background_alphadefault 1; the color transparency for the parameter left_background_fill.
a ggplot2 object.
\donttest{
t2 <- t1$plot_bar()
}
trans_comm()Transform intersection result to community-like microtable object for further composition analysis.
trans_venn$trans_comm(use_frequency = TRUE)
use_frequencydefault TRUE; whether only use OTUs occurrence frequency, i.e. presence/absence data; if FALSE, use abundance data.
a new microtable class.
\donttest{
t2 <- t1$trans_comm(use_frequency = TRUE)
}
print()Print the trans_venn object.
trans_venn$print()
clone()The objects of this class are cloneable with this method.
trans_venn$clone(deep = FALSE)
deepWhether to make a deep clone.
## ------------------------------------------------
## Method `trans_venn$new`
## ------------------------------------------------
data(dataset)
t1 <- dataset$merge_samples("Group")
t1 <- trans_venn$new(dataset = t1, ratio = "numratio")
## ------------------------------------------------
## Method `trans_venn$plot_venn`
## ------------------------------------------------
t1$plot_venn()
## ------------------------------------------------
## Method `trans_venn$plot_bar`
## ------------------------------------------------
t2 <- t1$plot_bar()
## ------------------------------------------------
## Method `trans_venn$trans_comm`
## ------------------------------------------------
t2 <- t1$trans_comm(use_frequency = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.