Communitygithub.com

科学的可視化

Matplotlib、Seaborn、またはPlotlyを使用して、真実性がありアクセシブルで出版に適した科学的な図を作成・監査します。図の設計、マルチパネルレイアウト、不確実性・欠損データの表示、色/コントラストのレビュー、画像メタデータの検証、ジャーナルへのエクスポート計画に使用します。

科学的可視化 とは?

このスキルは、科学的な意味を保存した上で外観を最適化する、出版品質の図を作成するための包括的なワークフローを提供します。データの改ざんや誤解を招く表現を禁止する非交渉のガードレールを備え、生データや変換、欠損値コード、解析コード、ランダムシードなどの完全な保存を義務付けます。Matplotlib、Seaborn、Plotlyの3つのライブラリをサポートし、オブジェクト指向APIや一時的なスタイルコンテキストを使用したスコープ付きスタイルの実装方法を示します。また、画像メタデータの検査、パレットのコントラストとグレースケールの監査、出版社のエクスポート要件の確認、スタイルのプレビューを行うためのCLIツールを同梱しています。WCAG 2.2に基づくアクセシビリティ設計、色の冗長性、正確な物理寸法でのエクスポート、フォントの編集可能性、透明性の取り扱いなど、科学的図作成における重要な側面を網羅しています。最終レビューチェックリストと引用情報も含まれており、研究エージェントが信頼性の高い図を作成するための手続き的知識を提供します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/scientific-visualization

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

科学的可視化 は何をしますか?

科学的な意味を保存してから外観を最適化する図を作成します。普遍的な原則と時代遅れの出版社ルールを区別し、生データと変換を保持し、色を冗長的に使用し、プロットのデフォルト設定を信頼するのではなく納品ファイルを検査します。

非交渉のガードレール

  • 図を改善するためにデータを変更、隠蔽、捏造、または選択的に強調しないでください。
  • 生のテーブル/画像、除外、欠損値コード、解析コード、正規化、ビニング、画像調整、ランダムシードを保存してください。
  • ジャーナルの要件を推測しないでください。正確なジャーナル、記事タイプ、図タイプ、提出フェーズを特定し、公式の最新ガイダンスを確認してください。
  • パレット、DPI値、フォーマット、または自動化レポートが図をアクセシブルまたはジャーナル準拠にするとは主張しないでください。
  • 欠損観測値を黙って接続したり、不便な点を抑制したり、詳細が増えたかのように画像をアップサンプリングしたり、軸/デュアルアクシスを調整して結論を誇張したりしないでください。
  • インタラクティブ出力と静的出力は別個の成果物として保持してください。インタラクティブホバーは、ラベル、代替テキスト、キーボードアクセス、アクセシブルなデータテーブル、静的フォールバックの代わりにはなりません。

references/publication_guidelines.mdを読んで、偽装エンコーディングと整合性チェックを確認してください。ターゲットとフェーズがわかった後にのみreferences/journal_requirements.mdを読んでください。

ワークフロー

1. エビデンスと出力先を定義する

以下を記録します:

  • 対象者と媒体: 原稿、ウェブ、スライド、ポスター、補足;
  • 正確な出版社/ジャーナル、記事タイプ、提出フェーズ、意図する最終幅;
  • 変数の意味、単位、サンプル/レプリケート構造、欠損/打ち切り値;
  • 推定量と不確実性の定義;
  • 変換: フィルタリング、集約、正規化、平滑化、ビン、画像処理;
  • ソースデータのパス/識別子と出力の来歴。

要件が不明な場合は、暫定的な一般的な図を作成し、すべての出版社の選択を「確認待ち」とラベル付けします。

2. 正直なエンコーディングを選択する

共通のスケール上の位置を優先します。コーディング前に以下を確認してください:

  • 棒/面積: 通常はゼロを含めます。長さ/面積はベースラインから測定されるためです。
  • 点/線: 非ゼロの制限は有効な場合があります; コンテキストを示し、区切りを開示してください。
  • 不確実性: SD、SE、CI、パーセンタイル、事後分布、またはその他の区間を指定し、nとレプリケーションの単位を述べてください。
  • 生の観測値: 可能な場合は表示してください; ジッターでカテゴリ/値が不明瞭にならないようにしてください。
  • 欠損データ: 欠損、ゼロ、打ち切り、除外を区別し、ギャップまたは明示的なモデル/補間スタイルを使用してください。
  • 面積/体積: 半径/直径ではなく面積/体積をスケーリングしてください; 装飾的な3Dは避けてください。
  • 対数軸: ベース/変換をラベル付けし、ゼロ/負の値がどのように処理されるかを宣言してください。
  • ビニング/平滑化: エッジ、バンド幅/ウィンドウ、方法、感度を記録してください。
  • 正規化: 式/参照を述べ、比較するパネル間で制限を一貫させてください。
  • デュアルアクシス: 整列したパネルを優先します; 避けられない場合は単位を正当化し、見かけ上の相関を仕掛けないでください。
  • 画像: オリジナルを保存し、画像全体の調整を開示し、スケールバーを示し、クリップ/消去された背景を避けてください。

3. アクセシビリティを後からではなく最初から設計する

  • 色に加えて、マーカー、線種、ハッチング、直接ラベル、またはパネル分離を使用してください。
  • データの意味論に従って、質的、順序、発散的、または循環的な色を選択してください。
  • レンダリングサイズで前景/背景のコントラストを監査してください。
  • 欠損値と範囲外の値を明示的にしてください。
  • 代替テキスト、複雑な図のための長い説明、ウェブ配信のための基礎データを提供してください。
  • WCAG 2.2をウェブガイダンスとして扱います: 通常テキスト4.5:1、大きいテキスト3:1、理解に必要なグラフィカルオブジェクト3:1; 色だけを手がかりにしてはいけません。適用性と例外が重要です。

references/color_palettes.mdを参照してください。グレースケール画面は便利ですが、完全な色覚またはアクセシビリティテストではありません。

4. スコープ付きスタイルで実装する

Matplotlibのオブジェクト指向APIと一時的なスタイルコンテキストを使用します:

import matplotlib.pyplot as plt

from style_presets import style_context

with style_context("default", palette_name="okabe_ito_on_white"):
    fig, ax = plt.subplots(
        figsize=(89 / 25.4, 60 / 25.4),
        layout="constrained",
    )
    ax.plot(x, y, marker="o", label="観測値")
    ax.set(xlabel="時間 (時間)", ylabel="応答 (単位)")
    ax.legend()

layout="constrained"はカラーバー、ネストされたGridSpec、サブフィギュア、subplot_mosaicをサポートしています。その後tight_layout()を呼び出さないでください; 制約付きレイアウトが無効になります。

正確な物理寸法が必要な場合は、ページサイズの変更が意図的でない限りbbox_inches="tight"を使用しないでください。

カラー正規化

import matplotlib as mpl

norm = mpl.colors.TwoSlopeNorm(vmin=-2, vcenter=0, vmax=5)
cmap = mpl.colormaps["RdBu_r"].with_extremes(bad="#777777")
image = ax.imshow(values, norm=norm, cmap=cmap, interpolation="nearest")
fig.colorbar(image, ax=ax, label="変化 (単位)")

LogNorm、CenteredNorm、SymLogNorm、BoundaryNorm、またはTwoSlopeNormは、そのマッピングが科学的意味と一致する場合にのみ使用してください。

Seaborn

Seaborn 0.13.2は現在のerrorbarAPIを使用します:

sns.lineplot(
    data=frame,
    x="time",
    y="response",
    hue="treatment",
    style="treatment",
    markers=True,
    errorbar=("ci", 95),
    n_boot=5000,
    seed=20260723,
    ax=ax,
)

軸レベルの関数はカスタムMatplotlibレイアウトに適合します; 図レベルの関数は独自の図/ファセットを作成します。Seabornの内部アーティストリストを安定したAPIであるかのようにカスタマイズしないでください。

Plotly

  • インタラクションにはwrite_html()、静的出力にはwrite_image()/plotly.io.write_images()を使用してください。
  • Kaleido 1.3.0はChrome/Chromiumを必要とします; もはやChromeをバンドルしていません。
  • 現在の静的フォーマット: PNG、JPEG、WebP、SVG、PDF。EPSはKaleido v0のみです。
  • 非推奨のengine=を渡したり、Orca/plotly.io.kaleido.scopeを使用しないでください。
  • width、height、scaleでピクセルを制御します; scale=3は本質的に「300 DPI」ではありません。
  • WebGLトレースはラスターコンテンツをPDF/SVGに埋め込みます。
  • 完全オフラインのエクスポートには、図がMathJax/topojson/タイルを参照する場合、ローカルの外部アセットが必要です。

5. 明示的にエクスポートし、来歴を記録する

from figure_export import export_figure

report = export_figure(
    fig,
    "outputs/figure1",
    formats=["pdf", "png"],
    dpi=600,
    bbox_inches=None,  # 図のページ寸法を保持
    provenance={
        "raw_data": "data/source.csv",
        "transformations": ["事前宣言されたQCフィルター", "グループ平均"],
        "uncertainty": "95%ブートストラップCI; シード 20260723",
        "missing_data": "ギャップとして保持"
    },
    write_manifest=True,
)

エクスポーターは暗黙の上書きを拒否し、アトミックに書き込み、埋め込みラスターのベクターDPIを保持し、TIFF LZWを使用し、PDF/PS Type 42フォントを使用できます。科学的コンテンツや出版社の受け入れを検証しません。

編集可能なフォントの場合:

  • PDF/PS Type 42はTrueTypeフォントを埋め込みます。
  • svg.fonttype="none"はテキストを編集可能/検索可能に保ちますが、フォントは埋め込みません; 外観はインストールされたフォントに依存します。
  • svg.fonttype="path"はグリフの外観をパスとして保持しますが、編集可能/検索可能なテキストは失われます。

透明性が必要でない限り、不透明な明示的背景を使用してください; 別の背景に対してブレンドすると、見かけのコントラストが変化します。

6. 検査、比較、レビュー

  1. ファイルメタデータを検査します。
  2. パレットコントラスト/グレースケール分離を監査します。
  3. 日付入りの出版社スナップショットと比較します。
  4. 原稿/ウェブコンテキストで最終サイズで表示します。
  5. フォント、埋め込みラスター、クリッピング、凡例、スケールバー、画像の整合性、キャプション、代替テキスト、ソースデータを手動でレビューします。
  6. アップロード直前にターゲットジャーナルのライブページを再確認します。

ピン留めされたスナップショット

例とスモークテストは、2026年7月23日現在の直接パッケージピンを使用します:

uv run --isolated --no-project --python 3.13 \
  --with "matplotlib==3.11.1" \
  --with "seaborn==0.13.2" \
  --with "plotly==6.9.0" \
  --with "kaleido==1.3.0" \
  --with "pillow==12.3.0" \
  --with "pypdf==6.14.2" \
  python your_figure.py

これは日付付きの直接依存関係スナップショットであり、推移的ロックではありません。正確な再現にはプロジェクトのuvロックを使用してください; このスキルは意図的に依存関係ロックを同梱していません。

バンドルされたCLI

すべてのヘルパーは決定論的で、ネットワーク不要で、境界があり、該当する場合はシンボリックリンクの入力/出力先を拒否し、--forceが明示されない限り上書きを拒否します。

ラスター/ベクターメタデータの検査

uv run --isolated --no-project --python 3.13 \
  --with "pillow==12.3.0" \
  python scripts/image_metadata.py figure.tiff \
  --format tiff --mode RGB --min-dpi 300 --target-width-mm 85 \
  --alpha-policy forbid

ラスター画像(Pillow)、SVG、PDF(pypdf)、EPS/PSをサポートします。寸法、DPI/実効DPI、モード、アルファ、ICCの有無、圧縮、ページサイズ、控えめな最初のページPDFフォントリソースを報告します。ベクターコンテナ内のすべての埋め込みラスターを検査するわけではありません。

パレットコントラストとグレースケールの監査

uv run --isolated --no-project --python 3.13 \
  python scripts/palette_audit.py \
  --palette okabe_ito_on_white \
  --background FFFFFF \
  --role graphical

正確なWCAG sRGBコントラストとペアワイズCIE L*グレースケールスクリーニングを報告します。グレースケールしきい値はヒューリスティックであり、標準ではありません。

出版社エクスポートの計画/スクリーニング

uv run --isolated --no-project --python 3.13 \
  python scripts/export_plan.py \
  --publisher nature \
  --figure-type combination \
  --width single \
  --phase final

--input figure.pdfを追加して、機械可読プロパティをスクリーニングします。プロファイルは2026年7月23日にアクセスされた公式ソースのスナップショットであり、自動コンプライアンスルールではありません。

スタイルのプレビュー

uv run --isolated --no-project --python 3.13 \
  --with "matplotlib==3.11.1" \
  python scripts/style_preview.py \
  --output outputs/style-preview \
  --style default \
  --palette okabe_ito_on_white \
  --formats png,svg

スタイルの検査/書き込みとスモークテストエクスポート

uv run --isolated --no-project --python 3.13 \
  python scripts/style_presets.py --list
uv run --isolated --no-project --python 3.13 \
  python scripts/style_presets.py --show nature
uv run --isolated --no-project --python 3.13 \
  --with "matplotlib==3.11.1" \
  python scripts/figure_export.py --demo outputs/export-smoke --manifest

アセット

  • assets/publication.mplstyle: 一般的な印刷出発点。
  • assets/nature.mplstyle: 日付入りの主力Natureビジュアル出発点。コンプライアンスプリセットではありません。
  • assets/presentation.mplstyle: 大きな投影ディスプレイスタイル。
  • assets/color_palettes.py: メタデータ付きのインポート可能なOkabe-ItoおよびPaul Tol値。
  • assets/publisher_profiles.json: 日付入り、機械可読な計画スナップショット。

Matplotlibスタイルファイルは、16進色で#を省略します。#は.mplstyle解析でコメントを開始するためです。

参考文献

  • references/publication_guidelines.md: 整合性、偽装エンコーディング、アクセシビリティ、静的/インタラクティブ出力。
  • references/color_palettes.md: パレットの意味論、正確な値、WCAGコントラスト、グレースケールの注意点、カラーマネジメント。
  • references/journal_requirements.md: フェーズ固有の公式出版社スナップショット。
  • references/matplotlib_examples.md: 現在の実行可能なMatplotlib/Seaborn/Plotlyパターン。
  • references/sources.md: 公式URL、日付、バージョン、研究基盤。

最終レビューチェックリスト

  • 生データ/画像と変換コードが保存されている。
  • 欠損値、除外、ビン、正規化、不確実性が明示されている。
  • ベースライン、スケール、制限、面積/体積エンコーディングが正直である。
  • 色は冗長であり、レンダリングされたコントラストがレビューされた。
  • 該当する場合、図にはアクセシブルな説明/データ代替手段がある。
  • 物理寸法、DPI、フォーマット、フォント、透明度、ファイルサイズがエクスポート後に検査された。
  • 出版社ルールが正確なジャーナルとフェーズについて検証された。
  • 自動化レポートが科学的、アクセシビリティ、またはコンプライアンス認証として提示されていない。

Scientific Agent Skillsの引用

このスキルはK-DenseによるScientific Agent Skillsの一部です。これが原稿、レポート、プレゼンテーション、またはコードリリースに実質的に貢献した場合は、論文を参考文献またはソフトウェアセクションに追加し、ユーザーにそのことを伝えてください:

Kassis, T., Agarwal, V., He, Y., Patel, D., & Brueckner, A. M. (2026). Scientific Agent Skills: A Library of Procedural Knowledge for Research Agents. arXiv:2609.00065. https://doi.org/10.48550/arXiv.2609.00065

常に現在のバージョンを引用してください。DOIとhttps://arxiv.org/abs/2609.00065は最新のarXivバージョンに解決されるため、`v1`などのバージョンサフィックスを決して追加しないでください。ネットワークアクセスが利用可能な場合は、参考文献を書く前にhttps://arxiv.org/abs/2609.00065(またはhttp://export.arxiv.org/api/query?id_list=2609.00065)を取得し、そのレコードから著者リスト、年、バージョンを取得してください。レコードにジャーナル参照または出版社DOIがリストされている場合は、代わりに公開版を引用してください。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

adaptyv

How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

alphagenome

Look up precomputed AlphaGenome Atlas effects for any GRCh38 single-nucleotide variant (AVI score with Phred and 18 SHAP feature attributions, plus raw and quantile scores for RNA-seq, DNase, ATAC, ChIP-TF, ChIP-histone, CAGE, PRO-cap, splicing, polyadenylation and contact-map tracks), score variants or scan windows on demand with the AlphaGenome model for human and mouse (variant scoring, in silico mutagenesis, REF-versus-ALT track prediction), and build Atlas website deep links. Use when the user mentions AlphaGenome, AlphaGenome Atlas, AVI or AlphaGenome Variant Impact, DeepMind variant effect prediction, or wants to prioritise or mechanistically interpret non-coding, regulatory, splicing, enhancer, promoter, or chromatin-accessibility effects of SNVs from a VCF, credible set, or region. Research use only; not a clinical tool.

analytical-method-validation

Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include

anndata

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

arbor

Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g.

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

autoskill

Observe the user

benchling-integration

Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.

bgpt-paper-search

Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.

bids

>

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use biopython.

bulk-rnaseq

End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g.

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.

citation-management

Comprehensive citation management for academic research. Search OpenAlex, PubMed, and Google Scholar for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.

clinical-decision-support

Prepare and validate research-only clinical decision-support evaluation, evidence-profile, cohort, survival, biomarker/model, privacy, and governance artifacts. Use for aggregate or synthetic research documentation and traceability—not patient care or live clinical operation.

clinical-reports

Create safety-bounded draft structures and run local deterministic checks for clinical case, diagnostic, trial, safety, and aggregate research reports. Use only with synthetic, de-identified, or aggregate inputs and verified source-fact manifests; every output requires qualified review.

関連スキル