View source: R/calc-similarity.R
calc_mds | R Documentation |
Calculate MDS coordinates based on a beta diversity metric.
calc_mds(
input,
data_col,
cluster_col,
method = "jaccard",
chain = NULL,
chain_col = global$chain_col,
prefix = "",
return_df = FALSE,
sep = global$sep
)
input |
Object 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 repertoire 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 the data_col argument must contain per-chain data such as CDR3 sequences. Set to NULL to include all chains. |
chain_col |
meta.data column containing chains for each cell |
prefix |
Prefix to add to new columns |
return_df |
Return results as a data.frame. If set to FALSE, results will be added to the input object. |
sep |
Separator used for storing per-chain V(D)J data for each cell |
Single cell object or data.frame with MDS coordinates
plot_mds()
, calc_similarity()
, plot_similarity()
# Calculate MDS coordinates
res <- calc_mds(
vdj_sce,
data_col = "clonotype_id",
cluster_col = "isotype"
)
# Calculate MDS coordinates based on IGK CDR3 sequences
res <- calc_mds(
vdj_sce,
data_col = "cdr3",
cluster_col = "isotype",
chain = "IGK"
)
# Change the method used for calculating repertoire similarity
res <- calc_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.