Analysis workflow2024

Weighted Gene Co-expression Network Analysis

  • #WGCNA
  • #Coexpression
  • #ModuleTraitAnalysis
  • #R

I used R to validate and align expression data, identify co-expression modules, and connect module summaries to sample attributes—then exported gene-level metrics and weighted networks for follow-up.

Follow the workflow. Select a stage to inspect one real example run.

GitHub

Example run

One dataset · the same workflow

Expression + sample attributes

Start with measured expression values and a matching attribute table.

Input
Expression matrix + sample attributes
Output
Matched data objects
R · expression matrix + one-hot attributes
Selected real genes and representative samples; not the full matrix.Hover, focus or tap for details
Method notes & example context

Workflow scope. This matrix-based R workflow checks expression inputs, averages repeated identifiers, aligns sample attributes, evaluates soft-threshold powers, constructs weighted co-expression and topological overlap, identifies modules, calculates module–attribute and gene-level correlations, and exports gene lists and network records. It is not a raw-read processing pipeline or a packaged one-click application.

Preparation in this run. The matrix already contains continuous expression values. The script does not add normalization or log transformation. There are 10,915 input rows, 10,914 unique identifiers and 25 samples; the one-row reduction comes from averaging a repeated identifier. No distinct identifier or sample is removed. Quality checks and a mean-expression filter are present in the code, but they do not account for this reduction. Sample clustering retains every sample with a permissive configured cut height; this is not evidence of a stringent outlier screen.

Identifier limitation. Some archived gene labels resemble spreadsheet-converted dates. Their intended identities are not established, and this display does not silently rename or validate them. Selected named genes avoid these labels. The duplicate example is labeled only “Repeated identifier”; its two measured rows and their actual average are preserved.

Network construction. Candidate powers span 1–15. The code uses the selected estimate for unsigned Pearson adjacency and unsigned TOM; the selected numeric power is not retained in the available text outputs and is not invented here. The drawn fit reference is not the power-selection parameter. The illustration uses a connected subset of saved, undirected TOM export links above the archived 0.02 threshold. Line width represents weight; node positions do not encode biological distance. These are not physical interactions or regulatory evidence.

Module identification. Average-linkage clustering is applied to 1 − TOM, followed by dynamic tree cut with minimum module size 50, deepSplit 2 and pamRespectsDendro FALSE. An eigengene cut line appears in the script, but no module-merging operation is executed. The final run has nine identified modules and 2,418 grey/unassigned genes. Only four module sizes are illustrated.

Example attributes. This run uses PBS (9 samples), LPS(1x) (9) and LPS(4x) (7), encoded as matching one-hot attributes. These are example data labels, not restrictions on the workflow. Correlations are not differential-expression contrasts. Modules from an unsigned network may contain oppositely directed expression patterns.

Statistical interpretation. Module–attribute correlations use eigengene summaries and nominal Student correlation p-values, not FDR-adjusted results. For this display, archived eigengene scores were recovered from the saved filtered expression matrix and own-module membership coefficients; the reconstructed scores reconcile all saved membership correlations to within 6 × 10⁻¹⁴ and match the saved association plot labels. The saved filtered export's rounding reproduces the original GS / MM results; the higher-precision input does not match them exactly. Inspect the marks for the verified coefficients and nominal p-values. The page does not imply causation, pathway activation or a formal research conclusion. The browser does not rerun soft-threshold selection, TOM construction or module detection.

Gene-level outputs. The GS / MM view uses 60 evenly spaced ranks across the turquoise module's absolute-membership ordering, after omitting ambiguous date-like labels for presentation. This is a range-spanning illustration, not a random sample or all module genes. Export records show the five highest absolute-membership examples. Absolute coordinates follow the original scatter convention; signed coefficients and nominal p-values remain in hover, focus and tap states. The displayed records are not experimentally validated hub genes. Gene tables and Cytoscape-compatible edge / node lists are separate saved outputs.