dimred-representation-comparison

dimred-representation-comparison is a skill for Claude Code from GGbond-bo/MemOmics-Agent. It costs 142 tokens per session (4,319 once invoked), scanned A, original, MIT.

A method for comparing ways of representing single-cell data, such as principal component analysis (PCA) and scVI, before judging which produces cleaner groups. It uses matched settings and repeated checks rather than relying on one chart.

In plain words
What is it for?
Compare embeddings, clustering quality, and stability across seeds and resolutions, while reporting uncertainty and the limits of the comparison.
Why use it?
A visual difference can come from preprocessing or random settings instead of the representation method, so a single UMAP plot is not enough evidence.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Good fit Compare embeddings, clustering quality, and stability across seeds and resolutions, while reporting uncertainty and the limits of the comparison.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ggbond-bo/memomics-agent/dimred-representation-comparison
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add GGbond-bo/MemOmics-Agent --skill dimred-representation-comparison
Clone the repo
git clone --depth 1 https://github.com/GGbond-bo/MemOmics-Agent

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dimred-representation-comparison

README.md
[![agentmods](https://agentmods.dev/badge/skills/ggbond-bo/memomics-agent/dimred-representation-comparison/github.svg)](https://agentmods.dev/skills/ggbond-bo/memomics-agent/dimred-representation-comparison)
Your own site
<a href="https://agentmods.dev/skills/ggbond-bo/memomics-agent/dimred-representation-comparison"><img src="https://agentmods.dev/badge/skills/ggbond-bo/memomics-agent/dimred-representation-comparison/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dimred-representation-comparison

Your own site · 80×15
<a href="https://agentmods.dev/skills/ggbond-bo/memomics-agent/dimred-representation-comparison"><img src="https://agentmods.dev/badge/skills/ggbond-bo/memomics-agent/dimred-representation-comparison.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 142 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,319 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00142 $0.04319
Opus 5.5 $0.00057 $0.01728
Sonnet 5.5 $0.00028 $0.00864
Haiku 4.5 $0.00014 $0.00432

Measured 1mo ago against content hash 56ad67e3ba48, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dimred-representation-comparison scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

memomics_home/skills/bioinformatics/dimred-representation-comparison/SKILL.md · 205 lines

How it starts

The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.

降维表示对比与分群质量定级

这是方法学结论定级类任务,不是出图任务。用户问「哪个分群更干净」时,他要的是 带限定词的结论 + 可审阅的证据表;一张 UMAP 并排图说服不了任何人。

⛔ 三条铁律(违反任一条,结论就是错的)

  1. 严格同参:基因集 / neighbors k / UMAP(min_dist, seed) / 聚类算法与分辨率网格 / 评估标签列,全部统一。
  2. 先解耦输入路线再谈算法优劣:PCA 与 scVI 的输入路线天然不同(SCT 正则化表达 vs raw counts), 不补一条「同路线 PCA」对照,你测到的是预处理差异,不是算法差异。
  3. 差异必须过稳定性关:单 seed + 单分辨率的领先不算领先;要给 bootstrap 差值 CI 与方向稳定率。

Step 0:先确认问题形态(不懂就问,别猜)

用户说法 实为 做法
「用 scVI 做 embedding,和 PCA 的 UMAP 比,哪个分群更干净」 方法对比 + 定级 走本 skill 全流程
「帮我跑个 scVI」 单方法执行 只是跑 scVI,不做对比结论
「随你怎么做」+ 已有数据 授权 端到端做完并交付证据表

⚠️ 若对象里 annotation 列来源不明(谁标的、按什么标的),先问清或标注为代理标签 —— 后面所有 ARI/kNN 纯度都以它为基准。


Step 1:严格同参的对比设计

1.1 统一基因集与参数

  • 两法吃同一套 HVG(如 SCT 的 3000 HVG 取交集)
  • 统一 neighbors(k=30) → UMAP(min_dist=0.3, seed=42) → Louvain(res 0.3/0.5/0.8)
  • 聚类零新依赖写法:networkx.algorithms.community.louvain_communities(G, resolution=r, seed=s) (与 scanpy Louvain 同算法族;Leiden 需 leidenalg,环境常缺)

1.2 ⛔ 不要用对象自带的 UMAP 当对照

obj@reductions$umap@misc 通常是 空 list,无法证明它基于 pca 还是 harmony 算的。 在 Python 端用同一套参数重算两版 UMAP,这才是可比的。把自带 UMAP/坐标导出作参考可以,作对照不行。

1.3 至少跑这几条腿(缺一条结论就残)

腿 输入路线 作用
A 主方法(如 PCA30-SCT) SCT 正则化表达 现状基线
B 同路线 PCA(必跑!) raw counts → normalize_total → log1p → scale → PCA 解耦预处理与算法
C 目标方法(scVI 无 batch_key) raw counts (ZINB) 纯算法对比
D 目标方法(scVI + batch_key) raw counts (ZINB) 实际应用场景(含批次信息,不与 A/B 直接比算法)
E 批次校正参考(Harmony) SCT + Harmony 提供「批次收益有多大」的标尺

维度要对齐:PCA30 与 scVI n_latent=10 天然不同,同时跑 n_latent=30 排除维度混杂 (silhouette 等指标不可跨维度直接比)。


Step 2:归因分解(决定结论对错的唯一一步)

总增益 = 预处理贡献 + 算法贡献
       = (A − B) + (B − C)

示例数据 实测:0.513 − 0.379 = +0.134,其中 SCT 贡献 +0.132、算法贡献仅 +0.001 ⇒ 结论从「PCA 更优」改判为「算法层无优劣,优势来自预处理路线」。 不跑 B 腿,这个错误会一路带进交付件。


Step 3:指标集(单指标必误导)

指标 实现要点 陷阱
kNN 邻域纯度 (k=15) 每细胞邻居中同标签比例 最直观;受类别数与小 n 影响
silhouette(原生 + UMAP 2D) 两处分别算 ≈0 或负 ≠ 方法失败(连续谱/高维稀疏天然如此);不可跨维度比
ARI / NMI vs 注释 聚类↔注释一致性 簇数≠类别数时被结构性压低 ⇒ 必须同时报簇数
Calinski-Harabasz / Davies-Bouldin 原生空间 辅助,不与 silhouette 冲突解读
类分离指数 / 成对可分性矩阵 每类「到最近异类质心距离 ÷ 类内离散」 定位具体哪两个亚型分不开
亚型拆散度 每亚型平均占据的簇比例 全部亚型都被拆到 ≥2 簇 ⇒ 标签与聚类本质不对齐
批次混合度 iLISI + kNN 同样本比例 + 样本×类别交叉表 缺它无法排除「靠批次效应分群」的假象

Read the full file on GitHub · 205 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 205 lines · 142 tokens per session scan A 56ad67e3ba48

Subscribe to this mod's changes

dimred-representation-comparison is a skill published in the GitHub repository GGbond-bo/MemOmics-Agent (33 stars, last pushed 14d ago), licensed MIT. It adds 142 tokens to every session and 4,319 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-14.

Related

dimred-representation-comparison compared with skills from other repositories

dimred-representation-comparison next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dimred-representation-comparisonGGbond-bo/MemOmics-AgentSkill3314d agoMITA142Claude Code
instrument-data-to-allotropeanthropics/knowledge-work-pluginsSkill37k4d agoApache-2.0A123Claude Code
matlabK-Dense-AI/scientific-agent-skillsSkill59k7d agoMITA44Claude Code
exploratory-data-analysisK-Dense-AI/scientific-agent-skillsSkill59k7d agoMITA83Claude Code
phylogeneticsK-Dense-AI/scientific-agent-skillsSkill59k7d agoMITA71Claude Code, Codex
research-engineerdavila7/claude-code-templatesSkill34ktodayMITA43Claude Code, Codex
mapping-to-snomedmaziyarpanahi/openmedSkill5.9ktodayApache-2.0A205Claude Code