HenrikBengtsson / matrixStats

R package: Methods that Apply to Rows and Columns of Matrices (and to Vectors)
https://cran.r-project.org/package=matrixStats
202 stars 33 forks source link

useNames = not working #256

Closed momodiame21 closed 2 months ago

momodiame21 commented 2 months ago

Hi, I'm trying to use a function transformCounts which is from 'mia' package but i'm encountering an error related to matrixStats. See below

tse <- transformCounts(tse, method = "relabundance")
Error: [matrixStats (>= 1.2.0)] useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE. See also ?matrixStats::matrixStats.options
tse <- transformCounts(tse, method = "relabundance", useNames = TRUE)
Error in transformCounts(tse, method = "relabundance", useNames = TRUE) : 
  unused argument (useNames = TRUE)
> # Calculates relative abundances, and stores the table to assays
> tse <- transformCounts(tse, method = "relabundance", useNames = FALSE)
Error in transformCounts(tse, method = "relabundance", useNames = FALSE) : 
  unused argument (useNames = FALSE)
HenrikBengtsson commented 2 months ago

Hello, from what package is transformCounts()?

Also, please format your code blocks and output as "Code" to make it easier to read. You can use the <> button in the editor for this; just mark the lines and click <>. You can even edit existing comments of yours to fix them up.

yaccos commented 2 months ago

The package in question is the mia package (https://github.com/microbiome/mia/). It does not depand on matrixStats directly, but rather on DelayedMatrixStats (https://github.com/microbiome/mia/blob/21a74d19e7b858e70e0608384113c56382b410f9/DESCRIPTION#L61). It would be very helpful if you could provide a minimal working example and a traceback of the error.

HenrikBengtsson commented 2 months ago

@momodiame21 , what version of R and Bioconductor are you using? If you do:

library(mia)
sessionInfo()

what do you get? I would expect this to have been fixed in mia or DelayedMatrixStats a while back, so I suspect you're running an old Bioconductor version.

There's nothing you can do on your end, but if you're running old versions, then updating should fix it.

momodiame21 commented 2 months ago

The issue is resolved. I made an amateur error. Sorry for wasting your time