choose_cluster_scExp: Choose a number of clusters

View source: R/correlation_filtering_clustering.R

choose_cluster_scExpR Documentation

Choose a number of clusters

Description

This functions takes as input a SingleCellExperiment object and a number of cluster to select. It outputs a SingleCellExperiment object with each cell assigned to a correlation cluster in colData. Also calculates a hierarchical clustering of the consensus associations calculated by ConsensusClusterPlus.

Usage

choose_cluster_scExp(
  scExp,
  nclust = 3,
  consensus = FALSE,
  hc_linkage = "ward.D"
)

Arguments

scExp

A SingleCellExperiment object containing consclust in metadata.

nclust

Number of cluster to pick (3)

consensus

Use consensus clustering results instead of simple hierarchical clustering ? (FALSE)

hc_linkage

A linkage method for hierarchical clustering. See cor. ('ward.D')

Value

Returns a SingleCellExperiment object with each cell assigned to a correlation cluster in colData.

Examples

data("scExp")
scExp_cf = correlation_and_hierarchical_clust_scExp(scExp)
scExp_cf = choose_cluster_scExp(scExp_cf,nclust=3,consensus=FALSE)
table(scExp_cf$cell_cluster)

scExp_cf = consensus_clustering_scExp(scExp)
scExp_cf_consensus = choose_cluster_scExp(scExp_cf,nclust=3,consensus=TRUE)
table(scExp_cf_consensus$cell_cluster)


vallotlab/ChromSCape documentation built on Oct. 15, 2023, 1:47 p.m.