我想知道如何在我的Snakefiles中管理路径。说我有这个配置:
current_dir
current_dir/snakefiles
current_dir/configfiles
我以这种方式执行我的工作流程:
current_dir$ snakemake -s snakefiles/my_snakefile --configfile configfiles/my_config.yml
我知道我可以使用全局变量workflow.snakefile
获取我的Snakefile的路径,但我也想得到:
current_dir
如何实现这一目标? Snakemake中还有其他全局变量,我不知道吗?
谢谢
答案 0 :(得分:2)
工作目录是通过Python设置的。您可以使用os.getcwd()
获取它。另请注意,有一种规范的方式来组织Snakemake工作流程:http://snakemake.readthedocs.io/en/latest/project_info/faq.html#what-is-the-recommended-way-to-distribute-a-snakemake-workflow。
虽然您当然可以使用其他内容,但遵循此方案可帮助其他人了解您的工作流程。当然可能存在不适合的情况。