即使强制执行规则,工作流的结果总是 "无事可做"。

问题描述 投票:1回答:1

因此,正如标题所说,我不能让我的工作流执行任何东西,除了所有规则......当执行所有规则时,它正确地找到所有的输入文件,所以configfile是好的,每个路径都是正确的。

当试图在没有附加标签的情况下运行时,我得到

Building DAG of jobs...
Checking status of 0 jobs.
Nothing to be done

我试过的事情。

  1. -f rcorrector -> 只有所有的规则。
  2. 文件名R1.fcor_val1.fq -> MissingRuleException (No Typos)
  3. --forceall -> 只有所有规则。
  4. 我还在摸索中,不能清楚地表达出来

求助

from os import path

configfile:"config.yaml"

RNA_DIR = config["RAW_RNA_DIR"]
RESULT_DIR = config["OUTPUT_DIR"]

FILES = glob_wildcards(path.join(RNA_DIR, '{sample}R1.fastq.gz')).sample
############################################################################
rule all:
    input:
        r1=expand(path.join(RNA_DIR, '{sample}R1.fastq.gz'), sample=FILES),
        r2=expand(path.join(RNA_DIR, '{sample}R2.fastq.gz'), sample=FILES)


#############################################################################

rule rcorrector:
    input:
        r1=path.join(RNA_DIR, '{sample}R1.fastq.gz'),
        r2=path.join(RNA_DIR, '{sample}R2.fastq.gz')
    output:
        o1=path.join(RESULT_DIR, 'trimmed_reads/corrected/{sample}R1.cor.fq'),
        o2=path.join(RESULT_DIR, 'trimmed_reads/corrected/{sample}R2.cor.fq')
    #group: "cleaning"
    threads: 8
    params: "-t {threads}"
    envmodules:
        "bio/Rcorrector/1.0.4-foss-2019a"
    script:
        "scripts/Rcorrector.py"

############################################################################

rule FilterUncorrectabledPEfastq:
    input:
        r1=path.join(RESULT_DIR, 'trimmed_reads/corrected/{sample}R1.cor.fq'),
        r2=path.join(RESULT_DIR, 'trimmed_reads/corrected/{sample}R2.cor.fq')
    output:
        o1=path.join(RESULT_DIR, "trimmed_reads/filtered/{sample}R1.fcor.fq"),
        o2=path.join(RESULT_DIR, "trimmed_reads/filtered/{sample}R2.fcor.fq")
    #group: "cleaning"
    envmodules:
        "bio/Jellyfish/2.2.6-foss-2017a",
        "lang/Python/2.7.13-foss-2017a"
        #TODO: load as module
    script:
        "/scripts/filterUncorrectable.py"

#############################################################################

rule trim_galore:
    input:
        r1=path.join(RESULT_DIR, "trimmed_reads/filtered/{sample}R1.fcor.fq"),
        r2=path.join(RESULT_DIR, "trimmed_reads/filtered/{sample}R2.fcor.fq")
    output:
        o1=path.join(RESULT_DIR, "trimmed_reads/{sample}.fcor_val1.fq"),
        o2=path.join(RESULT_DIR, "trimmed_reads/{sample}.fcor_val2.fq")
    threads: 8
    #group: "cleaning"
    envmodules:
        "bio/Trim_Galore/0.6.5-foss-2019a-Python-3.7.4"
    params:
        "--paired --retain_unpaired --phred33 --length 36 -q 5 --stringency 1 -e 0.1 -j {threads}"
    script:
        "scripts/trim_galore.py"
snakemake
1个回答
2
投票

在 snakemake 中,你把管道的最终输出文件定义为 目标文件 并将它们定义为流水线第一条规则的输入。这条规则传统上被命名为 all (最近为 targets 在Snakemake doc中)。)

在你的代码中。rule all 指定了管道的输入文件,而这些文件已经存在了,因此 snakemake 并没有看到任何事情要做。它只是需要从管道中指定感兴趣的输出文件。

rule all:
    input:
        expand(path.join(RESULT_DIR, "trimmed_reads/{sample}.fcor_val{read}.fq"), sample=FILES, read=[1,2]),

为什么你尝试的方法没有成功?

  1. -f 不起作用。

根据 文档:

--force, -f     

Force the execution of the selected target or the first rule regardless of already created output.

Default: False

在你的代码中,这意味着 rule all,它没有 output 定义,因此什么也没发生。

  1. filenameR1.fcor_val1.fq

这不符合 output 的任何规则,因此,错误 MissingRuleException.

  1. --强制全部

同理 -f 在你的情况下,标志。

--forceall, -F  

Force the execution of the selected (or the first) rule and all rules it is dependent on regardless of already created output.

Default: False
© www.soinside.com 2019 - 2024. All rights reserved.