scSorter: scSorter

Description Usage Arguments Value Examples

View source: R/scSorter.R

Description

This is the main function that implements the scSorter method.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
scSorter(
  expr,
  anno,
  default_weight = 2,
  n_start = 10,
  alpha = 0,
  u = 0.05,
  max_iter = 100,
  setseed = 0
)

Arguments

expr

A matrix of the input expression data. Each row represents a gene and each column represents a cell. Each row of this matrix should be named by the gene name it represents.

anno

A matrix or data frame that contains marker genes specified for cell types of interest. It should contain three columns named "Type", "Marker", and "Weight" that records the name and weight of marker genes specified for each cell type. "Weight" column is optional. If it is not specified, the default_weight will be applied to all marker genes.

default_weight

The default weight assigned to marker genes. The default value is 2.

n_start

The number of possible cluster initializations. The default value is 10.

alpha

The parameter determines the cutoff whether the cell type of a cell should be considered as undecided during unknown cell calling. The default value is 0.

u

The parameter determines whether undecided cells are further processed. The default value is 0.05.

max_iter

The maximum number of iterations for the algorithm to update parameters. The default value is 100.

setseed

Random seed for cluster initialization. The default value is 0.

Value

A list contains the elements: Pred_Type: The predicted cell types. Pred_param: The parameter estimates of mu and delta.

Examples

1
2
3
4
load(system.file('extdata', 'example_data.RData', package = 'scSorter'))
result = scSorter(expr, anno)
misclassification_rate = 1 - mean(result$Pred_Type == true_type)
table(result$Pred_Type, true_type)

scSorter documentation built on March 17, 2021, 9:06 a.m.