seurat_ref: Function to convert labelled seurat object to avg expression...

Description Usage Arguments Value Examples

View source: R/seurat_wrapper.R

Description

Function to convert labelled seurat object to avg expression matrix

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
seurat_ref(seurat_object, ...)

## S3 method for class 'seurat'
seurat_ref(
  seurat_object,
  cluster_col = "classified",
  var_genes_only = FALSE,
  assay_name = NULL,
  method = "mean",
  subclusterpower = 0,
  if_log = TRUE,
  ...
)

## S3 method for class 'Seurat'
seurat_ref(
  seurat_object,
  cluster_col = "classified",
  var_genes_only = FALSE,
  assay_name = NULL,
  method = "mean",
  subclusterpower = 0,
  if_log = TRUE,
  ...
)

Arguments

seurat_object

seurat_object after tsne or umap projections and clustering

...

additional arguments

cluster_col

column name where classified cluster names are stored in seurat meta data, cannot be "rn"

var_genes_only

whether to keep only var_genes in the final matrix output, could also look up genes used for PCA

assay_name

any additional assay data, such as ADT, to include. If more than 1, pass a vector of names

method

whether to take mean (default) or median

subclusterpower

whether to get multiple averages per original cluster

if_log

input data is natural log, averaging will be done on unlogged data

Value

reference expression matrix, with genes as row names, and cell types as column names

Examples

1
2
3
4
5
6
ref <- seurat_ref(
    seurat_object = s_small,
    cluster_col = "res.1",
    var_genes_only = TRUE
)
ref[1:3, 1:3]

Example output

            0        1        2
LTB  6.119387 3.915982 3.431685
EAF2 3.085469 2.170374 0.000000
CD19 2.792883 2.003836 0.000000

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