我正在尝试将 Snakemake 与 Singularity 结合起来,并且我注意到awk在使用 Singularity 时一个简单的命令不再起作用。在$1最后一行被取代的bash,而不是被用来作为第一个字段awk。
这是一个最小的工作示例(Snakefile):
singularity: "docker://debian:stretch"
rule all:
input: "test.txt"
rule test:
output:
"test.txt"
shell:
"cat /etc/passwd | awk -F':' '{{print $1}}' > {output}"
Run Code Online (Sandbox Code Playgroud)
当我在snakemake没有奇点的情况下运行时,输出test.txt看起来如预期(仅包含用户名)。当我运行时snakemake --use-singularity,文件包含整行,例如root:x:0:0:root:/root:/bin/bash.
这是 Snakemake 的日志:
$ snakemake --use-singularity --printshellcmd
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 1
Rules claiming more threads will be scaled down.
Job counts:
count jobs
1 all
1 test
2 …Run Code Online (Sandbox Code Playgroud)