Skip to main content
Glama
systemsomicslab

ms-data-parser

arf_parser

Read-only

Reads MS-DIAL .arf sample-intensity data, applies filters, and runs PCA on raw spot matrices, returning loadings and score-plot JSON in a Markdown summary.

Instructions

.arf(サンプル別強度)を読み込み、フィルタを適用して PCA を実行する。

生スポット行列に対する PCA の唯一の入口。フィルタ条件を変えて PCA をやり直したい ときは、引数を変えて本ツールを再呼び出しする(ファイルはセッションキャッシュされ 再パースは走らない)。手動除外(arf_exclude)も PCA 前に反映される。 正規化・QC・欠損補完を経た「前処理後」行列での PCA は arf_preprocess → arf_pca_preprocessed。

正負の Loading 上位とスコアプロット用 JSON を含む Markdown 要約を返す。

引数:

  • file_path: 解析する .arf ファイルのパス (省略時は自動検索)

  • props: PCAに使用するプロパティのリスト (デフォルト: ["height"])

  • components: 計算する主成分の数

  • top_features: 各主成分から抽出する正・負の寄与トップ件数 (デフォルト: 10)

  • log_transform: [任意] PCA前に log10 変換を適用する(強度の歪みを抑え条件分離が向上しやすい。既定 False)

  • min_detection_rate: [任意] 特徴量の実検出率(非ギャップフィル)による足切り 0.0-1.0(既定 0.0=無効)

  • min_intensity: [任意] スポット平均強度(HeightAverage)の最小閾値(既定 0.0=無効)

  • annotation_keyword: [任意] 同一バッチARF2の名前を優先した部分一致検索。 ARF2が無い/未注釈ならARF名を使う。PCはLPCにも部分一致するため、クラス限定はontologiesを使う。

  • spot_ids: [任意] MasterAlignmentIDの完全一致リスト(0以上、空リスト不可)。

  • ontologies: [任意] 脂質クラスの完全一致リスト(大文字小文字を区別しない)。 spot_ids、キーワード、他のフィルタとはAND。元のピーク値は変更しない。 これは生スポットの選択であり、選択変更後はarf_preprocessを再実行する。 部分集合でTIC正規化すると分母が変わる。全体の正規化/FDRを維持する用途では 全体で解析・エクスポートしてから対象を参照し、部分集合で再計算しない。

  • tag_labels: [任意] MS-DIALタグ名またはタグIDのリスト

  • tag_mode: any/all/none/not_all のいずれか

  • tag_scope: sample_peak(サンプル別Peak ID)または alignment_spot(MasterAlignmentID)

  • tag_directory: [任意] *_tags.xml の探索先。既定はARFと同じディレクトリ

  • missing_sample_policy: タグファイル未対応サンプルの扱い。error/exclude/untagged(既定 error)

  • class_ids: [任意] 因子トークンによるサンプル絞り込み。各要素は _ 区切りの部分指定 で、指定した全トークンを含むサンプルに一致する(要素内AND・順不同)。要素間はOR。 トークンは Class ID とサンプル名の両方から解決されるため、Class ID に入って いない因子(時点・複製・測定日)でも絞れる。例: ["6h"], ["ILG_6h","control_6h"]。

  • class_missing_sample_policy: Class IDメタデータ未対応サンプルの扱い。error/exclude(既定 error)

  • group_levels: [任意] PCA点の色分け因子の値トークン(例: ["gf","spf"])。 未指定なら各サンプルの完全Class IDで色分け。指定するとその因子だけで統合し、 該当しないサンプルは "other" 群になる。

  • group_factors: [任意] 因子軸のリスト。各軸は値トークンのリストで、直積ラベルを 作る(例 [["control","ILG"],["0h","6h"]] → "control|0h")。group_levels より優先。 処置×時点のような多群を手書き列挙せずに色分けできる。

  • include_roles: [任意] class_ids のフィルタに含める role(既定 ["sample"])。 統合トークン空間ではサンプル名経由で QC/blank を掴み得るため既定で落とす。 QC も含めたいときだけ ["sample","qc"] のように明示する。

Input Schema

NameRequiredDescriptionDefault
propsNo
spot_idsNo
tag_modeNoany
class_idsNo
file_pathNo
tag_scopeNosample_peak
componentsNo
ontologiesNo
tag_labelsNo
group_levelsNo
top_featuresNo
group_factorsNo
include_rolesNo
log_transformNo
min_intensityNo
tag_directoryNo
annotation_keywordNo
min_detection_rateNo
missing_sample_policyNoerror
class_missing_sample_policyNoerror

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true, and the description adds real behavior beyond that: session-level file caching (no re-parse), the interaction with manual exclusions, the shape of the return value (Markdown summary with top positive/negative loadings plus JSON for score plots), and the caveat that subset selections break global normalization. That is a lot of genuine context for a read-only tool.

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?

Purpose and the key alternative come first, then a parameter inventory; length is proportional to 20 arguments and no bullet is pure filler. It is dense rather than padded, though the class_ids/group_factors examples and the TIC caveat could be tightened slightly.

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

Completeness5/5

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

For a read-only, 20-parameter analysis tool with no output schema, the description covers inputs, caching, exclusion interaction, return contents, and downstream implications (re-running preprocessing after spot selection changes). An agent has what it needs to call this correctly.

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 coverage is 0% and there are 20 parameters, so the description must carry the load — and it does, documenting defaults and edge semantics for nearly every argument: annotation_keyword vs ontologies (PC matching LPC), class_ids token AND/OR resolution across Class ID and sample name, group_factors vs group_levels precedence, and include_roles defaulting to sample-only. This is well beyond a restatement of the schema.

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 chain (load .arf, apply filters, run PCA) and declares itself the single entry point for PCA on the raw spot matrix. It also explicitly separates itself from arf_pca_preprocessed, which handles the preprocessed matrix, so an agent can route between the two without opening schemas.

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?

Gives explicit when-to-use rules: re-call with different arguments to redo PCA (noting the file is session-cached), and use arf_preprocess → arf_pca_preprocessed for normalized/QC'd matrices. It also notes arf_exclude changes are applied before PCA and warns about TIC normalization on subsets.

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