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.
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.
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
Situation
File to Read
Purpose
Need algorithm details
references/algorithm.md
Consensus clustering, PAC scoring, and preprocessing assumptions
Optional plain text or single-column CSV file with one gene symbol per line.
TNMD
DPM1
SCYL3
Output Files
File
Description
Cluster_res.csv
PAC summary for each distance/algorithm combination with is_best marking the selected model
genes_for_clustering.csv
Selected genes and gene selection mode
samples_for_clustering.csv
Samples retained after disease-group filtering
result_<distance>_<algorithm>/
Method-specific consensus outputs and PAC_scores.csv
Consensus Matrix Plot.pdf
Consensus matrix heatmap for the optimal model
CDF curve Plot.pdf
CDF curves for the optimal method
session_info.txt
R 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
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