From 779330d3cce771625aef64c48968358811285772 Mon Sep 17 00:00:00 2001 From: alsmith Date: Mon, 8 Apr 2024 15:49:43 +0100 Subject: [PATCH] Refactor hub.smk and create_hub.py to use "method" instead of "pileup_method" --- seqnado/workflow/rules/hub.smk | 8 ++++---- seqnado/workflow/scripts/create_hub.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/seqnado/workflow/rules/hub.smk b/seqnado/workflow/rules/hub.smk index 87b640f4..34b66316 100644 --- a/seqnado/workflow/rules/hub.smk +++ b/seqnado/workflow/rules/hub.smk @@ -25,16 +25,16 @@ def get_hub_params(config): "subgroup_by": config["ucsc_hub_details"].get( "subgroup_by", [ - "pileup_method", + "method", "norm" ], ), - "supergroup_by": config["ucsc_hub_details"].get("supergroup_by", None), + "supergroup_by": config["ucsc_hub_details"].get("supergroup_by", "ext"), } if ASSAY == "RNA": - hub_params["overlay_by"] = ["samplename", "pileup_method", "norm"] - hub_params["subgroup_by"] = ["samplename", "pileup_method", "norm", "strand"] + hub_params["overlay_by"] = ["samplename", "method", "norm"] + hub_params["subgroup_by"] = ["method", "norm", "strand"] return hub_params diff --git a/seqnado/workflow/scripts/create_hub.py b/seqnado/workflow/scripts/create_hub.py index 0ad94637..973d2c10 100644 --- a/seqnado/workflow/scripts/create_hub.py +++ b/seqnado/workflow/scripts/create_hub.py @@ -33,12 +33,12 @@ def get_rna_samplename(path: str): elif snakemake.params.assay == "ATAC": df["samplename"] = df["fn"].str.extract(r".*/(.*)\.(?:bigBed|bigWig)") - df["pileup_method"] = df["fn"].apply(lambda x: x.split("/")[-3]) + df["method"] = df["fn"].apply(lambda x: x.split("/")[-3]) df["norm"] = df["fn"].apply(lambda x: x.split("/")[-2]) elif snakemake.params.assay == "RNA": df["samplename"] = df["fn"].apply(get_rna_samplename) - df["pileup_method"] = df["fn"].apply(lambda x: x.split("/")[-3]) + df["method"] = df["fn"].apply(lambda x: x.split("/")[-3]) df["strand"] = np.where(df["fn"].str.contains("_plus.bigWig"), "plus", "minus") df["norm"] = df["fn"].apply(lambda x: x.split("/")[-2])