预安装 conda envs Snakemake

发布于 2025-01-10 05:45:42 字数 302 浏览 0 评论 0原文

当尝试运行 Snakemake 时,我总是必须安装/下载 conda envs。

(snakemake) (ec2-user)$ bash run_snakemake.sh
Building DAG of jobs...
Creating conda environment ../envs/svg_env.yaml...
Downloading and installing remote packages.

有办法预装吗?我注意到 conda envs 安装在 .snakemake/ 文件夹内。

When trying to run snakemake, I always have to install/download conda envs.

(snakemake) (ec2-user)$ bash run_snakemake.sh
Building DAG of jobs...
Creating conda environment ../envs/svg_env.yaml...
Downloading and installing remote packages.

Is there a way to preinstall? I notice that conda envs get installed inside .snakemake/ folder.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吃→可爱长大的 2025-01-17 05:45:42

根据 docs,运行此命令将创建环境:

snakemake --use-conda --conda-create-envs-only

相关引用:

Conda 部署也适用于离线或气隙环境。运行 snakemake --use-conda --conda-create-envs-only 只会安装所需的 conda 环境,而不会运行完整的工作流程。随后使用 --use-conda 运行将使用本地环境,无需访问互联网。

As per docs, running this will create the envs:

snakemake --use-conda --conda-create-envs-only

Relevant quote:

Conda deployment also works well for offline or air-gapped environments. Running snakemake --use-conda --conda-create-envs-only will only install the required conda environments without running the full workflow. Subsequent runs with --use-conda will make use of the local environments without requiring internet access.

残花月 2025-01-17 05:45:42

@SultanOrazbayev 对于预安装有正确的答案,但根据您每次运行时重新安装的问题,我还想指出,默认情况下,snakemake 将其 .snakemake 目录放在工作目录中。如果您使用它多次运行工作流程,可能会导致环境重新安装。为了防止这种情况,您可以设置 singularity-prefixconda-prefix 选项。

另外值得注意的是,虽然它被称为 conda-create-envs-only,但如果您使用 use-singularity 运行,它也会设置奇点图像。

@SultanOrazbayev has the right answer for preinstall, but based on your question of reinstalling every run, I also wanted to note that by default snakemake places its .snakemake dir in the working directory. If you are utilizing that to run your workflow multiple times, it could cause the environments to reinstall. To prevent that, you can set the singularity-prefix and conda-prefix options.

Also of note, while it is called conda-create-envs-only it will also set up singularity images if you run with use-singularity.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文