英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论