Survival modeling wrapper for TreeSummarizedExperiment using coda_coxnet

getSurvival(x, ...)

# S4 method for class 'SummarizedExperiment'
getSurvival(
  x,
  time.col,
  status.col,
  assay.type = "counts",
  covar.cols = NULL,
  lambda = "lambda.1se",
  nvar = NULL,
  alpha = 0.9,
  nfolds = 10,
  showPlots = TRUE,
  coef_threshold = 0,
  ...
)

Arguments

x

A SummarizedExperiment object.

...

Optional arguments passed into mia::addDivergence().

time.col

Character scalar. Column name in colData(x) representing time to event or follow-up time. Must be numeric.

status.col

Character scalar. Column name in colData(x) representing event occurrence. Accepts numeric (0/1) or logical (FALSE/TRUE) values.

assay.type

Character scalar. Specifies which assay values are used in the dissimilarity estimation. (Default: "counts")

covar.cols

Character vector. Optional. Specifies covariate columns in colData(x) to adjust for in the survival model. (Default: NULL)

lambda

Character or numeric. Penalization parameter passed to cv.glmnet. Use "lambda.1se", "lambda.min", or a numeric value. (Default: "lambda.1se")

nvar

Integer scalar. Optional. Maximum number of variables (log-ratios) to include in the model. (Default: NULL)

alpha

Numeric scalar. Elastic net mixing parameter: 1 = Lasso, 0 = Ridge. (Default: 0.9)

nfolds

Integer scalar. Number of cross-validation folds for cv.glmnet. (Default: 10)

showPlots

Logical. If TRUE, generates plots for cross-validation, risk scores, and selected signature. (Default: TRUE)

coef_threshold

Numeric scalar. Minimum absolute value for a coefficient to be included in the final model. (Default: 0)

Value

A named list containing:

  • taxa.num: indices of selected taxa

  • taxa.name: names of selected taxa

  • log-contrast coefficients: coefficients of selected taxa in the final log-contrast model

  • risk.score: predicted risk scores

  • apparent Cindex: concordance index on training data

  • mean cv-Cindex: mean cross-validated concordance index

  • sd cv-Cindex: standard deviation of cross-validated concordance index

  • risk score plot: ggplot object showing risk score vs survival

  • signature plot: ggplot object of selected taxa and coefficients

Details

This function extracts compositional count data and survival metadata from a TreeSummarizedExperiment object and applies penalized Cox regression via coda_coxnet, using pairwise log-ratio transformations.

References

Meritxell Pujolassos , Antoni Susín , M.Luz Calle (2024). Microbiome compositional data analysis for survival studies NAR Genomics and Bioinformatics, 6(2), lqae038. doi:10.1093/nargab/lqae038

Examples

# data(SurvivalData)
# tse <- SurvivalData
# getSurvival(tse, time.col = "T1Dweek", status.col = "T1D", 
# covar.cols = c("Sex", "Antibiotics"))