gpt4 book ai didi

python - Snakefile 的各种迭代都会给出相同的错误

转载 作者:行者123 更新时间:2023-12-01 00:09:06 26 4
gpt4 key购买 nike

我正在尝试使用 Snakemake 来构建生物信息学管道。为了测试它,我制作了以下蛇文件。

我有一个包含各种 fastq.gz 文件的目录(例如 K1_R1.fastq.gz、K1_R2.fastq.gz、K2_R1.fastq.gz 等),并且我正在它们上运行 fastqc。

SAMPLES = [ "K1", "K2", "W1", "W2" ]
REPLICATE = ['R1', 'R2']

PathtoWD = '/home/hbanduk/scratch/working_projects_2020/'

rule fastqc:
input:
"expand(PathtoWD + "/raw_data/{sample}_{replicate}.fastq.gz", sample=SAMPLES, replicate=REPLICATE)"
output:
PathtoWD + "/fastqc_raw_reads/{sample}_{replicate}_fastqc.zip",
PathtoWD + "/fastqc_raw_reads/{sample}_{replicate}_fastqc.html"
shell:
"fastqc {input} -o /home/hbanduk/scratch/working_projects_2020/fastqc_raw_reads"

当我运行时,

snakemake -np snakefile

我收到以下错误:

SyntaxError in line 9 of 
/scratch/hbanduk/working_projects_2020/Snakefile:
invalid syntax

我已经尝试了该文件的许多排列,但我不断收到相同的错误(有时对于其他行)。

任何意见都将不胜感激。

最佳答案

Chris_Rands 关于双引号中的双引号的观点应该可以修复语法错误,但您可能希望完全删除 expand() 周围的引号。即:

expand(PathtoWD + "/raw_data/{sample}_{replicate}.fastq.gz", sample=SAMPLES, replicate=REPLICATE)

而不是

"expand(...)"

关于python - Snakefile 的各种迭代都会给出相同的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59753180/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com