Unexpected keyword filePath in rule definition.

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

Unexpected keyword filePath in rule definition

问题

Here is the translated content:

我的Snakemake在启动时出现错误

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

这是实际的Snakefile的样子

  1. $ cat bsmooth_Snakefile.smk
  2. configfile: "config/config.yaml"
  3. configfile: "config/samples.yaml"
  4. rule all:
  5. input:
  6. expand("results/bsmooth_fit/{sample}/{sample}.fitted.rda", sample=config["samples"])
  7. rule bsmooth_fit:
  8. input:
  9. filePath=lambda wildcards: config["samples"][wildcards.samples]
  10. output:
  11. bsfit="results/{rule}/{sample}/{sample}.fitted.rda"
  12. params:
  13. rscript=config["BSmooth_fit"]
  14. log:
  15. "logs/{rule}/{sample}.log"
  16. shell:
  17. "Rscript {params.rscript} --sample {wildcards.samples} --file {input.filePath} --outfile {output.bsfit} 2> {log}"

请查看附加的sample.yaml

  1. $ cat sample.yaml
  2. samples:
  3. Sample1Tumor: methylation_coverage/Sample1Tumor.bismark.cov.gz
  4. Sample1Norm: methylation_coverage/Sample1Norm.bismark.cov.gz

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

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

希望这有所帮助。

英文:

my snakemake fails to lunch with error

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

here's how actual snakefile looks like

  1. $ cat bsmooth_Snakefile.smk
  2. configfile: "config/config.yaml"
  3. configfile: "config/samples.yaml"
  4. rule all:
  5. input:
  6. expand("results/bsmooth_fit/{sample}/{sample}.fitted.rda", sample=config["samples"])
  7. rule bsmooth_fit:
  8. input:
  9. filePath=lambda wildcards: config["samples"][wildcards.samples]
  10. output:
  11. bsfit="results/{rule}/{sample}/{sample}.fitted.rda"
  12. params:
  13. rscript=config["BSmooth_fit"]
  14. log:
  15. "logs/{rule}/{sample}.log"
  16. shell:
  17. "Rscript {params.rscript} --sample {wildcards.samples} --file {input.filePath} --outfile {output.bsfit} 2> {log}"

pls see attached sample.yaml

  1. $cat sample.yaml
  2. samples:
  3. Sample1Tumor: methylation_coverage/Sample1Tumor.bismark.cov.gz
  4. Sample1Norm: methylation_coverage/Sample1Norm.bismark.cov.gz

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

  1. $cat config.yaml
  2. 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:

确定