Issues with tune.spca() and perf()

Hi,
I have an RNAseq dataset with 8 samples and have been trying to run both sPCA and assess the performance of the PLS-DA with perf, however I encounter errors for both functions and wondered whether you may have some adivce?
For the sPCA as I have low number of samples I tried to set up a LOOCV model, however if I do this by either stating the folds=8 or folds=nrow(PSTTs_transposed) I get the same error:

> tune.spca.result_PSTTs <- tune.spca(PSTTs_transposed, ncomp = 3, 
+                               folds = 8, 
+                               test.keepX = grid.keepX_PSTTs, nrepeat = 10)

Error in tune.spca(PSTTs_transposed, ncomp = 3, folds = 8, test.keepX = grid.keepX_PSTTs,  : 
  'folds' must be an integer > 2 and <= floor(nrow(X)/3)=2

Do you have any advice on what may be causing this?

Additionally when I try to assess the PLS-DA performance on a larger dataset of 16 samples with the below commands, I get this error:

> perf.plsda.TWISTfull <- mixOmics:: perf(plsda_TWISTfull, validation = 'Mfold', folds = 3, 
+                          progressBar = TRUE, 
+                          nrepeat = 10)

Error in UseMethod("perf") : 
  no applicable method for 'perf' applied to an object of class "c('plsda', 'mvr')

Any insights you may have would be greatly appreciated! Thank you in advance for your help.

hi @eh616,

We have not implemented the tune.spca for leave-one-out so I think this is what this bug is about. Given that you only have 8 samples, and that sPCA is fairly exploratory, I would just inspect the sample plots with all variables, or only the top selected variables. You primarily want to check how much variation these variables explain, and whether it makes sense biologically.

Regarding your other bug with plsda, can you check that plsda_TWISTfull is the result of a plsda? and no space between mixOmics:: perf (I wonder if it is calling the perf function from another package).

Kim-Anh