plot_numerical | R Documentation |
Visualize numerical single-cell data by creating a histogram, density plot, violin plots, or boxplots. When plotting V(D)J data, values can be plotted separately for each chain or summarized and plotted for each cell.
plot_histogram(
input,
data_col,
cluster_col = NULL,
group_col = NULL,
method = "histogram",
top = NULL,
other_label = "other",
units = "frequency",
plot_colors = NULL,
plot_lvls = NULL,
trans = "identity",
panel_nrow = NULL,
panel_scales = "fixed",
na_color = "grey80",
n_label = NULL,
label_params = list(),
...,
per_chain = FALSE,
chain = NULL,
chain_col = global$chain_col,
summary_fn = mean,
sep = global$sep
)
plot_violin(
input,
data_col,
cluster_col = NULL,
group_col = NULL,
method = "violin",
top = NULL,
other_label = "other",
plot_colors = NULL,
plot_lvls = NULL,
trans = "identity",
panel_nrow = NULL,
panel_scales = "free_x",
na_color = "grey80",
n_label = NULL,
label_params = list(),
...,
per_chain = FALSE,
chain = NULL,
chain_col = global$chain_col,
summary_fn = mean,
sep = global$sep
)
input |
Single cell object or data.frame, if a data.frame is provided, cell barcodes should be stored as row names. |
data_col |
meta.data column containing data to plot |
cluster_col |
meta.data column containing cluster IDs to use for grouping cells for plotting |
group_col |
meta.data column to use for grouping clusters into separate panels |
method |
Method to use for plotting, possible values include, 'histogram', 'density', 'boxplot', or 'violin' |
top |
To only show the top cell groups, provide
one of the following, all other cells will be labeled using the value
provided to the
|
other_label |
Label to use for 'other' cells when |
units |
Units to use for y-axis when method is 'histogram'. Use 'frequency' to show the number of values or 'percent' to show the percentage of total values. |
plot_colors |
Character vector specifying colors to use for cell
clusters specified by cluster_col. When cluster_col is |
plot_lvls |
Character vector containing order to use for plotting cell clusters specified by cluster_col |
trans |
Transformation to use when plotting data, e.g. 'log10'. By
default values are not transformed, refer to |
panel_nrow |
The number of rows to use for arranging plot panels |
panel_scales |
Should scales for plot panels be fixed or free. This
passes a scales specification to |
na_color |
Color to use for missing values. If plotting V(D)J data,
cells lacking data will be plotted as |
n_label |
Location on plot where n label should be added, this can be any combination of the following:
|
label_params |
Named list providing additional parameters to modify n label aesthetics, e.g. list(size = 4, color = "red") |
... |
Additional arguments to pass to ggplot2, e.g. color, fill, size, linetype, etc. |
per_chain |
If |
chain |
Chain(s) to use for filtering data before plotting. If NULL data will not be filtered based on chain. |
chain_col |
meta.data column containing chains for each cell |
summary_fn |
Function to use for summarizing values when |
sep |
Separator used for storing per-chain V(D)J data for each cell |
ggplot object
summarize_vdj()
for more examples on how per-chain data can be
summarized for each cell
# Create histogram
plot_histogram(
vdj_sce,
data_col = "reads",
cluster_col = "orig.ident",
trans = "log10"
)
# Create violin plots
plot_violin(
vdj_sce,
data_col = "nFeature_RNA",
cluster_col = "orig.ident"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.