Visualise survival analysis based on INCOMMON classes.
Source:R/plot_survival_analysis.R
plot_survival_analysis.Rd
Visualise survival analysis based on INCOMMON classes.
Usage
plot_survival_analysis(
x,
tumor_type,
gene,
cox_covariates = c("age", "sex", "tmb")
)
Arguments
- x
A list of objects of class
'INCOMMON'
containing the classification results for multiple samples, as produced by using functionclassify
.- tumor_type
The selected tumour type.
- gene
The selected gene.
- cox_covariates
A character vector listing the covariates to be used in the multivariarte regression.
Value
An object or a list of class 'ggplot2'
showing Kaplan-Meier curves and
Cox regression forest plot.
Examples
# First load example classified data
data(MSK_classified)
# Perform survival analysis based on the classification of KRAS mutant samples of pancreatic adenocarcinoma
MSK_classified = kaplan_meier_fit(x = MSK_classified, tumor_type = 'PAAD', gene = 'KRAS', survival_time = 'OS_MONTHS', survival_status = 'OS_STATUS')
#> ℹ There are 20289 different genotypes
#> ℹ The most abundant genotypes are:
#> • Mutant TP53 with LOH (562 Samples, Frequency 0.02)
#> • Mutant KRAS without AMP (199 Samples, Frequency 0.01)
#> • Mutant KRAS without AMP,Mutant TP53 with LOH (149 Samples, Frequency 0.01)
#> Call: survfit(formula = "survival::Surv(OS_MONTHS, OS_STATUS) ~ group",
#> data = data)
#>
#> 6 observations deleted due to missingness
#> n events median 0.95LCL 0.95UCL
#> KRAS WT 109 63 21.5 18.86 30.8
#> Mutant KRAS without AMP 940 565 17.2 15.74 19.4
#> Mutant KRAS with AMP 667 457 11.2 9.69 12.5
# Perform Cox regression
MSK_classified = cox_fit(x = MSK_classified, tumor_type = 'PAAD', gene = 'KRAS', survival_time = 'OS_MONTHS', survival_status = 'OS_STATUS', covariates = c('age', 'sex', 'tmb'), tmb_method = ">10")
#> Call:
#> survival::coxph(formula = formula %>% stats::as.formula(), data = data %>%
#> as.data.frame())
#>
#> coef exp(coef) se(coef) z p
#> groupMutant KRAS with AMP 0.41896 1.52039 0.13594 3.082 0.00206
#> groupMutant KRAS without AMP 0.13670 1.14649 0.13460 1.016 0.30980
#> AGE_AT_DEATH>68 -1.32060 0.26698 0.23843 -5.539 3.05e-08
#> AGE_AT_SEQUENCING>67 1.23185 3.42756 0.23771 5.182 2.19e-07
#> SEXMale 0.13644 1.14619 0.06167 2.213 0.02693
#> TMB_NONSYNONYMOUS> 10 0.56316 1.75621 0.26202 2.149 0.03161
#>
#> Likelihood ratio test=70.61 on 6 df, p=3.068e-13
#> n= 1066, number of events= 1066
#> (656 observations deleted due to missingness)
plot_survival_analysis(x = MSK_classified, tumor_type = 'PAAD', gene = 'KRAS')
#> Joining with `by = join_by(var)`
#> Joining with `by = join_by(var)`
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_rect()`).
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_point()`).
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_rect()`).
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_point()`).