getDecisions {celda}R Documentation

Gets cluster estimates using rules generated by 'celda::findMarkers'

Description

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

Usage

getDecisions(rules, features)

Arguments

rules

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

features

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

Value

A character vector of label predicitions.

Examples

library(M3DExampleData)
counts <- M3DExampleData::Mmus_example_list$data
# Subset 500 genes for fast clustering
counts <- as.matrix(counts[1501:2000, ])
# Cluster genes ans samples each into 10 modules
cm <- celda_CG(counts = counts, L = 10, K = 5, verbose = FALSE)
# Get features matrix and cluster assignments
factorized <- factorizeMatrix(counts, cm)
features <- factorized$proportions$cell
class <- clusters(cm)$z
# Generate Decision Tree
DecTree <- findMarkers(features,
    class,
    oneoffMetric = "modified F1",
    threshold = 1,
    consecutiveOneoff = FALSE)

# Get sample estimates in training data
getDecisions(DecTree$rules, features)

[Package celda version 1.2.4 Index]