Build weighted gene co-expression networks to identify modules of co-regulated genes and relate them to phenotypes. WGCNA groups genes into modules by co-expression, summarizes each module by its eigengene, and correlates eigengenes with sample traits to surface biologically relevant modules and hub genes. The insight that bounds interpretation: co-expression measures marginal correlation, so a module is a descriptive object (genes that vary together), not a regulatory network -- and the scale-free criterion used to pick the soft power is a heuristic, not proof the biology is scale-free. For direct (not indirect) edges, use a Gaussian graphical model; for directed TF-target regulation, use scenic-regulons or grn-inference.
install.packages('WGCNA')
BiocManager::install(c('CEMiTool', 'hdWGCNA'))
install.packages('GeneNet') # Gaussian graphical model (partial correlation)
Minimum 20 samples recommended for reliable module detection (absolute floor of 15). Single-cell data needs metacell aggregation (hdWGCNA), not raw counts.
Tell your AI agent what you want to do: - "Build a signed co-expression network from my RNA-seq data" - "Find gene modules correlated with treatment response" - "Identify hub genes by module membership in the most significant module" - "Test whether my modules are preserved in an independent cohort" - "Find co-expression modules in my single-cell data with hdWGCNA"
"I have normalized RNA-seq counts from 30 samples. Build a signed WGCNA network with bicor and find gene modules."
"Run CEMiTool on my expression data for an automated first-pass co-expression analysis."
"Correlate my WGCNA module eigengenes with survival time and treatment group."
"Which modules are significantly associated with disease status, and what are their hub genes by kME?"
"I have a discovery and a validation cohort. Test which of my modules are preserved using Zsummary."
"I want only direct gene-gene dependencies, not indirect co-expression. Build a Gaussian graphical model."
"Run hdWGCNA on my Seurat object to find co-expression modules per cell type, capping metacell overlap."
goodSamplesGenes); confirm sample size is adequatenetworkType='signed' at BOTH pickSoftThreshold and blockwiseModules.max_shared to avoid pseudo-replication.