calcPurity: Calculate purity

View source: R/rliger.R

calcPurityR Documentation

Calculate purity

Description

Calculates purity for liger clustering and external clustering (true clusters/classes). Purity can sometimes be a more useful metric when the clustering to be tested contains more subgroups or clusters than the true clusters (or classes). Purity also ranges from 0 to 1, with a score of 1 representing a pure, or accurate, clustering.

Usage

calcPurity(object, classes.compare, verbose = TRUE)

Arguments

object

liger object. Should run quantileAlignSNF before calling.

classes.compare

Clustering with which to compare (named vector).

verbose

Print messages (TRUE by default)

Value

Purity value.

Examples

ligerex <- createLiger(list(ctrl = ctrl, stim = stim))
ligerex <- normalize(ligerex)
ligerex <- selectGenes(ligerex)
ligerex <- scaleNotCenter(ligerex)
# Specification for minimal example run time, not converging
ligerex <- optimizeALS(ligerex, k = 5, max.iters = 1)
ligerex <- quantile_norm(ligerex)
agreement <- calcARI(ligerex, ligerex@clusters)

rliger documentation built on Nov. 9, 2023, 1:07 a.m.