snakemake中带有空格的文件

snakemake中带有空格的文件,snakemake,Snakemake,我正试图在一个蛇形文件中运行命令myconversion'my input file.xlsx''my output file.xlsx'。我试过了 input: "my input file.xlsx" output: "my output file.xlsx" shell: "myconversion {input:q} {output:q}" 然而,这是行不通的。我得到了Python错误 Error: Invalid value for "infile": Pat

我正试图在一个蛇形文件中运行命令
myconversion'my input file.xlsx''my output file.xlsx'
。我试过了

input:
    "my input file.xlsx"
output:
    "my output file.xlsx"
shell:
    "myconversion {input:q} {output:q}"
然而,这是行不通的。我得到了Python错误

Error: Invalid value for "infile": Path "'my" does not exist.

我做错了什么?

问题在于您的shell命令,而不是snakemake。对于CLI工具,需要在引号中指定文件名

rule asd:
    input:
        "my input file.xlsx"
    output:
        "my output file.xlsx"
    shell:
        'cat "{input}" "{output}"'

Snakemake允许在文件名中使用空格。我测试了您的代码,它运行良好(snakemake v4.8.0和macOS Sierra)。您使用的是什么操作系统和snakemake版本?出于好奇,
:q
在shell命令中指的是什么?
:q
会自动在输入和输出文件名()周围加引号。我使用Windows 10和snakemake 5.1.5.1。有什么线索可以解释为什么它在听起来应该的时候不起作用吗?对于这类问题通常都有解决办法,但我强烈建议您,如果要执行某种自动化任务,一般不要在文件名中使用空格。如果您不负责创建文件,请您的合作者提供名称中不带空格的文件:从长远来看,这对双方都有利。我知道,而且我通常避免这样做@天哪,不,不知道。