本文へ移動
cccskills
無料GitHub で公開

ssgsea-immune-infiltration-analysis

Use when estimating immune infiltration from bulk RNA-seq expression matrices with ssGSEA/GSVA, comparing case versus control groups, and generating downstream immune-score visualizations. NOT for single-cell RNA-seq, absolute cell proportion estimation, or clinical decision making.

インストール方法を見る

含まれるファイル(17)

  • SKILL.md6.8 KB
  • eval_report_ssgsea-immune-infiltration-analysis_result.json13.3 KB
  • references/algorithm.md1.4 KB
  • references/cli-guide.md7.3 KB
  • references/troubleshooting.md2.2 KB
  • scripts/cli_options.R3.7 KB
  • scripts/functions.R3.6 KB
  • scripts/io.R5.2 KB
  • scripts/main.R1.5 KB
  • scripts/recording.R1023 B
  • scripts/run_analysis.R7.5 KB
  • scripts/utils.R2.8 KB
  • scripts/visualization.R4.1 KB
  • tests/data/expression_matrix.csv24.4 MB
  • tests/data/group_info.csv2.7 KB
  • tests/data/immune_gene_sets.csv27.6 KB
  • tests/run_tests.R3.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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

ssGSEA Immune Infiltration Analysis

When to Use

  • Estimate relative immune infiltration from a bulk RNA-seq expression matrix.
  • Compare immune enrichment scores between one case group and one control group.
  • Generate structured result tables plus optional PDF visualizations for downstream review.

When Not to Use

  • Single-cell RNA-seq or spatial transcriptomics.
  • Absolute immune cell proportion estimation or deconvolution.
  • Clinical diagnosis, treatment recommendation, or any other medical decision making.

Workflow

  1. Confirm that the expression matrix, group file, and gene-set file match the documented schemas.
  2. Run scripts/main.R with the target case and control groups.
  3. Review run_record.txt, output_manifest.txt, and the generated tables or plots.
  4. If execution fails, read references/troubleshooting.md before retrying.

When to Read External Files

SituationFile to ReadPurpose
Need to run the analysisscripts/main.RCLI entry point
Need algorithm detailsreferences/algorithm.mdMethod assumptions and interpretation
Encounter an errorreferences/troubleshooting.mdError codes and fixes
Need CLI examples or baseline execution detailsreferences/cli-guide.mdExamples and recorded run details
Need dependency declarationsDESCRIPTIONPackage list and Bioconductor source note
Need test commandstests/run_tests.REnd-to-end test entry

Usage

Rscript scripts/main.R \
  --input_file ./expression_matrix.csv \
  --group_file ./group_info.csv \
  --gene_set ./immune_gene_sets.csv \
  --case_group treatment \
  --control_group control \
  --output_dir ./output \
  --method ssgsea \
  --seed 42

Validated path note:

  • ssgsea is the default validated path.
  • gsva is supported, but only with kernels validated in the local GSVA environment.
  • In the current audited environment, gsva with Gaussian completed successfully and is the documented baseline.

Arguments

ShortLongTypeDefaultDescription
-i--input_filefilerequiredExpression matrix with genes as rows and samples as columns
-g--group_filefilerequiredGroup annotation table
-e--gene_setfiletests/data/immune_gene_sets.csvImmune gene-set CSV
-a--case_groupstringrequiredCase group label
-b--control_groupstringrequiredControl group label
-o--output_dirdir./outputOutput directory
-m--methodstringssgseaGSVA method: ssgsea, gsva
-k--kcdfstringGaussianKernel mode: Gaussian, Poisson; Gaussian is the validated GSVA baseline
-n--min_szinteger2Minimum overlap genes per gene set
-x--max_szinteger10000Maximum genes per gene set
-p--parallel_szinteger2Requested parallel CPU count
-u--taunumeric0.25Tau parameter for ssGSEA
-d--mx_diffbooleantrueGSVA mx.diff switch
-c--gene_id_casestringupperGene ID normalization: asis, upper, lower
-s--seedinteger42Random seed
-t--timeout_secondsinteger0Optional timeout; 0 disables it
--sample_colstring/intnoneSample column name or 1-based index
--group_colstring/intnoneGroup column name or 1-based index
--make_plotsbooleantrueGenerate PDF plots
--verbosebooleantruePrint progress logs

Input Format

Expression Matrix

CSV or TSV. The first column must contain gene identifiers. Remaining columns are sample-level numeric expression values.

gene,Sample1,Sample2,Sample3
TP53,10.2,8.5,9.1
CXCL9,4.3,6.1,5.7

Group File

CSV or TSV with at least one sample column and one group column.

sample,group
Sample1,control
Sample2,treatment
Sample3,treatment

Gene Set File

CSV with gene and cell_type; immunity_class is optional.

gene,cell_type,immunity_class
CXCL9,Activated CD8 T cell,Adaptive
CD3D,Activated CD8 T cell,Adaptive

Output Files

FileDescription
data/ssgsea_list.rdsSerialized analysis result object
table/ssgsea_scores_long.csvLong-format immune infiltration scores
table/ssgsea_scores_wide.csvWide-format immune infiltration score matrix
table/ssgsea_group_compare.csvCase-vs-control comparison summary
table/immune_cell_correlation_matrix.csvImmune-cell Spearman correlation matrix
table/immune_cell_correlation_pvalue.csvCorrelation p-value matrix
plot/immune_cell_composition_sample.pdfSample-level composition plot; generated only when --make_plots=true
plot/immune_group_boxplot.pdfGroup comparison boxplot; generated only when --make_plots=true
plot/immune_correlation_heatmap.pdfImmune-cell correlation heatmap; generated only when --make_plots=true
plot/gene_immune_correlation_scatter_*.pdfAuto-selected gene-vs-cell scatter plot; generated only when --make_plots=true
run_record.txtStructured execution record
output_manifest.txtOutput file manifest with descriptions
session_info.txtR session information

Error Handling

ErrorCauseSolution
SKILL_FILE_NOT_FOUNDInput file path is invalidCheck file paths
SKILL_MISSING_COLUMNSRequired columns are absentFix the input schema
SKILL_EMPTY_DATANo usable rows, gene sets, or aligned samples remainCheck IDs and filters
SKILL_INVALID_PARAMETERCLI value is invalid or data is malformedReview arguments and file content
SKILL_SAMPLE_MISMATCHExpression and group samples do not alignHarmonize sample identifiers
SKILL_PACKAGE_NOT_FOUNDRequired R package is missingInstall the missing package
SKILL_TIMEOUTThe configured time limit was exceededIncrease --timeout_seconds or disable it with 0

Testing

Rscript scripts/main.R --help

Rscript tests/run_tests.R

Rscript tests/test_skill.R

tests/test_skill.R is self-contained: if expected outputs are absent, it first runs tests/run_tests.R and then validates both file presence and core result structure.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Transform lengthy academic papers into concise, structured 250-word abstracts.

日本語の概要は準備中です。原文の説明を表示しています。

aipoch/medical-research-skills1,9482026年9月17日 更新

Precision editing tool that reduces abstract word count through intelligent compression techniques, maintaining scientific rigor while meeting strict journal and conference requirements.

日本語の概要は準備中です。原文の説明を表示しています。

aipoch/medical-research-skills1,9482026年9月17日 更新

Refines long medical academic texts into SCI-style unstructured Chinese and English abstracts; use when you need to condense drafts/reports/summaries into bilingual abstracts and generate Summary_Report.md.

日本語の概要は準備中です。原文の説明を表示しています。

aipoch/medical-research-skills1,9482026年9月17日 更新

Generates submission-ready Elsevier/SCI Highlights from manuscript text or extracted PDF/DOCX/TXT content. Use when a user needs 3-5 concise, evidence-grounded highlight bullets for a research paper, review, meta-analysis, case report, or bioinformatics manuscript.

日本語の概要は準備中です。原文の説明を表示しています。

aipoch/medical-research-skills1,9482026年9月17日 更新

Generates complete FAERS pharmacovigilance study designs for multi-drug or class-level safety comparison inside one predefined SOC or AE family using active comparators, disproportionality analysis, subgroup characterization, and reviewer-facing evidence control.

日本語の概要は準備中です。原文の説明を表示しています。

aipoch/medical-research-skills1,9482026年9月17日 更新

Analyze data with `adme-property-predictor` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.

日本語の概要は準備中です。原文の説明を表示しています。

aipoch/medical-research-skills1,9482026年9月17日 更新

aipoch のスキルをすべて見る

このスキルの問題を報告する