即使强制使用规则,工作流也始终会产生"Nothing to do"



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

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

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

我尝试过的东西:

  1. -f rcorrector->only all rule
  2. filenameR1.fcor_val1.fq->MissingRuleException(无类型(
  3. --forceall->only-all规则
  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中,您将管道的最终输出文件定义为目标文件,并在管道的第一条规则中将它们定义为输入。这个规则传统上被命名为all(最近在snakemake-doc中被命名为targets(。

在您的代码中,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. --forceall

与您的案例中-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

最新更新