getDecisions: Gets cluster estimates using rules generated by...

Description Usage Arguments Value Examples

View source: R/getDecisions.R View source: R/findMarkersTree.R

Description

Get decisions for a matrix of features. Estimate cell cluster membership using feature matrix input.

Get decisions for a matrix of features. Estimate cell cluster membership using feature matrix input.

Usage

1
2
3
getDecisions(rules, features)

getDecisions(rules, features)

Arguments

rules

List object. The rules element from findMarkersTree output. Returns NA if cluster estimation was ambiguous.

features

A L (features) by N (samples) numeric matrix.

Value

A character vector of label predicitions.

A character vector of label predicitions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
library(M3DExampleData)
counts <- M3DExampleData::Mmus_example_list$data
# Subset 500 genes for fast clustering
counts <- as.matrix(counts[seq(1501, 2000), ])
# Cluster genes and samples each into 10 modules
sce <- celda_CG(counts = counts, L = 10, K = 5, verbose = FALSE)
# Get features matrix and cluster assignments
factorized <- factorizeMatrix(sce)
features <- factorized$proportions$cell
class <- celdaClusters(sce)
# Generate Decision Tree
DecTree <- findMarkersTree(features,
  class,
  oneoffMetric = "modified F1",
  threshold = 1,
  consecutiveOneoff = FALSE)
# Get sample estimates in training data
getDecisions(DecTree$rules, features)

## End(Not run)

celda documentation built on Nov. 8, 2020, 8:24 p.m.