From 4ab7ed3ff8eb7251cb5e940316338d6b326fc814 Mon Sep 17 00:00:00 2001 From: Mathias Johansson Date: Fri, 20 Sep 2024 15:56:39 +0200 Subject: [PATCH 1/5] add new qc criteria --- BALSAMIC/constants/metrics.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BALSAMIC/constants/metrics.py b/BALSAMIC/constants/metrics.py index 0e4ae6a81..eec6c6fb2 100644 --- a/BALSAMIC/constants/metrics.py +++ b/BALSAMIC/constants/metrics.py @@ -54,6 +54,9 @@ "lymphomatic": { "PCT_TARGET_BASES_500X": {"condition": {"norm": "gt", "threshold": 0.90}}, }, + "lymphoma_MRD": { + "PCT_TARGET_BASES_1000X": {"condition": {"norm": "gt", "threshold": 0.95}}, + }, "probio": { "PCT_TARGET_BASES_250X": {"condition": {"norm": "gt", "threshold": 0.95}}, }, From c18c500b42fea64f0e3e6c805df45dd347cae367 Mon Sep 17 00:00:00 2001 From: Mathias Johansson Date: Fri, 20 Sep 2024 16:01:10 +0200 Subject: [PATCH 2/5] changelog --- CHANGELOG.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b05912b31..c076ab30b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,7 @@ Added: * MSIsensor-pro container https://github.com/Clinical-Genomics/BALSAMIC/pull/1444 * MSI analysis to the tumor-normal workflow https://github.com/Clinical-Genomics/BALSAMIC/pull/1454 * Sentieon install directory path to case config arguments https://github.com/Clinical-Genomics/BALSAMIC/pull/1461 +* QC threshold for lymphoma_MRD panel https://github.com/Clinical-Genomics/BALSAMIC/pull/1479 Changed: ^^^^^^^^ From 7abcfdde2a1eb03a26aa5f757cce8c679a3c8995 Mon Sep 17 00:00:00 2001 From: Mathias Johansson Date: Tue, 15 Oct 2024 11:54:56 +0200 Subject: [PATCH 3/5] fix strictness of panelname --- BALSAMIC/assets/scripts/collect_qc_metrics.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BALSAMIC/assets/scripts/collect_qc_metrics.py b/BALSAMIC/assets/scripts/collect_qc_metrics.py index 61dfffdf7..6f44d23ab 100755 --- a/BALSAMIC/assets/scripts/collect_qc_metrics.py +++ b/BALSAMIC/assets/scripts/collect_qc_metrics.py @@ -144,8 +144,10 @@ def get_qc_supported_capture_kit(capture_kit, metrics: List[str]) -> str: if k != "default": available_panel_beds.append(k) - return next((i for i in available_panel_beds if i in capture_kit), None) - + return next( + (i for i in available_panel_beds if re.search(rf'{re.escape(i)}(?=_\d)', capture_kit)), + None + ) def get_requested_metrics(config: dict, metrics: dict) -> dict: """Parses the defined and requested metrics and returns them as a dictionary""" From 5cc46a523e454b6809292b68d9463fbd8d508fd9 Mon Sep 17 00:00:00 2001 From: Mathias Johansson Date: Tue, 15 Oct 2024 14:42:11 +0200 Subject: [PATCH 4/5] black --- BALSAMIC/assets/scripts/collect_qc_metrics.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/BALSAMIC/assets/scripts/collect_qc_metrics.py b/BALSAMIC/assets/scripts/collect_qc_metrics.py index 6f44d23ab..c11cb616e 100755 --- a/BALSAMIC/assets/scripts/collect_qc_metrics.py +++ b/BALSAMIC/assets/scripts/collect_qc_metrics.py @@ -145,10 +145,15 @@ def get_qc_supported_capture_kit(capture_kit, metrics: List[str]) -> str: available_panel_beds.append(k) return next( - (i for i in available_panel_beds if re.search(rf'{re.escape(i)}(?=_\d)', capture_kit)), - None + ( + i + for i in available_panel_beds + if re.search(rf"{re.escape(i)}(?=_\d)", capture_kit) + ), + None, ) + def get_requested_metrics(config: dict, metrics: dict) -> dict: """Parses the defined and requested metrics and returns them as a dictionary""" From cc5c7136d5ce7bcb416f34d1fe034d5b45188963 Mon Sep 17 00:00:00 2001 From: Mathias Johansson Date: Tue, 15 Oct 2024 14:55:43 +0200 Subject: [PATCH 5/5] fix pytests --- tests/conftest.py | 4 ++-- tests/scripts/test_collect_qc_metrics.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index e50ea436f..c92e23be3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1909,10 +1909,10 @@ def qc_requested_metrics(): "METRIC_1": {"condition": None}, "METRIC_2": {"condition": {"norm": "gt", "threshold": 2}}, }, - "panel_1": { + "panelA": { "METRIC_3": {"condition": {"norm": "gt", "threshold": 3}}, }, - "panel_2": { + "panelB": { "METRIC_1": {"condition": {"norm": "gt", "threshold": 1}}, "METRIC_2": {"condition": {"norm": "gt", "threshold": 22}}, "METRIC_4": {"condition": {"norm": "gt", "threshold": 4}}, diff --git a/tests/scripts/test_collect_qc_metrics.py b/tests/scripts/test_collect_qc_metrics.py index 789c0064c..bc66661fc 100644 --- a/tests/scripts/test_collect_qc_metrics.py +++ b/tests/scripts/test_collect_qc_metrics.py @@ -23,10 +23,10 @@ def test_get_qc_supported_capture_kit(qc_requested_metrics): """test extraction of the capture kit name available for analysis""" # GIVEN a capture kit - capture_kit = "panel_1_v1.0_hg19_design.bed" + capture_kit = "panelA_1.0_hg19_design.bed" # GIVEN an expected output - expected_output = "panel_1" + expected_output = "panelA" # WHEN calling the function supported_capture_kit = get_qc_supported_capture_kit( @@ -42,7 +42,7 @@ def test_get_requested_metrics_targeted(config_dict, qc_requested_metrics): # GIVEN a config_dict config = copy.deepcopy(config_dict) - config["panel"]["capture_kit"] = "tests/panel/panel_2_v1.0_hg19_design.bed" + config["panel"]["capture_kit"] = "tests/panel/panelB_1.0_hg19_design.bed" # GIVEN the expected output expected_output = {