Km Survival Curve

Use when generating Kaplan-Meier survival curves from tabular survival data containing time, event status, and a precomputed risk group. Supports command-line parameter input, parameter validation, automatic time-unit handling, single-file PDF figure export, and session metadata capture.

2,068 stars 206 forksData & Analytics

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add aipoch/medical-research-skills --skill km-survival-curve
Manual install
git clone --depth 1 https://github.com/aipoch/medical-research-skills.git /tmp/medical-research-skills
mkdir -p ~/.claude/skills
cp -r /tmp/medical-research-skills/awesome-med-research-skills/Data Analysis/km-survival-curve ~/.claude/skills/km-survival-curve

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)

# Kaplan-Meier Survival Curve Analysis

Use this skill to run Kaplan-Meier survival analysis on a tabular dataset and export a single PDF survival figure.

## Use This Skill When

- You need a Kaplan-Meier survival curve from a table containing time, status, and group columns.
- You need a command-line survival workflow with parameter validation.
- You need a single Kaplan-Meier plot as the final analysis result.

## Primary Command

```bash
Rscript scripts/main.R \
  --input_file <input_file> \
  --output_dir <output_dir> \
  --time_col <time_column> \
  --status_col <status_column> \
  --risk_col <group_column>
```

## Prerequisites

- `Rscript` is available in the shell.
- Required R packages: `optparse`, `data.table`, `survival`, `survminer`, `ggplot2`.
- Install missing packages with `Rscript -e 'install.packages(c("optparse", "data.table", "survival", "survminer", "ggplot2"), repos="https://cloud.r-project.org")'`.

## Core Arguments

| Argument | Required | Description |
|----------|----------|-------------|
| `--input_file` | Yes | Input data file in CSV or tab-delimited TXT/TSV format |
| `--output_dir` | No | Output directory, default `./KM_Results` |
| `--time_col` | No | Survival time column, default `futime` |
| `--status_col` | No | Event status column, default `fustat` |
| `--risk_col` | No | Risk group column, default `risk_group` |
Read the full skill on GitHub

Details

Skill name
km-survival-curve
Path
awesome-med-research-skills/Data Analysis/km-survival-curve/SKILL.md
License
MIT
Repo updated
17 September 2026

FAQ

What does the Km Survival Curve skill do?

Use when generating Kaplan-Meier survival curves from tabular survival data containing time, event status, and a precomputed risk group. Supports command-line parameter input, parameter validation, automatic time-unit handling, single-file PDF figure export, and session metadata capture.

How do I install the Km Survival Curve skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add aipoch/medical-research-skills --skill km-survival-curve. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Km Survival Curve popular?

It lives in aipoch/medical-research-skills, which has 2,068 GitHub stars and 206 forks.

Related skills

Clinicaltrials Database

2.1k

aipoch/medical-research-skills

Query ClinicalTrials.gov via API v2. Search trials by condition, drug, location, status, or phase. Retrieve trial details by NCT ID, export data, for clinical research and patient matching.

Research & Science206

Abstract Summarizer

2.1k

aipoch/medical-research-skills

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

Research & Science206

Abstract Trimmer

2.1k

aipoch/medical-research-skills

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

Research & Science206

Knn Imputation

2.1k

aipoch/medical-research-skills

Use when filtering genes with high missingness and then imputing missing values in a bulk expression matrix with group-aware KNN through DMwR2, where donor samples are restricted by one annotation column before imputation. For strata with 10 or fewer samples, the script falls back to row-wise direct filling with mean or median. NOT for: single-cell data, multi-column stratification, non-tabular inputs, network access, or interactive workflows.

Data & Analytics206

Immune Pathway Analysis

2.1k

aipoch/medical-research-skills

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.

Data & Analytics206

Lab Budget Forecaster

2.1k

aipoch/medical-research-skills

Use lab budget forecaster for data analysis workflows that need structured execution, explicit assumptions, and clear output boundaries.

Data & Analytics206

Browse the most popular Claude skills, all data & analytics skills, or write your own with the skills generator.