Skip to contents

get ranked calls for each cluster

Usage

cor_to_call_rank(
  cor_mat,
  metadata = NULL,
  cluster_col = "cluster",
  collapse_to_cluster = FALSE,
  threshold = 0,
  rename_prefix = NULL,
  top_n = NULL
)

Arguments

cor_mat

input similarity matrix

metadata

input metadata with tsne or umap coordinates and cluster ids

cluster_col

metadata column, can be cluster or cellid

collapse_to_cluster

if a column name is provided, takes the most frequent call of entire cluster to color in plot

threshold

minimum correlation coefficent cutoff for calling clusters

rename_prefix

prefix to add to type and r column names

top_n

the number of ranks to keep, the rest will be set to 100

Value

dataframe of cluster, new ident, and r info

Examples

res <- clustify(
    input = pbmc_matrix_small,
    metadata = pbmc_meta,
    cluster_col = "classified",
    ref_mat = cbmc_ref
)
#> Variable features not available, using all genes instead
#> consider supplying variable features to `query_genes` argument.
#> using # of genes: 599
#> similarity computation completed, matrix of 9 x 13, preparing output

cor_to_call_rank(res, threshold = "auto")
#> using threshold of 0.7
#> # A tibble: 117 × 4
#> # Groups:   cluster [9]
#>    cluster      type           r  rank
#>    <chr>        <chr>      <dbl> <dbl>
#>  1 B            B          0.909     1
#>  2 CD14+ Mono   B          0.528   100
#>  3 CD8 T        B          0.579   100
#>  4 DC           B          0.609   100
#>  5 FCGR3A+ Mono B          0.538   100
#>  6 Memory CD4 T B          0.627   100
#>  7 NK           B          0.504   100
#>  8 Naive CD4 T  B          0.644   100
#>  9 Platelet     B          0.146   100
#> 10 B            CD14+ Mono 0.535   100
#> # ℹ 107 more rows