“蛇毒”;其中一个命令以非零退出代码退出;请注意,snakemake使用bash严格模式&引用;

“蛇毒”;其中一个命令以非零退出代码退出;请注意,snakemake使用bash严格模式&引用;,bash,snakemake,drop,rna-seq,Bash,Snakemake,Drop,Rna Seq,嗨,我正在尝试使用snakemake运行管道。具体地说,在遵循此处指定的说明后,我正在运行演示rna seq分析管道: 运行snakemake--cores 1时,会收到以下错误消息: Error in rule aberrantExpression_bamStats: jobid: 26 output: /Users/00104561/drop_demo/Output/processed_data/aberrant_expression/v29/coverage/HG0

嗨,我正在尝试使用snakemake运行管道。具体地说,在遵循此处指定的说明后,我正在运行演示rna seq分析管道:

运行
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命令已成功启动,但它报告了一个错误(非零退出代码)

所以你让snakemake运行的命令出了问题。尝试直接从命令行运行报告的命令,而不使用snakemake,这样可能更容易调试


最近对一个类似问题的回答很好地解释了这一点:

“严格模式”实际上并不存在,但一些工具称之为打开一系列选项,这些选项指示shell在任何命令执行时失败。(不幸的是,这些选项中的一些会产生不必要的副作用,通常使用起来是一个坏主意——请参见演示中的练习,特别是
set-e
如何使shell的某些行为让读者非常惊讶,并降低跨版本边界的可移植性)“严格模式“包含代码< PiPEPHIVE < /COD>和<代码> ErrxIt<代码>,然后,任何<代码> GRP包括管道中的某个地方,如果没有匹配,将导致整个命令被认为是失败的——即使您认为将空字符串输出为输出是一个完全可接受的结果。无论如何,我建议将
set-x
放入shell脚本中,然后读取记录到stderr的跟踪,以查看它的确切停止位置。看起来您正在使用
shell
部分中的bash脚本。Snakemake不支持bash:您需要将脚本提取到一个.sh文件中,然后从
shell
运行它。这是一个很好的指导,但我不确定它是否真的构成了一个答案。不可回答的问题(f/e,因为它们没有a)应该被评论并可能被关闭(直到编辑以改进),而不是给出适用性/实用性无法保证的一半答案。