[Bioc-devel] BiocCheck

Dan Tenenbaum dtenenba at fhcrc.org
Thu May 29 20:47:09 CEST 2014



----- Original Message -----
> From: "Kasper Daniel Hansen" <kasperdanielhansen at gmail.com>
> To: "Dan Tenenbaum" <dtenenba at fhcrc.org>
> Cc: bioc-devel at r-project.org
> Sent: Thursday, May 29, 2014 10:51:56 AM
> Subject: Re: [Bioc-devel] BiocCheck
> 
> 
> This is the content of the Sweave script in lib/R/bin
> 
> 
> 
> # ${R_HOME}/bin/Sweave -*- sh -*-
> 
> 
> R_EXE="${R_HOME}/bin/R"
> 
> 
> R_SWEAVE_OPTIONS=${R_SWEAVE_OPTIONS:='--no-restore --slave'}
> 
> 
> args=
> while test -n "${1}"; do
> ## quote each argument here, unquote in R code.
> args="${args}nextArg${1}"
> shift
> done
> 
> 
> echo "utils:::.Sweave()" | "${R_EXE}" $R_SWEAVE_OPTIONS --args
> ${args}
> 
> 
> as you can see, it gets run essentially as a pipe to R, instead of
> through R script. That means command line variable parsing in
> .BiocCheckFromCommandLine gets messed up. This is probably easy to
> fix, but it requires some insight into the R function.
> 
> 

This is how you would fix it:

#!/bin/sh

R_SCRIPT="suppressPackageStartupMessages(library(methods))"
R_SCRIPT="$R_SCRIPT; suppressPackageStartupMessages(library(methods))"
R_SCRIPT="$R_SCRIPT; suppressPackageStartupMessages(library(BiocCheck))"
R_SCRIPT="$R_SCRIPT; BiocCheck:::.BiocCheckFromCommandLine()"

echo "$R_SCRIPT" | $R_HOME/bin/R --vanilla --slave --args $*


So you are welcome to change the BiocCheck script to that on your machine. I have to think some more before I do this in the package, though, because currently on windows, there is a BiocCheck.bat script that calls Rscript on the BiocCheck script; so in other words, it depends on BiocCheck being an Rscript script. So I would need to figure out how to rewrite the above script as a windows batch file. I don't think I can get to that for a while.

Dan



> I like how the Sweave script uses that R_HOME is defined when run
> through R CMD XX.
> 
> 
> Best,
> Kasper
> 
> 
> 
> On Thu, May 29, 2014 at 11:07 AM, Dan Tenenbaum < dtenenba at fhcrc.org
> > wrote:
> 
> 
> Hi Kasper,
> 
> 
> ----- Original Message -----
> > From: "Kasper Daniel Hansen" < kasperdanielhansen at gmail.com >
> > To: bioc-devel at r-project.org
> > Sent: Wednesday, May 28, 2014 7:20:00 AM
> > Subject: [Bioc-devel] BiocCheck
> > 
> > 1) The hash bang in the BiocCheck script currently requires
> > intervention at
> > install time.
> > 
> 
> Only if you don't have permission to write the script to $R_HOME/bin.
> Otherwise it is handled for you.
> 
> I would prefer to use
> 
> #!/usr/bin/env Rscript
> 
> but the problem with that is you can't add an argument like:
> 
> #!/usr/bin/env Rscript --vanilla
> 
> env doesn't support that.
> 
> 
> 
> 
> > It would be much more convenient if the script could read of the
> > location
> > of R, in the same way as (say) the Sweave script can. In fact, I
> > modified
> > the BiocCheck script as per the Sweave script but ran into problems
> > with
> > .BiocCheckFromCommandLine, and figured I better stop.
> > 
> 
> What does Sweave do? What problem did you run into?
> 
> 
> 
> > 2) Re. the checks for coding style: it would be convenient if there
> > was an
> > option (perhaps disabled by default, perhaps not) which lists the
> > offending
> > files for each "issue".
> > 
> 
> I think this would need to be disabled by default; in practice I see
> that many many files per package are "offending".
> 
> I can't get to this right away but I've added
> 
> https://github.com/Bioconductor/BiocCheck/issues/13
> 
> Dan
> 
> 
> > Best,
> > Kasper
> > 
> > [[alternative HTML version deleted]]
> > 
> > _______________________________________________
> > Bioc-devel at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/bioc-devel
> > 
> 
>



More information about the Bioc-devel mailing list