Skip to contents

Fit a Cox proportional hazards model for each variable in the expression data, and extract p-values and hazard ratios from it.

Usage

gly_cox(
  exp,
  time_col = "time",
  event_col = "event",
  p_adj_method = "BH",
  add_info = TRUE,
  ...
)

Arguments

exp

A glyexp::GlycomicSE() or glyexp::GlycoproteomicSE() object, or another SummarizedExperiment containing an expression matrix and sample information.

time_col

A character string specifying the column name in sample information that contains survival time. Default is "time".

event_col

A character string specifying the column name in sample information that contains event indicator (1 for event, 0 for censoring). Default is "event".

p_adj_method

A character string specifying the method to adjust p-values. See p.adjust.methods for available methods. Default is "BH". If NULL, no adjustment is performed.

add_info

A logical value. If TRUE (default), variable information from the experiment will be added to the result tibble. If FALSE, only the Cox model results are returned.

...

Additional arguments passed to survival::coxph().

Value

A list with three elements:

  • tidy_result: A tibble with Cox model results containing the following columns:

    • variable: Variable name

    • coefficient: Regression coefficient (log hazard ratio)

    • std.error: Standard error of the coefficient

    • statistic: Wald test statistic

    • p_val: Raw p-value from Wald test

    • hr: Hazard ratio (exp(coefficient))

    • p_adj: Adjusted p-value (if p_adj_method is not NULL)

  • raw_result: A list of raw coxph model objects.

  • meta_data: A list containing metadata from the input experiment

Details

The function fits an Cox proportional hazards model for each variable by:

coxph(Surv(time, event) ~ expression_value)

P-values are adjusted by Benjamini-Hochberg method by default.