EthoClaw ethoclaw-multiparameter-clustermap-generate
Generate journal-style hierarchical clustering clustermaps (heatmap+dendrogram) from a folder of .h5/.hdf5 files (KinematicParameter/ParameterName + ParameterData). Summarize frames per sample (mean/median/max), optionally normalize (column z-score), cluster samples/parameters, and export PNG/PDF + CSV + linkage arrays. Use when user asks for multi-parameter clustering heatmap/clustering tree/full parameter full sample clustering figure generation.
install
source · Clone the upstream repo
git clone https://github.com/penciler-star/EthoClaw
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/penciler-star/EthoClaw "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/ethoclaw-multiparameter-clustermap-generate" ~/.claude/skills/penciler-star-ethoclaw-ethoclaw-multiparameter-clustermap-generate && rm -rf "$T"
manifest:
skills/ethoclaw-multiparameter-clustermap-generate/SKILL.mdsource content
H5 Multi-parameter Clustermap
Create a Prism-like clustermap (heatmap + dendrogram) for all parameters × all samples from
.h5 files.
Assumptions about H5 structure
Each
.h5 must contain:
(parameter name list)KinematicParameter/ParameterName
(2D array: frames/timepoints × parameters)KinematicParameter/ParameterData
How it works
- For each sample (one
): summarize every parameter’s time-series into a single value (.h5
/mean
/median
).max - Stack into a feature matrix: rows = samples, cols = parameters.
- Optional normalization: parameter-wise z-score across samples (column z-score).
- Hierarchical cluster rows and columns and draw clustermap.
Quick start (no config editing)
Option 1: Run in the project folder (recommended)
cd /d C:\\path\\to\\your_project python <skill>/scripts/cluster_all_params.py
It will:
- auto-read all
under the current folder*.h5 - write outputs to
results/cluster_all_kinematic_params/
Option 2: Pass project path explicitly
python scripts/cluster_all_params.py --root "C:\\path\\to\\your_project"
Option 3: Use TOML config (only if you want a saved preset)
python scripts/cluster_all_params_from_config.py --config references/config.example.toml
Outputs
In your configured output folder:
clustermap_all_params.pngclustermap_all_params.pdffeature_matrix.csv
,row_linkage.npycol_linkage.npyclustering_meta.json
Config knobs you’ll likely change
CLI flags (no file edits):
--summary mean|median|max--style nature|cell|minimal
(used when--cmap RdBu_r|coolwarm|vlag|icefire|...
doesn’t override)style
/--linewidths
(grid lines)--linecolor--metric euclidean|correlation
TOML (optional saved preset):
features.summary = mean|median|maxplot.style = nature|cell|minimalplot.cmap = RdBu_r|coolwarm|vlag|icefire|...
/plot.linewidthsplot.linecolorclustering.metric = euclidean|correlation
Notes
- If
ordering differs between files, the script will stop (to avoid mixing mismatched features).ParameterName - If you have many parameters, set smaller
and rotate ticks.plot.xtick_fontsize