Skip to main content
Glama
systemsomicslab

ms-data-parser

plot_pca_loadings

Read-only

Draws horizontal bar charts of saved PCA loadings from MS-DIAL lipidomics results, highlighting top contributing features for selected principal components.

Instructions

保存済みの PCA(arf_parser / arf_pca_preprocessed / arf_pca_species / dataset_pca)のローディングを横棒で描く。

  • source: "auto"(既定)/ "arf" / "species" / "mztab"。auto はどれも優先せず、候補が 2 つ以上あると AMBIGUOUS_RESULT_SOURCE で止まる。result_id で特定の結果を名指しできる。

  • pcs: 描く主成分(既定 [1, 2]、1〜3 個)。

  • top_n: 主成分ごとに正の上位 N と負の上位 N(既定 15)。None は全件(60 特徴量まで)で、 全パネルの行を最初の主成分の順にそろえる。

  • value: "r"(既定。各特徴量と主成分スコアの相関、−1〜1)/ "coefficient"(固有ベクトルの成分)。 r は autoscale した PCA でだけ出せ、出せないときは coefficient で描いて説明文に書く。

  • 棒の色はクラス(ARF・分子種 PCA は .arf2 の Ontology)。

  • output: "image"(既定)/ "payload"(lipidmix.pca_loadings.v1)。ファイルは save_figure(kind="pca_loadings")。

Input Schema

NameRequiredDescriptionDefault
pcsNo
titleNo
top_nNo
valueNor
outputNo
sourceNoauto
result_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With only readOnlyHint=true declared, the description carries substantial extra context: the AMBIGUOUS_RESULT_SOURCE failure mode, the constraint that correlation values are only available for autoscaled PCA with an automatic fallback plus an explanatory note, the coloring rule derived from .arf2 Ontology, and the fact that files are written through save_figure(kind="pca_loadings"). This is behavior an agent could not infer from annotations.

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

Conciseness5/5

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

The core action is front-loaded in one sentence, followed by one dense bullet per parameter. Each bullet adds a default, a range, or a failure mode rather than restating the schema, so no sentence is filler.

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?

For a 7-parameter, no-output-schema plotting tool the coverage is strong: return modes, payload schema id, file-save path, and fallback behavior are all described. Minor gaps remain — the 'mztab' source option is listed without saying what it refers to, and the 'title' parameter is never mentioned.

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

Parameters5/5

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

Schema description coverage is 0%, yet the description explains nearly every parameter with defaults and non-obvious semantics: pcs (default [1,2], 1-3 components), top_n (top N positive and top N negative, default 15, None means all up to 60 features with panel rows aligned to the first component), value ('r' vs 'coefficient' with value range and availability), output ('image' vs payload schema id), source and result_id. Only the trivial 'title' parameter is left undocumented.

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?

States a concrete verb and resource (draws loadings of saved PCA results as horizontal bars) and enumerates the four result types it consumes (arf_parser / arf_pca_preprocessed / arf_pca_species / dataset_pca). This distinguishes it cleanly from the sibling PCA producers and from other plot tools such as arf_plot_volcano or pathway_plot.

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

Usage Guidelines4/5

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

Gives explicit selection guidance for the source parameter: 'auto' is the default, does not prioritize, and halts with AMBIGUOUS_RESULT_SOURCE when two or more candidates exist, in which case result_id should be used to name a specific result. It also states when 'r' cannot be produced and coefficient must be used instead. It does not, however, route the agent away from any sibling tool.

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