From 53cbf695eab1a8727c6cff6afd439b396ac33709 Mon Sep 17 00:00:00 2001 From: ashwini06 Date: Mon, 13 Dec 2021 13:16:43 +0100 Subject: [PATCH 1/5] add interval bed option to umi TNscope --- BALSAMIC/constants/workflow_params.py | 1 + BALSAMIC/snakemake_rules/umi/sentieon_varcall_tnscope.rule | 3 +++ BALSAMIC/snakemake_rules/umi/sentieon_varcall_tnscope_tn.rule | 3 +++ 3 files changed, 7 insertions(+) diff --git a/BALSAMIC/constants/workflow_params.py b/BALSAMIC/constants/workflow_params.py index 44d45e30b..ed686cef5 100644 --- a/BALSAMIC/constants/workflow_params.py +++ b/BALSAMIC/constants/workflow_params.py @@ -137,6 +137,7 @@ "init_tumorLOD": 0.5, "error_rate": 5, "prunefactor": 3, + "padding": 20, "disable_detect": "sv", }, } diff --git a/BALSAMIC/snakemake_rules/umi/sentieon_varcall_tnscope.rule b/BALSAMIC/snakemake_rules/umi/sentieon_varcall_tnscope.rule index 399e9be17..0552421a6 100644 --- a/BALSAMIC/snakemake_rules/umi/sentieon_varcall_tnscope.rule +++ b/BALSAMIC/snakemake_rules/umi/sentieon_varcall_tnscope.rule @@ -27,6 +27,7 @@ rule sentieon_tnscope_umi: init_tumor_lod = params.tnscope_umi.init_tumorLOD, error_rate = params.tnscope_umi.error_rate, prune_factor = params.tnscope_umi.prunefactor, + padding = params.tnscope_umi.padding, tumor = "TUMOR", pcr_model = params.common.pcr_model threads: @@ -44,6 +45,8 @@ export SENTIEON_LICENSE={params.sentieon_lic}; -t {threads} \ -r {input.ref_fa} \ -i {input.bam} \ +--interval {input.bed} \ +--interval_padding {params.padding} \ --algo {params.algo} \ --tumor_sample {params.tumor} \ --dbsnp {input.dbsnp} \ diff --git a/BALSAMIC/snakemake_rules/umi/sentieon_varcall_tnscope_tn.rule b/BALSAMIC/snakemake_rules/umi/sentieon_varcall_tnscope_tn.rule index 0aa0b95fe..4f9b3bfa1 100644 --- a/BALSAMIC/snakemake_rules/umi/sentieon_varcall_tnscope_tn.rule +++ b/BALSAMIC/snakemake_rules/umi/sentieon_varcall_tnscope_tn.rule @@ -28,6 +28,7 @@ rule sentieon_tnscope_umi_tn: error_rate = params.tnscope_umi.error_rate, prune_factor = params.tnscope_umi.prunefactor, pcr_model = params.common.pcr_model, + padding = params.tnscope_umi.padding, tumor = "TUMOR", normal = "NORMAL" threads: @@ -47,6 +48,8 @@ export SENTIEON_LICENSE={params.sentieon_lic}; -r {input.ref_fa} \ -i {input.bamT} \ -i {input.bamN} \ +--interval {input.bed} \ +--interval_padding {params.padding} \ --algo {params.algo} \ --tumor_sample {params.tumor} \ --normal_sample {params.normal} \ From e4eddbad8a76b7575f5a76b74893f291ddbafc93 Mon Sep 17 00:00:00 2001 From: ashwini06 Date: Mon, 13 Dec 2021 13:17:02 +0100 Subject: [PATCH 2/5] add tests --- BALSAMIC/utils/models.py | 2 ++ tests/utils/test_models.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/BALSAMIC/utils/models.py b/BALSAMIC/utils/models.py index b694a0757..f6e78508a 100644 --- a/BALSAMIC/utils/models.py +++ b/BALSAMIC/utils/models.py @@ -617,6 +617,7 @@ class UMIParamsTNscope(BaseModel): init_tumorLOD: float (required); minimum tumor log odds in the initial pass calling variants error_rate: int (required); allow error-rate to consider in calling prunefactor: int (required); pruning factor in the kmer graph + padding: int(required); amount to pad bed interval regions """ algo: str @@ -624,6 +625,7 @@ class UMIParamsTNscope(BaseModel): min_tumorLOD: int error_rate: int prunefactor: int + padding: int disable_detect: str diff --git a/tests/utils/test_models.py b/tests/utils/test_models.py index 53d44d5ce..f48f09492 100644 --- a/tests/utils/test_models.py +++ b/tests/utils/test_models.py @@ -349,6 +349,7 @@ def test_umiparams_tnscope(): "min_tumorLOD": 6, "error_rate": 5, "prunefactor": 3, + "padding": 30, "disable_detect": "abc", } @@ -362,7 +363,7 @@ def test_umiparams_tnscope(): assert test_tnscope_params_built.error_rate == 5 assert test_tnscope_params_built.prunefactor == 3 assert test_tnscope_params_built.disable_detect == "abc" - + assert test_tnscope_params_built.padding == 30 def test_params_vardict(): """test UMIParamsVardict model for correct validation""" From ac1168959838e19ac6dca6854bbd9b2956318cff Mon Sep 17 00:00:00 2001 From: ashwini06 Date: Mon, 13 Dec 2021 13:19:28 +0100 Subject: [PATCH 3/5] update changelog --- CHANGELOG.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6a5a315f8..9f162b59c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,12 @@ +[X.X.X] +------- + +Added: +^^^^^^ + +* Call umi variants using TNscope in bed defined regions #821 + + [8.2.4] ------- From 2f8a50a0090793d2bfbc6d4819aff81efccb27e6 Mon Sep 17 00:00:00 2001 From: ashwini06 Date: Mon, 13 Dec 2021 13:25:16 +0100 Subject: [PATCH 4/5] fix black --- tests/utils/test_models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/utils/test_models.py b/tests/utils/test_models.py index f48f09492..9b61315d1 100644 --- a/tests/utils/test_models.py +++ b/tests/utils/test_models.py @@ -365,6 +365,7 @@ def test_umiparams_tnscope(): assert test_tnscope_params_built.disable_detect == "abc" assert test_tnscope_params_built.padding == 30 + def test_params_vardict(): """test UMIParamsVardict model for correct validation""" From 1b81a73360f5b96a8be9bd3da9d9d2dd058fc74d Mon Sep 17 00:00:00 2001 From: ashwini06 Date: Mon, 13 Dec 2021 13:36:28 +0100 Subject: [PATCH 5/5] update padding to 100 --- BALSAMIC/constants/workflow_params.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BALSAMIC/constants/workflow_params.py b/BALSAMIC/constants/workflow_params.py index ed686cef5..a2616153f 100644 --- a/BALSAMIC/constants/workflow_params.py +++ b/BALSAMIC/constants/workflow_params.py @@ -137,7 +137,7 @@ "init_tumorLOD": 0.5, "error_rate": 5, "prunefactor": 3, - "padding": 20, + "padding": 100, "disable_detect": "sv", }, }