dice_facet_plot | R Documentation |
This function generates a plot to visualize categorical data in a domino plot format. The size of the dots is fixed, and the plot can be saved to an output file if specified. This version supports categorical colors and allows setting colors for left and right rectangle plots.
dice_facet_plot(
data,
gene_list,
x = "gene",
y = "Celltype",
contrast = "Contrast",
var_id = "var",
spacing_factor = 3,
categorical_colors = NULL,
color_scale_name = "Category",
left_rect_color = "lightblue",
right_rect_color = "lightpink",
rect_alpha = 0.5,
axis_text_size = 8,
x_axis_text_size = NULL,
y_axis_text_size = NULL,
legend_text_size = 8,
cluster_method = "complete",
cluster_y_axis = TRUE,
cluster_var_id = TRUE,
base_width = 5,
base_height = 4,
show_legend = TRUE,
legend_width = 0.25,
legend_height = 0.5,
custom_legend = TRUE,
aspect_ratio = NULL,
switch_axis = FALSE,
reverse_y_ordering = FALSE,
show_var_positions = FALSE,
output_file = NULL,
feature_col = NULL,
celltype_col = NULL,
contrast_col = NULL
)
data |
A data frame containing the categorical data. |
gene_list |
A character vector of gene names to include in the plot. |
x |
A string representing the column name in |
y |
A string representing the column name in |
contrast |
A string representing the column name in |
var_id |
A string representing the column name in |
spacing_factor |
A numeric value indicating the spacing between gene pairs. Default is |
categorical_colors |
A named vector of colors to use for categorical values in the data. Default is NULL. |
color_scale_name |
A string specifying the name of the color scale in the legend. Default is |
left_rect_color |
A string specifying the color for the left rectangles. Default is |
right_rect_color |
A string specifying the color for the right rectangles. Default is |
rect_alpha |
A numeric value between 0 and 1 indicating the transparency of the rectangles. Default is |
axis_text_size |
A numeric value specifying the size of the axis text. Default is |
x_axis_text_size |
A numeric value specifying the size of the x-axis text. If NULL, uses |
y_axis_text_size |
A numeric value specifying the size of the y-axis text. If NULL, uses |
legend_text_size |
A numeric value specifying the size of the legend text. Default is |
cluster_method |
The clustering method to use. Default is |
cluster_y_axis |
A logical value indicating whether to cluster the y-axis (cell types). Default is |
cluster_var_id |
A logical value indicating whether to cluster the var_id. Default is |
base_width |
A numeric value specifying the base width for saving the plot. Default is |
base_height |
A numeric value specifying the base height for saving the plot. Default is |
show_legend |
A logical value indicating whether to show the legend. Default is |
legend_width |
A numeric value specifying the relative width of the legend. Default is |
legend_height |
A numeric value specifying the relative height of the legend. Default is |
custom_legend |
A logical value indicating whether to use a custom legend. Default is |
aspect_ratio |
A numeric value specifying the aspect ratio of the plot. If |
switch_axis |
A logical value indicating whether to switch the x and y axes. Default is |
reverse_y_ordering |
A logical value indicating whether to reverse the y-axis ordering after clustering. Default is |
show_var_positions |
A logical value indicating whether to show the intermediate variable positions plot. Default is |
output_file |
An optional string specifying the path to save the plot. If |
feature_col |
Deprecated. Use |
celltype_col |
Deprecated. Use |
contrast_col |
Deprecated. Use |
A list containing the domino plot and optionally the variable positions plot.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.