Skip to content

[Bioc-devel] Interpreting BiocCheck output

8 messages · Marcel Ramos, Giulia Pais, Martin Morgan +3 more

#
Hello,
I?m having some issues in interpreting BiocCheck outputs, maybe someone can tell me how to fix the issues.

I?ve got 2 main issues that cause the check to fail after normal CRAN check has passed:

  1.  I get this error message

* Checking if other packages can import this one...

    * ERROR: Packages providing 2 object(s) used in this package should be imported in the NAMESPACE file, otherwise packages importing

      this package may fail.



However it is nowhere mentioned which packages they are and where those objects are instantiated so I have no clue how to solve this one

  1.  Since previous version of the package, which built and passed checks without issues, I?ve been using a custom *.Rmd file placed in inst/rmd in the vignette to recycle the same chunk of code and optimizing time in phase of update (I update info only once instead of 4 times). Even if the package passes CRAN checks, BiocCheck errors telling me it can?t find this Rmd file and therefore can?t evaluate the chunk where it is mentioned. Any suggestion on this?

Thanks in advance
Giulia
1 day later
#
Hi Giulia,

Are you using a recent version of BiocCheck?

If so, check the bottom of the BiocCheck::BiocCheck():

---
See the <packageName>.BiocCheck folder and run
 ??? browseVignettes(package = 'BiocCheck')
for details.
---

Can you provide more details, e.g., the repository of the package?

Thanks.

Best regards,

Marcel
On 10/4/22 4:44 AM, Giulia Pais wrote:
This email message may contain legally privileged and/or...{{dropped:2}}
#
Hi, thanks for the reply. I managed to fix the first error as it was a minor issue in the code, while for the second one I don?t have a solution since the problem appears only locally and not on Biconductor after the build.

Just for reference the package is ISAnalytics and the BiocCheck version is the latest one.

Thanks again,
Giulia

From: Bioc-devel <bioc-devel-bounces at r-project.org> on behalf of Marcel Ramos <marcel.ramosperez at roswellpark.org>
Date: Wednesday, 2022October5 at 23:48
To: bioc-devel at r-project.org <bioc-devel at r-project.org>
Subject: Re: [Bioc-devel] EXTERNAL: Interpreting BiocCheck output
Hi Giulia,

Are you using a recent version of BiocCheck?

If so, check the bottom of the BiocCheck::BiocCheck():

---
See the <packageName>.BiocCheck folder and run
     browseVignettes(package = 'BiocCheck')
for details.
---

Can you provide more details, e.g., the repository of the package?

Thanks.

Best regards,

Marcel
On 10/4/22 4:44 AM, Giulia Pais wrote:
This email message may contain legally privileged and/or...{{dropped:2}}

_______________________________________________
Bioc-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel
1 day later
#
Hi Giulia,

Thanks for sharing.
I took a look at https://github.com/calabrialab/ISAnalytics and I'm glad 
you resolved the issue.

Just a reminder, you can also use `utils::globalVariables('.')` in your 
package for functions
that use `'.'` (and other symbols) as a variable, e.g. in `purrr::pmap`.

Best regards,

Marcel
On 10/6/22 4:34 AM, Giulia Pais wrote:
This email message may contain legally privileged and/or...{{dropped:4}}
#
Just my two cents, but I don?t think using `globalVariables()` is a good idea in a package ? it?s too easy to say that R should ignore a variable that it should not.

In the context of dplyr, the alternative is to `importFrom dplyr .data` or to use ?standard? evaluation, depending on circumstance
# A tibble: 4 ? 11
    mpg   cyl  disp    hp  drat    wt  qsec    vs    am  gear  carb
  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1  32.4     4  78.7    66  4.08  2.2   19.5     1     1     4     1
2  30.4     4  75.7    52  4.93  1.62  18.5     1     1     4     2
3  33.9     4  71.1    65  4.22  1.84  19.9     1     1     4     1
4  30.4     4  95.1   113  3.77  1.51  16.9     1     1     5     2
mpg cyl
Mazda RX4     21.0   6
Mazda RX4 Wag 21.0   6
Datsun 710    22.8   4

Martin

From: Bioc-devel <bioc-devel-bounces at r-project.org> on behalf of Marcel Ramos <marcel.ramosperez at roswellpark.org>
Date: Friday, October 7, 2022 at 3:07 PM
To: bioc-devel at r-project.org <bioc-devel at r-project.org>
Subject: Re: [Bioc-devel] Interpreting BiocCheck output
Hi Giulia,

Thanks for sharing.
I took a look at https://github.com/calabrialab/ISAnalytics and I'm glad
you resolved the issue.

Just a reminder, you can also use `utils::globalVariables('.')` in your
package for functions
that use `'.'` (and other symbols) as a variable, e.g. in `purrr::pmap`.

Best regards,

Marcel
On 10/6/22 4:34 AM, Giulia Pais wrote:
This email message may contain legally privileged and/or...{{dropped:4}}

_______________________________________________
Bioc-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel
#
I'm throwing in another 1 cent.

I agree that utils::globalVariables() is risky; since it goes in the
root of the package code, it applies to *all* functions in the
package, which is a bit too broad of a stroke for my taste.  The way I
deal with false globals from non-standard evaluation (NSE), is to
declare them a as dummy variables local to the function.  In this
case, I would use:

myfcn <- function() {
  ## To please R CMD check
  mpg <- cyl <- NULL

  mtcars |> select(mpg, cyl) |> head(3)
}


ADVANCED:

To avoid those dummy assignments from taking place in every call, one
can also do:

myfcn <- local({
  ## To please R CMD check
  mpg <- cyl <- NULL

  function() {
    mtcars |> select(mpg, cyl) |> head(3)
  }
})

which is also a bit cleaner, because it keeps the original function body as-is.


REALLY ADVANCED:
If you want to be fancy, you can even protect against mistakes by using:

myfcn <- local({
  ## To please R CMD check
  mpg <- cyl <- NULL

  ## Prevent developer mistakes
  lapply(names(environment()), function(name, envir) {
    delayedAssign(
      name,
      stop(sprintf("INTERNAL ERROR: %s is not declared",
sQuote(name)), call. = FALSE),
      assign.env = envir
    )
  }, envir = environment())

  function() {
    mtcars |> select(mpg, cyl) |> head(3)
  }
})

The latter would throw an error, if you actually end up using 'mpg' or
'cyl' in a non-NSE way.

/Henrik
On Fri, Oct 7, 2022 at 12:29 PM Martin Morgan <mtmorgan.bioc at gmail.com> wrote:
#
Hi Giulia, hi all

I often run BiocCheck::BiocCheck() on my packages and end up with errors,
warnings and notes that have not printed specific enough messages, just as
you did.

When that happens, on the same R terminal, I use:

BiocCheck::.BiocCheck$error
BiocCheck::.BiocCheck$warning
BiocCheck::.BiocCheck$note

(please note the leading dot after the double colon)

Those three lists include more specific details. Often even the file names
and line numbers where the error occurred (In my experience I've found line
numbers to not be always perfectly accurate, but it's a good enough
approximation).

There may be a better way to get that information through some BiocCheck
log or other reporting facility, but that's convenient enough for me. I
hope this helps you.

Best
Sergio


El dv., 7 d?oct. 2022, 21:49, Henrik Bengtsson <henrik.bengtsson at gmail.com>
va escriure:

  
  
3 days later
#
If you are running locally,  there is also a <package>.BiocCheck folder that gets created with a log that has the more specific information as well.

Cheers,


Lori Shepherd - Kern

Bioconductor Core Team

Roswell Park Comprehensive Cancer Center

Department of Biostatistics & Bioinformatics

Elm & Carlton Streets

Buffalo, New York 14263