Snakemake流水线Conda环境下MultiQC运行失败及依赖冲突问题求助
Snakemake流水线Conda环境下MultiQC运行失败及依赖冲突问题求助
我在运行Snakemake里的MultiQC规则时遇到了问题,先给大家展示相关的配置和报错信息:
有问题的Snakemake规则
rule multiqc_trimmed: input: expand("results/read_quality/QC_trimmed/fastqc/{sample}_{pr}.trimmed_fastqc.zip", sample=config['samples'], pr=MULTIFR) output: "results/read_quality/QC_trimmed/qcreport_trimmed.html" params: outdir="results/read_quality/QC_trimmed" threads: 1 log: "workflow/logs/multiqc_trimmed/multiqc.log" benchmark: "workflow/benchmarks/multiqc_trimmed/multiqc.tsv" conda: "../envs/qc.yaml" shell: """ FILENAME=$(basename {output}) multiqc {params.outdir} -n $FILENAME -o {params.outdir} &>> {log} """
对应的Conda环境配置文件qc.yaml
name: cel-qc channels: - bioconda - conda-forge dependencies: - fastqc =0.12.1 - multiqc =1.17
首次运行的报错日志
File "/home/cel-rnaseq/.snakemake/conda/5cfa1cb4cfd5e47de4c18a25342a7d05_/bin/multiqc", line 6, in <module> from multiqc.__main__ import run_multiqc File "/home/cel-rnaseq/.snakemake/conda/5cfa1cb4cfd5e47de4c18a25342a7d05_/lib/python3.6/site-packages/multiqc/__init__.py", line 16, in <module> from .multiqc import run File "/home/cel-rnaseq/.snakemake/conda/5cfa1cb4cfd5e47de4c18a25342a7d05_/lib/python3.6/site-packages/multiqc/multiqc.py", line 25, in <module> import rich_click as click File "/home/cel-rnaseq/.snakemake/conda/5cfa1cb4cfd5e47de4c18a25342a7d05_/lib/python3.6/site-packages/rich_click/__init__.py", line 16, in <module> from rich_click.rich_command import RichCommand File "/home/cel-rnaseq/.snakemake/conda/5cfa1cb4cfd5e47de4c18a25342a7d05_/lib/python3.6/site-packages/rich_click/rich_command.py", line 5, in <module> from rich_click.rich_click import rich_abort_error, rich_format_error, rich_format_help File "/home/cel-rnaseq/.snakemake/conda/5cfa1cb4cfd5e47de4c18a25342a7d05_/lib/python3.6/site-packages/rich_click/rich_click.py", line 5, in <module> import rich.markdown File "/home/cel-rnaseq/.snakemake/conda/5cfa1cb4cfd5e47de4c18a25342a7d05_/lib/python3.6/site-packages/rich/markdown.py", line 1 from __future__ import annotations ^ SyntaxError: future feature annotations is not defined
我一开始判断是Python版本太低的问题(日志里显示用的是Python 3.6,而from __future__ import annotations是3.7+才支持的语法),于是尝试了以下调整:
- 在环境配置里添加Python 3.10或3.12
- 将MultiQC升级到最新稳定版1.27.1
但调整后又遇到了各种依赖冲突的错误,举几个典型例子:
错误1:Python版本与MultiQC依赖冲突
The following packages are incompatible ├─ multiqc =1.17 * is installable and it requires │ └─ requests =* * with the potential options │ ├─ requests [2.10.0|2.11.0|...|2.9.2] would require │ │ └─ python =2.7 *, which can be installed; │ ├─ requests [2.10.0|2.11.0|...|2.9.2] would require │ │ └─ python =3.4 *, which can be installed; │ ├─ requests [2.10.0|2.11.0|...|2.9.2] would require │ │ └─ python =3.5 *, which can be installed; │ ├─ requests [2.12.4|2.12.5|2.13.0] would require │ │ └─ python =3.6 *, which can be installed; │ ├─ requests [2.17.3|2.18.1|2.18.2|2.18.3|2.18.4] would require │ │ └─ urllib3 >=1.21.1,<1.22 *, which conflicts with any installable versions previously reported; │ ├─ requests 2.18.4 would require │ │ └─ urllib3 >=1.21.1,<1.23 *, which conflicts with any installable versions previously reported; │ ├─ requests [2.19.0|2.19.1|2.20.0|2.20.1] would require │ │ └─ urllib3 >=1.21.1,<1.24 *, which conflicts with any installable versions previously reported; │ ├─ requests [2.21.0|2.22.0] would require │ │ └─ urllib3 >=1.21.1,<1.25 *, which conflicts with any installable versions previously reported; │ ├─ requests [2.22.0|2.23.0|2.24.0|2.25.0] would require │ │ └─ urllib3 >=1.21.1,(<1.26,(!=1.25.0,!=1.25.1)) *, which conflicts with any installable versions previously reported; │ ├─ requests [2.25.1|2.26.0|...|2.29.0] would require │ │ └─ urllib3 >=1.21.1,<1.27 *, which conflicts with any installable versions previously reported; │ └─ requests [2.31.0|2.32.1|2.32.2|2.32.3] would require │ └─ urllib3 >=1.21.1,<3 *, which conflicts with any installable versions previously reported; └─ python =3.10 * is not installable because it conflicts with any installable versions previously reported.
错误2:在Snakemake外创建环境时的依赖冲突
error libmamba Could not solve for environment specs The following package could not be installed └─ multiqc =1.27.1 * is not installable because it requires └─ tiktoken =* *, which requires └─ regex >=2022.1.18 *, which conflicts with any installable versions previously reported. critical libmamba Could not solve for environment specs
错误3:添加部分依赖后的新冲突
error libmamba Could not solve for environment specs The following packages are incompatible ├─ multiqc =1.27.1 * is not installable because it requires │ └─ pillow >=10.2.0 * but there are no viable options │ ├─ pillow [10.2.0|10.3.0|10.4.0] would require │ │ └─ libtiff >=4.6.0,<4.8.0a0 * but there are no viable options │ │ ├─ libtiff [4.6.0|4.7.0] would require │ │ │ └─ libdeflate >=1.21,<1.22.0a0 *, which conflicts with any installable versions previously reported; │ │ ├─ libtiff 4.7.0 would require │ │ │ └─ libdeflate >=1.22,<1.23.0a0 *, which conflicts with any installable versions previously reported; │ │ ├─ libtiff 4.7.0 would require │ │ │ └─ libdeflate >=1.23,<1.24.0a0 *, which conflicts with any installable versions previously reported; │ │ ├─ libtiff 4.6.0 would require │ │ │ └─ libdeflate >=1.20,<1.21.0a0 *, which conflicts with any installable versions previously reported; │ │ ├─ libtiff 4.6.0 would require │ │ │ └─ libdeflate >=1.19,<1.20.0a0 *, which conflicts with any installable versions previously reported; │ │ └─ libtiff 4.6.0 would require │ │ └─ libdeflate >=1.18,<1.19.0a0 *, which conflicts with any installable versions previously reported; │ └─ pillow [11.0.0|11.1.0] would require │ └─ libtiff >=4.7.0,<4.8.0a0 *, which cannot be installed (as previously explained); └─ regex =2024.11.6 * is not installable because it conflicts with any installable versions previously reported. critical libmamba Could not solve for environment specs
现在我遇到的困境是:手动在Conda环境里直接安装MultiQC是能正常运行的,但只要通过配置文件来创建环境就会出现各种依赖冲突。我尝试过把报错的依赖包明确写进配置文件(比如加了regex=2024.11.6),但又会触发新的依赖问题。想问问大家有没有什么解决思路?
备注:内容来源于stack exchange,提问作者Nuria
相关产品推荐
相关产品推荐

