View source: R/calc-similarity.R
plot_similarity | R Documentation |
Plot repertoire similarity
plot_similarity(
input,
data_col,
cluster_col,
group_col = NULL,
method = abdiv::jaccard,
chain = NULL,
chain_col = global$chain_col,
cluster_heatmap = TRUE,
sep = global$sep,
plot_colors = NULL,
plot_lvls = names(plot_colors),
rotate_labels = FALSE,
remove_upper_triangle = FALSE,
remove_diagonal = remove_upper_triangle,
...
)
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 |
group_col |
meta.data column to use for grouping cluster IDs present in cluster_col. This is useful when there are multiple replicates or patients for each treatment condition. |
method |
Method to use for comparing clusters, possible values are:
|
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 |
cluster_heatmap |
If FALSE, rows and columns of heatmap will not be clustered. |
sep |
Separator used for storing per-chain V(D)J data for each cell |
plot_colors |
Character vector containing colors for plotting |
plot_lvls |
Levels to use for ordering clusters |
rotate_labels |
Should labels on circos plot be rotated to reduce overlapping text |
remove_upper_triangle |
If TRUE, upper triangle for heatmap will not be shown. |
remove_diagonal |
If TRUE, diagonal for heatmap will not be shown. |
... |
Additional arguments to pass to plotting function,
|
heatmap or circos plot
calc_similarity()
, calc_mds()
, plot_mds()
# Plot repertoire overlap
# use clonotype IDs present in 'clonotype_id' column for calculations
plot_similarity(
vdj_sce,
data_col = "clonotype_id",
cluster_col = "orig.ident"
)
# Specify method to use for calculating repertoire overlap
plot_similarity(
vdj_sce,
data_col = "clonotype_id",
cluster_col = "orig.ident",
method = abdiv::morisita
)
# Specify colors to use for heatmap
plot_similarity(
vdj_sce,
data_col = "clonotype_id",
cluster_col = "orig.ident",
plot_color = c("white", "red")
)
# Create circos plot
plot_similarity(
vdj_sce,
data_col = "clonotype_id",
cluster_col = "orig.ident",
method = "circos"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.