我想用snakemake编写我的RNA-seq管道,但是它总是报告相同的错误。这使我很烦!
以下显示了当前文件夹中的整个文件。
|-- 01_raw
| |-- epcr1_1.fastq
| |-- epcr1_2.fastq
| |-- epcr2_1.fastq
| |-- epcr2_2.fastq
| |-- wt1_1.fastq
| |-- wt1_2.fastq
| |-- wt2_1.fastq
| `-- wt2_2.fastq
|-- 02_clean
| `-- id.txt
|-- Snakefile
`-- Snakemake2.py
我的全部内容都在Snakefile中
SBT=["wt1","wt2","epcr1","epcr2"]
rule all:
input:
expand("02_clean/{nico}_1.paired.fq.gz","02_clean/{nico}_2.paired.fq.gz",nico=SBT)
rule trim_galore:
input:
"01_raw/{nico}_1.fastq",
"01_raw/{nico}_2.fastq"
output:
"02_clean/{nico}_1.paired.fq.gz",
"02_clean/{nico}_1.unpaired.fq.gz",
"02_clean/{nico}_2.paired.fq.gz",
"02_clean/{nico}_2.unpaired.fq.gz",
log:
"02_clean/{nico}_qc.log"
shell:
"Trimmomatic PE -threads 16 {input[0]} {input[1]} {output[0]} {output[1]} {output[2]} {output[3]} ILLUMINACLIP:/software/Trimmomatic-0.36/adapters/TruSeq3-PE-2.fa:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36 &"
当我使用命令“ snakemake -np”来dry_run时,希望它可以平稳运行,但是它总是报告相同的错误:
TypeError in line 6 of /root/s/r/snakemake/my_rnaseq_data/Snakefile:
'str' object is not callable
File "/root/s/r/snakemake/my_rnaseq_data/Snakefile", line 6, in <module>
第6行是
expand("02_clean/{nico}_1.paired.fq.gz","02_clean/{nico}_2.paired.fq.gz",nico=SBT)
我不知道这是怎么回事。我整天烦死了!希望有人能帮助我。谢谢前进!
答案 0 :(得分:1)
问题在于您如何使用expand
中的rule all
函数。 expand
作用于一个字符串,但您提供了两个。这将起作用:
rule all:
input:
expand("02_clean/{nico}_1.paired.fq.gz", nico=SBT),
expand("02_clean/{nico}_2.paired.fq.gz", nico=SBT)
或者,您可以进一步简化:
rule all:
input:
expand("02_clean/{nico}_{n}.paired.fq.gz", nico=SBT, n=[1,2])