python - Snakemake使用错误的环境
问题描述
我正在从 shell 脚本调用 Snakemake 工作流程。
但首先我需要激活一个包含 snakemake 和其他已安装库的环境。
source ${CONDA_HOME}/etc/profile.d/conda.sh
conda activate myenv
# then call the workflow.
snakemake 工作流程中的规则conda:
用于创建自己的环境。其中一条规则使用 python 运行一些脚本:
rule readsStat:
"""
Input is the reads output is info about reads
"""
input: expand(data_dir + "/{sample}", sample=sample_list)
output:data_dir + "/statitics/raw_reads/reads_stat.txt",
message: "Calculating read coverage statitics for: {input}",
params:
read_stat_script = rawcoverage_script,
threads: config['read_raw_coverage_threads']
benchmark: data_dir + "/benchmark/raw_reads/stat.benchmark.txt"
conda: STAT_ENV
shell:
"""
python {params.read_stat_script} -i {input} -o {output} -t {threads}
"""
问题是在规则激活了正确的环境而不是使用它(例如,.snakemake/conda/532a617ec7374b7bff46f066e73/bin/python
)之后,他们仍然使用我之前在调用脚本中激活的myenv
python 。envs/myenv/bin/python
知道我该如何解决吗?
谢谢
更新:
版本
conda 4.10.1
Snakemake 6.2.1
解决方案
问题在于:
source ${CONDA_HOME}/etc/profile.d/conda.sh
删除此行使 Snakemake 按预期工作。
谢谢
推荐阅读
- android - W/VRSystemServiceManager(number): vr 服务不活跃
- c - 如何无害地杀死子进程
- testing - 如何将测试用例从测试管理器迁移到 Azure Dev ops?
- java - 出现错误:java.lang.NoClassDefFoundError: javax/mail/MessagingException
- python - pyzbar 未检测到 Code93 条码
- javascript - 如何以正确的方式捆绑 AntD?
- flutter - 是否可以使用颤振实时跟踪所覆盖的公里数?
- c# - 使用 DigitalPersona 5300 Reader 进行指纹采集。如何在 Windows 服务中检测设备?
- c - 将数据添加到函数内部的结构,但外部值为空
- c# - Lidgren 客户加入编辑器但未构建