findMarkers {celda}R Documentation

Generate decision tree from single-cell clustering output.

Description

Uses decision tree procudure to generate a set of rules for each cell cluster defined by a single-cell clustering. Splits are determined by one of two metrics at each split: a one-off metric to determine rules for identifying clusters by a single feature, and a balanced metric to determine rules for identifying sets of similar clusters.

Usage

findMarkers(
  features,
  class,
  cellTypes,
  oneoffMetric = c("modified F1", "pairwise AUC"),
  threshold = 0.95,
  reuseFeatures = FALSE,
  altSplit = TRUE,
  consecutiveOneoff = TRUE
)

Arguments

features

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

class

A vector of K label assignemnts.

cellTypes

List where each element is a cell type and all the clusters within that cell type (i.e. subtypes).

oneoffMetric

A character string. What one-off metric to run, either 'modified F1' or 'pairwise AUC'.

threshold

A numeric value. The threshold for the oneoff metric to use between 0 and 1, 0.95 by default. Smaller values will result is more one-off splits.

reuseFeatures

Logical. Whether or not a feature can be used more than once on the same cluster. Default is TRUE.

altSplit

Logical. Whether or not to force a marker for clusters that are solely defined by the absence of markers. Defulault is TRUE

consecutiveOneoff

Logical. Whether or not to allow one-off splits at consecutive brances. Default it TRUE

Value

A named list with five elements.

Examples

library(M3DExampleData)
counts <- M3DExampleData::Mmus_example_list$data
# subset 100 genes for fast clustering
counts <- as.matrix(counts[1500:2000, ])
# cluster genes into 10 modules for quick demo
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)

# Plot dendrogram
plotDendro(DecTree)

[Package celda version 1.2.4 Index]