predIncomingSurv.Rd
This function let's user predict the genetic risk score of new/incoming patients. This function makes use of the output of the OncoCast function and an inputed data set similar to the one use to generate those results. The user can retrieve the genetic risk score of those new patients and their predicted survival curves.
predIncomingSurv(OC_object, new.data, surv.print = NULL, riskRefit)
OC_object | Output of the OncoCast function. |
---|---|
new.data | New data set containing the information of the incoming patients. Should be a dataframe with patients as rows and features as columns. |
surv.print | A numeric vector indicating the patients for which the user wishes to print the predicted survival curves. |
riskRefit | The refitted cox proportional hazard model with the risk score as predictor. |
data.out : The data frame inputted in the function with an additional column giving the predicted risk score of the incoming patients.
RiskHist : A histogram of the distribution of the risk scores of patients in the given dataset.
IncKM : An interactive Kaplan-Meier plot of the selected patients in the surv.print argument.
library(OncoCast) test <- OncoCast(data=survData,formula = Surv(time,status)~., method = "LASSO",runs = 30, save = FALSE,nonPenCol = NULL,cores =1)#> Warning: We do not recommend using a number of cross-validation/bootstraps lower than 50.#> [1] "Data check performed, ready for analysis." #> [1] "LASSO SELECTED"results <- getResults_OC(OC_object=test$LASSO,data=survData, cuts=c(0.2,0.4,0.6,0.8), geneList=NULL,mut.data=TRUE)#> Warning: Vectorized input to `element_text()` is not officially supported. #> Results may be unexpected or may change in future versions of ggplot2.#>new.data <- as.data.frame(matrix(rbinom(5*20,1,0.5),nrow=20,ncol = 5)) colnames(new.data) <- c("ImpCov1","ImpCov2","ImpCov3","ImpCov4","Cov7") rownames(new.data) <- paste0("Incoming",1:20) Incoming <- predIncomingSurv(test$LASSO,new.data=new.data, surv.print = c(5,10,15),riskRefit = results$RiskRefit)