Skip to contents

adapt clustify to tweak score for pos and neg markers

Usage

pos_neg_select(
  input,
  ref_mat,
  metadata,
  cluster_col = "cluster",
  cutoff_n = 0,
  cutoff_score = 0.5
)

Arguments

input

single-cell expression matrix

ref_mat

reference expression matrix with positive and negative markers(set expression at 0)

metadata

cell cluster assignments, supplied as a vector or data.frame. If data.frame is supplied then cluster_col needs to be set. Not required if running correlation per cell.

cluster_col

column in metadata that contains cluster ids per cell. Will default to first column of metadata if not supplied. Not required if running correlation per cell.

cutoff_n

expression cutoff where genes ranked below n are considered non-expressing

cutoff_score

positive score lower than this cutoff will be considered as 0 to not influence scores

Value

matrix of numeric values, clusters from input as row names, cell types from ref_mat as column names

Examples

pn_ref <- data.frame(
    "Myeloid" = c(1, 0.01, 0),
    row.names = c("CD74", "clustifyr0", "CD79A")
)

pos_neg_select(
    input = pbmc_matrix_small,
    ref_mat = pn_ref,
    metadata = pbmc_meta,
    cluster_col = "classified",
    cutoff_score = 0.8
)
#> using # of genes: 3
#> similarity computation completed, matrix of 2638 x 1, preparing output
#>                Myeloid
#> Naive CD4 T  0.0000000
#> Memory CD4 T 0.7857143
#> CD14+ Mono   0.9208333
#> B            0.0000000
#> CD8 T        0.8210332
#> FCGR3A+ Mono 0.9629630
#> NK           0.8161290
#> DC           0.9218750
#> Platelet     0.0000000