Agent skill

Consensus Clustering Analysis

by aipoch in aipoch/medical-research-skills

A skill your agent uses when identifying stable sample subtypes from bulk expression matrices with ConsensusClusterPlus, including PAC-based model selection and consensus matrix/CDF visualization.

MITAuto-check passedResearch & Science

Install Consensus Clustering Analysis

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

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

GitHub CLI
$ gh skill install aipoch/medical-research-skills consensus-clustering-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/consensus-clustering-analysis' .claude/skills/consensus-clustering-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
consensus-clustering-analysis
GitHub stars
2k
Token cost
~2k tokens
SKILL.md length
671 words
Files
21 (incl. scripts, references)
Skills in repo
567
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when identifying stable sample subtypes from bulk expression matrices with ConsensusClusterPlus, including PAC-based model selection and consensus matrix/CDF visualization.

  • Works in 4 steps: Validate Input → Prepare Clustering Matrix → Run Consensus Clustering → …
  • Identifying stable sample subtypes from bulk expression matrices with ConsensusClusterPlus
  • SKILL.md covers When to Use, When to Read External Files, Usage and Arguments, plus 8 more sections
  • Runs R scripts from its folder

What it does

Consensus Clustering Analysis is an agent skill from aipoch/medical-research-skills. Use when identifying stable sample subtypes from bulk expression matrices with ConsensusClusterPlus, including PAC-based model selection and consensus matrix/CDF visualization. NOT for: differential expression analysis, single-cell clustering workflows, or non-expression tables.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 24 other files, including scripts and reference files (for example `eval_report_consensus-clustering-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

  • Identifying stable sample subtypes from bulk expression matrices with ConsensusClusterPlus
  • Including PAC-based model selection and consensus matrix/CDF visualization

Example prompts

  • “/consensus-clustering-analysis”

Workflow steps

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

  1. Validate Input
  2. Prepare Clustering Matrix
  3. Run Consensus Clustering
  4. Generate Outputs

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 6 files in scripts/ (R, from the files we listed), 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

Consensus Clustering Analysis loads about 2k tokens when it runs, and up to ~6.1k if it reads all its reference files. Until then it costs about 77 tokens; SKILL.md has 671 words of instructions outside code blocks.

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

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). 671 words, ~1,966 tokens.

Download SKILL.mdSave it as .claude/skills/consensus-clustering-analysis/SKILL.md (or your agent's skills folder). This skill also uses 20 other files; get the full folder from GitHub.
name
consensus-clustering-analysis
description
Use when identifying stable sample subtypes from bulk expression matrices with ConsensusClusterPlus, including PAC-based model selection and consensus matrix/CDF visualization. NOT for: differential expression analysis, single-cell clustering workflows, or non-expression tables.
license
MIT
author
AIPOCH

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

Consensus Clustering Analysis

When to Use

Use this skill when you need to identify stable sample subtypes from a bulk expression matrix with ConsensusClusterPlus, compare candidate clustering settings with PAC, and export consensus matrix/CDF visualizations.

Do not use this skill for differential expression analysis, single-cell clustering, or non-expression tabular data.

When to Read External Files

SituationFile to ReadPurpose
Need algorithm detailsreferences/algorithm.mdConsensus clustering, PAC scoring, and preprocessing assumptions
Need to run analysisscripts/main.RExecute: Rscript scripts/main.R --input_file ... --group_file ...
Encounter errorsreferences/troubleshooting.mdCommon errors and solutions
Need CLI examplesreferences/cli-guide.mdDetailed CLI usage examples with verified local runs

Usage

bash
Rscript scripts/main.R \
  --input_file ./expression_matrix.csv \
  --group_file ./groups.csv \
  --disease_group case \
  --max_k 4 \
  --output_dir ./output/ \
  --gene_selection highly_variable \
  --top_n 5000 \
  --reps 1000 \
  --p_item 0.8 \
  --p_feature 1.0 \
  --timeout_seconds 3600 \
  --seed 42

Arguments

ShortLongTypeDefaultDescription
-i--input_filecharacterrequiredExpression matrix file (genes as rows, samples as columns)
-g--group_filecharacterrequiredGroup information file (sample ID + group columns)
-d--disease_groupcharactercaseGroup label retained for clustering
-k--max_kinteger4Maximum cluster count to evaluate
-o--output_dircharacter./output/Output directory
-m--gene_selectioncharacterhighly_variableGene selection mode: highly_variable or custom
-n--top_ninteger5000Number of top variable genes to keep
-l--gene_listcharacterNULLCustom gene list file when gene_selection=custom
-c--center_datalogicalTRUEMedian-center each gene before clustering
-r--repsinteger1000Consensus resampling repetitions
--p_itemdouble0.8Sample resampling proportion
--p_featuredouble1.0Feature resampling proportion
-t--timeout_secondsinteger3600Elapsed timeout in seconds
-s--seedinteger42Random seed for reproducibility

Input Format

Expression Matrix (input_file)

Genes as rows, samples as columns, CSV/TSV/TXT format with gene ID in the first column.

csv
,Sample01,Sample02,Sample03
TSPAN6,1.8479,1.8318,3.8276
TNMD,0.0349,0.0533,1.3889
Group File (group_file)

Delimited text file with sample ID and group columns.

csv
sample,group
Sample01,case
Sample02,control
Sample03,case
Gene List (gene_list)

Optional plain text or single-column CSV file with one gene symbol per line.

csv
TNMD
DPM1
SCYL3

Output Files

FileDescription
Cluster_res.csvPAC summary for each distance/algorithm combination with is_best marking the selected model
genes_for_clustering.csvSelected genes and gene selection mode
samples_for_clustering.csvSamples retained after disease-group filtering
result_<distance>_<algorithm>/Method-specific consensus outputs and PAC_scores.csv
Consensus Matrix Plot.pdfConsensus matrix heatmap for the optimal model
CDF curve Plot.pdfCDF curves for the optimal method
session_info.txtR session and package version info

Workflow

Step 1: Validate Input
  • Check file existence
  • Detect sample and group columns in the group file
  • Validate sample matching between expression matrix and group file
Step 2: Prepare Clustering Matrix
  • Filter samples by the requested disease group
  • Select genes using highly_variable or custom
  • Median-center genes if requested
Show full SKILL.md (281 more words)Show less
Step 3: Run Consensus Clustering
  • Evaluate supported distance and clustering algorithm combinations
  • Compute PAC scores across candidate K values
  • Select the optimal model by minimum PAC
Step 4: Generate Outputs
  • Save result tables
  • Generate consensus matrix and CDF plots
  • Record session information for reproducibility

Methods

ConsensusClusterPlus

Repeated subsampling is used to estimate cluster stability across candidate K values and clustering settings.

PAC Score

The proportion of ambiguous clustering is computed as CDF(0.9) - CDF(0.1) from lower-triangle consensus values. Lower PAC indicates more stable clustering.

Gene Selection
  • highly_variable: rank genes by median absolute deviation
  • custom: use the intersection of the provided gene list and matrix row names

Examples

Basic Usage
bash
Rscript scripts/main.R \
  -i expression_matrix.csv \
  -g groups.csv \
  -d case \
  -k 3 \
  -r 20 \
  -o output/example_basic \
  -t 120
With a Custom Gene List
bash
Rscript scripts/main.R \
  -i expression_matrix.csv \
  -g groups.csv \
  -d case \
  -m custom \
  -l genes.csv \
  -k 4 \
  -r 20 \
  -o output/example_custom \
  -t 120
Without Median Centering
bash
Rscript scripts/main.R \
  -i expression_matrix.csv \
  -g groups.csv \
  -d case \
  -c FALSE \
  -k 3 \
  -r 20 \
  -o output/example_rawscale \
  -t 120

Error Handling

Common Errors
ErrorCauseSolution
SKILL_FILE_NOT_FOUNDInput file does not existCheck file path and permissions
SKILL_MISSING_COLUMNSGroup file lacks sample/group columnsVerify column names in the group file
SKILL_SAMPLE_MISMATCHSample names do not matchEnsure group file sample IDs match matrix columns
SKILL_INVALID_PARAMETERCLI value is invalidCheck allowed options and numeric ranges
SKILL_INVALID_DATAToo few samples/genes remain after filteringLower max_k or review the input data
SKILL_TIMEOUTRun exceeded the configured timeoutIncrease timeout_seconds or reduce reps
SKILL_DEPENDENCY_MISSINGRequired R package is not installedInstall missing packages before rerunning

IF error persists, READ: references/troubleshooting.md


Testing

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

# Run analysis
Rscript scripts/main.R \
  -i tests/data/expression_matrix.csv \
  -g tests/data/groups.csv \
  -d case \
  -k 3 \
  -r 20 \
  -o output/example_basic \
  -t 120
Validation Commands
bash
# Inspect selected model
cat output/example_basic/Cluster_res.csv

# Check output plots exist
ls -la output/example_basic

Implementation Checklist

  • CLI parsing with optparse
  • set.seed() for reproducibility
  • requireNamespace() dependency checks
  • Session info recording
  • data.table::fread() input reading
  • File reading instructions in SKILL.md
  • Modular script structure (<150 lines per file)
  • Test data provided
  • Error handling with SKILL_* codes
  • Scripts in scripts/ directory
  • References in references/ directory

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 20 other files (scripts, references) in awesome-med-research-skills/Data Analysis/consensus-clustering-analysis of aipoch/medical-research-skills.

  • SKILL.md
  • DESCRIPTION
  • eval_report_consensus-clustering-analysis_result.json
  • references/algorithm.md
  • references/cli-guide.md
  • references/troubleshooting.md
  • scripts/functions_analysis.R
  • scripts/io_utils.R
  • scripts/main.R
  • scripts/run_analysis.R
  • scripts/utils.R
  • scripts/visualization.R
  • tests/data/expression_matrix.csv
  • tests/data/genes.csv
  • tests/data/groups.csv
  • tests/run_tests.R
  • tests/testthat.R
  • … and 4 more

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Consensus Clustering 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.

Consensus Clustering Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Consensus Clustering Analysis this skillaipoch/medical-research-skills2k—~2kAutomated safety check: PassMIT
Scanpy Single-Cell Analysisdavila7/claude-code-templates32k16 repos~2.8kAutomated safety check: PassMIT
deepTools NGS Toolkitdavila7/claude-code-templates32k13 repos~4.5kAutomated safety check: PassMIT
PyDESeq2 Differential Expressiondavila7/claude-code-templates32k12 repos~4kAutomated safety check: PassMIT
Gtars Genomic Interval Toolkitdavila7/claude-code-templates32k12 repos~1.9kAutomated safety check: PassMIT
LaminDB Biological Data Managementdavila7/claude-code-templates32k12 repos~3.6kAutomated safety check: PassMIT

Similar skills

  • Scanpy Single-Cell Analysis

    davila7/claude-code-templates

    Walks through single-cell RNA-seq analysis with Scanpy: loading .h5ad and 10X data, QC, normalization, PCA and UMAP, Leiden clustering, marker genes and cell type annotation.

    32k GitHub starsUsed in 16 repos~2.8k tokens
    Research & ScienceAuto-check passed
  • deepTools NGS Toolkit

    davila7/claude-code-templates

    Guides use of deepTools on sequencing data: BAM to bigWig conversion, QC, sample correlation, and heatmaps or profiles around TSS and peaks for ChIP-seq, RNA-seq and ATAC-seq.

    32k GitHub starsUsed in 13 repos~4.5k tokens
    Research & ScienceAuto-check passed
  • PyDESeq2 Differential Expression

    davila7/claude-code-templates

    Runs differential gene expression analysis on bulk RNA-seq counts with PyDESeq2: design formulas, Wald tests, FDR correction and volcano or MA plots.

    32k GitHub starsUsed in 12 repos~4k tokens
    Research & ScienceAuto-check passed
  • Gtars Genomic Interval Toolkit

    davila7/claude-code-templates

    Works with genomic intervals using gtars, a Rust toolkit with Python bindings: overlap detection, coverage tracks, tokenization for ML models and reference sequences.

    32k GitHub starsUsed in 12 repos~1.9k tokens
    Research & ScienceAuto-check passed
  • LaminDB Biological Data Management

    davila7/claude-code-templates

    Manages biological datasets with LaminDB: versioned artifacts, run lineage, ontology-based annotation, schema validation and links to workflow managers and ML tools.

    32k GitHub starsUsed in 12 repos~3.6k tokens
    Research & ScienceAuto-check passed
  • Single-Cell Initial Analysis

    LigphiDonk/Oh-my--paper

    Runs a seven-step quality-control and exploration pipeline on scRNA-seq, CyTOF or flow cytometry data and writes a plain-language report of what it found.

    738 GitHub starsUsed in 1 repo~1.4k tokens
    Research & ScienceAuto-check passed

More from aipoch/medical-research-skills

All 567 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…

    2k GitHub stars~2.2k tokensUpdated 20 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.

    2k GitHub stars~1.4k tokensUpdated 20 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.

    2k GitHub stars~3.7k tokensUpdated 20 days ago
    Auto-check passed
  • Iso Certification

    aipoch/medical-research-skills

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

    2k GitHub stars~1.8k tokensUpdated 20 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…

    2k GitHub stars~1.7k tokensUpdated 20 days ago
    Auto-check passed
  • Latex Posters

    aipoch/medical-research-skills

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

    2k GitHub stars~1.3k tokensUpdated 20 days ago
    Auto-check passed

Questions about Consensus Clustering Analysis

What does Consensus Clustering Analysis do?

A skill your agent uses when identifying stable sample subtypes from bulk expression matrices with ConsensusClusterPlus, including PAC-based model selection and consensus matrix/CDF visualization. Consensus Clustering Analysis is an agent skill from aipoch/medical-research-skills. Use when identifying stable sample subtypes from bulk expression matrices with ConsensusClusterPlus, including PAC-based model selection and consensus matrix/CDF visualization.

When should I use Consensus Clustering Analysis?

Consensus Clustering Analysis fits situations like: identifying stable sample subtypes from bulk expression matrices with ConsensusClusterPlus; including PAC-based model selection and consensus matrix/CDF visualization.

How do I install Consensus Clustering Analysis in Claude Code?

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

How do I install Consensus Clustering Analysis in Codex?

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

Can I use Consensus Clustering 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 consensus-clustering-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/consensus-clustering-analysis, .gemini/skills/consensus-clustering-analysis, .github/skills/consensus-clustering-analysis and .opencode/skills/consensus-clustering-analysis in your project.

What does Consensus Clustering Analysis need to run?

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

Does Consensus Clustering 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 Consensus Clustering 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 Consensus Clustering Analysis use?

Consensus Clustering 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 Consensus Clustering Analysis use?

About 2k tokens (SKILL.md is roughly 7.9k 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 4.1k tokens, read only when the agent opens those files.

What are the alternatives to Consensus Clustering Analysis?

Skills that share tags, products or a category with Consensus Clustering Analysis: Scanpy Single-Cell Analysis (davila7/claude-code-templates, 32k stars), deepTools NGS Toolkit (davila7/claude-code-templates, 32k stars), PyDESeq2 Differential Expression (davila7/claude-code-templates, 32k stars) and Gtars Genomic Interval Toolkit (davila7/claude-code-templates, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Consensus Clustering Analysis?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,973 GitHub stars. The repository holds 567 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.