selectK: Select the number of the patterns for running...

View source: R/analysis.R

selectKR Documentation

Select the number of the patterns for running 'identifyCommunicationPatterns'

Description

We infer the number of patterns based on two metrics that have been implemented in the NMF R package, including Cophenetic and Silhouette. Both metrics measure the stability for a particular number of patterns based on a hierarchical clustering of the consensus matrix. For a range of the number of patterns, a suitable number of patterns is the one at which Cophenetic and Silhouette values begin to drop suddenly.

Usage

selectK(
  object,
  slot.name = "netP",
  pattern = c("outgoing", "incoming"),
  title.name = NULL,
  do.facet = TRUE,
  k.range = seq(2, 10),
  nrun = 30,
  seed.use = 10
)

Arguments

object

CellChat object

slot.name

the slot name of object that is used to compute centrality measures of signaling networks

pattern

"outgoing" or "incoming"

title.name

title of plot

do.facet

whether use facet plot showing the two measures

k.range

a range of the number of patterns

nrun

number of runs when performing NMF

seed.use

seed when performing NMF

Value

a ggplot object


sqjin/CellChat documentation built on Nov. 10, 2023, 4:29 a.m.