Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • N ngs_tools
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value stream
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • bioinfo
  • ngs_tools
  • Issues
  • #56

Closed
Open
Created Jun 19, 2019 by domingue@domingueMaintainer

dge_workflow: echoing R code in to Rscript not loading personal library packages

The function dge_star_counts2matrix, located in dge_utils stops with the error:

devtools::source_url("https://git.mpi-cbg.de/bioinfo/datautils/raw/v1.40/R/core_commons.R")
Error in loadNamespace(name) : there is no package called ‘devtools’
Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

I tracked it down and this occurs because of the flag "--vanilla" in:

| R --no-save --no-restore --no-site-file -q. This flag keeps the R environment "clean" but that also means R packages installed in personal libraries are not loaded - thus the error despite devtools being installed.

There are two (three) solutions for this:

  1. Replace --vanilla flag with --no-save --no-restore --no-site-file since vanilla is in fact a wrapper for --no-save, --no-restore, --no-site-file, --no-init-file and --no-environ. Removing the flags causing the issue will work (I tested it).
  2. Instead of echoing the Rcode (echo '[some code]' | R --no-save --no-restore --no-site-file -q) we could the approach Rscript - <<"EOF" [some code] EOF. This was also tested and also works, but I have not looked into unintended consequences (loading of hidden R files for instance).
  3. More of a long term solution, and probably not feasible, keep these R snippets in their separate .R files, or as functions, a call them with Rscript some_function.R.

For the time being I would suggest either of 1. and 2. @herseman If you have any preference let me know so that I make the PR.


A consequence of this bug, and that was how I found it, is that star_align.kts will not produce the count matrix table and, afaik, finish successfully with a reported warning.

Assignee
Assign to
Time tracking