cheeseman-lab / brieflow

Extensible pipeline tool for processing optical pooled screens data.
MIT License
0 stars 0 forks source link

Separate Target Definitions #13

Closed roshankern closed 3 days ago

roshankern commented 3 days ago

In this PR we move all output/target definitions to separate files. The new process for defining and using outputs is as follows:

1) For a process, create a snakemake file in targets like targets/preprocess.smk 2) Create an outputs dictionary that maps a rule name to a list of file path outputs. Ex:

PREPROCESS_OUTPUTS = {
    "extract_metadata_sbs": [
        PREPROCESS_FP
        / "metadata"
        / "sbs"
        / get_filename({"well": "{well}", "cycle": "{cycle}"}, "metadata", "tsv"),
    ],
}

3) Define output types as None, temp, protected, etc 4) Map outputs to their types with lib.shared.target_utils.map_outputs 5) Use these outputs in a Snakemake rule. Ex:

# Apply Laplacian-of-Gaussian filter to all channels
rule log_filter:
    conda:
        "../envs/sbs_process.yml"
    input:
        SBS_PROCESS_OUTPUTS["align"],
    output:
        SBS_PROCESS_OUTPUTS_MAPPED["log_filter"],
    params:
        skip_index=0,
    script:
        "../scripts/sbs_process/log_filter.py"

@mat10d this is ready for review! Let me know if you have any questions!

review-notebook-app[bot] commented 3 days ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB