Skip to main content
Glama
systemsomicslab

ms-data-parser

arf_differential

Read-only

Run two-group differential analysis on a preprocessed feature matrix using Welch t-tests and log2FC, with factor-token group pooling. Preprocess first; returns group comparisons for lipidomics data.

Instructions

前処理後行列で2群差次的解析(Welch t 検定 + log2FC)を行う。

group_a / group_b の両方を指定する。多群 ANOVA は「因子(加齢/菌叢等)→水準」の 対応が MS-DIAL メタに無く安全に導けないため現状は非対応(誤って全 Class ID を 水準にした結果を返さないよう封鎖している)。3群以上を比べたいときは、下記の 因子トークン・プール指定で関心のある2群を切り出して呼ぶこと。

先に arf_preprocess を実行して session_state.session.arf.feature_matrix を用意すること (未実行ならエラーを返す。生行列への暗黙フォールバックはしない)。

  • group_a / group_b: 完全な Class ID(24M_GF_F)に加え、因子トークンによる プール群指定を受け付ける。group_a="24M", group_b="9w" のように書くと、その トークンを含む全 Class ID がプールされる(24M_GF_F + 24M_SPF_M + …)。 複数トークンの AND 指定も可("24M_GF")。両群が同じ Class ID を掴むとエラー。

  • log_transform: [既定 True] log2(x+1) 空間で検定する。MS 強度は対数正規に近く、 生強度での t 検定/ANOVA は正規性仮定を外れやすいため既定で有効。2群では log2FC も log2 空間の群平均差(=幾何平均比)になる。生スケールで検定したい場合のみ False。

Input Schema

NameRequiredDescriptionDefault
group_aNo
group_bNo
q_thresholdNo
log_transformNo
log2fc_thresholdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare readOnlyHint=true, so the description carries most of the load and does so well: it discloses the hard prerequisite and that violation produces an error rather than a silent fallback, and that overlapping Class ID resolution between the two groups is an error. It also justifies the log_transform default (intensity is approximately log-normal, raw-scale t-tests violate normality). It does not describe the shape of the returned results, which is the remaining gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The output is front-loaded with the core action, then prerequisite, then parameter semantics as a bullet list. The explanation of why ANOVA is blocked is slightly verbose but earns its place by preventing an agent from improvising a multi-group comparison. Minor redundancy between the multi-group paragraph and the group_a/group_b bullet.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given five parameters at 0% schema coverage, no output schema, and only a readOnly annotation, the description covers the stateful prerequisite, the error paths, and the non-obvious pooling syntax. It is nearly complete, falling short only on the two filter thresholds and on what the result set contains.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does thoroughly for group_a/group_b (full Class ID like `24M_GF_F`, factor-token pooling such as `group_a="24M", group_b="9w"`, AND-composition of multiple tokens, error on identical Class IDs) and for log_transform (default True, log2(x+1) space, log2FC becomes a difference of group means in log space). However, q_threshold and log2fc_threshold — two of five parameters — receive no explanation at all, leaving the coverage incomplete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence names a specific verb and resource — two-group differential analysis with Welch t-test plus log2FC — computed on the preprocessed matrix. It is clearly distinguishable from sibling tools such as arf_preprocess (upstream) and arf_plot_volcano / arf_export_differential (downstream consumers).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit prerequisite (arf_preprocess must have produced session_state.session.arf.feature_matrix, otherwise it errors with no implicit fallback), an explicit exclusion (multi-group ANOVA is unsupported, with the reason it cannot be derived safely from MS-DIAL metadata), and an explicit workaround for 3+ groups (pool two groups via factor tokens). That is when-to-use, when-not-to-use, and an alternative in one place.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.