annotate_merge_by_cluster: Merge annotation by cluster

View source: R/annotate_clusters.R

annotate_merge_by_clusterR Documentation

Merge annotation by cluster

Description

Merges individual cell annotations by cluster using majority rule (the entire cluster is annotated as the individual annotation represented by most cells within the cluster)

Usage

annotate_merge_by_cluster(
  annotation,
  cluster,
  threshold = "max",
  collapse = "/",
  exclude = c()
)

Arguments

annotation

vector of individual cell annotations (i.e. from SingleR) (one value for each cell)

cluster

vector of cluster assignments (one value for each cell)

threshold

Frequency threshold to be included in new cluster name (use 'max' to only include a single annotation)

collapse

If frequency is not 'max', the annotations that fullfil the threshold are separated by this character

exclude

Vector of annotations that should not be merged, but kept as is (i.e. gdT cells defined by their TCR)

Value

vector of cluster annotations


Terkild/scutility documentation built on Jan. 16, 2025, 5:28 p.m.