$npx -y skills add ma-compbio-lab/SkillFoundry --skill lifelines-kaplan-meier-starterUse this skill to run a deterministic Kaplan-Meier survival analysis over a toy cohort and summarize per-group survival curves.
| 1 | # Lifelines Kaplan Meier Starter |
| 2 | |
| 3 | Use this skill to run a deterministic Kaplan-Meier survival analysis over a toy cohort and summarize per-group survival curves. |
| 4 | |
| 5 | ## What it does |
| 6 | |
| 7 | - Loads a tiny cohort table with durations, events, and group labels. |
| 8 | - Fits one Kaplan-Meier curve per group with `lifelines`. |
| 9 | - Returns compact JSON with median survival times and survival probabilities at fixed time points. |
| 10 | - Optionally renders a PNG survival plot. |
| 11 | |
| 12 | ## When to use it |
| 13 | |
| 14 | - You need a local starter for survival-analysis workflows. |
| 15 | - You want a verified template for grouped time-to-event data in Python. |
| 16 | |
| 17 | ## Example |
| 18 | |
| 19 | ```bash |
| 20 | slurm/envs/statistics/bin/python skills/clinical-biomedical-data-science/lifelines-kaplan-meier-starter/scripts/run_lifelines_kaplan_meier.py \ |
| 21 | --input skills/clinical-biomedical-data-science/lifelines-kaplan-meier-starter/examples/toy_survival_cohort.tsv \ |
| 22 | --summary-out scratch/lifelines/kaplan_meier_summary.json \ |
| 23 | --png-out scratch/lifelines/kaplan_meier_plot.png |
| 24 | ``` |
| 25 | |
| 26 | ## Verification |
| 27 | |
| 28 | - Skill-local tests: `python3 -m unittest discover -s skills/clinical-biomedical-data-science/lifelines-kaplan-meier-starter/tests -p 'test_*.py'` |
| 29 | - Repository smoke: `python3 -m unittest tests.smoke.test_phase25_agent_and_clinical_skills -v` |