Closed StefPN closed 1 month ago
For some reason, none of my text can be seen either in the preview or after submission. So I posted it here: https://mixomics-users.discourse.group/t/error-in-check-entry-pls-x-y-ncomp-keepx-keepy-mode-mode-scale-scale-unmapped-y-contains-samples-with-no-associated-class-may-be-caused-by-nas-in-input-y-vector/1202
Copying code here for reference:
<!--
π Click the "Preview" tab above to see this text in HTML π
-->
Please follow **all the steps** described at https://mixomics-users.discourse.group/t/reproducible-example-to-clarify-issues/470 and next fill in the items below:
------------
π **Describe the bug:**
<!--
I went pack to a script after updating my mixomics package to 6.23.4. Suddenly, this code does not work anymore:
tune.spls1.MAE <- mixOmics::tune.spls(X, Y, ncomp= 1,
+ test.keepX = list.keepX,
+ validation = 'loo',
+ progressBar = FALSE,
+ measure = 'MAE')
Error in Check.entry.pls(X, Y, ncomp, keepX, keepY, mode = mode, scale = scale, :
Unmapped Y contains samples with no associated class. May be caused by NAs in input Y vector
I did check X and Y and they looks fine, all numeric, no NAs
-->
------------
π **reprex results from [reproducible example](https://mixomics-users.discourse.group/t/reproducible-example-to-clarify-issues/470) including sessioninfo():**
------------
π€ **Expected behavior:**
<!--
I expected the tuning to work as it has done previously. Using
data("breast.TCGA")
X <- breast.TCGA$data.train$mrna
Y <- breast.TCGA$data.train$subtype
Y=as.numeric
tune.spls1.MAE <- mixOmics::tune.spls(X, Y, ncomp= 1,
test.keepX = list.keepX,
validation = 'loo',
progressBar = FALSE,
measure = 'MAE')
Works! Just trying my first three columns of X againt Y throws the same error but the numbers look fine. The function can handle negative values, I suppose.
-->
------------
π‘ **Possible solution:**
<!--
No idea. I appreciate your help!
-->
I believe there is a bug in the code for the tune.spls() function. Specifically, the below line from the check.entry.R script on the Mixomics github:
if (DA) {
if (length(which(rowSums(Y)==0)) != 0) {
stop(βUnmapped Y contains samples with no associated class. May be caused by NAs in input Y vectorβ)
}
}
Is being run in the tune.spls() function, even when the analysis is NOT DA.
Because I get the same error as @stepra, but when I remove the 0s from my input Y vector (e.g., by adding a constant), the error disappears. However, when I try to specify DA = FALSE for tune.spls() to get the chunk above to not apply, I get an error saying that there is no input argument for DA.
not enough information at this time, unable to reproduce this error and due to post being from summer 2023 closing for now
Please follow all the steps described at https://mixomics-users.discourse.group/t/reproducible-example-to-clarify-issues/470 and next fill in the items below:
π Describe the bug:
π reprex results from reproducible example including sessioninfo():
π€ Expected behavior:
π‘ Possible solution: