clustify_nudge: Combined function to compare scRNA-seq data to bulk RNA-seq...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Combined function to compare scRNA-seq data to bulk RNA-seq data and marker list

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
clustify_nudge(input, ...)

## Default S3 method:
clustify_nudge(
  input,
  ref_mat,
  marker,
  metadata = NULL,
  cluster_col = NULL,
  query_genes = NULL,
  compute_method = "spearman",
  weight = 1,
  seurat_out = FALSE,
  threshold = -Inf,
  dr = "umap",
  norm = "diff",
  call = TRUE,
  marker_inmatrix = TRUE,
  mode = "rank",
  obj_out = FALSE,
  rename_prefix = NULL,
  lookuptable = NULL,
  ...
)

## S3 method for class 'Seurat'
clustify_nudge(
  input,
  ref_mat,
  marker,
  cluster_col = NULL,
  query_genes = NULL,
  compute_method = "spearman",
  weight = 1,
  seurat_out = TRUE,
  obj_out = FALSE,
  threshold = -Inf,
  dr = "umap",
  norm = "diff",
  marker_inmatrix = TRUE,
  mode = "rank",
  rename_prefix = NULL,
  ...
)

Arguments

input

express matrix or object

...

passed to matrixize_markers

ref_mat

reference expression matrix

marker

matrix of markers

metadata

cell cluster assignments, supplied as a vector or data.frame. If data.frame is supplied then cluster_col needs to be set.

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.

query_genes

A vector of genes of interest to compare. If NULL, then common genes between the expr_mat and ref_mat will be used for comparision.

compute_method

method(s) for computing similarity scores

weight

relative weight for the gene list scores, when added to correlation score

seurat_out

output cor matrix or called seurat object

threshold

identity calling minimum score threshold, only used when obj_out = T

dr

stored dimension reduction

norm

whether and how the results are normalized

call

make call or just return score matrix

marker_inmatrix

whether markers genes are already in preprocessed matrix form

mode

use marker expression pct or ranked cor score for nudging

obj_out

whether to output object instead of cor matrix

rename_prefix

prefix to add to type and r column names

lookuptable

if not supplied, will look in built-in table for object parsing

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Seurat3
clustify_nudge(
    input = s_small3,
    ref_mat = cbmc_ref,
    marker = cbmc_m,
    cluster_col = "RNA_snn_res.1",
    threshold = 0.8,
    seurat_out = FALSE,
    mode = "pct",
    dr = "tsne"
)

# Matrix
clustify_nudge(
    input = pbmc_matrix_small,
    ref_mat = cbmc_ref,
    metadata = pbmc_meta,
    marker = as.matrix(cbmc_m),
    query_genes = pbmc_vargenes,
    cluster_col = "classified",
    threshold = 0.8,
    call = FALSE,
    marker_inmatrix = FALSE,
    mode = "pct"
)

NCBI-Hackathons/RClusterCT documentation built on July 20, 2021, 3:15 p.m.