Snakemake:我一直在获取'conda'命令在$ PATH中不可用.在SGE群集上运行时 [英] Snakemake: I keep getting The 'conda' command is not available in $PATH. when running on SGE cluster
问题描述
我在这里扯头发,希望有人可以帮助我.
I'm tearing my hair out here, hopefully someone can help me.
运行snakemake 4.8.0
Running snakemake 4.8.0
我有一个snakemake管道,该管道与两个conda envs和--use-conda一起运行,并且在作为独立管道运行时可以正常工作.
I have a snakemake pipeline, which I run with two conda envs and --use-conda and it works fine when run as a standalone pipeline.
但是,当我在集群上运行时,出现错误:
However, when I run on our cluster, I get the error:
'conda'命令在$ PATH中不可用."
"The 'conda' command is not available in $PATH."
现在.Anaconda已安装在我们的群集上,但是我们需要使用以下命令在节点上将其激活:
Now. Anaconda is installed on our cluster, but we need to activate it on nodes with:
module load anaconda
此外,模块被定义为一个函数,因此我首先要介绍一些东西.因此,在我的snakefile的顶部,我有:
Also, module is defined as a function, so I have source a couple of things first. Therefore, at the top of my snakefile, I have:
shell.prefix("source $HOME/.bashrc; source /etc/profile; module load anaconda; )
这不能解决问题.
我什至在 .bashrc
中放入了 module load anaconda
,但这仍然行不通.仅在集群执行时,我收到关于找不到conda的错误.
I even put module load anaconda
in my .bashrc
, and that still doesn't work. Only on cluster execution, I get the error about conda not being found.
我的 .bashrc
的其他更改被蛇形拾取并拾取,所以我不知道为什么它在conda上有问题.
Other changes to my .bashrc
are picked up and are picked up by snakemake, so I have no idea why it is having problems with conda.
我什至创建了一个conda env,将snakemake和conda加载到该env中,在提交脚本和Snakefile中激活该env:
I even created a conda env, loaded snakemake and conda into that env, activate the env in the submission script and in the Snakefile:
shell.prefix("source $HOME/.bashrc; source /etc/profile; module load anaconda; source activate MAGpy-3.5; ")
并且它 still 说:'conda'命令在$ PATH中不可用."
And it still says "The 'conda' command is not available in $PATH."
从字面上将我的头发扯掉.
Literally tearing my hair out.
顺便说一句,我使用 qsub -S/bin/bash
提交,还使用 shell.executable("/bin/bash")
,但使用临时shell脚本在 .snakemake
中创建的文件由/bin/sh
运行-可以吗?
As an aside, I submit using qsub -S /bin/bash
and also use shell.executable("/bin/bash")
but the temp shell scripts created in .snakemake
are run by /bin/sh
- is that expected?
请帮助我!
推荐答案
您可以提供自定义的"jobscript模板",您尝试过吗?默认值如下:
You can provide a custom "jobscript template", have you tried that? The default one looks like this:
#!/bin/sh
# properties = {properties}
{exec_job}
所以也许您的样子可能是这样的:
So perhaps yours could look this like:
#!/bin/bash
# properties = {properties}
module add anaconda
{exec_job}
,然后在运行snakemake时使用-jobscript
参数引用该文件.
and then you refer to this file with the --jobscript
parameter when you run snakemake.
P.S.如果您在代码中查找,则在没有任何 PATH
设置的情况下,调用 python -m snakemake
来填充 {exec_job}
导致您看到的错误.
P.S. if you look in the code the {exec_job}
is filled in with a call to python -m snakemake
without any PATH
setting, which I think contributes to the error you are seeing.
这篇关于Snakemake:我一直在获取'conda'命令在$ PATH中不可用.在SGE群集上运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!