Immune Pathway Analysisのロゴ

Immune Pathway Analysis

組織人気
aipoch
immune-pathway-analysis

Run immune pathway GSVA or ssGSEA analysis from a bulk expression matrix, a sample group file, and a local immune Reactome gene-set table, then export differential pathway results and a heatmap for two-group comparison.

概要

公開者aipoch
リポジトリmedical-research-skills
スキル名immune-pathway-analysis
スター
1.9K
フォーク
175
同梱ファイル
19
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 19個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    aipochがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Immune Pathway Analysis」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/aipoch/medical-research-skills/tree/main/awesome-med-research-skills/Data%20Analysis/immune-pathway-analysis
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。

TypingMindで使用

TypingMindのチャットでImmune Pathway Analysisを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にImmune Pathway Analysisを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Immune Pathway Analysisは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Source: https://github.com/aipoch/medical-research-skills

Immune Pathway Analysis

When to Use

Use this skill when the goal is to quantify immune-related pathway activity from bulk expression data and compare pathway enrichment between two sample groups.

Typical requests:

  • "Run immune pathway GSVA for these samples."
  • "Score immune Reactome pathways and compare case versus control."
  • "Generate an immune pathway heatmap from a saved result."
  • "Use a local immune gene-set table for pathway scoring."

This skill is appropriate for:

  • Bulk RNA-seq or microarray-like expression matrices
  • Local immune Reactome gene-set tables prepared in advance
  • Two-group pathway differential analysis with limma
  • Reproducible CLI execution with append-only provenance files

Execution Model

This is a hybrid skill.

  1. Confirm the request is in scope with this SKILL.md.
  2. Ask only for missing file paths or missing group labels.
  3. Run scripts/main.R with the appropriate mode.
  4. Use --mode analyze to score pathways and export tables.
  5. Use --mode visualize to regenerate a heatmap from a saved result object.
  6. Use --mode full to run analysis and visualization in one pass.
  7. Read reference files only when you need deeper algorithm, troubleshooting, or CLI details.
  8. After execution, report the output directory, scoring method, comparison groups, and the primary output files.

Completion Format

After a successful run, summarize the outcome in 3 short parts:

  1. Mode and method used, plus the compared groups.
  2. Output directory and key files written.
  3. Important warnings that affect interpretation, such as no pathways meeting fdr_threshold and fallback to |t| ranking.

Example completion summary:

Completed immune pathway analysis in ./output/run_001 using gsva for Case versus Control. Key outputs: table/immune_pathway_diff.csv, table/immune_pathway_scores.csv, data/immune_pathway_result.rds, and plot/immune_pathway_heatmap.pdf. No pathways passed FDR <= 0.05, so the workflow used the documented fallback ranking by |t| for the top-pathway export and heatmap subset.

When to Read External Files

SituationFile to ReadPurpose
Need method details or interpretation guidancereferences/algorithm.mdReview GSVA logic, limma comparison, and interpretation guidance
Need runnable commands or dependency setupreferences/cli-guide.mdReuse CLI examples, fixture notes, and validated baseline records
Need error remediationreferences/troubleshooting.mdMap error codes, fallback behavior, and common fixes
Need the executable workflowscripts/main.RUse the CLI entry point
Need minimal demo inputstests/data/Use the bundled example expression, group, and gene-set files

When Not to Use

  • Immune cell fraction estimation or deconvolution
  • Gene-level differential expression without pathway scoring
  • Single-cell clustering, annotation, or communication analysis
  • Clinical diagnosis or treatment selection

If the request falls outside these boundaries, stop and state that this skill only covers bulk immune pathway GSVA or ssGSEA analysis from a local immune gene-set table.

Input Validation

This skill accepts:

  • A bulk expression matrix in CSV or TSV format
  • A sample group file with exactly two comparison groups for analysis mode
  • A local immune gene-set table in long format
  • An existing output directory containing data/immune_pathway_result.rds for visualize mode

If the user's request does not involve bulk immune pathway scoring from local files, do not proceed with the workflow. Instead respond:

"Immune Pathway Analysis is designed for bulk immune pathway GSVA or ssGSEA analysis from a local gene-set table. Your request appears to be outside this scope. Please provide a bulk expression matrix, a two-group sample file, and a local pathway table, or use a more appropriate skill for deconvolution, differential expression, or single-cell analysis."

If the request is in scope but required inputs are missing, ask only for the missing file paths or group labels before running scripts/main.R.

Usage

bash
Rscript scripts/main.R \
  --mode full \
  --input_file ./expression_matrix.csv \
  --group_file ./group_info.csv \
  --geneset_file ./immune_genesets.csv \
  --case_group Case \
  --control_group Control \
  --output_dir ./output/run_001 \
  --seed 42

Arguments

ShortLongTypeDefaultDescription
-m--modecharacteranalyzeRun mode: analyze, visualize, or full
-i--input_filecharacterrequired for analyze or fullExpression matrix file in CSV or TSV format
-g--group_filecharacterrequired for analyze or fullSample group file in CSV or TSV format
--geneset_filecharacterrequired for analyze or fullLocal immune gene-set table in long format
--geneset_columncharactergs_namePathway column in the gene-set table
--gene_columncharactergene_symbolGene symbol column in the gene-set table
--focus_genesetscharacteroptionalComma-separated pathway names to prioritize in the heatmap
-a--case_groupcharacterrequired for analyze or fullCase group label
-c--control_groupcharacterrequired for analyze or fullControl group label
-o--output_dircharacter./outputOutput directory inside this skill folder
--methodcharactergsvaScoring method: gsva or ssgsea
--kcdfcharacterGaussianGSVA kernel: Gaussian, Poisson, or none
--min_szinteger2Minimum gene-set size
--max_szinteger5000Maximum gene-set size
--parallel_szinteger1Worker count passed to GSVA::gsva
--mx_difflogicalTRUEGSVA mx.diff flag
--taudouble1GSVA tau value
--fdr_thresholddouble0.05FDR threshold for significance summaries
--top_ninteger20Maximum number of pathways exported to the top-score matrix
--seedinteger42Random seed
--timeout_secondsinteger0Optional timeout in seconds; 0 disables timeout
--plot_filecharacterimmune_pathway_heatmap.pdfHeatmap file name stored under plot/
--plot_titlecharacterImmune Pathway GSVA HeatmapHeatmap title
--widthdouble14Heatmap width in inches
--heightdouble8Heatmap height in inches
--colorscharacter#91bfdb,#ffffbf,#fc8d59Comma-separated heatmap colors
--scalecharacternoneHeatmap scale mode: none, row, or column
--cluster_rowslogicalTRUECluster heatmap rows
--cluster_colslogicalFALSECluster heatmap columns
--show_rownameslogicalTRUEShow pathway names on the heatmap
--show_colnameslogicalFALSEShow sample names on the heatmap
--fontsizedouble10Base heatmap font size
--fontsize_rowdouble8Heatmap row font size
--fontsize_coldouble9Heatmap column font size
--legend_cexdouble1Legend text scaling factor
--top_upintegeroptionalNumber of up-regulated pathways kept for plotting
--top_downintegeroptionalNumber of down-regulated pathways kept for plotting
--top_modecharacterbothHeatmap subset mode: both, up, down, or total
--sort_bycharacterFDRPathway ranking: FDR, absLFC, or LFC
--append_statslogicalFALSEAppend FDR and logFC to heatmap labels
--label_max_charsinteger90Maximum heatmap label length

Input Format

Expression Matrix

  • CSV or TSV file
  • The first column contains gene identifiers
  • Remaining columns are sample names
  • Values must be numeric
  • Missing values are not allowed

Group File

  • CSV or TSV file with a header
  • Supported sample column names: sample, sample_name, sample_id, sampleid
  • Supported group column names: group, condition, class, cluster
  • Sample names must match the expression matrix columns

Gene-Set Table

  • CSV or TSV file in long format
  • One row per gene-to-pathway mapping
  • Must contain a pathway column and a gene column
  • Default column names are gs_name and gene_symbol
  • Alternate schemas are supported through --geneset_column and --gene_column

Output Files

FileDescription
table/immune_pathway_diff.csvDifferential pathway results from limma
table/immune_pathway_scores.csvFull GSVA or ssGSEA score matrix
table/immune_pathway_scores_top.csvTop pathway score matrix selected from the differential results
table/immune_gene_set_summary.csvPer-pathway gene counts after table parsing
data/immune_pathway_result.rdsSaved analysis object used by visualize mode
plot/immune_pathway_heatmap.pdfHeatmap PDF generated in visualize or full mode
session_info.txtR session and package version record
output_manifest.txtAppend-only output manifest
run_record.txtAppend-only run record

When no pathways pass the selected fdr_threshold, the workflow logs a warning and falls back to ranking pathways by |t|. In that case, table/immune_pathway_scores_top.csv can still be populated for downstream plotting and review.

Error Handling

Error CodeMeaningSolution
SKILL_FILE_NOT_FOUNDAn input file or saved result object does not existCheck the path and rerun
SKILL_MISSING_COLUMNSThe group file or gene-set table lacks required columnsRename the columns or export the correct table
SKILL_EMPTY_DATAThe matrix, gene-set list, or plotting matrix is emptyCheck the input content, gene overlap, and selected gene-set columns
SKILL_INVALID_PARAMETERA CLI value is missing, invalid, or unsafeReview the argument table and rerun
SKILL_SAMPLE_MISMATCHSamples do not align between the matrix and group fileAlign sample names before rerunning
SKILL_PACKAGE_NOT_FOUNDRequired R packages are missingInstall the packages listed in references/cli-guide.md
SKILL_VERSION_INCOMPATIBLEInstalled package versions are a known incompatible combinationFollow the version guidance in references/cli-guide.md and rerun

Read references/troubleshooting.md if the error persists.

Testing

  • Minimal runnable files are bundled in tests/data/.
  • The bundled smoke-test dataset is intended to validate execution and the fallback path. It may legitimately produce zero pathways with FDR <= 0.05.
  • tests/data/immune_genesets_minimal.csv is a unit-test fixture, not a drop-in full-workflow demo with tests/data/expression_matrix.csv unless you prepare a matching matrix with overlapping genes.
  • Use Rscript tests/run_unit_tests.R to run boundary checks, helper-function checks, and validation tests without the full GSVA workflow.
  • Use Rscript tests/run_tests.R to execute the unit checks plus the full smoke-test workflow.
  • Use Rscript tests/test_skill.R tests/output to validate the expected outputs.
  • The validated test baseline, package versions, fixture notes, and custom-column CLI examples are documented in references/cli-guide.md.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Immune Pathway Analysis」では何ができますか?

Run immune pathway GSVA or ssGSEA analysis from a bulk expression matrix, a sample group file, and a local immune Reactome gene-set table, then export differential pathway results and a heatmap for two-group comparison.

TypingMindでImmune Pathway Analysisを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Immune Pathway Analysisはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにImmune Pathway Analysisをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/aipoch/medical-research-skills/tree/main/awesome-med-research-skills/Data%20Analysis/immune-pathway-analysisを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Immune Pathway Analysisを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Immune Pathway Analysisで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもImmune Pathway Analysisを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Immune Pathway Analysis」は無料ですか?

はい。aipochがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇