From 1b787933b636bde6dfa136567407817fda5e510a Mon Sep 17 00:00:00 2001 From: LaraFuhrmann <55209716+LaraFuhrmann@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:30:20 +0200 Subject: [PATCH] update viloca ewm for amplicon --- .../{viloca_ewm_uni.py => viloca_ewm.py} | 73 +++++++++++++------ 1 file changed, 50 insertions(+), 23 deletions(-) rename resources/auxiliary_workflows/benchmark/resources/method_definitions/{viloca_ewm_uni.py => viloca_ewm.py} (51%) diff --git a/resources/auxiliary_workflows/benchmark/resources/method_definitions/viloca_ewm_uni.py b/resources/auxiliary_workflows/benchmark/resources/method_definitions/viloca_ewm.py similarity index 51% rename from resources/auxiliary_workflows/benchmark/resources/method_definitions/viloca_ewm_uni.py rename to resources/auxiliary_workflows/benchmark/resources/method_definitions/viloca_ewm.py index b7c55b7d..37e683e5 100644 --- a/resources/auxiliary_workflows/benchmark/resources/method_definitions/viloca_ewm_uni.py +++ b/resources/auxiliary_workflows/benchmark/resources/method_definitions/viloca_ewm.py @@ -1,7 +1,7 @@ # GROUP: global # CONDA: libshorah # CONDA: biopython = 1.79 -# PIP: git+https://github.com/cbg-ethz/VILOCA@master +# PIP: git+https://github.com/cbg-ethz/VILOCA@check_exitcode_multipro import subprocess from pathlib import Path @@ -46,28 +46,55 @@ def main( sampler = "use_quality_scores" dname_work.mkdir(parents=True, exist_ok=True) - subprocess.run( - [ - "viloca", - "run", - "-b", - fname_bam.resolve(), - "-f", - Path(fname_reference).resolve(), - "--mode", - str(sampler), - "--alpha", - str(alpha), - "--n_max_haplotypes", - str(n_max_haplotypes), - "--n_mfa_starts", - str(n_mfa_starts), - "--win_min_ext", - str(win_min_ext), - "--extended_window_mode", - ], - cwd=dname_work, - ) + if fname_insert_bed == []: + subprocess.run( + [ + "viloca", + "run", + "-b", + fname_bam.resolve(), + "-f", + Path(fname_reference).resolve(), + "--mode", + str(sampler), + "--alpha", + str(alpha), + "--n_max_haplotypes", + str(n_max_haplotypes), + "--n_mfa_starts", + str(n_mfa_starts), + "--win_min_ext", + str(win_min_ext), + "--extended_window_mode", + ], + cwd=dname_work, + ) + else: + # insert bed file is there + subprocess.run( + [ + "viloca", + "run", + "-b", + fname_bam.resolve(), + "-f", + Path(fname_reference).resolve(), + "--mode", + str(sampler), + "--alpha", + str(alpha), + "--n_max_haplotypes", + str(n_max_haplotypes), + "--n_mfa_starts", + str(n_mfa_starts), + "--win_min_ext", + str(win_min_ext), + "--extended_window_mode", + "-z", + Path(fname_insert_bed).resolve(), + ], + cwd=dname_work, + ) (dname_work / "snv" / "SNVs_0.010000_final.vcf").rename(fname_results_snv)