If (pval < alpha) error

Hi,
I am getting the following error when running perf on a plsda and when running tune.plsda for a sparse plsda. I did not get it a few weeks back with pretty much the same dataset. I cannot see where the missing value might be coming from. Any hints about why this could be?
Thanks in advance.
Best,
David

Error in if (pval < alpha) { :
valeur manquante là où TRUE / FALSE est requis

Hi David,

Thanks for using mixOmics!

This issue has been solved in the latest GitHub version which you can install using instructions here: https://github.com/mixOmicsTeam/mixOmics#latest-github-version.

Best,

Al

Hi Al,
Thanks for your prompt reply. I have installed the latest version, that is 6.11.6, but the error remains. Even when I run the dev version.
For information, I am running R_3.6.1 on MacOS Mojave 10.14.6
Thanks again.
Best,
David

Hi David,

Thanks for the update. Would you be able to reproduce the error somehow so I can narrow down to it? Ideally using mixOmics datasets. Running on mixOmics datasets I don’t get any errors so it’s difficult to speculate where the bug might be.
Best,
Al

Hi Al,
Thanks for your feedback. I apologize for my delay in replying to your post. I’ve doing some testing today and I confess I am quite puzzled.
If I run the following code I get the already mentioned pval TRUE/FALSE error

cpm_TMM <- read.table("…/cpm_TMM.mOm.txt", header = TRUE, row.names = 1, sep = “\t”)
cpm_TMM <- cpm_TMM[apply(cpm_TMM, 1, sd) > 0,]
plsda.Tr <- plsda(t(cpm_TMM), design$Tr, ncomp = 10)
perf.plsda.Tr <- perf(plsda.Tr, validation = “Mfold”, folds = 5, progressBar = FALSE, nrepeat = 10)

However, if I just sample the Tr variable (which obvioudly leads to a wrong variable though) , then I do not get the error anymore. As follows:

cpm_TMM <- read.table("…/cpm_TMM.mOm.txt", header = TRUE, row.names = 1, sep = “\t”)
cpm_TMM <- cpm_TMM[apply(cpm_TMM, 1, sd) > 0,]
plsda.Tr <- plsda(t(cpm_TMM), sample(design$Tr), ncomp = 10)
perf.plsda.Tr <- perf(plsda.Tr, validation = “Mfold”, folds = 5, progressBar = FALSE, nrepeat = 10)
Error in if (pval < alpha) { :
valeur manquante là où TRUE / FALSE est requis

I’ve allowed myself to create a link to both the dataset and the design data frames in case you wanted to have a look

I thank you for your help.
Best,
David

Hi David,

Thanks for the details and the data, massive help! This was in fact a bug in our internals that did not handle models with 0 error rate well so thanks for getting in touch on this. Please install the latest devel version and let me know if you run into any other issues.

Warmly,

Al

Hi Al,
THnaks for your kind and quick reply. I’ve downloaded the 6.11.7 version thought
devtools::install_github(“mixOmicsTeam/mixOmics”, ref = “devel”).
Unfortunately the problem persists. More precisely, I’ve run the same perf code line four times, and I’ve got the error message three times.
Best,
David

Hi David,

Sorry you still have the issue. It runs successfully on my end with the latest devel version. Did you restart R after installing the new version before re-running the code? Also may I suggest that you you use ncomp = 4 (optimal ncomp seems to be no more than 4) and cpus = parallel::detectCores()-1 arguments for faster code diagnostics at this stage.

Best,

Al

Hi Al,
It works fine now, thanks a lot! I had not restarted the session after the dev version installation. Sorry about that. I also changed ncomp to 4 and it goes faster. I had ncomp to 10 as copy paste default, but it is true that in this context it takes far too long, as it is unnecessary.
Thanks again!
Best,
David

Hi David,
Glad to hear it runs fine. That’s correct, your model achieved complete accuracy in the first few components. Also, by default the perf function runs on one core, if you change cpus to more than 1 for intensive computations you start to see some speedup in that sense as well.
Best,
Al