bulkrna-survival
БесплатноБез исполняемых скриптовНе проверенLoad when stratifying patients by gene expression and testing for survival differences (Kaplan-Meier + Cox) in bulk RNA-seq. Skip if no time-to-event clinical…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
bulkrna-survival
When to use
Run on a bulk RNA-seq cohort with paired clinical survival data (time-to-event + censoring) when you want to ask "does high vs low expression of gene X predict survival?". Default workflow: per-gene median-cutoff stratification, log-rank p-value, Kaplan-Meier curve, and Cox proportional-hazards hazard ratio.
Inputs & Outputs
| Input | Format | Required |
|---|---|---|
| Expression matrix | .csv (gene × sample) |
yes (or --demo) |
| Clinical data | .csv (sample, time, event cols) via --clinical |
yes (or --demo) |
| Genes to test | --genes TP53,BRCA1 (comma-separated) |
optional, defaults to all in expression matrix |
| Output | Path | Notes |
|---|---|---|
| Per-gene survival stats | tables/survival_results.csv |
columns: gene, cutoff, n_high, n_low, hazard_ratio, log_rank_chi2, log_rank_pval, median_survival_high, median_survival_low |
| KM curves | figures/km_<gene>.png |
one per gene tested |
| Forest plot | figures/forest_plot.png |
HR + CI across genes |
| Report | report.md + result.json |
summary contains n_genes and per-gene results array (bulkrna_survival.py:153-160) |
Flow
- Load expression matrix + clinical data; align by sample ID.
- For each gene in
--genes(or all):- Skip with warning at
bulkrna_survival.py:630if gene not in expression matrix. - Stratify samples by
--cutoff-method(defaultmedian; altoptimalfinds the maxstat cut). - Run log-rank test on the stratified groups.
- Compute a simple events/time hazard ratio. Warn at
:326("Heavy censoring (X%). KM tail estimates may be unreliable.") when the censoring rate exceeds 80%.
- Skip with warning at
- Try R
survivalpackage first; fall back to Pythonlifelines(:626warns "R survival not available (...); using Python fallback."). - Render KM curves + forest plot; emit
tables/survival_results.csv.
Gotchas
- Genes not in the expression matrix are silently skipped.
bulkrna_survival.py:630logs a warning per missing gene and continues. After the run, count the rows intables/survival_results.csv(or inspectresult.json["results"]) and compare against the--geneslist — a typo'd or wrong-namespace gene produces no obvious error. --cutoff-method optimalp-values are NOT corrected for multiple testing. Theoptimalcutoff scans all possible cuts and picks the maximally separating one, which inflates Type I error. Reported log-rank p-values are raw — apply Bonferroni / BH correction externally if you scan many genes.- The hazard ratio is a simple events/person-time ratio, not a Cox MLE. The script computes
(events_high / time_high) / (events_low / time_low)(bulkrna_survival.py:328-333), not a Cox proportional-hazards regression coefficient. This estimator is biased when proportional-hazards holds with unequal exposure — for publication-grade HRs, re-fit a proper Cox model in R orlifelinesagainst the same stratification. - R-vs-Python backend silently switches.
:626warns and falls back to a NumPy log-rank implementation when Rsurvivalisn't importable; the per-gene HR estimator is the same simple events/time ratio in both cases, but the chosen backend isn't recorded in the summary dict — only in the warning log. Verify R availability before relying on the result for downstream papers. - Heavy censoring distorts KM tail estimates.
:326fires when ≥80% of patients are censored; the printed median survival numbers are dominated by extrapolation past the last event time. Treatmedian_survival_*as "≥ X" rather than a point estimate when the corresponding gene's censoring rate is high.
Key CLI
python omicsclaw.py run bulkrna-survival --demo
python omicsclaw.py run bulkrna-survival \
--input expression.csv --clinical clinical.csv \
--genes TP53,BRCA1,EGFR --output results/
python omicsclaw.py run bulkrna-survival \
--input expression.csv --clinical clinical.csv \
--genes TP53 --cutoff-method optimal --output results/
See also
references/parameters.md— every CLI flag and tuning hintreferences/methodology.md— KM + log-rank + Cox theory, R vs Python backend differences, optimal-cutoff caveatsreferences/output_contract.md— exact output directory layout- Adjacent skills:
bulkrna-de(parallel: differential expression — survival adds the time-to-event dimension),bulkrna-coexpression(parallel: module-level survival via eigengene if traits include time-to-event)
Установить bulkrna-survival в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл bulkrna-survival?
Load when stratifying patients by gene expression and testing for survival differences (Kaplan-Meier + Cox) in bulk RNA-seq. Skip if no time-to-event clinical data exists, or for non-bulk cohorts (single-cell / spatial survival is not supported).
Как установить скилл bulkrna-survival?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bulkrna-survival запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic