Skip to content

Commit

Permalink
Merge pull request #339 from mixOmicsTeam/issue-336
Browse files Browse the repository at this point in the history
Issue 336
  • Loading branch information
evaham1 authored Nov 11, 2024
2 parents 3d13a76 + 1bcd7f1 commit 9ee3c22
Show file tree
Hide file tree
Showing 49 changed files with 133 additions and 294 deletions.
14 changes: 4 additions & 10 deletions R/block.pls.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#' Four PLS algorithms are available: PLS regression \code{("regression")}, PLS
#' canonical analysis \code{("canonical")}, redundancy analysis
#' \code{("invariant")} and the classical PLS algorithm \code{("classic")} (see
#' References and \code{?pls} for more details).
#' References and \code{?pls} for more details). Note that the argument 'scheme'
#' has now been hardcoded to 'horst' and 'init' to 'svd.single'.
#'
#' Note that our method is partly based on Generalised Canonical Correlation
#' Analysis and differs from the MB-PLS approaches proposed by Kowalski et al.,
Expand All @@ -50,11 +51,6 @@
#' off-diagonal elements of a fully connected design (see examples in
#' \code{block.splsda}). If \code{Y} is provided instead of \code{indY}, the
#' \code{design} matrix is changed to include relationships to \code{Y}.
#' @param scheme Character, one of 'horst', 'factorial' or 'centroid'. Default =
#' \code{'horst'}, see reference.
#' @param init Mode of initialization use in the algorithm, either by Singular
#' Value Decomposition of the product of each block of X with Y ('svd') or each
#' block independently ('svd.single'). Default = \code{svd.single}
#' @template arg/verbose.call
#' @return \code{block.pls} returns an object of class \code{'block.pls'}, a
#' list that contains the following components:
Expand Down Expand Up @@ -95,10 +91,8 @@ block.pls <- function(X,
indY,
ncomp = 2,
design,
scheme,
mode,
scale = TRUE,
init ,
tol = 1e-06,
max.iter = 100,
near.zero.var = FALSE,
Expand All @@ -108,8 +102,8 @@ block.pls <- function(X,

# call to 'internal_wrapper.mint.block'
result = internal_wrapper.mint.block(X=X, Y=Y, indY=indY, ncomp=ncomp,
design=design, scheme=scheme, mode=mode, scale=scale,
init=init, tol=tol, max.iter=max.iter ,near.zero.var=near.zero.var,
design=design, scheme="horst", mode=mode, scale=scale,
init="svd.single", tol=tol, max.iter=max.iter ,near.zero.var=near.zero.var,
all.outputs = all.outputs, DA = FALSE)

# calculate weights for each dataset
Expand Down
7 changes: 3 additions & 4 deletions R/block.plsda.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#' \item{call}{if \code{verbose.call = FALSE}, then just the function call is returned.
#' If \code{verbose.call = TRUE} then all the inputted values are accessable via
#' this component}
#' Note that the argument 'scheme' has now been hardcoded to 'horst' and 'init' to 'svd.single'.
#' @author Florian Rohart, Benoit Gautier, Kim-Anh Lê Cao, Al J Abadi
#' @seealso \code{\link{plotIndiv}}, \code{\link{plotArrow}},
#' \code{\link{plotLoadings}}, \code{\link{plotVar}}, \code{\link{predict}},
Expand Down Expand Up @@ -95,9 +96,7 @@ block.plsda <- function(X,
indY,
ncomp = 2,
design,
scheme,
scale = TRUE,
init = "svd",
tol = 1e-06,
max.iter = 100,
near.zero.var = FALSE,
Expand Down Expand Up @@ -151,10 +150,10 @@ block.plsda <- function(X,
indY = indY,
ncomp = ncomp,
design = design,
scheme = scheme,
scheme = "horst",
mode = 'regression',
scale = scale,
init = init,
init = "svd.single",
tol = tol,
max.iter = max.iter,
near.zero.var = near.zero.var,
Expand Down
7 changes: 3 additions & 4 deletions R/block.spls.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#' \item{call}{if \code{verbose.call = FALSE}, then just the function call is returned.
#' If \code{verbose.call = TRUE} then all the inputted values are accessable via
#' this component}
#' Note that the argument 'scheme' has now been hardcoded to 'horst' and 'init' to 'svd.single'.
#' @author Florian Rohart, Benoit Gautier, Kim-Anh Lê Cao, Al J Abadi
#' @seealso \code{\link{plotIndiv}}, \code{\link{plotArrow}},
#' \code{\link{plotLoadings}}, \code{\link{plotVar}}, \code{\link{predict}},
Expand Down Expand Up @@ -98,10 +99,8 @@ block.spls = function(X,
keepX,
keepY,
design,
scheme,
mode,
scale = TRUE,
init ,
tol = 1e-06,
max.iter = 100,
near.zero.var = FALSE,
Expand All @@ -118,10 +117,10 @@ block.spls = function(X,
keepX = keepX,
keepY = keepY,
design = design,
scheme = scheme,
scheme = "horst",
mode = mode,
scale = scale,
init = init,
init = "svd.single",
tol = tol,
max.iter = max.iter,
near.zero.var = near.zero.var,
Expand Down
7 changes: 3 additions & 4 deletions R/block.splsda.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#' \item{call}{if \code{verbose.call = FALSE}, then just the function call is returned.
#' If \code{verbose.call = TRUE} then all the inputted values are accessable via
#' this component}
#' Note that the argument 'scheme' has now been hardcoded to 'horst' and 'init' to 'svd.single'.
#' @author Florian Rohart, Benoit Gautier, Kim-Anh Lê Cao, Al J Abadi
#' @seealso \code{\link{plotIndiv}}, \code{\link{plotArrow}},
#' \code{\link{plotLoadings}}, \code{\link{plotVar}}, \code{\link{predict}},
Expand Down Expand Up @@ -95,9 +96,7 @@ block.splsda <- function(X,
ncomp = 2,
keepX,
design,
scheme,
scale = TRUE,
init = "svd",
tol = 1e-06,
max.iter = 100,
near.zero.var = FALSE,
Expand Down Expand Up @@ -154,10 +153,10 @@ block.splsda <- function(X,
keepX = keepX,
DA = TRUE,
design = design,
scheme = scheme,
scheme = 'horst',
mode = 'regression',
scale = scale,
init = init,
init = 'svd.single',
tol = tol,
max.iter = max.iter,
near.zero.var = near.zero.var,
Expand Down
7 changes: 3 additions & 4 deletions R/mint.block.pls.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#' subsequent S3 methods} \item{max.iter}{the maximum number of iterations,
#' used for subsequent S3 methods} \item{iter}{Number of iterations of the
#' algorithm for each component}
#' Note that the argument 'scheme' has now been hardcoded to 'horst' and 'init' to 'svd.single'.
#' @author Florian Rohart, Benoit Gautier, Kim-Anh Lê Cao, Al J Abadi
#' @seealso \code{\link{spls}}, \code{\link{summary}}, \code{\link{plotIndiv}},
#' \code{\link{plotVar}}, \code{\link{predict}}, \code{\link{perf}},
Expand Down Expand Up @@ -101,10 +102,8 @@ mint.block.pls <- function(X,
study,
ncomp = 2,
design,
scheme,
mode,
scale = TRUE,
init ,
tol = 1e-06,
max.iter = 100,
near.zero.var = FALSE,
Expand All @@ -118,10 +117,10 @@ mint.block.pls <- function(X,
study = study,
ncomp = ncomp,
design = design,
scheme = scheme,
scheme = 'horst',
mode = mode,
scale = scale,
init = init,
init = 'svd.single',
tol = tol,
max.iter = max.iter,
near.zero.var = near.zero.var,
Expand Down
7 changes: 3 additions & 4 deletions R/mint.block.plsda.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
#' subsequent S3 methods} \item{max.iter}{the maximum number of iterations,
#' used for subsequent S3 methods} \item{iter}{Number of iterations of the
#' algorithm for each component}
#' Note that the argument 'scheme' has now been hardcoded to 'horst' and 'init' to 'svd.single'.
#' @author Florian Rohart, Benoit Gautier, Kim-Anh Lê Cao, Al J Abadi
#' @seealso \code{\link{spls}}, \code{\link{summary}}, \code{\link{plotIndiv}},
#' \code{\link{plotVar}}, \code{\link{predict}}, \code{\link{perf}},
Expand Down Expand Up @@ -137,9 +138,7 @@ mint.block.plsda <- function(X,
study,
ncomp = 2,
design,
scheme,
scale = TRUE,
init ,
tol = 1e-06,
max.iter = 100,
near.zero.var = FALSE,
Expand Down Expand Up @@ -189,10 +188,10 @@ mint.block.plsda <- function(X,
study = study,
ncomp = ncomp,
design = design,
scheme = scheme,
scheme = 'horst',
mode = 'regression',
scale = scale,
init = init,
init = 'svd.single',
tol = tol,
max.iter = max.iter,
near.zero.var = near.zero.var,
Expand Down
7 changes: 3 additions & 4 deletions R/mint.block.spls.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#' subsequent S3 methods} \item{max.iter}{the maximum number of iterations,
#' used for subsequent S3 methods} \item{iter}{Number of iterations of the
#' algorithm for each component}
#' Note that the argument 'scheme' has now been hardcoded to 'horst' and 'init' to 'svd.single'.
#' @author Florian Rohart, Benoit Gautier, Kim-Anh Lê Cao, Al J Abadi
#' @seealso \code{\link{spls}}, \code{\link{summary}}, \code{\link{plotIndiv}},
#' \code{\link{plotVar}}, \code{\link{predict}}, \code{\link{perf}},
Expand Down Expand Up @@ -95,10 +96,8 @@ mint.block.spls <- function(X,
keepX,
keepY,
design,
scheme,
mode,
scale = TRUE,
init ,
tol = 1e-06,
max.iter = 100,
near.zero.var = FALSE,
Expand All @@ -114,10 +113,10 @@ mint.block.spls <- function(X,
keepX = keepX,
keepY = keepY,
design = design,
scheme = scheme,
scheme = 'horst',
mode = mode,
scale = scale,
init = init,
init = 'svd.single',
tol = tol,
max.iter = max.iter,
near.zero.var = near.zero.var,
Expand Down
7 changes: 3 additions & 4 deletions R/mint.block.splsda.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#' subsequent S3 methods} \item{max.iter}{the maximum number of iterations,
#' used for subsequent S3 methods} \item{iter}{Number of iterations of the
#' algorithm for each component}
#' Note that the argument 'scheme' has now been hardcoded to 'horst' and 'init' to 'svd.single'.
#' @author Florian Rohart, Benoit Gautier, Kim-Anh Lê Cao, Al J Abadi
#' @seealso \code{\link{spls}}, \code{\link{summary}}, \code{\link{plotIndiv}},
#' \code{\link{plotVar}}, \code{\link{predict}}, \code{\link{perf}},
Expand Down Expand Up @@ -111,9 +112,7 @@ mint.block.splsda <- function(X,
ncomp = 2,
keepX,
design,
scheme,
scale = TRUE,
init ,
tol = 1e-06,
max.iter = 100,
near.zero.var = FALSE,
Expand Down Expand Up @@ -162,10 +161,10 @@ mint.block.splsda <- function(X,
ncomp = ncomp,
keepX = keepX,
design = design,
scheme = scheme,
scheme = 'horst',
mode = 'regression',
scale = scale,
init = init,
init = 'svd.single',
tol = tol,
max.iter = max.iter,
near.zero.var = near.zero.var,
Expand Down
Loading

0 comments on commit 9ee3c22

Please sign in to comment.