1

我想知道如何管理我的 Snakefiles 中的路径。假设我有这个配置:

current_dir
current_dir/snakefiles
current_dir/configfiles

我以这种方式执行我的工作流程:

current_dir$ snakemake -s snakefiles/my_snakefile --configfile configfiles/my_config.yml

我知道我可以使用全局变量获得我的 Snakefile 的路径workflow.snakefile,但我也想获得:

  • 我的配置文件的路径
  • 我正在执行我的蛇文件的路径,例如current_dir

如何做到这一点?Snakemake 中是否还有其他我不知道的全局变量?

谢谢

4

1 回答 1

4

工作目录是通过 Python 设置的。你可以得到它os.getcwd()。另请注意,有一种组织 Snakemake 工作流程的规范方法:http: //snakemake.readthedocs.io/en/latest/project_info/faq.html#what-is-the-recommended-way-to-distribute-a-蛇制作工作流程

虽然您当然可以使用其他东西,但遵循此方案可以帮助其他人了解您的工作流程。当然,可能存在不适合的情况。

于 2017-01-16T12:41:02.677 回答