I’m working on a PLS analysis and saw the wrapper for tune.pls under the “tuning parameters” section of the mixOmics website. When I try to use this function, I receive an error that the tune.pls function does not exist. Is this correct?
Run tuning with tune.pls
tune_pls ← tune.pls(
X = X,
Y = Y,
ncomp = 3, # Number of components to test
folds = 5, # 5-fold cross-validation
nrepeat = 5, # Repeat 5 times
seed = 123 # For reproducibility
)
Error in tune.pls(X = X, Y = Y, ncomp = 3, folds = 5, nrepeat = 5, seed = 123) :
could not find function “tune.pls”
As you might have seen at the top of that page on parameter tuning on our website, these tuning functions are new and currently only available in the development version of mixOmics (v6.31.4). Thank you for using this new functionality and in doing so helping us test it!
To begin with, could I please check you have the correct version of mixOmics installed (6.31.4)? This should be printed out when you run library(mixOmics) or sessionInfo(). When I load mixOmics I see:
Loaded mixOmics 6.31.4
Thank you for using mixOmics!
Tutorials: http://mixomics.org
Bookdown vignette: https://mixomicsteam.github.io/Bookdown
Questions, issues: Follow the prompts at http://mixomics.org/contact-us
Cite us: citation('mixOmics')
If you do not see this version, try running: devtools::install_github("mixOmicsTeam/mixOmics", ref = "6.31.4", force = TRUE)
Thank you for the quick reply! That was part of the issue, I was not running 6.31.4 but that has been addressed. I am now receiving a new error when running the wrapper command-
library(BiocParallel)
register(SerialParam())
set.seed(123) # For reproducibility
tune_pls ← tune.pls(
X = X,
Y = Y,
ncomp = 3, # Number of components to test
folds = 5, # 5-fold cross-validation
nrepeat = 5, # Repeat 5 times
seed = 123 # For reproducibility
)
Error: BiocParallel errors
1 remote errors, element index: 1
4 unevaluated and other errors
first remote error:
Error in X.test %*% a.cv: non-conformable arguments
I haven’t been able to recreate your error with the test data which is used in the example on the mixomics webpage. Could you try running this code and letting me know if you encounter any errors:
devtools::install_github('mixOmicsTeam/mixOmics', ref = '6.31.4', force = TRUE)
library(mixOmics)
# load data
data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$clinic
# run tuning on 5 components, may take a few seconds
tune.res <- tune.pls(X = X,
Y = Y,
ncomp = 3,
folds = 5,
nrepeat = 5,
seed = 123) # for reproducibility with example, remove for own analysis
# plot output
plot(tune.res)
If this code runs fine then the error is related to your data. If this is the case I would suggest you email me your data (eva.hamrud@unimelb.edu.au) and the script which causes this error and I can have a closer look at what is going on!