Unexpected keyword filePath in rule definition.

huangapple go评论72阅读模式
英文:

Unexpected keyword filePath in rule definition

问题

Here is the translated content:

我的Snakemake在启动时出现错误

$ snakemake -s bsmooth_Snakefile.smk -np --forcerun
文件/scripts/bsmooth_snakemake/bsmooth_Snakefile.smk中的SyntaxError,第9行:
规则定义中的关键字filePath意外 (bsmooth_Snakefile.smk,第9行)

这是实际的Snakefile的样子

$ cat bsmooth_Snakefile.smk

configfile: "config/config.yaml"
configfile: "config/samples.yaml"

rule all:
    input: 
        expand("results/bsmooth_fit/{sample}/{sample}.fitted.rda", sample=config["samples"])
rule bsmooth_fit:
    input:
        filePath=lambda wildcards: config["samples"][wildcards.samples]
    output:
        bsfit="results/{rule}/{sample}/{sample}.fitted.rda"
    params:
        rscript=config["BSmooth_fit"]
    log:
        "logs/{rule}/{sample}.log"
    shell:
        "Rscript {params.rscript} --sample {wildcards.samples} --file {input.filePath} --outfile {output.bsfit} 2> {log}"

请查看附加的sample.yaml

$ cat sample.yaml

samples:
    Sample1Tumor: methylation_coverage/Sample1Tumor.bismark.cov.gz
    Sample1Norm: methylation_coverage/Sample1Norm.bismark.cov.gz

我还附上包含脚本的config.yaml

$ cat config.yaml
BSmooth_fit: scripts/bsmooth_snakemake.r

希望这有所帮助。

英文:

my snakemake fails to lunch with error

$snakemake -s bsmooth_Snakefile.smk -np --forcerun
SyntaxError in file /scripts/bsmooth_snakemake/bsmooth_Snakefile.smk, line 9:
Unexpected keyword filePath in rule definition (bsmooth_Snakefile.smk, line 9)

here's how actual snakefile looks like

$ cat bsmooth_Snakefile.smk

configfile: "config/config.yaml"
configfile: "config/samples.yaml"

rule all:
	input: 
  		expand("results/bsmooth_fit/{sample}/{sample}.fitted.rda", sample=config["samples"])
rule bsmooth_fit:
	input:
    	filePath=lambda wildcards: config["samples"][wildcards.samples]
	output:
		bsfit="results/{rule}/{sample}/{sample}.fitted.rda"
	params:
		rscript=config["BSmooth_fit"]
	log:
		"logs/{rule}/{sample}.log"
	shell:
		"Rscript {params.rscript} --sample {wildcards.samples} --file {input.filePath} --outfile {output.bsfit} 2> {log}"

pls see attached sample.yaml

$cat sample.yaml

samples:
    Sample1Tumor: methylation_coverage/Sample1Tumor.bismark.cov.gz
    Sample1Norm: methylation_coverage/Sample1Norm.bismark.cov.gz

I'm also attaching the config.yaml that contains the script

$cat config.yaml
BSmooth_fit: scripts/bsmooth_snakemake.r

Any help would be appreciated

答案1

得分: 2

请确保您的缩进中没有混合使用制表符(TAB)和空格(SPACES)。您可能在filePath前有一个TAB字符。请将所有的TAB字符替换为空格,然后再试一次。

英文:

Check and make sure you are not mixing TAB and SPACES for indentation. You probably have a TAB character in front of filePath. Substitute all TABs with SPACEs and try again.

huangapple
  • 本文由 发表于 2023年5月26日 07:21:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76336780.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定