risk-stratification-and-prognosis-indexing
Summary
Compute personalized survival risk scores and stratify samples into prognostic groups using Cox proportional hazards models (Cox-PH or deep-learning Cox-nnet) applied to metabolomic or expression data paired with event/time vectors. This skill transforms continuous survival predictions into categorical risk strata for clinical decision-making.
When to use
When you have paired survival data (event indicator and follow-up time vectors), expression or metabolomic feature matrices, and need to generate individual prognosis indices and assign samples to risk groups for downstream prognostic classification or treatment planning.
When NOT to use
- Input expression/metabolomic data is already a pre-computed risk score or prognosis index—apply this skill to raw features, not derived scores.
- Survival event/time vectors are missing or incomplete; Cox models require complete pairs for all samples.
- The cohort has very few events (n < 10–20 events); Cox models may overfit and cross-validation will be unstable.
Inputs
- Survival event vector (binary: event occurred or censored)
- Survival time vector (numeric: follow-up duration)
- Expression data matrix or metabolomic feature matrix (rows=samples, columns=features)
- Optional: percent threshold for feature selection
- Optional: cvlambda for lambda tuning in cross-validation
Outputs
- Prognosis index (continuous risk scores, one per sample)
- Risk group assignments (categorical, typically stratified by quantile)
- Sample identifiers paired with prognosis indices and risk groups
- Survival predictions at metabolite and pathway levels
How to apply
Load survival event/time vectors and expression/metabolomic data into the lilikoi.prognosis function with specified hyperparameters: alpha (regularization strength; 0 for no penalty), nfold (cross-validation folds, typically 5), method (e.g., 'quantile' for risk stratification), and coxnnet flag (TRUE for deep-learning Cox-nnet; FALSE for classical Cox-PH). The function applies gradient-based optimization with the selected Cox model to compute continuous prognosis indices (risk scores) at both metabolite and pathway levels. Extract the prognosis index and predicted risk groups for each sample. Validate that risk groups show stratified survival curves and that the cross-validation fold count and regularization parameter are documented.
Related tools
- Lilikoi v2.0 (Implements the lilikoi.prognosis function for Cox-PH and Cox-nnet prognosis prediction with hyperparameter tuning and risk stratification) — https://github.com/lanagarmire/lilikoi2
- Cox-PH (Classical Cox proportional hazards regression model for survival prediction)
- Cox-nnet (Deep-learning based Cox model using gradient-based optimization for nonlinear survival prediction)
- R (Programming environment for executing lilikoi prognosis workflows)
Examples
lilikoi.prognosis(event=survival_events, time=survival_times, exprdata=expr_matrix, alpha=0, nfold=5, method="quantile", coxnnet=TRUE, coxnnet_method="gradient")
Evaluation signals
- Prognosis index is numeric, continuous, and ranges plausibly (typically unbounded; check for outliers or NaNs).
- Risk group assignments are categorical and non-empty; group sizes are roughly balanced or reflect expected class prevalence.
- All input samples have a corresponding prognosis index and risk group assignment (no missing values after execution).
- Kaplan–Meier survival curves for each risk group are visibly stratified with non-overlapping confidence intervals and significant log-rank test (p < 0.05).
- Cross-validation folds are balanced and reported; alpha and nfold parameters match the invocation and are documented.
Limitations
- Requires complete survival event and time pairs; samples with missing event or time data must be removed before analysis.
- Cox models assume proportional hazards; check assumption violation using residual diagnostics (e.g., Schoenfeld residuals); if violated, consider stratified or time-varying coefficient models.
- Deep-learning Cox-nnet may overfit on small cohorts (n < 100–200 samples); cross-validation and regularization (alpha parameter) are essential.
- Risk stratification is data-driven (quantile-based); group cutoffs may not be reproducible or clinically meaningful across independent cohorts.
- No changelog or version compatibility matrix provided; reproducibility may require pinning to a specific Lilikoi v2.0 release.
Evidence
- [other] Cox-nnet integration and prognosis function hyperparameters: "The lilikoi.prognosis function accepts survival event and time vectors, expression data, regularization parameter alpha (0 for no penalty), cross-validation fold count (nfold=5), prognosis index"
- [intro] Core prognosis prediction capability: "the most significant addition of prognosis prediction, implemented by Cox-PH model and the deep-learning based Cox-nnet model"
- [readme] Lilikoi v2.0 design and scope: "The new Lilikoi v2 R package has implemented a deep-learning method for classification, in addition to popular machine learning methods. It also has several new modules, including the most"
- [readme] Lilikoi prognosis function signature and workflow: "lilikoi.prognosis(event, time, exprdata, percent=percent, alpha=0, nfold=5, method="quantile", cvlambda=cvlambda,python.path=NULL,coxnnet=FALSE,coxnnet_method="gradient")"
- [other] Output and results structure: "Extract the prognosis index (risk scores) and survival predictions for each sample. 4. Generate a results table containing sample identifiers, prognosis indices, and predicted risk groups"
1---2name: risk-stratification-and-prognosis-indexing3description: Use when when you have paired survival data (event indicator and follow-up time vectors), expression or metabolomic feature matrices, and need to generate individual prognosis indices and assign samples to risk groups for downstream prognostic classification or treatment planning.4license: CC-BY-4.05---67# risk-stratification-and-prognosis-indexing89## Summary1011Compute personalized survival risk scores and stratify samples into prognostic groups using Cox proportional hazards models (Cox-PH or deep-learning Cox-nnet) applied to metabolomic or expression data paired with event/time vectors. This skill transforms continuous survival predictions into categorical risk strata for clinical decision-making.1213## When to use1415When you have paired survival data (event indicator and follow-up time vectors), expression or metabolomic feature matrices, and need to generate individual prognosis indices and assign samples to risk groups for downstream prognostic classification or treatment planning.1617## When NOT to use1819- Input expression/metabolomic data is already a pre-computed risk score or prognosis index—apply this skill to raw features, not derived scores.20- Survival event/time vectors are missing or incomplete; Cox models require complete pairs for all samples.21- The cohort has very few events (n < 10–20 events); Cox models may overfit and cross-validation will be unstable.2223## Inputs2425- Survival event vector (binary: event occurred or censored)26- Survival time vector (numeric: follow-up duration)27- Expression data matrix or metabolomic feature matrix (rows=samples, columns=features)28- Optional: percent threshold for feature selection29- Optional: cvlambda for lambda tuning in cross-validation3031## Outputs3233- Prognosis index (continuous risk scores, one per sample)34- Risk group assignments (categorical, typically stratified by quantile)35- Sample identifiers paired with prognosis indices and risk groups36- Survival predictions at metabolite and pathway levels3738## How to apply3940Load survival event/time vectors and expression/metabolomic data into the lilikoi.prognosis function with specified hyperparameters: alpha (regularization strength; 0 for no penalty), nfold (cross-validation folds, typically 5), method (e.g., 'quantile' for risk stratification), and coxnnet flag (TRUE for deep-learning Cox-nnet; FALSE for classical Cox-PH). The function applies gradient-based optimization with the selected Cox model to compute continuous prognosis indices (risk scores) at both metabolite and pathway levels. Extract the prognosis index and predicted risk groups for each sample. Validate that risk groups show stratified survival curves and that the cross-validation fold count and regularization parameter are documented.4142## Related tools4344- **Lilikoi v2.0** (Implements the lilikoi.prognosis function for Cox-PH and Cox-nnet prognosis prediction with hyperparameter tuning and risk stratification) — https://github.com/lanagarmire/lilikoi245- **Cox-PH** (Classical Cox proportional hazards regression model for survival prediction)46- **Cox-nnet** (Deep-learning based Cox model using gradient-based optimization for nonlinear survival prediction)47- **R** (Programming environment for executing lilikoi prognosis workflows)4849## Examples5051```52lilikoi.prognosis(event=survival_events, time=survival_times, exprdata=expr_matrix, alpha=0, nfold=5, method="quantile", coxnnet=TRUE, coxnnet_method="gradient")53```5455## Evaluation signals5657- Prognosis index is numeric, continuous, and ranges plausibly (typically unbounded; check for outliers or NaNs).58- Risk group assignments are categorical and non-empty; group sizes are roughly balanced or reflect expected class prevalence.59- All input samples have a corresponding prognosis index and risk group assignment (no missing values after execution).60- Kaplan–Meier survival curves for each risk group are visibly stratified with non-overlapping confidence intervals and significant log-rank test (p < 0.05).61- Cross-validation folds are balanced and reported; alpha and nfold parameters match the invocation and are documented.6263## Limitations6465- Requires complete survival event and time pairs; samples with missing event or time data must be removed before analysis.66- Cox models assume proportional hazards; check assumption violation using residual diagnostics (e.g., Schoenfeld residuals); if violated, consider stratified or time-varying coefficient models.67- Deep-learning Cox-nnet may overfit on small cohorts (n < 100–200 samples); cross-validation and regularization (alpha parameter) are essential.68- Risk stratification is data-driven (quantile-based); group cutoffs may not be reproducible or clinically meaningful across independent cohorts.69- No changelog or version compatibility matrix provided; reproducibility may require pinning to a specific Lilikoi v2.0 release.7071## Evidence7273- [other] Cox-nnet integration and prognosis function hyperparameters: "The lilikoi.prognosis function accepts survival event and time vectors, expression data, regularization parameter alpha (0 for no penalty), cross-validation fold count (nfold=5), prognosis index"74- [intro] Core prognosis prediction capability: "the most significant addition of prognosis prediction, implemented by Cox-PH model and the deep-learning based Cox-nnet model"75- [readme] Lilikoi v2.0 design and scope: "The new Lilikoi v2 R package has implemented a deep-learning method for classification, in addition to popular machine learning methods. It also has several new modules, including the most"76- [readme] Lilikoi prognosis function signature and workflow: "lilikoi.prognosis(event, time, exprdata, percent=percent, alpha=0, nfold=5, method="quantile", cvlambda=cvlambda,python.path=NULL,coxnnet=FALSE,coxnnet_method="gradient")"77- [other] Output and results structure: "Extract the prognosis index (risk scores) and survival predictions for each sample. 4. Generate a results table containing sample identifiers, prognosis indices, and predicted risk groups"