总是报告错误:在我的snakemake中,对于RNA-seq工作流程,'str'对象不可调用

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

我想使用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>

而line6是

expand("02_clean/{nico}_1.paired.fq.gz","02_clean/{nico}_2.paired.fq.gz",nico=SBT)

我不知道它有什么问题。这整天都让我烦恼!希望有人能帮帮我。谢谢!

snakemake rna-seq
1个回答
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])
© www.soinside.com 2019 - 2024. All rights reserved.