configfile: "defaults/config.yaml"

include: "../shared/vendored/snakemake/config.smk"
include: "rules/config.smk"

rule all:
    input:
        auspice_json=expand("auspice/rubella_{build}.json", build=config["builds"]),
        tip_frequencies_json=expand("auspice/rubella_{build}_tip-frequencies.json", build=config["builds"]),


include: "rules/prepare_sequences.smk"
include: "rules/construct_phylogeny.smk"
include: "rules/annotate_phylogeny.smk"
include: "rules/export.smk"

rule clean:
    params:
        targets = [
            ".snakemake",
            "auspice",
            "data",
            "logs",
            "results",
            ]
    shell:
        """
        rm -rfv {params.targets}
        """

# Import custom rules provided via the config.
if "custom_rules" in config:
  for rule_file in config["custom_rules"]:
    include: rule_file
