View source: R/calc-similarity.R
plot_mds | R Documentation |
Calculate MDS coordinates based on a beta diversity metric and plot results.
plot_mds(
input,
data_col,
cluster_col,
method = "jaccard",
chain = NULL,
chain_col = global$chain_col,
plot_colors = NULL,
plot_lvls = names(plot_colors),
label_points = TRUE,
n_label = "none",
label_params = list(),
sep = global$sep,
...
)
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 values to use for calculating pairwise similarity between clusters, e.g. 'clonotype_id' |
cluster_col |
meta.data column containing cluster IDs to use for calculating overlap |
method |
Method to use for comparing clusters and calculating MDS coordinates, available methods include:
|
chain |
Chain to use for comparing clusters. To perform calculations
using a single chain, the column passed to |
chain_col |
meta.data column containing chains for each cell |
plot_colors |
Character vector containing colors for plotting |
plot_lvls |
Levels to use for ordering clusters |
label_points |
Label points on plot |
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") |
sep |
Separator used for storing per-chain V(D)J data for each cell |
... |
Additional arguments to pass to |
ggplot object
calc_mds()
, calc_similarity()
, plot_similarity()
,
MASS::isoMDS()
# Calculate MDS coordinates
plot_mds(
vdj_sce,
data_col = "clonotype_id",
cluster_col = "isotype"
)
# Calculate MDS coordinates based on IGK CDR3 sequences
plot_mds(
vdj_sce,
data_col = "cdr3",
cluster_col = "isotype",
chain = "IGK"
)
# Calculate repertoire similarity using the Horn-Morisita index
plot_mds(
vdj_sce,
data_col = "clonotype_id",
cluster_col = "isotype",
method = "horn_morisita"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.