plot_cor: Plot similarity measures on a tSNE or umap

Description Usage Arguments Value Examples

View source: R/plot.R

Description

Plot similarity measures on a tSNE or umap

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plot_cor(
  cor_mat,
  metadata,
  data_to_plot = colnames(cor_mat),
  cluster_col = NULL,
  x = "UMAP_1",
  y = "UMAP_2",
  scale_legends = FALSE,
  ...
)

Arguments

cor_mat

input similarity matrix

metadata

input metadata with per cell tsne or umap coordinates and cluster ids

data_to_plot

colname of data to plot, defaults to all

cluster_col

colname of clustering data in metadata, defaults to rownames of the metadata if not supplied.

x

metadata column name with 1st axis dimension. defaults to "UMAP_1".

y

metadata column name with 2nd axis dimension. defaults to "UMAP_2".

scale_legends

if TRUE scale all legends to maximum values in entire correlation matrix. if FALSE scale legends to maximum for each plot. A two-element numeric vector can also be passed to supply custom values i.e. c(0, 1)

...

passed to plot_dims

Value

list of ggplot objects, cells projected by dr, colored by cor values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
res <- clustify(
    input = pbmc_matrix_small,
    metadata = pbmc_meta,
    ref_mat = cbmc_ref,
    query_genes = pbmc_vargenes,
    cluster_col = "classified"
)

plot_cor(
    cor_mat = res,
    metadata = pbmc_meta,
    data_to_plot = colnames(res)[1:2],
    cluster_col = "classified",
    x = "UMAP_1",
    y = "UMAP_2"
)

clustifyr documentation built on Nov. 8, 2020, 5:32 p.m.