美文网首页
snakemake学习笔记004:前后两个rule为啥连不起来呢

snakemake学习笔记004:前后两个rule为啥连不起来呢

作者: 小明的数据分析笔记本 | 来源:发表于2022-05-06 01:07 被阅读0次
SRR, = glob_wildcards("output.gtf/"+"{srr}.gtf")
#SRR = ["ERR188401","ERR204916"]
rule all:
    input:
        #expand("output.gtf/"+"{srr}.gtf",srr=SRR),
        "MergedList.txt",

rule gtflist:
    input:
        gtffiles = expand("output.gtf/"+"{srr}.gtf",srr=SRR)
    output:
        output_txt = "MergedList.txt"
    run:
        with open(output.output_txt,'w') as f:
            for gtf in input.gtffiles:
                print(gtf,file=f)



rule stringtieMerge:
    input:
        refgtf = "/mnt/shared/scratch/myan/private/practice_data/RNAseq/chrX_data/genes/chrX.gtf",
        gtflist = "MergedList.txt"
    output:
        gtf = "output.merged.gtf/StringtieMerged.gtf"
    log:
        "output.merged.gtf/StringtieMerge.logs"
    threads:
        1
    params:
        "-m 200 -c 3"
    shell:
        """
        stringtie --merge {params} -p {threads} -G {input.refgtf} -o {output.gtf} {input.gtflist}
        """

第二个rule就是不运行

原来是在rule all 代码里少写了 第二个rule的输出文件

正确写法是

SRR, = glob_wildcards("output.gtf/"+"{srr}.gtf")
#SRR = ["ERR188401","ERR204916"]
rule all:
    input:
        #expand("output.gtf/"+"{srr}.gtf",srr=SRR),
        "MergedList.txt",
        "output.merged.gtf/StringtieMerged.gtf"

rule gtflist:
    input:
        gtffiles = expand("output.gtf/"+"{srr}.gtf",srr=SRR)
    output:
        output_txt = "MergedList.txt"
    run:
        with open(output.output_txt,'w') as f:
            for gtf in input.gtffiles:
                print(gtf,file=f)



rule stringtieMerge:
    input:
        refgtf = "/mnt/shared/scratch/myan/private/practice_data/RNAseq/chrX_data/genes/chrX.gtf",
        gtflist = "MergedList.txt"
    output:
        gtf = "output.merged.gtf/StringtieMerged.gtf"
    log:
        "output.merged.gtf/StringtieMerge.logs"
    threads:
        1
    params:
        "-m 200 -c 3"
    shell:
        """
        stringtie --merge {params} -p {threads} -G {input.refgtf} -o {output.gtf} {input.gtflist}
        """

rule all 的作用是啥我还是不懂

相关文章

网友评论

      本文标题:snakemake学习笔记004:前后两个rule为啥连不起来呢

      本文链接:https://www.haomeiwen.com/subject/golayrtx.html