R/predSurvCurve.R
predict_SurvCurve.Rd
This function computes the survival curve for a test patient based on their predicted risk score using a Cox proportional hazards model. It estimates the baseline survival function from training data and predicts the survival probability for the test patient at specified times.
predict_SurvCurve(
cox_pred_training,
mSurv,
cox_pred_test,
eval_surv_times = NULL
)
A numeric vector representing the predicted risk scores (or log-risk scores) from the Cox model for the training set. It can be obtained from *predict_PatientRisk* function.
A data frame with two columns: "time" representing survival times, and "status" representing the event status (1 for event, 0 for censored) for the training dataset.
A numeric vector of length 1 representing the predicted risk score (or log-risk score) for the test patient. It can be obtained from *predict_PatientRisk* function.
A numeric vector of times at which the survival curve should be evaluated. If NULL (default), the times will be taken from the training data up to the maximum event time.
A list containing:
- eval_times
: The times at which the survival curve is
evaluated.
- S_0_t
: The baseline survival function evaluated at the times
in eval_surv_times
.
- S_test_patient
: The survival curve for the test patient at the
times in eval_surv_times
.
This function calculates the baseline survival curve using the training data by first estimating the hazard function and cumulative hazard function. Then, it computes the survival probability for the test patient using the baseline survival function and the test patient's risk score. If the test patient's risk is associated with a hazard ratio greater than 1, the survival curve will decrease more rapidly. If `eval_surv_times` is provided, the curve is evaluated at those specific times; otherwise, the function uses the survival times from the training data.
martinezromero2018asuri BuenoFortes2023asuri
data(seBRCA)
# prefilterSAM ---
groupsVector <- SummarizedExperiment::colData(seBRCA)$ER.IHC
set.seed(5)
DE_list_genes <- prefilterSAM(seBRCA, groupsVector)
#> 2025-07-08 12:28:27.706744
#>
|
| | 0%
|
| | 1%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|= | 2%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|== | 3%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|== | 4%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|== | 5%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|=== | 6%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|==== | 7%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|==== | 8%
|
|==== | 9%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|===== | 10%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|====== | 11%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|====== | 12%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|====== | 13%
|
|======= | 14%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|======== | 15%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|======== | 16%
|
|======== | 17%
|
|========= | 18%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|========== | 19%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|========== | 20%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|========== | 21%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|=========== | 22%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============ | 23%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============ | 24%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============ | 25%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============= | 26%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============== | 27%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============== | 28%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============== | 29%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|=============== | 30%
|
|================ | 31%
|
|================ | 32%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================ | 33%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================= | 34%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================== | 35%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================== | 36%
|
|================== | 37%
|
|=================== | 38%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|==================== | 39%
|
|==================== | 40%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|==================== | 41%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|===================== | 42%
|
|====================== | 43%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|====================== | 44%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|====================== | 45%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|======================= | 46%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|======================== | 47%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|======================== | 48%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|======================== | 49%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|========================= | 50%
|
|========================== | 51%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|========================== | 52%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|========================== | 53%
|
|=========================== | 54%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============================ | 55%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============================ | 56%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============================ | 57%
|
|============================= | 58%
|
|============================== | 59%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============================== | 60%
|
|============================== | 61%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|=============================== | 62%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================================ | 63%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================================ | 64%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================================ | 65%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================================= | 66%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================================== | 67%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================================== | 68%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================================== | 69%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|=================================== | 70%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|==================================== | 71%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|==================================== | 72%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|==================================== | 73%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|===================================== | 74%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|====================================== | 75%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|====================================== | 76%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|====================================== | 77%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|======================================= | 78%
|
|======================================== | 79%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|======================================== | 80%
|
|======================================== | 81%
|
|========================================= | 82%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|========================================== | 83%
|
|========================================== | 84%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|========================================== | 85%
|
|=========================================== | 86%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============================================ | 87%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============================================ | 88%
|
|============================================ | 89%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============================================= | 90%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============================================== | 91%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============================================== | 92%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|============================================== | 93%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|=============================================== | 94%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================================================ | 95%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================================================ | 96%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================================================ | 97%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|================================================= | 98%
#> Warning: The spline based estimation of pi0 results in a non-positive value of pi0.
#> Therefore, pi0 is estimated by using lambda = 0.5.
#>
|
|==================================================| 99%
|
|==================================================| 100%
#> 2025-07-08 12:29:49.474071
# genePheno ---
vectorSampleID <- rownames(SummarizedExperiment::colData(seBRCA))
vectorGroups <- SummarizedExperiment::colData(seBRCA)$ER.IHC |> as.numeric()
Pred_ER.IHC <- genePheno(seBRCA, DE_list_genes, vectorGroups, vectorSampleID)
#>
|
| | 0%
|
| | 1%
|
|= | 2%
|
|== | 3%
|
|== | 4%
|
|== | 5%
|
|=== | 6%
|
|==== | 7%
|
|==== | 8%
|
|==== | 9%
|
|===== | 10%
|
|====== | 11%
|
|====== | 12%
|
|====== | 13%
|
|======= | 14%
|
|======== | 15%
|
|======== | 16%
|
|======== | 17%
|
|========= | 18%
|
|========== | 19%
|
|========== | 20%
|
|========== | 21%
|
|=========== | 22%
|
|============ | 23%
|
|============ | 24%
|
|============ | 25%
|
|============= | 26%
|
|============== | 27%
|
|============== | 28%
|
|============== | 29%
|
|=============== | 30%
|
|================ | 31%
|
|================ | 32%
|
|================ | 33%
|
|================= | 34%
|
|================== | 35%
|
|================== | 36%
|
|================== | 37%
|
|=================== | 38%
|
|==================== | 39%
|
|==================== | 40%
|
|==================== | 41%
|
|===================== | 42%
|
|====================== | 43%
|
|====================== | 44%
|
|====================== | 45%
|
|======================= | 46%
|
|======================== | 47%
|
|======================== | 48%
|
|======================== | 49%
|
|========================= | 50%
|
|========================== | 51%
|
|========================== | 52%
|
|========================== | 53%
|
|=========================== | 54%
|
|============================ | 55%
|
|============================ | 56%
|
|============================ | 57%
|
|============================= | 58%
|
|============================== | 59%
|
|============================== | 60%
|
|============================== | 61%
|
|=============================== | 62%
|
|================================ | 63%
|
|================================ | 64%
|
|================================ | 65%
|
|================================= | 66%
|
|================================== | 67%
|
|================================== | 68%
|
|================================== | 69%
|
|=================================== | 70%
|
|==================================== | 71%
|
|==================================== | 72%
|
|==================================== | 73%
|
|===================================== | 74%
|
|====================================== | 75%
|
|====================================== | 76%
|
|====================================== | 77%
|
|======================================= | 78%
|
|======================================== | 79%
|
|======================================== | 80%
|
|======================================== | 81%
|
|========================================= | 82%
|
|========================================== | 83%
|
|========================================== | 84%
|
|========================================== | 85%
|
|=========================================== | 86%
|
|============================================ | 87%
|
|============================================ | 88%
|
|============================================ | 89%
|
|============================================= | 90%
|
|============================================== | 91%
|
|============================================== | 92%
|
|============================================== | 93%
|
|=============================================== | 94%
|
|================================================ | 95%
|
|================================================ | 96%
|
|================================================ | 97%
|
|================================================= | 98%
|
|==================================================| 99%
|
|==================================================| 100%
# Survival times should be provided in YEARS
time <- 'time'
status <- 'status'
# Pred_ER.IHC$genes is the subset of genes to be tested. In our case study,
# it is the list of genes related to the ER clinical variable that was
# obtained using the function **genePheno()**.
geneList <- names(Pred_ER.IHC$genes)
# Training of the multivariate COX model. Provide the expression matrix
# (genes as rows and samples as columns) for the list of genes selected,
# the time and the status vectors, and the method to stratify the patients
# (select one of these methods: `min.pval`, `med.pval`, `class.probs`).
set.seed(5)
multivariate_risk_predictor <- patientRisk(seBRCA, geneList, time, status,
method = "class.probs")
#> Nested ten fold cross validation: Predicting the risk for each lambda...
#> Nested Cross Validation: optimizing lambda...
#> Risk predicted!
# Simulate expression data
num_samples <- 20
set.seed(5)
mExprs_testData <- matrix(rnorm(length(geneList) * num_samples,
mean = 10, sd = 3),
nrow = length(geneList), ncol = num_samples)
# Assign row names (genes) and column names (samples)
rownames(mExprs_testData) <- geneList
colnames(mExprs_testData) <- paste0("Sample", 1:num_samples)
set.seed(5)
risk_prediction_validation_set <- predict_PatientRisk(
multivariate_risk_predictor,
mExprs_testData)
# Example for single patient prediction: Patient fourth is selected.
mExprs_testSingleData <- data.frame(mExprs_testData[, 4])
colnames(mExprs_testSingleData) <- colnames(mExprs_testData)[4]
# Risk prediction for the optimal subset of genes selected by patientRisk()
set.seed(5)
risk_prediction_one_patient <- predict_PatientRisk(
multivariate_risk_predictor,
mExprs_testSingleData)
#> Normalized patient Risk (0 100): 50.0280115373784
#> The patient is categorized as High Risk
#> High Risk interval (46.2794277806291100)
#COX prediction for the training set
mPheno <- SummarizedExperiment::colData(seBRCA)
mExprs <- SummarizedExperiment::assay(seBRCA)
set.seed(5)
mExprSelectedGenes <- mExprs[rownames(mExprs) %in% geneList,]
cox_pred_training <- predict_PatientRisk(multivariate_risk_predictor,
mExprSelectedGenes)
cox_pred_training$risk_score
#> GSM491233 GSM540243 GSM540162 GSM540353 GSM540238 GSM540197 GSM447221 GSM540205
#> 0.7190410 0.4054879 0.8269172 0.8265797 0.8156729 0.6467808 0.9144073 0.4529388
#> GSM491226 GSM540241 GSM491214 GSM540140 GSM540270 GSM540182 GSM540150 GSM540267
#> 0.6165642 0.6862860 0.7042427 0.8996518 0.4285915 0.8135798 0.6460493 0.8549948
#> GSM491260 GSM540247 GSM491264 GSM540364 GSM540240 GSM540282 GSM491284 GSM491262
#> 0.8451462 0.4082528 0.5429171 0.9207305 0.7464093 1.1017595 0.6887527 0.4265469
#> GSM540161 GSM491195 GSM491240 GSM447202 GSM540310 GSM540292 GSM540272 GSM447231
#> 0.5364335 1.0036726 0.2844805 1.0345877 1.0147750 0.9099552 0.8905901 0.7513594
#> GSM491276 GSM540291 GSM447243 GSM540318 GSM540342 GSM540328 GSM540253 GSM540370
#> 0.6125229 0.9667927 0.4441126 0.5949662 0.5645350 0.6025412 0.7707832 0.8785838
#> GSM540167 GSM540319 GSM540123 GSM491223 GSM540135 GSM491278 GSM540110 GSM540248
#> 1.1723045 0.7351070 0.7850097 1.0057653 0.5483383 0.6815549 0.5543248 1.1081183
#> GSM540332 GSM540297 GSM540341 GSM491281 GSM491261 GSM447212 GSM540125 GSM540179
#> 0.6688741 0.5615452 0.7277622 0.5458684 0.6978522 0.7449289 0.7571234 0.8481099
#> GSM540235 GSM540126 GSM491222 GSM540229 GSM540178 GSM540201 GSM491267 GSM447205
#> 0.8739801 0.7213706 0.4628399 0.5078199 0.8012764 0.8007125 0.6216320 0.7943181
#> GSM540284 GSM540118 GSM540120 GSM540230 GSM447209 GSM491181 GSM540261 GSM540148
#> 0.6153390 0.8830617 0.6870697 0.7244158 0.9270661 1.1148695 0.8478156 0.7269557
#> GSM540231 GSM491282 GSM540237 GSM540351 GSM540339 GSM540344 GSM447197 GSM491288
#> 0.2490732 0.4445665 0.8730601 1.0308426 0.8935776 0.5283496 0.6334421 0.4179865
#> GSM540142 GSM540203 GSM491211 GSM540173 GSM540281 GSM491272 GSM491180 GSM540280
#> 0.4583640 0.6613671 1.0069747 0.3902803 0.9020432 0.7056391 0.9310194 0.6791726
#> GSM491265 GSM540245 GSM540359 GSM540154 GSM491198 GSM540330 GSM491199 GSM540159
#> 0.8195886 0.6819132 0.9991005 0.8055988 0.7598502 0.3387579 0.9675615 0.8861328
#> GSM540196 GSM540215 GSM540293 GSM447206 GSM540350 GSM491182 GSM491219 GSM540337
#> 0.6585738 0.9926866 0.8921874 0.8843804 0.8520478 1.2040714 1.0686918 0.5707146
#> GSM491204 GSM491231 GSM491263 GSM540371 GSM447227 GSM491183 GSM540354 GSM540302
#> 0.6878297 0.8511437 0.6263247 0.9802147 0.3539889 0.8964488 0.9022721 1.0187794
#> GSM540285 GSM491197 GSM447233 GSM540165 GSM540124 GSM540340 GSM540295 GSM491196
#> 1.1197571 1.1202908 0.4192845 0.6462978 0.8841608 0.7803262 0.4707060 1.0393315
#> GSM491191 GSM491279 GSM540277 GSM491234 GSM540166 GSM540273 GSM540363 GSM447215
#> 0.7902954 0.9639887 0.5338513 0.7578985 0.3633403 0.8561439 0.5831286 0.8392175
#> GSM540268 GSM491269 GSM540219 GSM540299 GSM540213 GSM491238 GSM540233 GSM491227
#> 0.8844033 0.3971920 0.8659392 0.5348489 0.5927981 0.8339601 0.4884702 0.5126679
#> GSM491257 GSM540356 GSM540143 GSM540160 GSM540130 GSM491220 GSM540141 GSM540199
#> 0.6562722 0.9986799 0.7502148 0.8523145 0.8052802 0.7755367 0.5471024 0.6263443
#> GSM540109 GSM447207 GSM447232 GSM491242 GSM491246 GSM540347 GSM540157 GSM491259
#> 0.9366112 0.7500790 0.8251665 0.3678751 0.5486082 0.6126358 0.8634199 0.5900058
#> GSM540362 GSM491184 GSM540334 GSM491203 GSM491229 GSM491268 GSM540265 GSM491202
#> 1.0466615 1.0572599 0.4672134 0.6728669 1.0213933 0.5856612 0.8788277 1.0378973
#> GSM491245 GSM540144 GSM491193 GSM491189 GSM540137 GSM540188 GSM491221 GSM540266
#> 0.8286314 0.6225959 0.9428367 0.8398426 0.7362701 0.6129922 0.8411554 0.3912515
#> GSM491252 GSM447226 GSM447216 GSM447198 GSM540172 GSM491275 GSM447199 GSM540249
#> 0.6423747 0.8092341 0.8189519 0.8907207 0.5985464 0.7097165 0.4395899 0.8252490
#> GSM491280 GSM491178 GSM540220 GSM447208 GSM540216 GSM540367 GSM540208 GSM540108
#> 0.5381471 1.0510236 0.7768837 0.3075110 0.7997588 0.8243908 0.7763647 0.4726074
#> GSM540269 GSM540244 GSM540195 GSM540286 GSM491228 GSM540369 GSM447245 GSM540322
#> 0.6265616 0.8800733 0.7577649 0.5938235 1.0362130 1.0870367 0.4631430 0.6734032
#> GSM540177 GSM540155 GSM540242 GSM540346 GSM540214 GSM491225 GSM540349 GSM491243
#> 0.6247837 1.1415973 1.0579746 0.7994070 0.9221799 0.3948674 0.9572358 0.8658110
#COX prediction for the test patient
set.seed(5)
cox_pred_test <- predict_PatientRisk(multivariate_risk_predictor,
mExprs_testSingleData)
#> Normalized patient Risk (0 100): 50.0280115373784
#> The patient is categorized as High Risk
#> High Risk interval (46.2794277806291100)
cox_pred_test$risk_score
#> Sample4
#> 0.1117757
#Survival curve estimation
eval_surv_times <- seq(0, max(mPheno$time), by = 0.1)
set.seed(5)
surv_curv_cox <- predict_SurvCurve(cox_pred_training$risk_score,
mPheno[, c(2, 3)],
cox_pred_test$risk_score,
eval_surv_times)
#> The Survival curve is only estimated for the interval [%.1f, %.1f]07.66083333333333
#> No observation beyond this point in the training set