总是报错:'str' object is not callable in my snakemake for RNA-seq workflow
always report errors: 'str' object is not callable in my snakemake for RNA-seq workflow
我想用 snakemake 编写我的 RNA-seq 管道,但它总是报告相同的 errors.It 让我很烦!
下图显示当前文件夹下的整个文件。
|-- 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)
不知道怎么回事。让我烦了一整天!希望有人能帮忙me.Thanks提前!
问题在于您在 rule all
中使用 expand
函数的方式。 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])
我想用 snakemake 编写我的 RNA-seq 管道,但它总是报告相同的 errors.It 让我很烦!
下图显示当前文件夹下的整个文件。
|-- 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)
不知道怎么回事。让我烦了一整天!希望有人能帮忙me.Thanks提前!
问题在于您在 rule all
中使用 expand
函数的方式。 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])