starskyzheng / panpop

Application of pan-genome for population
MIT License
96 stars 9 forks source link

TGS流程磁盘储存资源占用过大 #54

Closed jwli-code closed 6 months ago

jwli-code commented 6 months ago

郑博士你好,我跑TGS的流程后发现 生成文件夹 02_bam 文件夹中同时保留了bam文件和 sort.bam文件,我的存储资源不是很大,生成sort.bam文件后是否就不需要bam文件?应该更改哪里的源代码可以实现这个目的。

jwli-code commented 6 months ago
rule sort_bam:
    input:
        lambda wildcards: "02_bam/{sample}.{platform}.{mapper}.bam".format(sample=wildcards.sample, platform=get_platform(wildcards), mapper=MAPPER)
    output:
        "02_bam/{sample}.{platform}.{mapper}.sort.bam"
    threads: 10
    resources:
        mem_mb = 10000
    shell:
        """
         {SAMTOOLS} sort -@ {threads} -O BAM -o {output} {input}
         rm {input}
        """

改正这些是否就足够

starskyzheng commented 6 months ago

也许可以,您可以试试。 但建议您参考这个来做:https://snakemake.readthedocs.io/en/stable/tutorial/advanced.html#step-6-temporary-and-protected-files

jwli-code commented 6 months ago

十分感谢 按照你推荐的已经测试成功