diff --git a/src/metaDMG/cli/cli.py b/src/metaDMG/cli/cli.py index b90fd3c..7fb12f0 100644 --- a/src/metaDMG/cli/cli.py +++ b/src/metaDMG/cli/cli.py @@ -132,6 +132,14 @@ def create_config( rich_help_panel="LCA parameters", ), # GENERAL PARAMETERS + stopIfErrors: Optional[int] = typer.Option( + 0, + "-stopIfErrors", + "-Z", + help="Temporary hack to bypass sorting check if SO tag does not exist in sam header. Values 0 or 1. zero=dont check", + callback=lambda x: cli_utils.is_positive_int_or_None(x), + rich_help_panel="General parameters", + ), metaDMG_cpp: str = typer.Option( "./metaDMG-cpp", "--metaDMG-cpp", @@ -276,6 +284,7 @@ def create_config( sample_suffix=sample_suffix, long_name=long_name, damage_mode=damage_mode, + stopIfErrors=stopIfErrors, __version__=__version__, ) diff --git a/src/metaDMG/cli/cli_utils.py b/src/metaDMG/cli/cli_utils.py index c5b532f..394880d 100644 --- a/src/metaDMG/cli/cli_utils.py +++ b/src/metaDMG/cli/cli_utils.py @@ -459,6 +459,7 @@ def get_config_dict( sample_prefix: str = "", sample_suffix: str = "", long_name: bool = False, + stopIfErrors: int = 1, damage_mode: DAMAGE_MODE = DAMAGE_MODE.LCA, __version__: str = "", ) -> dict: @@ -486,6 +487,7 @@ def get_config_dict( "weight_type": weight_type, "custom_database": custom_database, "forward_only": forward_only, + "stopIfErrors": stopIfErrors, # "output_dir": output_dir, "parallel_samples": parallel_samples, diff --git a/src/metaDMG/fit/serial.py b/src/metaDMG/fit/serial.py index fc41b64..07ec4ac 100644 --- a/src/metaDMG/fit/serial.py +++ b/src/metaDMG/fit/serial.py @@ -91,6 +91,7 @@ def get_LCA_command(config: Config) -> str: f"-weighttype {config['weight_type']} " f"-fix_ncbi {config['custom_database']} " f"-tempfolder {config['path_tmp']}/ " + f"-stopIfErrors {config['stopIfErrors']} " ) return command[:-1] @@ -145,6 +146,7 @@ def get_damage_command(config: Config) -> str: f"--runmode {runmode} " f"--outname {outname} " f"{config['bam']} " + f"-stopIfErrors {config['stopIfErrors']} " ) return command[:-1] diff --git a/src/metaDMG/utils.py b/src/metaDMG/utils.py index 275b414..35c01a4 100644 --- a/src/metaDMG/utils.py +++ b/src/metaDMG/utils.py @@ -170,6 +170,7 @@ def make_configs( d.setdefault("cores_per_sample", 1) d.setdefault("damage_mode", "lca") d.setdefault("min_reads", 0) + d.setdefault("stopIfErrors", 1) d["force"] = force paths = ["names", "nodes", "acc2tax", "output_dir", "config_file"]