Code Monkey home page Code Monkey logo

bioccheck's Introduction

bioccheck's People

Contributors

c-mertes avatar dtenenba avatar dvantwisk avatar federicomarini avatar freekmanders avatar grimbough avatar hpages avatar jimhester avatar jwokaty avatar lcolladotor avatar link-ny avatar llrs avatar lshep avatar mtmorgan avatar nturaga avatar pkrog avatar shians avatar vobencha avatar zeehio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bioccheck's Issues

copy files in src folder with a filter

Hi,

I was using a 64 bit Windows system and trying to run BiocCheck() to test my package, the problem I have encountered is that BiocCheck() cannot work with devtools::load_all() function since it will make a compilation of the 32-bit package failed. The reason is that BiocCheck() will create a src-i386 folder which contains the same files as src folder and compile a 32bit dynamic library in that folder. Because load_all() will compile code and leave compiled files in the src folder, a direct copy of src folder will also copy the compiled files. Therefore, make will believe that the code has been compiled and try to link 64bit .o files to create a 32bit DLL and trigger an error. Here is the error message:

BiocCheck::BiocCheck()
This is BiocCheck version 1.19.31. BiocCheck is a work in progress. Output and severity of issues may
change. Installing package...
  cmd: C:/PROGRA~1/R/R-36~1.0/bin/R
  args: --vanilla CMD INSTALL --no-test-load --library=C:\Users\Jeff\AppData\Local\Temp\Rtmp6DcBjL\file1e2072347a9f/lib "C:/Users/Jeff/OneDrive/course material/work/Roswell park/SharedObject"
  stderr:
  * installing *source* package 'SharedObject' ...
  ** using staged installation
  ** libs
  
  *** arch - i386
  C:\Rtools\mingw_32\bin\nm.exe: C_interface.o: File format not recognized
  C:\Rtools\mingw_32\bin\nm.exe: C_memoryManagerInterface.o: File format not recognized
  C:\Rtools\mingw_32\bin\nm.exe: RcppExports.o: File format not recognized
  C:\Rtools\mingw_32\bin\nm.exe: altrepCommonFunc.o: File format not recognized
  C:\Rtools\mingw_32\bin\nm.exe: altrepRegistration.o: File format not recognized
  C:\Rtools\mingw_32\bin\nm.exe: memoryManager.o: File format not recognized
  C:\Rtools\mingw_32\bin\nm.exe: tools.o: File format not recognized
  C_interface.o: file not recognized: File format not recognized
  collect2.exe: error: ld returned 1 exit status
  no DLL was created
  ERROR: compilation failed for package 'SharedObject'
  * removing 'C:/Users/Jeff/AppData/Local/Temp/Rtmp6DcBjL/file1e2072347a9f/lib/SharedObject'
    * ERROR: C:/Users/Jeff/OneDrive/course material/work/Roswell park/SharedObject must be installable.
Error in (function (package, help, pos = 2, lib.loc = NULL, character.only = FALSE,  : 
  there is no package called ‘SharedObject’

After deleting all compiled files in the src folder, BiocCheck() works as usual. A solution for this problem can be using a filter when doing the copy of the src folder and filter out .o, .so, .dll files. I'm not sure if BiocCheck() has a control over it. If not, I would appreciate if you can direct me to the right place to submit this bug report.

Best,
Jiefei

Misleading error message for documentation check

One of the error messages that BiocCheck can spit out is: "At least 80% of man pages documenting exported objects must have runnable examples".

However, the actual assert is that more than 80% of exported objects should be covered: https://github.com/Bioconductor/BiocCheck/blob/master/R/checks.R#L950

Additionally, I would suggest to change this check when there are small number of functions exported (<= 5), otherwise it means that all the functions should have runnable examples which could be impractical for some cases.

add flags to point to build/check output files?

A lot can be learned from the output of R CMD build and R CMD check; for example, whether the vignette is built, whether unit tests are run, and so on. In the context of the single package builder, the output of these commands is readily available so we could pass the filenames to BiocCheck so that it could do additional checks. The .Rcheck directory is also available....

Check failure on R Markdown templates containing child chunks

Hi, I'm running into an issue with BiocCheck failing on R Markdown templates that contain chunks with a child call to an external file. For example, the templates in bcbioRNASeq work fine but are causing BiocCheck to error.

Here's an example:
https://github.com/hbc/bcbioRNASeq/blob/master/inst/rmarkdown/templates/quality-control/skeleton/skeleton.Rmd

BiocCheck is returning an error because _header.Rmd doesn't exist in the same directory as the source R Markdown in the package. That's true, but the file is downloaded by the prepareTemplate() function defined in basejump; see prepareTemplate() source code. This makes juggling shared header, footer, and setup files a lot easier across templates and packages.

Here's an example output of the check failure:

* Checking coding practice...
Warning in file(con, "r") :
  cannot open file '/data00/bcbioRNASeq/inst/rmarkdown/templates/differential-expression/skeleton/_header.Rmd': No such file or directory
Calls: BiocCheck ... process_tangle.block -> lapply -> FUN -> knit -> readLines -> file
Quitting from lines 45-45 (/data00/bcbioRNASeq/inst/rmarkdown/templates/differential-expression/skeleton/_header.Rmd)
Error in file(con, "r") : cannot open the connection
Calls: BiocCheck ... process_tangle.block -> lapply -> FUN -> knit -> readLines -> file
Backtrace:
     █
  1. └─global::BiocCheck()
  2.   └─BiocCheck::BiocCheck(...)
  3.     └─BiocCheck:::checkCodingPractice(package_dir, parsedCode, package_name)
  4.       └─BiocCheck:::checkLogicalUseFiles(pkgdir)
  5.         ├─base::unlist(lapply(FUN = makeTempRFile, allFiles))
  6.         └─base::lapply(FUN = makeTempRFile, allFiles)
  7.           └─BiocCheck:::FUN(X[[i]], ...)
  8.             └─knitr::purl(input = infile, output = outfile, quiet = TRUE)
  9.               └─knitr::knit(..., tangle = TRUE)
 10.                 └─knitr:::process_file(text, output)
 11.                   ├─base::withCallingHandlers(...)
 12.                   ├─knitr:::process_tangle(group)
 13.                   └─knitr:::process_tangle.block(group)
 14.                     └─base::lapply(sc_split(params$child), knit_child)
 15.                       └─knitr:::FUN(X[[i]], ...)
 16.                         └─knitr::knit(..., tangle = opts_knit$get("tangle"), envir = envir)
 17.                           └─base::readLines(input, encoding = "UTF-8", warn = FALSE)
 18.                             └─base::file(con, "r")

I can confirm that setting the --no-check-coding-practices flag works for this issue but seems a little heavy because it will skip some other checks that are helpful. Looking in the BiocCheck::usage() documentation, I'm not seeing any other options for skipping the child chunk check. Can we add one?

Potentially related issues: #17, #46.

Best,
Mike

WARNING with empty/missing \value section in man pages describing data sets

A warning is issued for a man page describing data objects when it doesn't contain a non-empty \value section.

* Checking man pages...
    * WARNING: Add non-empty \value sections to the following man
      pages: ...

According to "Writing R Extensions" Section 2.1.2 Documenting data sets:

The structure of Rd files which document R data sets is slightly different. Sections such as \arguments and \value are not needed but the format and source of the data should be explained.

Therefore, a \value section on a data man page shouldn't be enforced. In fact, even the template produced by a call to package.skeleton doesn't include this section.

Data sets man pages can be told apart from other man pages based on the \keyword entry which for data sets should always be 'datasets'.

Add test for Remotes?

This one just tripped me up, so I wonder if it's worth adding a test to BiocCheck that checks for packages listed in the Remotes field in the DESCRIPTION file. I'm not totally up with the structure of the BiocCheck package so my apologies if this is clumsy, but maybe something along the lines of:

checkRemotes <- function(pkgdir)
{
    ## Parse the DESCRIPTION FILE
    dcf <- read.dcf(file.path(pkgdir, "DESCRIPTION"))
    ## Check for the presence of anything in the Remotes field
    chkRemotes <- grepl("Remotes", colnames(dcf))
    
    if (any(chkRemotes)){
        handleError("Package dependency in the DESCRIPTION is not hosted on",
                    "CRAN or Bioconductor")
    }
}

Clarifying objects initialized

There is an old issue Bioconductor/biocCheck.old#43 I found today.
It changed to a NOTE in the latest version:

* Checking to see if we understand object initialization....
    * NOTE: Consider clarifying how object ‘y’ (used in X) was
      initialized. Maybe it is part of a data set loaded with data(),
      or perhaps part of an object referenced in with() or within().

What is the meaning of this "Consider clarifying how object ‘y’ (used in X) was initialized"? How can it be clarified?

BiocCheck should not be a Bioc-mirror fork

There should be no forks coming out of Bioconductor-mirror.
The mirror is deprecated.

Please update the BiocCheck repository in the git server if there are any differences
and use the git server repository version to create a new repository under
the Bioconductor account.

Thanks!

Regards,
Marcel

Recommend styler over formatR suggestion

Hi,

Based on my recent work for r-lib/actions#84 and at https://github.com/leekgroup/derfinderPlot/blob/master/dev/02_update.R, I want to make a small PR to BiocCheck and http://www.bioconductor.org/developers/how-to/coding-style/. This is directly related to r-lib/styler#636.

While formatR has been really helpful, in my experience when I use it, I need to double check very carefully all the code as it might change the meaning of some of it. My understanding is that styler is the package that is best maintained now for styling code (you still need to check your code! but styler seems to do a better job) and I quickly stumbled upon it yesterday on a Google search. Unlike formatR, it's compatible with tidyverse code (magrittr pipes and multi-line piped code), it also updates the example code in roxygen2-formatted examples. For my derfinderPlot package (a small one I was testing things with), it didn't break any code unlike formatR (see r-lib/styler#636 for the quotes issue).

styler has a styler::tidyverse_style() function and at r-lib/styler#636 I'm suggesting creating a styler::bioc_style() or styler::bioc_like_style() function that builds upon their styler::tidyverse_function(). Even without such a function, you can currently use styler like I did so at https://github.com/leekgroup/derfinderPlot/blob/master/dev/02_update.R#L2-L12 when updating my derfinderPlot package. Hopefully they like the idea, at which point, I would make a PR in styler. Probably styler::bioc_like_style() is the better name since I wouldn't want the function to enforce things like camelCase, somefunc(a=1, b=2) over somefunc(a = 1, b = 2), but well, those aren't really checked by BiocCheck anyway.

Both styler and formatR have issues with line lengths as noted in r-lib/styler#247, but from what I read there, it's a very complicated problem.

For BiocCheck, if you like the idea, I'm suggesting making a PR that either recommends styler first and formatR second, or only recommends styler (given that styler seems to me more actively maintained). I would also like to make the same suggestion for http://www.bioconductor.org/developers/how-to/coding-style/ though I don't know if there's a GitHub repo for the Bioc website.

Best,
Leo

Incomplete error information

If the biocViews field is empty in the DESCRIPTION file, the error message would be:

$`error`
[1] "Add biocViews other than "

which is hard to understand, It might be better if the error message can be more informative in this case.

Failed BiocCheck when using knitr Engine in rnw vignette

I encountered problems with the new BiocCheck version in the devel branch.

In the release version it is running through with no problems. in the devel version it stops with the following error:

Error in match.arg(options$results, c("verbatim", "tex", "hide")) : 
  'arg' should be one of “verbatim”, “tex”, “hide”
Calls: <Anonymous> ... Stangle -> Sweave -> SweaveParseOptions -> check -> match.arg
Execution halted

For more details I have our package on travis, where the error message can be checked.
https://travis-ci.org/gagneurlab/OUTRIDER/builds/397133569

I tracked it down to the function call
BiocCheck -> checkCodingPractice -> checkLogicalUseFiles -> makeTempRFile

I think the problem is, that the function assumes it is in Sweave format, if the ending is rnw, but ignores the vignette engine. We use the knitr engine and therefore it cant be parsed by Stangle. I guess adding an check for the vignette engine should do the trick.

I will add do a PR for this issue.

If I used the file ending in conjunction with the vignette engine in a wrong way, please let me know.

Checking maintainer subscription to BioC developers mailing list

Hi Kevin,

Great package! Very useful prior to my BioC submission. Just one suggestion to add:

The current checks do not seem to verify whether the maintainer is subscribed to the BioC developers mailing list (please do correct me if I am wrong!). Maybe you can add that as a default check? It's the only thing that prevented BASiCS from building after I submitted the package.

Best

Cata

Avoid 1:...; false positive on hard-coded ranges

I understand the rationale behind discouraging 1:variable or 1:function(variable), but there are some instances where I know that I want the first (or last, or ...) n elements of a vector or list. In my code I have:

  ## remove the first 5 bins, eliminating noisy artifacts produced by
  ## instrument compensation. This is below the level of actual data, so
  ## shouldn't cause any problems with analysis.
  intensity[1:5] <- 0

This raises the flag, suggesting you'd prefer I use intensity[seq_len(5)]? I think in this case 1:5 is both safe and more easily understood than the alternative? Is it possible to exclude such cases from this rule?

Error when a vignette fragment is imported through 'child=' code chuck option

Hi,

I'm encountering problems during BiocCheck, which are likely caused by the functions not finding vignette files. In the package I have a master vignette which serves as skeleton for including parts placed in "src" subfolder by using child= code chunk option. BiocCheck fails during line parsedCode <- parseFiles(package_dir). The linked toy example reproduces the described behavior, see also the output below.

Best regards,
Małgorzata

> R CMD BiocCheck toy_0.1.3.tar.gz 
This is BiocCheck version 1.13.1. BiocCheck is a work in progress.
Output and severity of issues may change. Installing package...
* Checking for version number mismatch...
    This is not a software package, skipping vignette checks...
* Checking version number...
* Checking version number validity...
    Package version 0.1.3; pre-release
* Checking R Version dependency...
* Checking biocViews...
* Checking that biocViews are present...
* Checking for non-trivial biocViews...
* Checking that biocViews come from the same category...
* Checking biocViews validity...
* Checking for recommended biocViews...
* Checking build system compatibility...
* Checking for blank lines in DESCRIPTION...
* Checking for whitespace in DESCRIPTION field names...
* Checking that Package field matches directory/tarball name...
* Checking for Version field...
* Checking for valid maintainer...
* Checking unit tests...
    * NOTE: Consider adding unit tests. We strongly encourage them. See
      http://bioconductor.org/developers/how-to/unitTesting-guidelines/.
Loading required namespace: knitr
Error in readLines(if (is.character(input2)) { :
  cannot open the connection
Calls: <Anonymous> -> BiocCheck -> parseFiles -> parseFile
Execution halted

BiocCheck should fail fast when the server does't return an HTTP 200

Rather than doing an early return at this line : https://github.com/Bioconductor/BiocCheck/blob/master/R/checks.R#L1133 , it would be better for the check to error (as it is a true error condition for the build system to not be authenticated). This function will not run if it's invoked from a user's machine, since the BIOC_DEVEL_PASSWORD environment variable is not defined.

As such, I'd recommend doing the following instead :

stop("Unable to authenticate with mailing list: 'https://stat.ethz.ch/mailman/admin/bioc-devel'")

/cc @dtenenba @jimhester

Detect mis-use of Suggests:

If in the DESCRIPTION file a package has

Suggests: foo

And then somewhere in package code (R/*.R) they do something like this:

foo::some_func()

The package code might fail because Suggests dependencies are not installed by default.
This problem could be masked if the foo package just happens to be installed on the build system. But then it could bite the end user who does not have it installed.

Oftentimes people do something like this deliberately when a package is optional, to
lighten its dependency stack, but they usually wrap the code in something like:

if (require(foo))
{
    # functionality that uses foo
}

If they do this, they don't need the :: anymore inside that conditional.

So I guess BiocCheck should REQUIRE that any package used in :: notation in package R code should be in Imports (or, less ideally, Depends), and the relevant function be imported in NAMESPACE. And of course, point out that the :: can be removed once they've done this.

finding NEWS.md in package directory

Hi Lori, @lshep
It doesn't seem like NEWS.md is found by BiocCheck.

Location: https://github.com/waldronlab/SingleCellMultiModal/blob/master/NEWS.md

SPB response:

* Checking package NEWS...
    * NOTE: Consider adding a NEWS file, so your package news will be
      included in Bioconductor release announcements.

Related BiocCheck line:

BiocCheck/R/checks.R

Lines 1262 to 1263 in 1cdf169

newsloc <- file.path(pkgdir, c("inst", ".",".", "inst"),
c("NEWS.Rd", "NEWS.md", "NEWS", "NEWS"))

Potential solution based on requirements here:

1.	./inst/NEWS.Rd	latex
2.	./inst/NEWS	plain text
3.	./inst/NEWS.md	mardown
4.	./NEWS.md	markdown
5.	./NEWS	plain text
> apply(expand.grid(c(".", "inst"), c("NEWS.Rd", "NEWS.md", "NEWS")), 1L, paste, collapse = "/")[-1]
[1] "inst/NEWS.Rd" "./NEWS.md"    "inst/NEWS.md" "./NEWS"       "inst/NEWS"   

Thanks!

Rcpp packages still triggering registered routine check.

Dan made a commit to attempt to disable this check for packages using Rcpp BiocCheck@ef3fff5fbb But this ends up not working because most Rcpp using packages use Rcpp::compileAttributes() and this generates a RcppExports.R file which contains .Call(). So in practice Rcpp packages still get this check and the subsequent RECOMMEND even when it is not completely applicable.

system file check

Have a system file check for files that should not be included in the directory (.o / .so / .dll / etc) - Move from python implemented code in SPB

Warn when using default `eval=FALSE` setup

The user should get a warning when using eval = FALSE in a knitr setup chunk such as:

'''{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, eval = FALSE)
'''

Regards,
Marcel

BiocCheck exit code

Hi Martin and Lori, @mtmorgan @lshep

I've integrated Travis-CI with BiocCheck but I'm still having issues getting an non-zero exit code
when running BiocCheck via Rscript:

git clone [email protected]:waldronlab/MultiAssayExperiment && cd MultiAssayExperiment
Rscript -e "BiocCheck::BiocCheck()"

the return code is

$ echo $?
0

when it should be a 1.

The exit code works okay via R CMD BiocCheck.

Regards,
Marcel

Misterious error "* Checking library calls... Error in parse(outfile, keep.source = TRUE) (...) unexpected symbol 6: 7: Create a"

Hello,
I was running BiocCheck in a in-development package( www.github.com/lubianat/PubScore) and
I got an error in my BiocCheck that I was not able to figure out the source.

This was the error found:

  • Checking library calls...
    Error in parse(outfile, keep.source = TRUE) :
    /tmp/RtmpwYXYVW/file2cda59db730a/parseFile.tmp:7:8: unexpected symbol
    6:
    7: Create a
    ^
    When searching the internet, I could not find the solution for it.

Do you know what might be causing that? Is that a common error?

Thank you very much,
Tiago

Error

See this submission where the issue was raised.

This is related to this helper file, which unexpectedly returns more than one element (perhaps this should be separate function?):

BiocCheck/R/checks.R

Lines 227 to 236 in 6fa591d

vigHelper <- function(vignetteFile, builder){
lines <- readLines(vignetteFile, n=100L, warn=FALSE)
idx <- grep(lines, pattern="VignetteEngine")
if (length(idx) != 0){
eng <- gsub("::.*", "", gsub(".*\\{|\\}.*", "", lines[idx]))
return(eng %in% builder)
} else {
return(NA)
}
}

It could be solved via by changing return(...) to return(all(eng %in% builder))

Could not run BiocCheck

Hello,

When I tried to use BiocCheck to check the package, I got the following error (By the way, I am using Win10, not sure whether this is a cause):

> library(BiocCheck)
> BiocCheck("D:/RNAseqProject/bayNorm_dev/bayNorm")
This is BiocCheck version 1.18.0. BiocCheck is a work in
progress. Output and severity of issues may change. Installing
package...
  cmd: C:/allR/R-35~1.1PA/bin/R
  args: --vanilla CMD INSTALL --no-test-load --library=C:\Users\wt215\AppData\Local\Temp\RtmpuKZ06R/lib "D:/RNAseqProject/bayNorm_dev/bayNorm"
  stderr:
  * installing *source* package 'bayNorm' ...
  ** libs
  
  *** arch - i386
  Warning in system(cmd) : 'make' not found
  ERROR: compilation failed for package 'bayNorm'
  * removing 'C:/Users/wt215/AppData/Local/Temp/RtmpuKZ06R/lib/bayNorm'
  In R CMD INSTALL
    * ERROR: D:/RNAseqProject/bayNorm_dev/bayNorm must be
      installable.
Error in (function (package, help, pos = 2, lib.loc = NULL, character.only = FALSE,  : 
  there is no package called ‘bayNorm’

The Check Package command provided by RStudio works ok.

How to solve this?

Thanks a lot!

> sessionInfo()
R version 3.5.1 Patched (2018-11-13 r75601)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936 
[2] LC_CTYPE=Chinese (Simplified)_China.936   
[3] LC_MONETARY=Chinese (Simplified)_China.936
[4] LC_NUMERIC=C                              
[5] LC_TIME=Chinese (Simplified)_China.936    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] BiocCheck_1.18.0

loaded via a namespace (and not attached):
 [1] stringdist_0.9.5.1  codetools_0.2-15    XML_3.98-1.16      
 [4] bitops_1.0-6        R6_2.3.0            RBGL_1.58.1        
 [7] stats4_3.5.1        httr_1.3.1          graph_1.60.0       
[10] biocViews_1.50.5    getopt_1.20.2       optparse_1.6.0     
[13] RUnit_0.4.32        tools_3.5.1         Biobase_2.42.0     
[16] RCurl_1.95-4.11     yaml_2.2.0          parallel_3.5.1     
[19] compiler_3.5.1      BiocGenerics_0.28.0 BiocManager_1.30.4 
[22] knitr_1.20         

Method to determine the package name

Hi,

I recently has changed my package name and found that BioCheck() uses the folder name instead of the name in the DESCRIPTION file to determine the package name. Therefore, if the folder has a name different from the package name, BioCheck() will fail to load the package. Here is a simple example to show the bug.

DESCRIPTION:

Package: SharedObject

Package directory:

C:\Users\Jeff\OneDrive\course material\work\Roswell park\SharedObject_copy

BiocCheck() output:

> getwd()
[1] "C:/Users/Jeff/OneDrive/course material/work/Roswell park/SharedObject_copy"
> 
> BiocCheck::BiocCheck(package="C:/Users/Jeff/OneDrive/course material/work/Roswell park/SharedObject_copy")
This is BiocCheck version 1.19.31. BiocCheck is a work in progress. Output and severity of issues may
change. Installing package...
* Checking Package Dependencies...
* Checking if other packages can import this one...
* Checking to see if we understand object initialization...
* Checking for deprecated package usage...
* Checking for remote package usage...
* Checking version number...
* Checking version number validity...
    Package version 0.99.0; pre-release
* Checking R Version dependency...
* Checking package size...
        Skipped... only checked on source tarball
* Checking individual file sizes...
* Checking biocViews...
* Checking that biocViews are present...
* Checking package type based on biocViews...
    Software
* Checking for non-trivial biocViews...
* Checking that biocViews come from the same category...
* Checking biocViews validity...
* Checking for recommended biocViews...
* Checking build system compatibility...
* Checking for blank lines in DESCRIPTION...
* Checking if DESCRIPTION is well formatted...
* Checking for whitespace in DESCRIPTION field names...
* Checking that Package field matches directory/tarball name...
    * ERROR: Package directory 'SharedObject_copy' must match Package: field (got 'SharedObject').
* Checking DESCRIPTION/NAMESPACE consistency...
    * WARNING: Import BiocGenerics in DESCRIPTION as well as NAMESPACE.
* Checking vignette directory...
    This is a software package
* Checking library calls...
* Checking for library/require of SharedObject...
* Checking coding practice...
    * NOTE: Avoid sapply(); use vapply()
      Found in files:
        pkgSetting.R (line 41, column 5)
        resourcesManager.R (line 25, column 3)
        resourcesManager.R (line 60, column 7)
        tools.R (line 121, column 19)
Error in loadNamespace(name) : 
  there is no package called ‘SharedObject_copy’
> 
> 
> BiocCheck::BiocCheck(package="SharedObject")
Error: 'C:/Users/Jeff/OneDrive/course material/work/Roswell park/SharedObject_copy/SharedObject' does not exist!
In addition: Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="SharedObject": The system cannot find the file specified

It seems like if the package name is not consistent with the folder name, running a BiocCheck is not very simple. It will be better if BiocCheck() can detect the package name in the DESCRIPTION file not the package directory.

Best,
Jiefei

object (function) order

Hi Lori, @lshep

I was wondering if this order should be reversed.
I'm used to seeing the function first and the object contained within.
To me it would make more sense to have a NOTE like this:

   * NOTE: Consider clarifying how 1 object(s) are initialized. Maybe
      it is part of a data set loaded with data(), or perhaps part of
      an object referenced in with() or within().
    object (function)
      gene_name (runGIGSEA)

read as:

function (object)
  runGIGSEA (gene_name)

OR have the note read differently:

object in function
  gene_name in runGIGSEA

Regards,
Marcel

Check vignette title

BiocCheck should confirm the vignette title. For instance, I copied the vignette header from a template and I did not notice that the vignette title was set with the line %\VignetteIndexEntry{Vignette Title}.

I have seen other packages with such titles and I'm sure there are more people like me that thought the name of the vignette would be retrieved from title instead. Maybe this could print a warning or, at least, a note?

try to detect wrong setup for non-Sweave vignettes

Example: https://tracker.bioconductor.org/issue1443
Affected tarball: https://tracker.bioconductor.org/file7436/MMDiff2_0.99.0.tar.gz

It's a knitr vignette but the DESCRIPTION file does not have the
VignetteBuilder: knitr line in it.

So when BiocCheck tries to Stangle the vignette (prior to parsing its code) it crashes because it is expecting an Sweave vignette.

However, the vignette does have a VignetteEngine line. So it seems like BiocCheck could detect this situation and REQUIRE that it be fixed before proceeding. It could also detect the opposite situation (VignetteBuilder line in DESCRIPTION but no VignetteEngine line in the vignette) and probably other permutations as well (no VignetteIndexEntry?).

.git etc not ignored by checkIndivFileSizes

When running BiocCheck() on the RCM package ( https://github.com/CenterForStatistics-UGent/RCM ) I get the following warning :

$warning
[1] "The following files are over 5MB in size: '.git/objects/pack/pack-740ada64c24e3f429d86431cae7e341dab19b815.pack'"

That's pretty odd, as the .git folder is a hidden folder in the root directory and part of the git system. I have added the following to .Rbuildignore :

\.gitignore
\.git/*

but to no avail. I keep getting the same warning, which doesn't even make sense. Warning is given every time when I try to run BiocCheck::BiocCheck() from the console in the RStudio project for this package.

EDIT:

Traced the problem back to checkIndivFileSizes which just takes all files and folders of the project directory (as opposed to the installed package). That's why I also changed the title of the issue.

For reference: I first thought it was an issue with R CMD INSTALL and contacted r-devel for this:

https://stat.ethz.ch/pipermail/r-devel/2018-December/077091.html

Naughty behavior: installing files into R_HOME installation without asking for permission

Hi, I just discovered that the BiocCheck package installs files into R.home("bin") if it can:

$ ls -l lib/R/bin/Bioc*
-rwxr-xr-x 1 hb hb 269 Aug 11 16:34 lib/R/bin/BiocCheck
-rwxr-xr-x 1 hb hb 277 Aug 11 16:34 lib/R/bin/BiocCheckGitClone

and it does so without asking for permission or notifying the user. It "just" happens when the package is loaded:

BiocCheck/R/zzz.R

Lines 20 to 25 in 6722da6

.onLoad <- function(libname, pkgname)
{
if (.isScriptInstalled())
return()
.installScript()
}

It also happens when the package is installed.

Example

$ Rscript -e 'dir(R.home("bin"), pattern="Bioc")'
character(0)
$ Rscript -e 'BiocManager::install("BiocCheck")'
[...]
BiocCheck and BiocCheckGitClone script installed.
[...]
$ Rscript -e 'dir(R.home("bin"), pattern="Bioc")'
[1] "BiocCheck"         "BiocCheckGitClone"

$ Rscript -e 'file.remove(dir(R.home("bin"), pattern="Bioc", full.names=TRUE))'
[1] TRUE TRUE

$ Rscript -e 'loadNamespace("BiocCheck")'
BiocCheck and BiocCheckGitClone script installed.
<environment: namespace:BiocCheck>

$ Rscript -e 'dir(R.home("bin"), pattern="Bioc")'
[1] "BiocCheck"         "BiocCheckGitClone"

I argue that this is rather bad behavior. This hack sets a precedence that it's ok to do so. At a minimum, it should always ask the user for permission prior to installing files, especially to R.home().

On a related note: I do find it useful we could have customized flavors of R CMD check, just like --as-cran is one. Something like:

R CMD check --flavor=CRAN MyPkg
R CMD check --flavor=Bioconductor MyPkg

I think this is something we could convince R core to implement. I've started a discussion on this at HenrikBengtsson/Wishlist-for-R#16 a while back.

BiocCheck does not recognise NEWS.md

Issue Description

When we include the file NEWS.md at the top level of our package, BiocCheck() returns

NOTE: "Consider adding a NEWS file, so your package news will be included in Bioconductor release announcements."

When we remove the .md file extension, saving the file as NEWS instead, this note disappears.

Our package is available at https://github.com/gabrielodom/pathwayPCA

Session Info

R Under development (unstable) (2019-02-12 r76095)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] pathwayPCA_0.99.3

loaded via a namespace (and not attached):
[1] graph_1.61.0 magrittr_1.5 knitr_1.21 splines_3.6.0
[5] BiocGenerics_0.29.1 BiocCheck_1.19.26 getopt_1.20.2 lattice_0.20-38
[9] R6_2.3.0 stringr_1.4.0 httr_1.4.0 tools_3.6.0
[13] biocViews_1.51.14 grid_3.6.0 parallel_3.6.0 Biobase_2.43.1
[17] xfun_0.4 lars_1.2 yaml_2.2.0 survival_2.43-3
[21] RBGL_1.59.1 optparse_1.6.1 Matrix_1.2-15 BiocManager_1.30.4
[25] bitops_1.0-6 codetools_0.2-16 curl_3.3 RCurl_1.95-4.11
[29] RUnit_0.4.32 stringdist_0.9.5.1 stringi_1.3.1 compiler_3.6.0
[33] stats4_3.6.0 XML_3.98-1.17 jsonlite_1.6

not catching incorrect biocViews

The AneuFInderData package (https://tracker.bioconductor.org/issue1397), specifically the version from
2016-03-11.05:39:49, has these biocViews:

biocViews: ExperimentData, CopyNumberVariation, GenomicVariation,
        WholeGenome

ExperimentData is valid but the others are all under Software. BiocCheck is supposed to detect this.

This build report does not report it:

https://bioconductor.org/spb_reports/AneuFinder_0.99.1_buildreport_20160311143437.html#zin2_check_anchor

It should (IIRC) report something between these two lines:

* Checking that biocViews come from the same category...
* Checking biocViews validity...

Not sure if this is due to recent @mtmorgan changes but I tend to doubt it because unit tests passed after that commit (and I think that functionality is covered). Anyway, I'll take a look.

Error when checking examples with `\dontrun`

Hi Lori, @lshep
I get an error when using BiocCheck on my package:

* Checking coding practice...
    * NOTE: Avoid sapply(); use vapply() found in files:
      RaggedExperiment-class.R (line 361, column 13)
Error in source(fl, local = env) : 
  /tmp/RtmpOdc8J1/assay-functions-Ex.R.R:13:1: unexpected input
12: 
13: \
    ^

The package and error line / file can be found here:
https://github.com/Bioconductor/RaggedExperiment/blob/master/inst/scripts/assay-functions-Ex.R#L12

Thanks!
Marcel

BiocCheck breaks when `[` is aliased.

If you put

foo <- `[`

Somewhere in a package, it will trigger

Error in makeUsageCollector(fun, ...) : only works for closures

In BiocCheck::BiocCheck() (version 1.18.0). This comes from

if (typeof(fun) != "closure")
       stop("only works for closures")

In codetools::makeUsageCollector(), and the fact that

typeof(\`[\`)
## "special"

False positive with system()

In scran, I have a function named .create_linear_system(). BiocCheck 1.17.11 flags this as:

    * NOTE: Avoid system() ; use system2()
      Found in files:
        R/computeSumFactors.R (line 108)
        tests/testthat/test-sumnorm.R (line 94)
        tests/testthat/test-sumnorm.R (line 141)

Seems like a simple fix - just check that "system(" isn't preceded by valid name characters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.