챕터 11 - 최종 Snakefile - 복습과 토론

다음은 네 개의 게놈을 비교하는 최종 Snakefile입니다.

이 Snakemake 워크플로의 특징은 다음과 같습니다:

ACCESSIONS = ["GCF_000017325.1",
              "GCF_000020225.1",
              "GCF_000021665.1",
              "GCF_008423265.1"]

rule all:
    input:
        "compare.mat.matrix.png"

rule sketch_genome:
    input:
        "genomes/{accession}.fna.gz",
    output:
        "{accession}.fna.gz.sig",
    shell: """
        sourmash sketch dna -p k=31 {input} --name-from-first
    """

rule compare_genomes:
    input:
        expand("{acc}.fna.gz.sig", acc=ACCESSIONS),
    output:
        "compare.mat"
    shell: """
        sourmash compare {input} -o {output}
    """

rule plot_comparison:
    message: "sourmash로 모든 입력 게놈을 비교합니다"
    input:
        "compare.mat"
    output:
        "compare.mat.matrix.png"
    shell: """
        sourmash plot {input}
    """

이후 섹션에서는 이 Snakefile에서 사용된 Snakemake의 핵심 기능들을 더 자세히 다루고, 좀 더 복잡한 생물정보학 워크플로와 여러 유용한 패턴 및 재사용 가능한 레시피도 소개할 것입니다.