arf_pca_species
Runs PCA on selected molecular species across sample groups and returns a score plot, with options for normalization, log transform, group orientation, and low-reliability sample projection.
Instructions
選んだ分子種(arf_plot_species と同じ項目指定・除外)で PCA を回し、スコア図を返す。
対象の試料は groups に入る試料(2 群に入る試料は最初の群の色で 1 回だけ)。
low_reliability_samples は主成分の計算に使わず、投影だけする(図では白抜き)。
normalize: "none"(既定)/ "total"(試料ごとに選んだ分子種の合計で割り、全試料の合計の中央値を掛ける。 試料量の差を除いて組成を比べるとき)。log_transform(既定 True)で log10(x + 1)。 その後、計算に使う試料の平均と母標準偏差で autoscale。分散 0 の分子種は外す。
orient_by: 群名。その群の平均スコアが正になるよう主成分の符号をそろえる(符号は本来任意)。
ローディング(固有ベクトルの成分と相関 r)はセッションに残し、plot_pca_loadings(source="species") が描く。スコア図のファイルは save_figure(kind="pca", source="species")。
output: "image"(既定)/ "payload"(点列・寄与率・PC1 の r の上位と下位)。
計算に使う試料が 3 未満などの入力の誤りは {"status": "error", "message": ...}。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| title | No | ||
| groups | Yes | ||
| output | No | ||
| normalize | No | none | |
| orient_by | No | ||
| require_msms | No | ||
| log_transform | No | ||
| apply_curation | No | ||
| standard_samples | No | ||
| low_reliability_samples | No | ||
| exclude_auto_likely_wrong | No |