Agent skill

Wgcna Analysis

by aipoch in aipoch/medical-research-skills

A skill your agent uses when building a weighted gene co-expression network from a bulk expression matrix and a sample group file, filtering variable genes by MAD, identifying co-expression modules…

MITAuto-check passedResearch & Science

Install Wgcna Analysis

skills CLI
$ npx skills add aipoch/medical-research-skills --skill wgcna-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aipoch/medical-research-skills wgcna-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/'awesome-med-research-skills/Data Analysis/wgcna-analysis' .claude/skills/wgcna-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
wgcna-analysis
GitHub stars
1.9k
Token cost
~2.9k tokens
SKILL.md length
1,115 words
Files
17 (incl. scripts, references)
Skills in repo
578
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when building a weighted gene co-expression network from a bulk expression matrix and a sample group file, filtering variable genes by MAD, identifying co-expression modules…

  • Works in 5 steps: Load and validate inputs → Filter variable genes → Build the WGCNA network → …
  • Building a weighted gene co-expression network from a bulk expression matrix and a sample group file
  • SKILL.md covers When to Read External Files, When Not to Use, Usage and Arguments, plus 6 more sections
  • Runs R scripts from its folder

What it does

Wgcna Analysis is an agent skill from aipoch/medical-research-skills. Use when building a weighted gene co-expression network from a bulk expression matrix and a sample group file, filtering variable genes by MAD, identifying co-expression modules with WGCNA, correlating modules with traits, and exporting module-level plots and gene tables. NOT for single-cell RNA-seq, differential expression testing, methylation analysis, or datasets that are too small for WGCNA after quality control.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 20 other files, including scripts and reference files (for example `eval_report_wgcna-analysis_result.json`, `references/algorithm.md` and `references/cli-guide.md`).

It sits in Research & Science, covering Bioinformatics. The repository describes itself as: Hundreds of agent skills for medical research, including protocol design, data analysis, evidence insights, and academic writing. The licence is MIT.

When your agent uses it

  • Building a weighted gene co-expression network from a bulk expression matrix and a sample group file
  • Filtering variable genes by MAD
  • Identifying co-expression modules with WGCNA
  • Correlating modules with traits

Example prompts

  • “/wgcna-analysis”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Load and validate inputs
  2. Filter variable genes
  3. Build the WGCNA network
  4. Associate modules with traits
  5. Export results

What it can do on your machine

Read from SKILL.md and the folder at commit 686e09d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 9 files in scripts/ (R), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Wgcna Analysis loads about 2.9k tokens when it runs, and up to ~8.2k if it reads all its reference files. Until then it costs about 109 tokens; SKILL.md has 1,115 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~109
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~8.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from aipoch/medical-research-skills at commit 686e09d, republished under its MIT licence (© aipoch). 1,115 words, ~2,912 tokens.

Download SKILL.mdSave it as .claude/skills/wgcna-analysis/SKILL.md (or your agent's skills folder). This skill also uses 16 other files; get the full folder from GitHub.
name
wgcna-analysis
description
Use when building a weighted gene co-expression network from a bulk expression matrix and a sample group file, filtering variable genes by MAD, identifying co-expression modules with WGCNA, correlating modules with traits, and exporting module-level plots and gene tables. NOT for single-cell RNA-seq, differential expression testing, methylation analysis, or datasets that are too small for WGCNA after quality control.
license
MIT
author
AIPOCH

Source: https://github.com/aipoch/medical-research-skills

WGCNA Analysis

When to Read External Files

AI Agent: This section tells you when to read additional files.

SituationFile to ReadPurpose
Need algorithm detailsreferences/algorithm.mdWGCNA workflow, filtering strategy, statistics, assumptions
Need to run analysisscripts/main.RExecute: Rscript scripts/main.R --input_file ... --group_file ...
Encounter errorsreferences/troubleshooting.mdCommon errors, causes, and fixes
Need CLI examplesreferences/cli-guide.mdComplete command examples for common scenarios
Need conversion audit detailsreferences/diagnosis-report.mdSkill readiness assessment and remediation summary
Need test datatests/data/Minimal example input files for validation

When Not to Use

  • Do not use for single-cell RNA-seq matrices.
  • Do not use for methylation data, DEG testing, or other non-WGCNA workflows.
  • Do not use if the user only wants exploratory discussion and does not want the analysis executed.
  • Do not proceed if the dataset is obviously too small for WGCNA or becomes too small after QC.

When an input is out of scope, stop early and state which limitation applies.


Usage

bash
Rscript scripts/main.R \
  --input_file ./expression_matrix.csv \
  --group_file ./group_info.csv \
  --output_dir ./output/ \
  --sample_column sample \
  --group_column group \
  --network_type unsigned \
  --cor_type pearson \
  --mad_quantile 0.25 \
  --min_mad 0.01 \
  --max_genes 5000 \
  --min_module_size 30 \
  --merge_cut_height 0.25 \
  --soft_r2_cutoff 0.85 \
  --module_of_interest auto \
  --top_modules 1 \
  --tom_sample_size 400 \
  --chunk_size 0 \
  --seed 42 \
  --timeout_seconds 0

Arguments

ShortLongTypeDefaultDescription
-i--input_filecharacterrequiredExpression matrix file with genes in rows and samples in columns
-g--group_filecharacterrequiredSample-to-group mapping file
-o--output_dircharacter./output/Output directory
-a--sample_columncharactersampleSample column in the group file; falls back to the first column if not found
-b--group_columncharactergroupGroup column in the group file; falls back to the second column if not found
-n--network_typecharacterunsignedNetwork type for WGCNA: unsigned or signed
-c--cor_typecharacterpearsonCorrelation type: pearson or bicor
-q--mad_quantiledouble0.25MAD quantile used to define the variability cutoff
-m--min_maddouble0.01Minimum MAD cutoff combined with the quantile filter
-k--max_genesinteger0Maximum number of retained variable genes; 0 keeps all filtered genes
-p--min_module_sizeinteger30Minimum module size used by blockwiseModules()
-r--merge_cut_heightdouble0.25Merge cut height for module merging
-u--soft_r2_cutoffdouble0.85Target scale-free topology R-squared cutoff for soft-threshold selection
-t--trait_of_interestcharacterNULLTrait column used for module membership vs trait scatter plots; defaults to the first trait column
-x--module_of_interestcharacterautoModule color or comma-separated module colors to export; auto ranks modules by absolute module-trait correlation
--top_modulesinteger1Number of top-ranked modules to export when module_of_interest=auto
-y--tom_sample_sizeinteger400Number of genes sampled for the TOM heatmap
--chunk_sizeinteger0Row chunk size for large expression matrices; 0 disables chunked loading
-s--seedinteger42Random seed for reproducibility and TOM heatmap sampling
-z--timeout_secondsinteger0Optional elapsed-time limit in seconds; 0 disables timeout

Input Format

Expression Matrix (input_file)

CSV file with gene identifiers in the first column and sample IDs in the header row. All expression columns must be numeric.

csv
,TCGA-78-7156,TCGA-44-6774,TCGA-69-A59K
A1BG,2.612908495,2.077948602,3.865545859
A1BG-AS1,3.526391179,3.221923473,4.684308865
A1CF,1.179552278,1.136255654,1.188781778

Requirements:

  • First column contains non-empty gene IDs
  • Sample column names are unique and non-empty
  • Expression values are numeric
  • After QC, the matrix must remain large enough for WGCNA
Group File (group_file)

CSV file with at least two columns: one sample ID column and one group column.

csv
sample,group
TCGA-78-7156,Control
TCGA-44-6774,Control
TCGA-69-A59K,Control
TCGA-44-6147,Case

Requirements:

  • Sample IDs must match expression matrix column names
  • Sample IDs must be unique
  • Group values must be non-empty
  • At least two groups are required

Output Files

All files are written under output_dir.

FileFormatDescription
session_info.txttextR session information and package versions
plots/soft_threshold.pdfPDFScale-free topology fit and mean connectivity across tested powers
plots/sample_clustering.pdfPDFSample dendrogram with group color annotation
plots/gene_cluster_modules.pdfPDFGene dendrogram with module color labels
plots/module_eigengene_heatmap.pdfPDFEigengene adjacency heatmap
plots/tom_heatmap.pdfPDFTOM-based network heatmap for a sampled subset of genes
plots/module_trait_relationships.pdfPDFHeatmap of module-trait correlations and p-values
plots/module_membership_vs_trait_<module>_<trait>.pdfPDFScatter plot for each exported module against the selected trait
tables/sft_fit_indices.csvCSVSoft-threshold fit statistics returned by pickSoftThreshold()
tables/module_trait_cor.csvCSVModule eigengene vs trait correlation matrix
tables/module_trait_p.csvCSVP-value matrix corresponding to module-trait correlations
tables/module_assignments.csvCSVPer-gene module assignments
tables/selected_modules.csvCSVRanked summary of exported modules for the selected trait
tables/module_genes_<module>.csvCSVGene-level export for each selected module
tables/analysis_summary.csvCSVSummary of samples, retained genes, selected power, selected trait, and exported modules
data/net.rdsRDSFull WGCNA network object returned by blockwiseModules()
data/analysis_objects.rdsRDSSaved analysis objects, trait data, statistics, and selected modules
data/wgcna_tom-block.*.RDataRDataSaved TOM block file(s) produced by blockwiseModules()

Show full SKILL.md (424 more words)Show less

Workflow

Step 1: Load and validate inputs
  • Validate file existence and CLI parameters
  • Read the expression matrix and group file
  • Check sample ID consistency between files
Step 2: Filter variable genes
  • Compute per-gene MAD values
  • Keep genes above the quantile-based MAD cutoff
  • Optionally cap the retained genes with max_genes
Step 3: Build the WGCNA network
  • Transpose the matrix into the WGCNA sample-by-gene format
  • Select soft-threshold power with pickSoftThreshold()
  • Build modules with blockwiseModules()
Step 4: Associate modules with traits
  • Encode groups as a trait matrix
  • Compute module-trait and gene-trait correlations
  • Rank modules by absolute correlation with the selected trait
Step 5: Export results
  • Save summary tables, module assignments, and per-module gene exports
  • Generate dendrogram, heatmap, TOM, and scatter plot PDFs
  • Save session info and serialized R objects

Error Handling

Common Errors
ErrorCauseSolution
SKILL_FILE_NOT_FOUNDInput file path is wrong or a required TOM file is missingCheck file paths and rerun the analysis from the start
SKILL_MISSING_COLUMNSRequired sample, group, or gene identifier columns are missing or emptyVerify the CSV header and column names
SKILL_EMPTY_DATAInput is empty, no genes pass filtering, or the filtered matrix is too small for WGCNACheck data quality and relax filtering settings
SKILL_INVALID_PARAMETERA CLI value is missing, out of range, or not in the allowed choicesReview parameter values in the command
SKILL_SAMPLE_MISMATCHGroup file sample IDs do not match expression matrix sample IDsMake sample identifiers identical across both files
SKILL_PACKAGE_NOT_FOUNDA required R package is not installedInstall missing packages before running

IF error persists, READ: references/troubleshooting.md


Testing

Smoke Test
bash
# Check CLI help
Rscript scripts/main.R --help

# Run with bundled test data
Rscript scripts/main.R \
  --input_file tests/data/expression.csv \
  --group_file tests/data/group.csv \
  --output_dir tests/output-skill/ \
  --sample_column sample \
  --group_column group \
  --network_type unsigned \
  --cor_type pearson \
  --mad_quantile 0.25 \
  --min_mad 0.01 \
  --max_genes 500 \
  --min_module_size 20 \
  --merge_cut_height 0.25 \
  --soft_r2_cutoff 0.8 \
  --module_of_interest auto \
  --top_modules 1 \
  --tom_sample_size 150 \
  --chunk_size 0 \
  --seed 42 \
  --timeout_seconds 0

# Validate required outputs
Rscript tests/validate_outputs.R tests/output-skill/
Validation Commands
bash
Rscript tests/validate_outputs.R tests/output-skill/

Expected outputs include session_info.txt, the plot PDFs, table CSVs, and the serialized R objects listed above.

Additional Verification
  • When exporting explicit modules, confirm the matching tables/module_genes_<module>.csv files exist.
  • When generating module membership plots, confirm the matching plots/module_membership_vs_trait_<module>_<trait>.pdf files exist.
  • If chunked loading is enabled, compare tables/analysis_summary.csv against a non-chunked run on the same input.
Notes
  • Re-running the same command with the same seed is expected to be reproducible.
  • Failed runs may still create output_dir and session_info.txt before exiting; this is expected and safe to overwrite on retry.

Implementation Checklist

  • CLI parsing with optparse
  • set.seed() for reproducibility
  • Dependency checks with explicit package loading
  • Relative source() paths via get_script_dir()
  • Optional timeout parameter
  • Optional chunked loading for large matrices
  • Session info recording
  • Error handling with SKILL_* codes
  • SKILL.md parameters match the implemented CLI
  • File reading instructions in SKILL.md
  • Test data provided in tests/data/
  • Smoke-test output validation script provided

Last updated: 2026-04-17 | Version: 1.0.0

© aipoch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 16 other files (scripts, references) in awesome-med-research-skills/Data Analysis/wgcna-analysis of aipoch/medical-research-skills.

  • SKILL.md
  • eval_report_wgcna-analysis_result.json
  • references/algorithm.md
  • references/cli-guide.md
  • references/troubleshooting.md
  • scripts/chunk_io.R
  • scripts/functions.R
  • scripts/io.R
  • scripts/main.R
  • scripts/plotting.R
  • scripts/run_analysis.R
  • scripts/utils.R
  • scripts/wgcna_core.R
  • scripts/wgcna_selection.R
  • tests/data/expression.csv
  • tests/data/group.csv
  • tests/validate_outputs.R

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Wgcna Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Wgcna Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Wgcna Analysis this skillaipoch/medical-research-skills1.9k—~2.9kAutomated safety check: PassMIT
Alphagenome Single Variant Analysisgoogle-deepmind/science-skills3.2k2 repos~3kAutomated safety check: NotesApache-2.0
13C Metabolic Flux AnalysisK-Dense-AI/scientific-agent-skills48k1 repos~3.2kAutomated safety check: PassMIT
Clinvar Databasegoogle-deepmind/science-skills3.2k2 repos~3.9kAutomated safety check: NotesApache-2.0
Metabolic Study Planneraiming-lab/AutoResearchClaw15k—~1.9kAutomated safety check: PassMIT
Dbsnp Databasegoogle-deepmind/science-skills3.2k2 repos~3.4kAutomated safety check: NotesApache-2.0

Similar skills

  • Alphagenome Single Variant Analysis

    google-deepmind/science-skills

    Analyzes genetic variant effects on gene expression (RNA-seq), chromatin accessibility (DNASE), histone marks (ChIP), and transcription factors using the AlphaGenome API.

    3.2k GitHub starsUsed in 2 repos~3k tokens
    Research & ScienceAuto-check: notes
  • 13C Metabolic Flux Analysis

    K-Dense-AI/scientific-agent-skills

    Estimates reaction fluxes inside cells from steady-state carbon-13 labeling data with a bundled mfapy-based solver, and reports which fluxes the data pin down.

    48k GitHub starsUsed in 1 repo~3.2k tokens
    Research & ScienceAuto-check passed
  • Clinvar Database

    google-deepmind/science-skills

    A skill your agent uses when needing clinical significance, pathogenicity classifications (e.g., Pathogenic, Benign, VUS), clinical evidence rationales, or finding "hard positive" benchmark controls…

    3.2k GitHub starsUsed in 2 repos~3.9k tokens
    Research & ScienceAuto-check: notes
  • Metabolic Study Planner

    aiming-lab/AutoResearchClaw

    Turns a broad metabolic modelling topic into a concrete, paper-shaped plan with organism, model, perturbations, metrics and figures before any FBA code is written.

    15k GitHub stars~1.9k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Dbsnp Database

    google-deepmind/science-skills

    A skill your agent uses when you want to look up, map, and search for short genetic variants (SNPs, indels) in NCBI's dbSNP database.

    3.2k GitHub starsUsed in 2 repos~3.4k tokens
    Research & ScienceAuto-check: notes
  • MFA Pipeline Orchestrator

    aiming-lab/AutoResearchClaw

    Runs a metabolic flux analysis from model loading to phenotype prediction and figures by handing work to four sub-agents in sequence.

    15k GitHub stars~923 tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed

More from aipoch/medical-research-skills

All 578 skills in this repo
  • Academic Poster Generator

    aipoch/medical-research-skills

    Complete workflow for generating academic research posters from PDF literature; use when you need to extract paper content from PDFs and produce a LaTeX-based poster…

    1.9k GitHub stars~2.2k tokensUpdated 23 days ago
    Auto-check passed
  • Diagnostic Study Quality Assessment Quadas

    aipoch/medical-research-skills

    Analyzes clinical diagnostic accuracy studies for bias using the QUADAS-2 tool.

    1.9k GitHub stars~1.4k tokensUpdated 23 days ago
    Auto-check passed
  • Exploratory Data Analysis

    aipoch/medical-research-skills

    Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.

    1.9k GitHub stars~3.7k tokensUpdated 23 days ago
    Auto-check passed
  • Iso Certification

    aipoch/medical-research-skills

    A toolkit for preparing ISO 13485:2016 certification documentation for medical device QMS.

    1.9k GitHub stars~1.8k tokensUpdated 23 days ago
    Auto-check passed
  • Journal Skills

    aipoch/medical-research-skills

    Recommends target journals for manuscript submission by analyzing the paper topic/abstract and the journal distribution of similar PubMed literature; use when users ask for journal…

    1.9k GitHub stars~1.7k tokensUpdated 23 days ago
    Auto-check passed
  • Latex Posters

    aipoch/medical-research-skills

    Creates academic-poster writing packages for LaTeX using beamerposter, tikzposter, or baposter.

    1.9k GitHub stars~1.3k tokensUpdated 23 days ago
    Auto-check passed

Questions about Wgcna Analysis

What does Wgcna Analysis do?

A skill your agent uses when building a weighted gene co-expression network from a bulk expression matrix and a sample group file, filtering variable genes by MAD, identifying co-expression modules…. Wgcna Analysis is an agent skill from aipoch/medical-research-skills. Use when building a weighted gene co-expression network from a bulk expression matrix and a sample group file, filtering variable genes by MAD, identifying co-expression modules with WGCNA, correlating modules with traits, and exporting module-level plots and gene tables.

When should I use Wgcna Analysis?

Wgcna Analysis fits situations like: building a weighted gene co-expression network from a bulk expression matrix and a sample group file; filtering variable genes by MAD; identifying co-expression modules with WGCNA; correlating modules with traits.

How do I install Wgcna Analysis in Claude Code?

Run `npx skills add aipoch/medical-research-skills --skill wgcna-analysis -a claude-code`. Or copy the skill folder (awesome-med-research-skills/Data Analysis/wgcna-analysis in aipoch/medical-research-skills) into .claude/skills/wgcna-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Wgcna Analysis in Codex?

Run `npx skills add aipoch/medical-research-skills --skill wgcna-analysis -a codex`. Or copy the skill folder (awesome-med-research-skills/Data Analysis/wgcna-analysis in aipoch/medical-research-skills) into .agents/skills/wgcna-analysis in your project. Codex loads it when a task matches its description.

Can I use Wgcna Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aipoch/medical-research-skills --skill wgcna-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/wgcna-analysis, .gemini/skills/wgcna-analysis, .github/skills/wgcna-analysis and .opencode/skills/wgcna-analysis in your project.

What does Wgcna Analysis need to run?

Going by SKILL.md and its folder, Wgcna Analysis needs R for the scripts in its folder.

Does Wgcna Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Wgcna Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Wgcna Analysis use?

Wgcna Analysis is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Wgcna Analysis use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.3k tokens, read only when the agent opens those files.

What are the alternatives to Wgcna Analysis?

Skills that share tags, products or a category with Wgcna Analysis: Alphagenome Single Variant Analysis (google-deepmind/science-skills, 3.2k stars), 13C Metabolic Flux Analysis (K-Dense-AI/scientific-agent-skills, 48k stars), Clinvar Database (google-deepmind/science-skills, 3.2k stars) and Metabolic Study Planner (aiming-lab/AutoResearchClaw, 15k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Wgcna Analysis?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,937 GitHub stars. The repository holds 578 skills in this directory. The repository was last updated on September 17, 2026.

Source: aipoch/medical-research-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.