无法同时执行所有程序

Not able to execute all the programs simultaneously

我正在尝试使用 snakemake 设计生物信息学管道,但我无法同时执行这些程序。当我尝试单独 运行 时,我已确保所有规则 运行。

rule fast_QC:
    input:
           "/home/pal/BU243_S1_L001_R1_001.fastq.gz"
    output:
         html="/home/pal/BU243_S1_L001_R1_001.html",
         zip="/home/pal/BU243_S1_L001_R1_001.zip",
         gz="/home/pal/BU243_S1_L001_R1_001.fa"
    params:""
    log:
       "/home/pal/BU243_S1_L001_R1_001.log"
    shell:
        "fastqc {input}"

rule trim_galore:
     input:
     "/home/pal/BU243_S1_L001_R1_001.fa"
     output:
      html = "/home/pal/BU243_S1_L001_R1_001.html",
      zip = "/home/pal/BU243_S1_L001_R1_001.zip",
      gz = "/home/pal/BU243_S1_L001_R1_0012.gz"
     params:""
     log:
        "/home/pal/processed_BU243_S1_L001_R1_001.gz.log"
    shell:
        "trim_galore -a AACTGTAGGCACCATCAAT --length 18 --dont_gzip {input}"

我使用命令执行文件

snakemake --snakefile example.smake --dryrun

我只看到已执行的规则(即 fast_QC)。

您需要 add a target rule 在工作流程中指定最后一条规则的文件名。习惯上将该目标规则命名为all。我进一步修改了代码以对您的示例使用通配符。因此,现在您只需向 sample_list 添加更多样本,您的工作流程就会适当扩展。

sample_list = ['BU243_S1_L001_R1_001']

rule all:
    input:
        expand("/home/pal/{sample}.html",
                    sample=sample_list)


rule fast_QC:
    input:
        "/home/pal/{sample}.fastq.gz"
    output:
        html="/home/pal/{sample}.html",
        zip="/home/pal/{sample}.zip",
        gz="/home/pal/{sample}.fa"
    params:""
    log:
    "/home/pal/{sample}.log"
    shell:
        "fastqc {input}"

rule trim_galore:
    input:
        "/home/pal/{sample}.fa"
    output:
        html = "/home/pal/{sample}.html",
        zip = "/home/pal/{sample}.zip",
        gz = "/home/pal/{sample}2.gz"
    params:""
    log:
        "/home/pal/processed_{sample}.gz.log"
    shell:
        "trim_galore -a AACTGTAGGCACCATCAAT --length 18 --dont_gzip {input}"

在执行 snakemake 命令时:

  • 不要在命令行中使用 --dryrun,因为它只是显示将要执行的规则,但实际上不会 运行 它们。
  • 使用 --jobs 选项指定一次最多可以 运行 的作业数。如果未指定,则默认为一次 运行 作业 1.