clusterScore: Module scoring

View source: R/semCluster.R

clusterScoreR Documentation

Module scoring

Description

Generate factor scores, principal component scores, or projection scores of latent, composite, and unmeasured variable modules, respectively, and fit them with an exogenous group effect.

Usage

clusterScore(
  graph,
  data,
  group,
  HM = "LV",
  type = "wtc",
  size = 5,
  verbose = FALSE,
  ...
)

Arguments

graph

An igraph object.

data

A matrix or data.frame. Rows correspond to subjects, and columns to graph nodes.

group

A binary vector. This vector must be as long as the number of subjects. Each vector element must be 1 for cases and 0 for control subjects.

HM

Hidden model type. For each defined hidden module: (i) if HM = "LV", a latent variable (LV) will be defined as common unknown cause acting on cluster nodes; (ii) if HM = "CV", cluster nodes will be considered as regressors of a latent composite variable (CV); (iii) if HM = "UV", an unmeasured variable (UV) model will be generated for each module, where source nodes (i.e., in-degree = 0) act as common regressors influencing the other nodes via an unmeasured variable. By default, HM is set to "LV" (i.e., the latent variable model).

type

Graph clustering method. If type = "tahc", network modules are generated using the tree agglomerative hierarchical clustering method (Yu et al., 2015). Other non-tree clustering methods from igraph package include: "wtc" (default value; walktrap community structure with short random walks), "ebc" (edge betweenness clustering), "fgc" (fast greedy method), "lbc" (label propagation method), "lec" (leading eigenvector method), "loc" (multi-level optimization), "opc" (optimal communiy structure), "sgc" (spinglass statistical mechanics). By default, the "wtc" method is used.

size

Minimum number of nodes per hidden module. By default, a minimum number of 5 nodes is required.

verbose

A logical value. If TRUE, intermediate graphs will be displayed during the execution. In addition, a reduced graph with clusters as nodes will be fitted and showed to screen (see also mergeNodes). By default, verbode = FALSE.

...

Currently ignored.

Value

A list of 3 objects:

  1. "fit", hidden module fitting as a lavaan object;

  2. "membership", hidden module nodes membership; clusterGraph function;

  3. "dataHM", data matrix with cluster scores in first columns.

Author(s)

Mario Grassi mario.grassi@unipv.it

References

Grassi M, Palluzzi F, Tarantino B (2022). SEMgraph: An R Package for Causal Network Analysis of High-Throughput Data with Structural Equation Models. Bioinformatics, 38 (20), 4829–4830 <https://doi.org/10.1093/bioinformatics/btac567>

See Also

See clusterGraph and cplot for graph clustering.

Examples


# Nonparanormal(npn) transformation
als.npn <- transformData(alsData$exprs)$data

C <- clusterScore(graph = alsData$graph, data = als.npn,
                  group = alsData$group,
                  HM = "LV",
                  type = "wtc",
                  verbose = FALSE)
summary(C$fit)
head(C$dataHM)
table(C$membership)


SEMgraph documentation built on Sept. 11, 2024, 8:36 p.m.