Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bioinformatics Snakemake检查点抛出(使用非零退出代码退出),即使在正确完成后也是如此_Bioinformatics_Snakemake - Fatal编程技术网

Bioinformatics Snakemake检查点抛出(使用非零退出代码退出),即使在正确完成后也是如此

Bioinformatics Snakemake检查点抛出(使用非零退出代码退出),即使在正确完成后也是如此,bioinformatics,snakemake,Bioinformatics,Snakemake,我目前正在运行一个snakemake检查点,即使在正确完成命令后,它似乎仍会抛出一个非零退出代码,我不确定如何解决该问题 下面脚本的目的是解析坐标文件bed_文件,从bam文件rna_文件中提取所有区域,并最终组装这些区域。代码如下,我的snakemake版本是5.6.0 #Pull coordinates from a BAM file, and use the command samtools view to extract the corresponding #data, naming t

我目前正在运行一个snakemake检查点,即使在正确完成命令后,它似乎仍会抛出一个非零退出代码,我不确定如何解决该问题

下面脚本的目的是解析坐标文件
bed_文件
,从bam文件
rna_文件
中提取所有区域,并最终组装这些区域。代码如下,我的snakemake版本是5.6.0

#Pull coordinates from a BAM file, and use the command samtools view to extract the corresponding #data, naming the output as the coordinate file, here named "6:25274434-25278245.bam". There are #an unknown number of output files

checkpoint pull_reads_for_BAM:
    input:
    ¦   bed_file = get_lncRNA_file,
    ¦   rna_file = get_RNA_file
    conda:
    ¦   "envs/pydev_1.yml"
    params:
    ¦   "01.pulled_reads"
    output:
    ¦   directory("01.pulled_reads/{tissue}")
    shell:"""

    mkdir 01.pulled_reads/{wildcards.tissue}

    store_regions=$(cat {input.bed_file} | awk -F'\t' '{{ print $1 ":" $2 "-" $3 }}')

    for i in $store_regions ; do
    ¦   samtools view -b -h {input.rna_file} ${{i}} > 01.pulled_reads/{wildcards.tissue}/${{i}}.bam ;
    done

    echo "This completed fine"

    """

rule samtools_sort:
    input:
    ¦   "01.pulled_reads/{tissue}/{i}.bam"
    params:
    ¦   "{i}"
    output:
    ¦   "01.pulled_reads/{tissue}/{i}.sorted.bam"
    shell:
    ¦   "samtools sort -T sorted_reads/{params}.tmp {input} > {output}"

rule samtools_index:
    input:
    ¦   "01.pulled_reads/{tissue}/{i}.sorted.bam"
    output:
    ¦   "01.pulled_reads/{tissue}/{i}.sorted.bam.bai"
    shell:
        "samtools index {input}"

rule string_tie_assembly:
    input:
    ¦   "01.pulled_reads/{tissue}/{i}.sorted.bam"
    output:
    ¦   "02.string_tie_assembly/{tissue}/{i}_assembly.gtf"
    shell:
        "stringtie {input} -f 0.0 -a 0 -m 50 -c 3.0 -f 0.0 -o {output}"


def trigger_aggregate(wildcards):
    checkpoint_output = checkpoints.pull_reads_for_BAM.get(**wildcards).output[0]

    x = expand("02.string_tie_assembly/{tissue}/{i}_assembly.merged.gtf",
    ¦   tissue = wildcards.tissue,
    ¦   i=glob_wildcards(os.path.join(checkpoint_output, "{i}.bam")).i)
    return x


#Aggregate function that triggers rule 
rule combine_all_gtf_things:
    input:
    ¦   trigger_aggregate
    output:
    ¦   "03.final_stuff/{tissue}.merged.gtf"
    shell:"""
    cat {input} > {output}
    """

命令运行完成后,snakemake出于某种神秘的原因返回
(以非零退出代码退出)
。我可以观察文件中生成的输出,它看起来是正确的,所以我不确定它为什么会抛出这个错误

我生成的检查点是按照以下方式建模的:

尚未回答的相关问题:

不确定这是否是问题,但如果目录存在或执行mkdir之前不存在
01.pulld\u reads/{wildcards.tissure}
将失败


尝试将
-p
选项添加到mkidr,即
mkdir-p 01.pulled_reads/{wildcards.tissure}
这个问题似乎是由于
{tissure}
中的通配符被设置为目录引起的。至于为什么会出现非零退出状态,我不确定。只需将
{tissue}\u dir
添加到上面的路径,即可解决此问题

有关此问题的更多信息,请参见:

这当然是一个好主意,但尝试了一下,仍然得到了相同的错误消息。我还尝试将
| | true
添加到此命令的最后一行,但这似乎也不起作用。我已经在bitbucket站点上为snakemake生成了一个线程,可以在这里进行跟踪