我在我的snakemake工作流中执行R脚本时遇到了一些问题。似乎我的个人.Rprofile文件被加载到了R脚本中。该作业在一个singularity容器内运行,问题是我在R配置文件中自动加载了一些未安装在容器中的软件包。当然,我可以通过编辑我的R配置文件来解决这个问题,但是任何想要使用该流水线的其他人都必须做同样的事情,这是我不喜欢的。有没有人有其他解决方法呢?
谢谢!
谢谢!
Rscript
:$ Rscript
Usage: /path/to/Rscript [--options] [-e expr [-e expr2 ...] | file] [args]
--options accepted are
--no-environ Don't read the site and user environment files
--no-site-file Don't read the site-wide Rprofile
--no-init-file Don't read the user R profile
--vanilla Combine --no-save, --no-restore, --no-site-file
--no-init-file and --no-environ
而且R
有一些选项可以帮助您解决这个问题:
$ R --help
Usage: R [options] [< infile] [> outfile]
or: R CMD command [arguments]
Start R, a system for statistical computation and graphics, with the
specified options, or invoke an R tool via the 'R CMD' interface.
Options:
--no-environ Don't read the site and user environment files
--no-site-file Don't read the site-wide Rprofile
--no-init-file Don't read the user R profile
--vanilla Combine --no-save, --no-restore, --no-site-file,
--no-init-file and --no-environ
--vanilla
是我想使用的参数。然而,我找不到一种方法在snakemake中传递该参数,同时仍然将R脚本作为脚本运行(这样做的优点是在R环境中有所有snakemake参数可用)。相反,我去了源代码并编辑了script.py文件.../lib/python3.6/site-packages/snakemake/script.py
:shell("Rscript {f.name}", bench_record=bench_record)
到
shell("Rscript --vanilla {f.name}", bench_record=bench_record)
现在可以工作了。
script.py
)中找到了这个:elif path.endswith(".R"): shell("Rscript {f.name}", bench_record=bench_record)
。所以我猜目前还不能传递参数。 - fakechek