alanocallaghan / scater

Clone of the Bioconductor repository for the scater package.
https://bioconductor.org/packages/devel/bioc/html/scater.html
94 stars 40 forks source link

partial match argument warning/error #196

Closed LiNk-NY closed 1 year ago

LiNk-NY commented 1 year ago

Hi Alan, @Alanocallaghan

It looks like plotColData is using a partial argument $val instead of the full name $value or even better [["value"]]. To reproduce, you can set the option options(warn = 2L) or add the options in the chunk below. Here is the error:

>     options(warn = 2L)
>     suppressPackageStartupMessages({
+         library(TENxPBMCData)
+         library(scater)
+     })
>     sce <- TENxPBMCData("pbmc3k")
snapshotDate(): 2023-04-04
see ?TENxPBMCData and browseVignettes('TENxPBMCData') for documentation
loading from cache
>     sce$nCounts <- colSums(counts(sce))
>     plotColData(sce, "nCounts")
Error in y_by_out$val : 
  (converted from warning) partial match of 'val' to 'value'

https://github.com/Alanocallaghan/scater/blob/60e1a8b0a01a80d838e58dab101608391836006d/R/plotColData.R#L73

FWIW, I keep these options in my ~/.Rprofile for good practice:

options(
    warnPartialMatchAttr = TRUE,
    warnPartialMatchDollar = TRUE,
    warnPartialMatchArgs = TRUE
)

see here for reference https://kevinushey.github.io/blog/2015/02/02/rprofile-essentials/

Best, Marcel

alanocallaghan commented 1 year ago

Thanks, sorry for the delay as I'm on leave but will fix this next week

LiNk-NY commented 1 year ago

No worries. Thanks Alan @Alanocallaghan

alanocallaghan commented 1 year ago

I tried adding this to the test suite but I just get an avalanche of warnings from (eg) ggplot2, pheatmap using partial matching internally

LiNk-NY commented 1 year ago

Thanks Alan!