bulk-wgcna-analysis-with-omicverse

Installation
SKILL.md

Bulk WGCNA analysis with omicverse

Overview

Activate this skill for users who want to reproduce the WGCNA workflow from t_wgcna.ipynb. It guides you through loading expression data, configuring PyWGCNA, constructing weighted gene co-expression networks, and inspecting modules of interest.

Instructions

  1. Prepare the environment
    • Import omicverse as ov, scanpy as sc, matplotlib.pyplot as plt, and pandas as pd.
    • Set plotting defaults via ov.plot_set().
  2. Load and filter expression data
    • Read expression matrices (e.g., from expressionList.csv).
    • Calculate median absolute deviation with from statsmodels import robust and gene_mad = data.apply(robust.mad).
    • Keep the top variable genes (e.g., data = data.T.loc[gene_mad.sort_values(ascending=False).index[:2000]]).
  3. Initialise PyWGCNA
    • Create pyWGCNA_5xFAD = ov.bulk.pyWGCNA(name=..., species='mus musculus', geneExp=data.T, outputPath='', save=True).
    • Confirm pyWGCNA_5xFAD.geneExpr looks correct before proceeding.
  4. Preprocess the dataset
    • Run pyWGCNA_5xFAD.preprocess() to drop low-expression genes and problematic samples.
  5. Construct the co-expression network
Related skills
Installs
32
GitHub Stars
985
First Seen
Jan 26, 2026