labelSpheres: Label unannotated hyperspheres

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/labelSpheres.R

Description

Given a set of labels for annotated hyperspheres, propagate labels to the surrounding unannotated hyperspheres.

Usage

1

Arguments

x

A numeric matrix of hypersphere coordinates, containing the median intensity of each marker (column) in each hypersphere (row).

Alternatively, a CyData object containing median intensities for groups of cells, such as that produced by countCells.

labels

A character vector of labels for each hypersphere, set to an empty string for unannotated hyperspheres.

Details

After some hyperspheres have been labelled with interpretSpheres, the remainder can be automatically labelled with this function. Unlabelled hyperspheres are assigned the label of the closest labelled hypersphere. Obviously, this assumes that enough hyperspheres have been labelled so that the closest hypersphere is of a similar cell type/state.

Value

A character vector containing labels for all hyperspheres.

Author(s)

Aaron Lun

See Also

interpretSpheres

Examples

1
2
3
4
5
6
7
set.seed(1000)
coords <- matrix(rgamma(10000, 2, 2), nrow=1000)
labels <- character(nrow(coords))
labels[1:4] <- c("B", "CD4T", "CD8T", "Mono")

ref <- labelSpheres(coords, labels)
head(ref)

cydar documentation built on April 17, 2021, 6:01 p.m.