我正在尝试将 Snakemake 与 Singularity 结合使用,我注意到awk
使用奇异性时,一个简单的命令不再起作用。最后$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}"
当我在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
rule test:
output: test.txt
jobid: 1
cat /etc/passwd | awk -F':' '{print $1}' > test.txt
Activating singularity image /scratch/test/.snakemake/singularity/fa9c8c7220ff16e314142a5d78ad6cff.simg
Finished job 1.
1 of 2 steps (50%) done
localrule all:
input: test.txt
jobid: 0
Finished job 0.
2 of 2 steps (100%) done