【发布时间】:2021-04-21 08:17:45
【问题描述】:
您好,我正在尝试使用snakemake 运行管道。具体来说,我按照此处指定的说明运行演示 rna-seq 分析管道:https://gagneurlab-drop.readthedocs.io/en/latest/installation.html
当我运行snakemake --cores 1 时,我收到以下错误消息::
Error in rule aberrantExpression_bamStats:
jobid: 26
output: /Users/00104561/drop_demo/Output/processed_data/aberrant_expression/v29/coverage/HG00126.1.M_111124_8.tsv
shell:
# identify chromosome format
if samtools idxstats /Users/00104561/drop_demo/Data/rna_bam/HG00126.1.M_111124_8_chr21.bam | grep -qP "^chr";
then
chrNames=$(cut -f1 Scripts/AberrantExpression/pipeline/resource/chr_UCSC_NCBI.txt | tr '
' '|')
else
chrNames=$(cut -f2 Scripts/AberrantExpression/pipeline/resource/chr_UCSC_NCBI.txt | tr '
' '|')
fi
# write coverage from idxstats into file
count=$(samtools idxstats /Users/00104561/drop_demo/Data/rna_bam/HG00126.1.M_111124_8_chr21.bam | grep -E "^($chrNames)" | cut -f3 | paste -sd+ - | bc)
echo -e "HG00126.1.M_111124_8 ${count}" > /Users/00104561/drop_demo/Output/processed_data/aberrant_expression/v29/coverage/HG00126.1.M_111124_8.tsv
(one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
任何帮助将不胜感激!我对生物信息学很陌生!
【问题讨论】:
-
“严格模式”实际上并不存在,但它是一些工具所说的打开一系列选项,指示 shell 在任何命令发生时失败。 (不幸的是,其中一些选项有不必要的副作用,一般来说是一个坏主意——请参阅BashFAQ #105 中的练习,特别展示了
set -e如何使一些 shell 的行为让读者非常惊讶,并且还减少了跨版本边界的可移植性)。 -
例如,如果“严格模式”的snakemake理念同时包含
pipefail和errexit,那么您在管道中某处包含的任何grep都会导致整个命令被视为如果甚至没有匹配项,则失败 - 即使您考虑将空字符串作为输出作为完全可以接受的结果。 -
无论如何,我建议将
set -x放入 shell 脚本中,然后读取记录到 stderr 的跟踪以查看它停止的确切位置。 -
看起来您正在使用来自
shell部分的 bash 脚本。 Snakemake 不支持 bash:您需要将脚本提取到 .sh 文件中并从shell运行。
标签: bash snakemake drop rna-seq