plot_scatter | R Documentation |
Create a scatter plot with cells colored based on the provided feature. This can be used to create dimensional reduction plots (e.g. UMAP, tSNE, PCA) or to compare different cell attributes (e.g. CD4 vs CD8 expression). When plotting V(D)J data, per-chain values will be summarized for each cell.
plot_scatter(
input,
data_col = NULL,
x = "UMAP_1",
y = "UMAP_2",
group_col = NULL,
data_slot = "data",
top = NULL,
other_label = "other",
plot_colors = NULL,
plot_lvls = NULL,
outline = FALSE,
trans = "identity",
panel_nrow = NULL,
panel_scales = "fixed",
min_q = NULL,
max_q = NULL,
na_color = "grey80",
n_label = NULL,
label_params = list(),
...,
chain = NULL,
chain_col = global$chain_col,
summary_fn = NULL,
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 |
Name of meta.data column or other variable (e.g. gene name) to use for coloring points |
x, y |
Name of meta.data column or other variable to plot on x and y-axis |
group_col |
meta.data column to use for splitting plot into panels |
data_slot |
Slot to pull data from when |
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 |
plot_colors |
Character vector specifying colors to use for cell clusters specified by cluster_col. |
plot_lvls |
Character vector containing order to use for plotting cell clusters specified by cluster_col. |
outline |
Add an outline around each cluster, outline aesthetics can be
modified by passing arguments directly to |
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 |
min_q |
Minimum quantile cutoff for color scale. |
max_q |
Maximum quantile cutoff for color scale. |
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 |
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 per-chain values for each
cell, can be either a function, e.g. |
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 scatter plot
plot_scatter(
vdj_sce,
data_col = "reads",
x = "UMAP_1",
y = "UMAP_2",
trans = "log10"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.