未正确安装带有集成 conda env 的 Snakemake

Snakemake with integrated conda env not properly installed

我的 snakemake 管道中有一个规则到 运行 multiqc :

    rule summaryReport:
        input:
            fastqc_forward = expand(final_path + "/fastqc/{sample}_R1_fastqc.html", sample = samples),
            fastqc_rev = expand(final_path + "/fastqc/{sample}_R2_fastqc.html", sample = samples)
        output:
            report = final_path + "/fastqc/report_quality_control.html"
        params:
            path = final_path + "/fastqc"
        conda:
            "multiqc.yaml"
        shell:
            "multiqc {params.path} --filename {output.report}"

使用 conda env 文件 multiqc.yaml :

name: multiqc 
channels:
  - conda-forge
  - bioconda
dependencies:
  - multiqc=1.12

当我 运行 管道时出现以下错误:

Activating conda environment: /XXXX/.snakemake/conda/e8f3e6def45259d12dddd42fcd679657
Traceback (most recent call last):
  File "/XXXX/.snakemake/conda/e8f3e6def45259d12dddd42fcd679657/bin/multiqc", line 6, in <module>
    from multiqc.__main__ import multiqc
ModuleNotFoundError: No module named 'multiqc'

我测试过手动激活conda环境,确实在运行ning multiqc时出现了同样的错误。

由于 snakemake 外部的“multiqc.yaml”,我已经测试过创建一个 conda 环境,在这种情况下,multiqc 是 运行ning 正确。

如果有人对此有想法,那将对我有很大帮助!

提前致谢

您很可能还想安装 python,因为根据 docs 不建议使用 system-wide python:

name: multiqc 
channels:
  - conda-forge
  - bioconda
dependencies:
  - python=3.7
  - multiqc=1.12