【问题标题】:An WorkflowError with wildcards带有通配符的 WorkflowError
【发布时间】:2018-04-03 03:20:31
【问题描述】:
我想使用snakemake QC 的fastq 文件,但它表明:
工作流错误:
目标规则不能包含通配符。请指定具体文件
或没有通配符的规则。
我写的代码是这样的
SAMPLE = ["A","B","C"]
rule trimmomatic:
input:
"/data/samples/{sample}.fastq"
output:
"/data/samples/{sample}.clean.fastq"
shell:
"trimmomatic SE -threads 5 -phred33 -trimlog trim.log {input} {output} LEADING:20 TRAILING:20 MINLEN:16"
我是新手,如果有人知道,请告诉我。非常感谢!
【问题讨论】:
标签:
error-handling
wildcard
snakemake
【解决方案1】:
您可以执行以下操作之一,但您可能想要执行后一个操作。
-
通过命令行显式指定输出文件名:
snakemake data/samples/A.clean.fastq
这将运行规则来创建文件data/samples/A.clean.fastq
-
使用rule all 指定要在 Snakefile 本身中创建的目标输出文件。 See here 了解更多关于通过rule all 添加目标的信息
SAMPLE_NAMES = ["A","B", "C"]
rule all:
input:
expand("data/samples/{sample}.clean.fastq", sample=SAMPLE_NAMES)
rule trimmomatic:
input:
"data/samples/{sample}.fastq"
output:
"data/samples/{sample}.clean.fastq"
shell:
"trimmomatic SE -threads 5 -phred33 -trimlog trim.log {input} {output} LEADING:20 TRAILING:20 MINLEN:16"