setKcc: Set cluster membership for K clusters

View source: R/setClusters.R

setKccR Documentation

Set cluster membership for K clusters

Description

Set cluster membership for K clusters

Usage

setKcc(cnr, kCC = NULL, prefix = "X", overwrite = TRUE)

Arguments

cnr

a cnr object

kCC

number of K clusters to use, select optimum or maximum k from kSpectral. Default is NULL which will pull the optK[kCC] from kStats

prefix

prefix charcter to append to Consensus Clusters

overwrite

whether to overwrite the ConsensusC column, default is TRUE

Value

Appends cluster membership based on consensus clustering for a specified kCC to the cnr$Y phenotype matrix. Column name is ConsensusC.

If 'overwrite = TRUE' this column will be overwritten in subsequent analyses. To prevent this, change the name of the column to a differnt name e.g. 'kCC.10' prior to the next run. Or set 'overwrite = FALSE', this will issue a warning, and will rename append '.x' and '.y' suffix from 'merge'.

Examples


data(cnr)
noisy.cells <- cnr$qc$cellID[cnr$qc$qc.status == "FAIL"]

cnr <- excludeCells(cnr, excl = noisy.cells)

cnr <- phylo_cnr(cnr, root.cell = "cell0")

cnr <- run_consensus_clustering(cnr, iters = 20, maxK = 40,
       verbose = TRUE)

cnr <- doKSpectral(cnr)

cnr <- setKcc(cnr)



SingerLab/gac documentation built on March 23, 2024, 5:15 a.m.