BRS | R Documentation |
Main BRS subclass predictor
BRS(
newx,
trainx = as.matrix(BRSpred::CohortA_pre),
trainy = BRSpred::erasmus_clinical[colnames(BRSpred::CohortA_pre), "Erasmus.BRS"],
common = TRUE,
genes,
pamrobj,
seed = 1234,
nfold,
threshold,
type = "class",
scale = c("together", "independent", "none"),
qnormalize = TRUE,
impute = FALSE,
getall = FALSE,
verb = TRUE,
...
)
newx |
Input data matrix |
trainx |
Training data matrix x; by default Cohort A pre-BCG samples |
trainy |
Training subclasses y; by default BRS classes identified via consensus clustering for Cohort A pre-BCG samples |
common |
Should only common genes be considered (prevents need for potential imputation) |
genes |
Subset of genes used in the training; by default top 2000 variable genes in the training data |
pamrobj |
Previously trained pamr-object used for prediction; by default pamr object is instead trained on the fly based on trainx and trainy |
seed |
RNG seed, if cross-validation is used for threshold-determination this should be set; by default 1234 |
nfold |
If provided, will designate number of folds in the CV (defaults to pamr.cv's default value) |
threshold |
pamr-prediction threshold parameter (if missing, by default the optimal threshold is identified by minimizing CV misclassification rate) |
type |
Type of prediction as given by pamr; eligible values 'class', 'posterior', 'centroid', 'nonzero' (see ?pamr.predict) |
scale |
Z score based scaling of data; none, or together with or independently of the training data; notice that the centroids are sensitive to scaling |
qnormalize |
Should quantile normalization be applied to 'x' in respect to the training data (by default TRUE) |
impute |
Should gene imputation be allowed via internal function if not pre-processed by user (by default FALSE) |
getall |
Should all objects be returned - will instead create a list with predictions, pamr object, newx, trainx, and trainy (by default FALSE) |
verb |
Verbosity |
... |
Additional parameters passed on to pamr::pamr.predict |
This is the main BCG response subtype predictor function. It essentially works as a wrapper for training a 3-class pamr-object classifier, with optimal threshold determined using cross-validation. Convenience functions, such as z-score scaling, quantile normalization, and missing gene imputation are provided. Notice however, that the centroid based classifier may be sensitive to the choices in respect to these parameters.
pamr::pamr.predict-call predictions (getall == FALSE) or a list with the prediction and corresponding data matrices and pamr-object and threshold (getall == TRUE)
de Jong F. C., Laajala T. D., et al. Citation
library(BRSpred)
predict_post <- BRSpred::BRS(newx = BRSpred::CohortA_post, scale = "together")
predict_cohortb <- BRSpred::BRS(newx = BRSpred::CohortB, scale = "independent")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.