plot_motifs | R Documentation |
Plot CDR3 sequence motifs
plot_motifs(
input,
data_col = global$cdr3_col,
cluster_col = NULL,
chain,
chain_col = global$chain_col,
width = 0.75,
align_end = "5",
quiet = FALSE,
sep = global$sep,
plot_colors = NULL,
plot_lvls = names(plot_colors),
panel_nrow = NULL,
panel_scales = "free",
n_label = "corner",
label_params = list(),
...
)
input |
Single cell object or data.frame containing V(D)J data. If a data.frame is provided, the cell barcodes should be stored as row names. |
data_col |
meta.data column containing sequences to use for plotting. |
cluster_col |
meta.data column containing cluster IDs to use for grouping cells. |
chain |
Chain to use for plotting sequences. Cells with more than one of the provided chain will be excluded from the analysis. |
chain_col |
meta.data column containing chains for each cell. |
width |
Integer specifying how many residues to include, sequences longer than width will be get trimmed based on the align_end argument, sequences shorter than width will get removed. If a fraction is provided, the width cutoff is set based on percent rank, i.e. a value of 0.75 would select a width where at least 75% of sequences are longer than the cutoff. |
align_end |
End to use for aligning sequences, specify '5' or '3' to align sequences at the 5' or 3' end when plotting. |
quiet |
If |
sep |
Separator used for storing per cell V(D)J data |
plot_colors |
Character vector containing colors for plotting |
plot_lvls |
Character vector containing levels for ordering |
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 |
n_label |
Location on plot where n label should be added, this can be one of the following:
|
label_params |
Named list providing additional parameters to modify n label aesthetics, e.g. list(size = 4, color = "red") |
... |
Additional parameters to pass to |
ggplot object
cluster_sequences()
# Cluster cells based on CDR3 amino acid sequences and plot sequence motifs
res <- cluster_sequences(
vdj_sce,
data_col = "cdr3"
)
plot_motifs(
res,
data_col = "cdr3",
cluster_col = "cdr3_cluster_0.5",
chain = "IGK"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.