hierarchical-clustering-plot
Use when building a sample-level hierarchical clustering dendrogram from a bulk expression matrix and sample annotation table, especially for QC, batch inspection, or sample similarity assessment. Trigger keywords: hierarchical clustering, dendrogram, sample QC, batch inspection, sample similarity. NOT for: differential expression testing, gene clustering heatmaps, single-cell clustering workflows.
Veto GatesRequired pass for any deployment consideration
| Dimension | Result | Detail |
|---|---|---|
| Scientific Integrity | PASS | No fabricated statistics; hierarchical clustering uses base R dist() and hclust(); output is a distance matrix and dendrogram only; no statistical claims generated |
| Practice Boundaries | PASS | No diagnostic conclusions; output is a sample similarity visualization; no medical claims; clearly scoped to QC and batch inspection |
| Methodological Ground | PASS | Complete linkage with Euclidean distance is a methodologically sound default for expression QC; multiple distance and linkage options correctly implemented; no causal claims |
| Code Usability | PASS | Script runs successfully in test environment; two full runs completed without error; error paths confirmed; set.seed() present; temp workspace staging is robust |
Core Capability95 / 100 — 8 Categories
Medical TaskExecution Average: 87.8 / 100 — Assertions: 24/25 Passed
Full execution in < 2 seconds; 40 matched samples, 21 features; all 5 output files confirmed; memory usage logged at each step
Full execution successful; linkage=average and label_column=sample confirmed in log; all outputs correct
Both error paths tested and confirmed in live execution; SKILL_INVALID_PARAMETER and SKILL_FILE_NOT_FOUND both fire correctly
All distance and linkage options confirmed in --help and SKILL.md; validation of invalid method confirmed in Edge test; live ward.D2 run not executed
Timeout mechanism and temp workspace cleanup confirmed in code; SKILL_TIMEOUT and SKILL_MEMORY_WARNING documented; live timeout test not feasible on small dataset
Key Strengths
- When to Read External Files table maps every operational concern to the specific script file, making agent-side debugging deterministic
- Temp workspace staging pattern ensures atomic output: either all files are written or none are
- 13 distinct SKILL_* error codes including SKILL_MEMORY_WARNING and SKILL_PLOT_ERROR cover edge cases not seen in sibling skills
- testthat test suite (tests/testthat/test-clustering.R) and test runner enable formal regression testing
- Memory usage reporting with gc() at each step is unique in the collection and valuable for large datasets