BU

bulk-wgcna-analysis-with-omicverse

Analyze gene co-expression networks including module detection and hub gene extraction.

Install

mkdir -p .claude/skills/bulk-wgcna-analysis-with-omicverse && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8448" && unzip -o skill.zip -d .claude/skills/bulk-wgcna-analysis-with-omicverse && rm skill.zip

Installs to .claude/skills/bulk-wgcna-analysis-with-omicverse

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

WGCNA co-expression network: soft-threshold, module detection, eigengenes, hub genes, and trait correlation in OmicVerse.
121 charsno explicit “when” trigger
Advanced

Key capabilities

  • Preprocess expression matrices
  • Calculate soft-threshold powers
  • Construct co-expression networks
  • Detect gene modules and eigengenes
  • Identify hub genes and trait correlations

How it works

It uses PyWGCNA to construct weighted gene co-expression networks, identifying modules and correlating them with sample traits.

Inputs & outputs

You give it
Expression matrix and sample info
You get back
WGCNA module analysis and hub gene identification

When to use bulk-wgcna-analysis-with-omicverse

  • Construct co-expression gene networks
  • Detect gene modules in expression data
  • Identify hub genes and trait correlations

About this skill

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
    • Evaluate soft-threshold power: pyWGCNA_5xFAD.calculate_soft_threshold().
    • Build adjacency and TOM matrices via calculating_adjacency_matrix() and calculating_TOM_similarity_matrix().
  6. Detect gene modules
    • Generate dendrograms and modules: calculate_geneTree(), calculate_dynamicMods(kwargs_function={'cutreeHybrid': {...}}).
    • Derive module eigengenes with calculate_gene_module(kwargs_function={'moduleEigengenes': {'softPower': 8}}).
    • Visualise adjacency/TOM heatmaps using plot_matrix(save=False) if needed.
  7. Inspect specific modules
    • Extract genes from modules with get_sub_module([...], mod_type='module_color').
    • Build sub-networks using get_sub_network(mod_list=[...], mod_type='module_color', correlation_threshold=0.2) and plot them via plot_sub_network(...).
  8. Update sample metadata for downstream analyses
    • Load sample annotations updateSampleInfo(path='.../sampleInfo.csv', sep=',').
    • Assign colour maps for metadata categories with setMetadataColor(...).
  9. Analyse module–trait relationships
    • Run analyseWGCNA() to compute module–trait statistics.
    • Plot module eigengene heatmaps and bar charts with plotModuleEigenGene(module, metadata, show=True) and barplotModuleEigenGene(...).
  10. Find hub genes
    • Identify top hubs per module using top_n_hub_genes(moduleName='lightgreen', n=10).
  11. Defensive validation
    # Before WGCNA: verify enough genes remain after MAD filtering
    assert data.shape[0] >= 1000, f"Only {data.shape[0]} genes after filtering — WGCNA needs >1000 for meaningful modules"
    # Verify expression values are numeric and non-negative
    assert data.dtypes.apply(lambda d: d.kind in 'iuf').all(), "Expression matrix contains non-numeric columns"
    # Verify enough samples for network construction
    assert data.shape[1] >= 6, f"Only {data.shape[1]} samples — WGCNA needs >=6 samples for reliable co-expression"
    
  12. Troubleshooting tips
    • Large datasets may require increasing save=False to avoid writing many intermediate files.
    • If module detection fails, confirm enough genes remain after MAD filtering and adjust deepSplit or softPower.
    • Ensure metadata categories have assigned colours before plotting eigengene heatmaps.

Examples

  • "Build a WGCNA network on the 5xFAD dataset, visualise modules, and extract hub genes from the lightgreen module."
  • "Load sample metadata, update colours for sex and genotype, and plot module eigengene heatmaps."
  • "Create a sub-network plot for the gold module using a correlation threshold of 0.2."

References

When not to use it

  • When dataset has fewer than 6 samples

Prerequisites

Expression matrixSample metadata

Limitations

  • Requires at least 1000 genes after filtering
  • Requires at least 6 samples for reliable results

How it compares

It provides an integrated pipeline for WGCNA within the omicverse framework, simplifying the workflow from preprocessing to hub gene identification.

Compared to similar skills

bulk-wgcna-analysis-with-omicverse side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
bulk-wgcna-analysis-with-omicverse (this skill)05moNo flagsAdvanced
quant-analyst1032moNo flagsAdvanced
stock-analyzer712moReviewBeginner
google-analytics436moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

quant-analyst

zenobi-us

Expert quantitative analyst specializing in financial modeling, algorithmic trading, and risk analytics. Masters statistical methods, derivatives pricing, and high-frequency trading with focus on mathematical rigor, performance optimization, and profitable strategy development.

103355

stock-analyzer

FrancyJGLisboa

Provides comprehensive technical analysis for stocks and ETFs using RSI, MACD, Bollinger Bands, and other indicators. Activates when user requests stock analysis, technical indicators, trading signals, or market data for specific ticker symbols.

71214

google-analytics

davila7

Analyze Google Analytics data, review website performance metrics, identify traffic patterns, and suggest data-driven improvements. Use when the user asks about analytics, website metrics, traffic analysis, conversion rates, user behavior, or performance optimization.

43193

data-engineering

pluginagentmarketplace

ETL pipelines, Apache Spark, data warehousing, and big data processing. Use for building data pipelines, processing large datasets, or data infrastructure.

13192

math-tools

ananddtyagi

Deterministic mathematical computation using SymPy. Use for ANY math operation requiring exact/verified results - basic arithmetic, algebra (simplify, expand, factor, solve equations), calculus (derivatives, integrals, limits, series), linear algebra (matrices, determinants, eigenvalues), trigonometry, number theory (primes, GCD/LCM, factorization), and statistics. Ensures mathematical accuracy by using symbolic computation rather than LLM estimation.

26134

crawl4ai

basher83

This skill should be used when users need to scrape websites, extract structured data, handle JavaScript-heavy pages, crawl multiple URLs, or build automated web data pipelines. Includes optimized extraction patterns with schema generation for efficient, LLM-free extraction.

21137

Search skills

Search the agent skills registry