saezlab/OmnipathR

Automatic logs in the working directory create problems for docker containers

dpryan79 opened this issue · 9 comments

As part of the Bioconda project we package all Bioconductor packages with conda and automatically create docker (and later singularity) containers for use in workflow systems such as Snakemake, NextFlow, and Galaxy. While creating the container for OmnipathR, we ran into problems because simply loading the package in R creates log files. These are created where ever the current working directory happens to be and tends to produce problems with docker containers (the automated tests fail because they lack root permissions needed to delete the log files inside the container). While I have adjusted the automatic tests to remove these logs, it would be good to not create log files if one simply runs library('OmnipathR') in R.

Xref: bioconda/bioconda-recipes#28911

Hi,

That's a good point. One solution could be if you create a config file at <user_config_path>/OmnipathR/omnipathr.yml with the content:

default
  omnipath.logfile: /dev/null

Alternatively, I can add an option to disable logging, which could be set from the config file or by an environment variable. Let me know if you prefer this.

Best,

Denes

An option would probably be easiest :)

Hi @dpryan79,

Since 38757b4 if you set the parameter omnipath.logfile to none , the logging to file is disabled. In the config file it looks like this:

default
  omnipath.logfile: none

Alternatively, the parameter can be set by an environment variable:

$ export OMNIPATH_LOGFILE="none"
$ R
> library(OmnipathR)
>

I hope this helps. This is currently here in our git repo, in version 3.1.2. I am wondering if there is a way to backport it to Bioc 3.13?

Best,

Denes

Awesome, thanks!

You should be able to post a bugfix update to the current bioconductor release. You'll need to bump the version to 3.0.1. Other than that I don't really know how the Bioconductor release process works.

Hi @dpryan79,

I backported this to Bioc 3.13, OmnipathR 3.0.1 has been propagated already for Linux and OSX, hopefully it will be updated also for Windows soon: http://bioconductor.org/packages/3.13/bioc/html/OmnipathR.html

Best,

Denes

I am not quite sure what the use of omnipath.logfile is: it does not seem to be useful to suppress creation of the logfile, supposedly because OmnipathR overwrites that option on first load and immediately creates the log file. See here:

options(omnipath.logfile='none')

getOption('omnipath.logfile')
[1] "none"

OmnipathR:::omnipath_has_logfile()
[1] TRUE

getOption('omnipath.logfile')
NULL

I found export OMNIPATH_LOGFILE="none" very useful, but I wonder how I can suppress creation of the log file from within R.

Sys.setenv(OMNIPATH_LOGFILE = 'none')
OmnipathR:::omnipath_has_logfile()

works ;)

You are right, now in 3.0.4 and 3.1.4 I made the options set before package loading to be preserved. These changes will be in BioC 3.13 and 3.14 hopefully soon.

Thanks, confirmed!