From f96520b9158bfb3199d3cb30e98e2ff3486c67de Mon Sep 17 00:00:00 2001 From: Leonardo Schwarz Date: Tue, 12 Nov 2024 15:31:27 +0100 Subject: [PATCH] add rules for new panel processing --- .../workflow/Snakefile | 1 + .../workflow/rules/rules_panel.smk | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/depiction_targeted_preproc/workflow/rules/rules_panel.smk diff --git a/src/depiction_targeted_preproc/workflow/Snakefile b/src/depiction_targeted_preproc/workflow/Snakefile index 3a26e84..b17cbab 100644 --- a/src/depiction_targeted_preproc/workflow/Snakefile +++ b/src/depiction_targeted_preproc/workflow/Snakefile @@ -2,6 +2,7 @@ version: "3" include: "rules/rules_prepare_pipeline.smk" +include: "rules/rules_panel.smk" include: "rules/rules_proc.smk" include: "rules/rules_vis.smk" include: "rules/rules_qc.smk" diff --git a/src/depiction_targeted_preproc/workflow/rules/rules_panel.smk b/src/depiction_targeted_preproc/workflow/rules/rules_panel.smk new file mode 100644 index 0000000..91cbbca --- /dev/null +++ b/src/depiction_targeted_preproc/workflow/rules/rules_panel.smk @@ -0,0 +1,26 @@ +"""This file bundles all panel manipulation rules needed throughout the pipeline. +To keep things tidy, each file will be in the same directory `{sample}/panels/`. +Initially before the workflow is started a file `mass_list.raw.csv` has to be created. +""" + + +rule panel_standardized_full: + input: + csv="{sample}/panels/unstandardized_full.csv", + output: + csv="{sample}/panels/full.csv", + shell: + "python -m depiction_targeted_preproc.workflow.panel.standardize_panel " + "--input-panel-path {input.csv} --config-name standardize_main_config.yml " + "--output-panel-path {output.csv}" + + +rule panel_filter_calibration: + input: + csv="{sample}/panels/full.csv", + output: + csv="{sample}/panels/calibration.csv", + run: + import polars as pl + + pl.read_csv(input.csv).filter(type="target").write_csv(output.csv)