domino_plot | R Documentation |
This function generates a plot to visualize gene expression levels for a given list of genes. The size of the dots can be customized, and the plot can be saved to an output file if specified.
domino_plot(
data,
gene_list,
x = "gene",
y = "Celltype",
contrast = "Contrast",
var_id = "var",
log_fc = "avg_log2FC",
p_val = "p_val_adj",
min_dot_size = 1,
max_dot_size = 5,
spacing_factor = 3,
logfc_colors = c(low = "blue", mid = "white", high = "red"),
color_scale_name = "Log2 Fold Change",
size_scale_name = "-log10(adj. p-value)",
p_label_formatter = function(lp) sprintf("%.2g", 10^-lp),
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,
logfc_limits = NULL,
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,
logfc_col = NULL,
pval_col = NULL
)
data |
A data frame containing gene expression 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 |
log_fc |
A string representing the column name in |
p_val |
A string representing the column name in |
min_dot_size |
A numeric value indicating the minimum dot size in the plot. Default is |
max_dot_size |
A numeric value indicating the maximum dot size in the plot. Default is |
spacing_factor |
A numeric value indicating the spacing between gene pairs. Default is |
logfc_colors |
A named vector specifying the colors for the low, mid, and high values in the color scale. Default is |
color_scale_name |
A string specifying the name of the color scale in the legend. Default is |
size_scale_name |
A string specifying the name of the size scale in the legend. Default is |
p_label_formatter |
A function used to format the size legend labels (typically for p-values). 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 |
logfc_limits |
A numeric vector of length 2 specifying the limits for the log fold change color scale. If |
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 |
logfc_col |
Deprecated. Use |
pval_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.