configfile: "config.yaml"

rule all:
    input:
        "/output/celltype_map.png",
        "/output/kde_map.png",
        "/output/celltype_abundance.csv"

rule run_ssam:
    output:
        ct_map    = "/output/celltype_map.png",
        kde_map   = "/output/kde_map.png",
        abundance = "/output/celltype_abundance.csv"
    threads: config["threads"]
    params:
        input_mode = config["input_mode"],
        zarr       = config.get("zarr", ""),
        bandwidth  = config["bandwidth"],
        threshold  = config["threshold"],
        map_width  = config["map_width"],
    log:
        "/output/ssam.log"
    shell:
        """
        python /pipeline/scripts/run_ssam.py \
            --input-mode {params.input_mode} \
            --output-dir /output \
            --bandwidth {params.bandwidth} \
            --threshold {params.threshold} \
            --map-width {params.map_width} \
            --threads {threads} \
            --zarr {params.zarr} \
            2> {log}
        """