文章目录
- 摘要
- 问题汇总
- (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
- NameError: The name 'XXX' is unknown in this context. Please make sure that you defined that variable. Also note that braces not used for variable access have to be escaped by repeating them, i.e. {{XXX}}
- EOL while scanning string literal
- The flag 'directory' used in rule merge_anno is only valid for outputs, not inputs.Building DAG of jobs... ChildIOException:File/directory is a child to another output:('./10_1_CGPDDS210602_20210713/04.Annotation/pSM620', dfast)('./10_1_CGPDDS210602_20210713/04.Annotation/pSM620/all_anno_upset.png', plot)
- Error: Directory cannot be locked. Please make sure that no other Snakemake process is trying to create the same files in the following directory:
- 总结
摘要
随着不断学习,流程搭建多了,snakemake遇到的问题也多了起来,之前那篇snakemake常见问题汇总(上)已经总结了一部分,今天再补充一些遇到的其他问题。
问题汇总
(one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
rule没问题,但命令执行后报错,需要将命令单独拿出来测试。
shell中的特殊符号(’’/{}等)对shell执行命令产生影响,尤其是使用awk或者sed命令时,经常出现问题,有些需要在特殊符号前面添加反斜线,注释掉特殊符号的意义。
NameError: The name ‘XXX’ is unknown in this context. Please make sure that you defined that variable. Also note that braces not used for variable access have to be escaped by repeating them, i.e. {{XXX}}
shell中的花括号主要指代input和output内容,如果是shell命令引用,需要双花括号。
EOL while scanning string literal
双引号多了或者少了
The flag ‘directory’ used in rule merge_anno is only valid for outputs, not inputs.Building DAG of jobs… ChildIOException:File/directory is a child to another output:(’./10_1_CGPDDS210602_20210713/04.Annotation/pSM620’, dfast)(’./10_1_CGPDDS210602_20210713/04.Annotation/pSM620/all_anno_upset.png’, plot)
在流程前面的rule生成的输出文件夹不能作为后面rule输出文件的路径。
Error: Directory cannot be locked. Please make sure that no other Snakemake process is trying to create the same files in the following directory:
之前执行时突然中断(ctrl+z),需要使用--unlock
参数解除文件夹限制
总结
关于snakemake的常见问题差不多这两篇问题都覆盖到了,后面可能会出一些snakemake的高级技巧展示,比如if的应用,当然还是要先学好才能整理给大家,欢迎加群交流,扫码或加vx:bbplayer2021,邀请进群