kevinblighe / PCAtools

PCAtools: everything Principal Components Analysis
327 stars 67 forks source link

Error with the pca function #70

Open Pierre9344 opened 9 months ago

Pierre9344 commented 9 months ago

Hello,

I get the error next when using the pca function:

> PCAtools::pca(rlog, coldata, removeVar = 0.1)
Erreur : useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.

I got this after updating some packages. I guess this come from the matrixStats package (https://cran.rstudio.com/web/packages/matrixStats/news/news.html).

Can you correct this?

Thank you in advance for your help.

elifozcelik commented 9 months ago

Hi, I am having the same issue. My I ask what is the version you are using for matrixStats?

lalodragon commented 9 months ago

@elifozcelik This appears to be defunct in matrixStats 1.2, but may also be universally defunct in R 4.4

I have the same issue. In trying to find a workaround, I discovered that DelayedArray is also complicating this somehow. If I edit the problem line here

vars <- colVars(DelayedArray(mat), center = .center) to vars <- colVars(DelayedArray(mat), center = .center, useNames = T) I continue to get the same error. However, if I remove the DelayedArray wrapper vars <- colVars(mat, center = .center, useNames = T) This works.

I'm not familiar with DelayedArray enough to guess why this is happening. But in the meantime, removing it and adding the useNames specification does work.

Pierre9344 commented 6 months ago

Hello, I found a workaround that consist in installing the 1.1 version of the matrixStats package:

remotes::install_github("HenrikBengtsson/matrixStats", ref="1.1.0")

keep in mind that R will propose to update it when installing other package. The fact that we use a "deprecated" version may also cause problem with other packages (I didn't see any for now).