如何解决Snakemake:使用拆分命令时出错?
当我在 Snakemake 规则的 shell 部分使用 Unix split
命令时出现错误:
rule split:
input:
"test_file.txt"
output:
directory("split_test_file")
shell:
'''
mkdir {output}
split -1 3 {input} split_
mv split_* {output}
'''
这是错误:
Error in rule split:
jobid: 0
output: split_test_file
shell:
mkdir split_test_file
split -1 3 test_file.txt split_
mv split_* split_test_file
(one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
我认为错误发生在 mv split_* split_test_file
行中,因为当我只运行前 2 行时没有错误。我似乎无法找到为什么我不能将拆分 test_file.txt
产生的所有文件移动到输出目录中?非常感谢!
解决方法
-
split
命令中有一个拼写错误,其中-1
需要是字母-l
。 - 您的
mv
命令会导致错误mv: cannot move ‘split_test_file’ to a subdirectory of itself,‘split_test_file/split_test_file’
。要移动的文件和目标目录都以相同的字符串split_
开头,这会导致此错误。修改其中任何一个都可以解决此问题。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。