Select() from stan_model clashes with org.Hs.egPFAM


#21

from https://stackoverflow.com/questions/34589497/r-calling-internal-function-from-an-exported-function-inside-package

"
But I read that using :::is not recommended.

I think you mention this based on the following statement in the manual for writing packages by R.

Using foo:::f instead of foo::f allows access to unexported objects. This is generally not recommended, as the semantics of unexported objects may be changed by the package author in routine maintenance.

"


#22

I might have identified the function, @jonah

And it might be third party fault

Does this function name ring any bell? (from https://rdrr.io/github/Bioconductor-mirror/AnnotationDbi/src/R/AnnDbPkg-templates-common.R)

warnIfDef <- function(){
    if(grepl("PFAM",x)){
        bimapName <- paste0(prefix,"PFAM")
    }else{
         bimapName <- paste0(prefix,"PROSITE")
    }
    x <- dc[[bimapName]]
    msg = wmsg(paste0(bimapName,
 " is defunct. ",
 "Please use select() if you need access to PFAM or PROSITE accessions. \n"))
    if(interactive()){
        .Defunct(msg=msg)
    }
}

error traceback:

> traceback()
9: stop(paste(msg, collapse = ""), call. = FALSE, domain = NA)
8: .Defunct(msg = msg)
7: (function () 
   {
       if (grepl("PFAM", x)) {
           bimapName <- paste0(prefix, "PFAM")
       }
       else {
           bimapName <- paste0(prefix, "PROSITE")
       }
       x <- dc[[bimapName]]
       msg = wmsg(paste0(bimapName, " is defunct. ", "Please use select() if you need access to PFAM or PROSITE accessions. \n"))
       if (interactive()) {
           .Defunct(msg = msg)
       }
   })()
6: FUN(X[[i]], ...)
5: lapply(X = X, FUN = FUN, ...)
4: sapply(li, exists, where = i, mode = mode, inherits = FALSE)
3: apropos(model_re, mode = "S4", ignore.case = FALSE)
2: stan_model(file, model_name = model_name, model_code = model_code, 
       stanc_ret = NULL, boost_lib = boost_lib, eigen_lib = eigen_lib, 
       save_dso = save_dso, verbose = verbose)
1: rstan::stan(file = "norm_hkg.stan", data = list(y = t(d.epithelial$counts[d.epithelial$genes$symbol %in% 
       hk_600, ]), S = ncol(d.epithelial[d.epithelial$genes$symbol %in% 
       hk_600, ]), G = nrow(d.epithelial[d.epithelial$genes$symbol %in% 
       hk_600, ])))

#23

I’ve never seen that warnIfDef. It looks like it stems from something triggered by calling apropos(). But that’s a function in the utils package (which is basically part of core R).