ConsensusOPLS {ConsensusOPLS}R Documentation

ConsensusOPLS

Description

Constructs the consensus OPLS model with the optimal number of orthogonal components for given data blocks and response, and evaluate the model quality w.r.t other models built with randomly permuted responses.

Usage

ConsensusOPLS(
  data,
  Y,
  maxPcomp = 1,
  maxOcomp = 5,
  modelType = "da",
  nperm = 100,
  cvType = "nfold",
  nfold = 5,
  nMC = 100,
  cvFrac = 4/5,
  kernelParams = list(type = "p", params = c(order = 1)),
  mc.cores = 1,
  verbose = FALSE
)

Arguments

data

A list of data blocks. Each element of the list must be of matrix type. Rows and columns can be identified (names), in which case this will be retained during analysis. Any pre-processing of the data (e.g. scaling) must be carried out before building the model.

Y

A vector, factor, dummy matrix or numeric matrix for the response. The type of answer given will condition the model to be used: a numeric vector for linear regression, a factor or dummy matrix for logistic regression or a discriminant model.

maxPcomp

Maximum number of Y-predictive components used to build the optimal model. Default, 1.

maxOcomp

Maximum number of Y-orthogonal components used to build the optimal model. Default, 5.

modelType

String for type of OPLS regression model, either reg for regression or da for discriminant analysis. Default, da.

nperm

Number of random permutations desired in response Y. Default, 100.

cvType

String for type of cross-validation used. Either nfold for n-fold cross-validation, where nfold is look up, or mccv for Monte Carlo cross-validation, or mccvb for Monte Carlo class-balanced cross-validation, where nMC and cvFrac are used. Default, nfold, i.e. nMC and cvFrac are ignored.

nfold

Number of folds performed in n-fold cross-validation. This can be set to the number of samples to perform Leave-One-Out cross validation. Default, 5.

nMC

An integer indicating the number of rounds performed when cvType is mccv or mccvb. Default, 100.

cvFrac

A numeric value indicating the fraction of observations from data used in the training set for mccv or mccvb cross-validation. Default, 4/5 = 0.8.

kernelParams

List of parameters for the kernel. Either p for polynomial kernel, which implies specifying the order of the polynomial by the order parameter, or g for Gaussian kernel. Default, list(type='p', params = c(order=1.0)).

mc.cores

Number of cores for parallel computing. Default, 1.

verbose

A logical indicating if detailed information (cross validation) will be shown. Default, FALSE.

Value

An object of class ConsensusOPLS representing the consensus OPLS model fit.

Examples

data(demo_3_Omics)
datablocks <- lapply(demo_3_Omics[c("MetaboData", "MicroData", "ProteoData")], scale)
res <- ConsensusOPLS(data=datablocks, 
                     Y=demo_3_Omics$Y,
                     maxPcomp=1, maxOcomp=2, 
                     modelType='da',
                     nperm=5)
res

[Package ConsensusOPLS version 1.0.0 Index]