diff --git a/big_scape/cli/__init__.py b/big_scape/cli/__init__.py index aaf62a45..b93a1292 100644 --- a/big_scape/cli/__init__.py +++ b/big_scape/cli/__init__.py @@ -6,6 +6,7 @@ validate_binning_cluster_workflow, validate_binning_query_workflow, validate_alignment_mode, + validate_extend_strategy, validate_includelist_all, validate_includelist_any, validate_gcf_cutoffs, @@ -23,6 +24,7 @@ "validate_binning_cluster_workflow", "validate_binning_query_workflow", "validate_alignment_mode", + "validate_extend_strategy", "validate_includelist_all", "validate_includelist_any", "validate_gcf_cutoffs", diff --git a/big_scape/cli/cli_common_options.py b/big_scape/cli/cli_common_options.py index b0bcd865..a5c0fda4 100644 --- a/big_scape/cli/cli_common_options.py +++ b/big_scape/cli/cli_common_options.py @@ -13,6 +13,7 @@ validate_not_empty_dir, validate_input_mode, validate_alignment_mode, + validate_extend_strategy, validate_includelist_all, validate_includelist_any, validate_gcf_cutoffs, @@ -307,6 +308,7 @@ def common_cluster_query(fn): "--extend_strategy", type=click.Choice(["legacy", "greedy"]), default="legacy", + callback=validate_extend_strategy, help="Strategy to extend BGCs. 'legacy' will use the original BiG-SCAPE extension strategy, " "while 'greedy' will use a new greedy extension strategy. (default: legacy).", ), diff --git a/big_scape/cli/cli_validations.py b/big_scape/cli/cli_validations.py index a9aa04d4..1a4f0d92 100644 --- a/big_scape/cli/cli_validations.py +++ b/big_scape/cli/cli_validations.py @@ -162,6 +162,18 @@ def validate_alignment_mode( return None +def validate_extend_strategy( + ctx, param, extend_strategy +) -> Optional[bs_enums.EXTEND_STRATEGY]: + """Validate the passed extend strategy is one of the allowed modes""" + valid_strats = [strat.value for strat in bs_enums.EXTEND_STRATEGY] + + for strat in valid_strats: + if extend_strategy == strat: + return bs_enums.EXTEND_STRATEGY[strat.upper()] + return None + + def validate_gcf_cutoffs(ctx, param, gcf_cutoffs) -> list[float]: """Validates range and formats into correct list[float] format""" diff --git a/big_scape/comparison/utility.py b/big_scape/comparison/utility.py index 68bde596..6945e288 100644 --- a/big_scape/comparison/utility.py +++ b/big_scape/comparison/utility.py @@ -8,6 +8,7 @@ from sqlalchemy import insert, select # from other modules +import big_scape.enums as bs_enums from big_scape.data import DB # from this module @@ -183,7 +184,7 @@ def save_edges_to_db( # yield pair, distance, jaccard, adjacency, dss, edge_param_id -def get_edge_param_id(run, weights) -> int: +def get_edge_param_id(run: dict, weights: str) -> int: """get edge params id if available, else create a new one Args: @@ -201,23 +202,29 @@ def get_edge_param_id(run, weights) -> int: raise RuntimeError("DB.metadata is None") alignment_mode = run["alignment_mode"] + extend_strategy = run["extend_strategy"] - edge_param_id = edge_params_query(alignment_mode, weights) + edge_param_id = edge_params_query(alignment_mode, weights, extend_strategy) if edge_param_id is None: - edge_param_id = edge_params_insert(alignment_mode, weights) + edge_param_id = edge_params_insert(alignment_mode, weights, extend_strategy) logging.debug("Edge params id: %d", edge_param_id[0]) return edge_param_id[0] -def edge_params_query(alignment_mode, weights): +def edge_params_query( + alignment_mode: bs_enums.ALIGNMENT_MODE, + weights: str, + extend_strategy: bs_enums.EXTEND_STRATEGY, +): """Create and run a query for edge params Args: alignment_mode (enum): global, glocal or auto weights (str): weights category, i.e. "mix" + extend_strategy (enum): legacy, greedy Raises: RuntimeError: no dabatase @@ -233,6 +240,7 @@ def edge_params_query(alignment_mode, weights): edge_params_query = ( select(edge_params_table.c.id) .where(edge_params_table.c.alignment_mode == alignment_mode.name) + .where(edge_params_table.c.extend_strategy == extend_strategy.name) .where(edge_params_table.c.weights == weights) ) @@ -241,12 +249,17 @@ def edge_params_query(alignment_mode, weights): return edge_param_id -def edge_params_insert(alignment_mode, weights): +def edge_params_insert( + alignment_mode: bs_enums.ALIGNMENT_MODE, + weights: str, + extend_strategy: bs_enums.EXTEND_STRATEGY, +): """Insert an edge param entry into the database Args: - alignment_mode (_type_): global, glocal or auto - weights (_type_): weights category, i.e. "mix" + alignment_mode (enum): global, glocal or auto + weights (str): weights category, i.e. "mix" + extend_strategy (enum): legacy, greedy Raises: RuntimeError: no dabatase @@ -261,7 +274,11 @@ def edge_params_insert(alignment_mode, weights): edge_params_table = DB.metadata.tables["edge_params"] edge_params_insert = ( edge_params_table.insert() - .values(alignment_mode=alignment_mode.name, weights=weights) + .values( + alignment_mode=alignment_mode.name, + weights=weights, + extend_strategy=extend_strategy.name, + ) .returning(edge_params_table.c.id) .compile() ) diff --git a/big_scape/comparison/workflow.py b/big_scape/comparison/workflow.py index 68b41e7f..c0f378b2 100644 --- a/big_scape/comparison/workflow.py +++ b/big_scape/comparison/workflow.py @@ -21,7 +21,6 @@ from .record_pair import RecordPair # from dependencies -import click from sqlalchemy import select # from other modules @@ -108,6 +107,7 @@ def get_batch_size(cores: int, desired_batch_size: int, num_items: int): def generate_edges( pair_generator: RecordPairGenerator, alignment_mode: bs_enums.ALIGNMENT_MODE, + extend_strategy: bs_enums.EXTEND_STRATEGY, cores: int, max_queue_length: int, callback: Optional[Callable] = None, @@ -184,6 +184,7 @@ def on_complete(future: Future): ( batch, alignment_mode, + extend_strategy, pair_generator.edge_param_id, pair_generator.weights, ), @@ -294,7 +295,11 @@ def do_lcs_pair(pair: RecordPair) -> bool: # pragma no cover return False -def expand_pair(pair: RecordPair, alignment_mode: bs_enums.ALIGNMENT_MODE) -> bool: +def expand_pair( + pair: RecordPair, + alignment_mode: bs_enums.ALIGNMENT_MODE, + extend_strategy: bs_enums.EXTEND_STRATEGY, +) -> bool: """Expand the pair Args: @@ -304,14 +309,7 @@ def expand_pair(pair: RecordPair, alignment_mode: bs_enums.ALIGNMENT_MODE) -> bo Returns: bool: True if the pair was extended, False if it does not """ - # TODO: true arg means silent if there is no context. this is done so that unit - # tests don't complain. remove this and mock the context in unit tests instead - click_context = click.get_current_context(silent=True) - - if not click_context: - raise RuntimeError("No click context found") - - if click_context.obj["extend_strategy"] == "legacy": + if extend_strategy == bs_enums.EXTEND_STRATEGY.LEGACY: extend( pair, BigscapeConfig.EXPAND_MATCH_SCORE, @@ -319,7 +317,7 @@ def expand_pair(pair: RecordPair, alignment_mode: bs_enums.ALIGNMENT_MODE) -> bo BigscapeConfig.EXPAND_GAP_SCORE, BigscapeConfig.EXPAND_MAX_MATCH_PERC, ) - if click_context.obj["extend_strategy"] == "greedy": + if extend_strategy == bs_enums.EXTEND_STRATEGY.GREEDY: extend_greedy(pair) # after local expansion, additionally expand shortest arms in glocal/auto @@ -395,6 +393,7 @@ def calculate_scores_pair( data: tuple[ list[Union[tuple[int, int], tuple[BGCRecord, BGCRecord]]], bs_enums.ALIGNMENT_MODE, + bs_enums.EXTEND_STRATEGY, int, str, ] @@ -414,14 +413,14 @@ def calculate_scores_pair( Args: data (tuple[list[tuple[int, int]], str, str]): list of pairs, alignment mode, - bin label + extend_strategy, edge_param_id, bin label Returns: list[tuple[int, int, float, float, float, float, int, int, int, int, int, int, int, int, bool, str,]]: list of scores for each pair in the order as the input data list, including lcs and extension coordinates """ - data, alignment_mode, edge_param_id, weights_label = data + data, alignment_mode, extend_strategy, edge_param_id, weights_label = data # convert database ids to minimal record objects if isinstance(data[0][0], int): @@ -491,7 +490,7 @@ def calculate_scores_pair( ): needs_expand = do_lcs_pair(pair) if needs_expand: - expand_pair(pair, alignment_mode) + expand_pair(pair, alignment_mode, extend_strategy) if weights_label not in LEGACY_WEIGHTS: bin_weights = LEGACY_WEIGHTS["mix"]["weights"] diff --git a/big_scape/data/schema.sql b/big_scape/data/schema.sql index 1cfb8531..46058693 100644 --- a/big_scape/data/schema.sql +++ b/big_scape/data/schema.sql @@ -122,8 +122,9 @@ CREATE TABLE IF NOT EXISTS edge_params ( id INTEGER PRIMARY KEY AUTOINCREMENT, weights TEXT NOT NULL, alignment_mode TEXT NOT NULL, + extend_strategy TEXT NOT NULL, UNIQUE(id), - UNIQUE(weights, alignment_mode) + UNIQUE(weights, alignment_mode, extend_strategy) ); CREATE INDEX IF NOT EXISTS record_id_index ON bgc_record(id); diff --git a/big_scape/distances/classify.py b/big_scape/distances/classify.py index c68f5a84..4663e348 100644 --- a/big_scape/distances/classify.py +++ b/big_scape/distances/classify.py @@ -59,6 +59,7 @@ def callback(edges): bs_comparison.generate_edges( missing_edge_bin, run["alignment_mode"], + run["extend_strategy"], run["cores"], run["cores"] * 2, callback, diff --git a/big_scape/distances/legacy_classify.py b/big_scape/distances/legacy_classify.py index 3a57ec01..27daf616 100644 --- a/big_scape/distances/legacy_classify.py +++ b/big_scape/distances/legacy_classify.py @@ -58,6 +58,7 @@ def callback(edges): bs_comparison.generate_edges( missing_edge_bin, run["alignment_mode"], + run["extend_strategy"], run["cores"], run["cores"] * 2, callback, diff --git a/big_scape/distances/mix.py b/big_scape/distances/mix.py index 85fb23a2..1d930f83 100644 --- a/big_scape/distances/mix.py +++ b/big_scape/distances/mix.py @@ -56,6 +56,7 @@ def callback(edges): bs_comparison.generate_edges( missing_edge_bin, run["alignment_mode"], + run["extend_strategy"], run["cores"], run["cores"] * 2, callback, diff --git a/big_scape/distances/query.py b/big_scape/distances/query.py index ca4951c9..43c9967d 100644 --- a/big_scape/distances/query.py +++ b/big_scape/distances/query.py @@ -180,6 +180,7 @@ def callback(edges): bs_comparison.generate_edges( bin, run["alignment_mode"], + run["extend_strategy"], run["cores"], run["cores"] * 2, callback, diff --git a/big_scape/enums/__init__.py b/big_scape/enums/__init__.py index d66d9c7f..dcd95d0d 100644 --- a/big_scape/enums/__init__.py +++ b/big_scape/enums/__init__.py @@ -1,8 +1,15 @@ """Module containing code related to enums""" + from .input_parameters import INPUT_MODE from .source_type import SOURCE_TYPE from .partial_task import TASK, INPUT_TASK, HMM_TASK, COMPARISON_TASK -from .comparison import ALIGNMENT_MODE, LCS_MODE, COMPARISON_MODE, CLASSIFY_MODE +from .comparison import ( + ALIGNMENT_MODE, + EXTEND_STRATEGY, + LCS_MODE, + COMPARISON_MODE, + CLASSIFY_MODE, +) from .genbank import RECORD_TYPE __all__ = [ @@ -13,6 +20,7 @@ "HMM_TASK", "COMPARISON_TASK", "ALIGNMENT_MODE", + "EXTEND_STRATEGY", "LCS_MODE", "COMPARISON_MODE", "CLASSIFY_MODE", diff --git a/big_scape/enums/comparison.py b/big_scape/enums/comparison.py index caacbd56..1747ae46 100644 --- a/big_scape/enums/comparison.py +++ b/big_scape/enums/comparison.py @@ -11,6 +11,11 @@ class ALIGNMENT_MODE(Enum): AUTO = "auto" +class EXTEND_STRATEGY(Enum): + LEGACY = "legacy" + GREEDY = "greedy" + + class COMPARISON_MODE(Enum): CDS = "cds" DOMAIN = "domain" diff --git a/test/comparison/test_binning.py b/test/comparison/test_binning.py index 92e8694d..730f8e31 100644 --- a/test/comparison/test_binning.py +++ b/test/comparison/test_binning.py @@ -15,7 +15,6 @@ RecordPairGenerator, ConnectedComponentPairGenerator, QueryRecordPairGenerator, - QueryMissingRecordPairGenerator, save_edge_to_db, get_record_category, get_legacy_weights_from_category, @@ -325,6 +324,7 @@ def test_connected_component_pair_generator(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CATEGORY, } @@ -657,6 +657,7 @@ def test_mix_iter(self): run = { "record_type": bs_enums.RECORD_TYPE.REGION, "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, } new_bin = generate_mix_bin(bgc_list, run) @@ -903,6 +904,7 @@ def test_as_class_bin_generator(self): run_category_weights = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CATEGORY, "hybrids_off": False, @@ -921,6 +923,7 @@ def test_get_edge_params_id_insert(self): bs_data.DB.create_in_mem() run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CATEGORY, } @@ -937,6 +940,7 @@ def test_get_edge_params_id_fetch(self): bs_data.DB.create_in_mem() run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CATEGORY, } @@ -955,6 +959,7 @@ def test_get_edge_weight(self): bs_data.DB.create_in_mem() run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CATEGORY, } diff --git a/test/integration/test_comparison.py b/test/integration/test_comparison.py index 6d5b9f19..1407fe24 100644 --- a/test/integration/test_comparison.py +++ b/test/integration/test_comparison.py @@ -356,19 +356,24 @@ def test_get_edge_param(self): run_1 = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CATEGORY, } weights_1 = "mix" - alignment_mode = run_1["alignment_mode"] + extend_strat = run_1["extend_strategy"] - edge_param_id = bs_comparison.edge_params_query(alignment_mode, weights_1) + edge_param_id = bs_comparison.edge_params_query( + alignment_mode, weights_1, extend_strat + ) # the db is empty so we dont find an entry self.assertEqual(edge_param_id, None) - edge_param_id = bs_comparison.edge_params_insert(alignment_mode, weights_1) + edge_param_id = bs_comparison.edge_params_insert( + alignment_mode, weights_1, extend_strat + ) edge_param_id = edge_param_id[0] @@ -377,6 +382,7 @@ def test_get_edge_param(self): run_2 = { "alignment_mode": bs_enums.ALIGNMENT_MODE.GLOBAL, + "extend_strategy": bs_enums.EXTEND_STRATEGY.GREEDY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CATEGORY, } @@ -397,6 +403,7 @@ def test_fetch_records_from_db(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "record_type": bs_enums.RECORD_TYPE.REGION, "cores": 1, @@ -443,6 +450,7 @@ def test_calculate_scores_pair(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "record_type": bs_enums.RECORD_TYPE.REGION, "cores": 1, @@ -480,6 +488,7 @@ def test_calculate_scores_pair(self): ( batch, run["alignment_mode"], + run["extend_strategy"], missing_edge_bin.edge_param_id, missing_edge_bin.weights, ) @@ -506,6 +515,7 @@ def test_generate_and_save_edges_workflow(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "record_type": bs_enums.RECORD_TYPE.REGION, "cores": 1, @@ -535,6 +545,7 @@ def callback(edges): bs_comparison.generate_edges( missing_edge_bin, run["alignment_mode"], + run["extend_strategy"], run["cores"], run["cores"] * 2, callback, @@ -577,6 +588,7 @@ def test_calculate_distances_mix_bin_worflow(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "record_type": bs_enums.RECORD_TYPE.REGION, } @@ -633,6 +645,7 @@ def test_calculate_distances_mix(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "record_type": bs_enums.RECORD_TYPE.REGION, "cores": 1, @@ -667,6 +680,7 @@ def test_generate_bins_classify_worflow(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CLASS, "record_type": bs_enums.RECORD_TYPE.REGION, @@ -723,6 +737,7 @@ def test_generate_bins_classify_worflow(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": False, "classify": bs_enums.CLASSIFY_MODE.CLASS, "record_type": bs_enums.RECORD_TYPE.REGION, @@ -756,6 +771,7 @@ def test_generate_bins_legacy_classify_worflow(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CLASS, "record_type": bs_enums.RECORD_TYPE.REGION, @@ -812,6 +828,7 @@ def test_generate_bins_legacy_classify_worflow(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CLASS, "record_type": bs_enums.RECORD_TYPE.REGION, @@ -843,6 +860,7 @@ def test_calculate_distances_legacy_classify(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CLASS, "record_type": bs_enums.RECORD_TYPE.REGION, @@ -893,6 +911,7 @@ def test_calculate_distances_legacy_classify(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CLASS, "record_type": bs_enums.RECORD_TYPE.REGION, @@ -920,6 +939,7 @@ def test_calculate_distances_classify(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": True, "classify": bs_enums.CLASSIFY_MODE.CLASS, "record_type": bs_enums.RECORD_TYPE.REGION, @@ -967,6 +987,7 @@ def test_calculate_distances_classify(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": False, "classify": bs_enums.CLASSIFY_MODE.CLASS, "record_type": bs_enums.RECORD_TYPE.REGION, @@ -1441,6 +1462,7 @@ def test_generate_bins_query_workflow(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": False, "record_type": bs_enums.RECORD_TYPE.REGION, "cores": 1, @@ -1575,6 +1597,7 @@ def test_calculate_distances_query(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": False, "record_type": bs_enums.RECORD_TYPE.REGION, "cores": 1, @@ -1649,6 +1672,7 @@ def test_get_query_records(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": False, "record_type": bs_enums.RECORD_TYPE.REGION, "cores": 1, @@ -1666,6 +1690,7 @@ def test_get_query_records(self): run = { "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "legacy_weights": False, "record_type": bs_enums.RECORD_TYPE.REGION, "cores": 1, diff --git a/test/integration/test_network.py b/test/integration/test_network.py index 2b8fb5db..31226fdb 100644 --- a/test/integration/test_network.py +++ b/test/integration/test_network.py @@ -103,6 +103,7 @@ def test_get_connected_components_two_cutoffs(self): run = { "record_type": bs_enums.RECORD_TYPE.REGION, "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, } gbks_a = [] @@ -146,6 +147,7 @@ def test_get_connected_components_all_cutoffs(self): run = { "record_type": bs_enums.RECORD_TYPE.REGION, "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, } gbks_a = [] @@ -398,6 +400,7 @@ def test_get_connected_components_no_ref_to_ref_ccs(self): run = { "record_type": bs_enums.RECORD_TYPE.REGION, "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, } gbks_a = [] @@ -496,6 +499,7 @@ def test_get_connected_components_two_bins(self): "record_type": bs_enums.RECORD_TYPE.REGION, "legacy_classify": True, "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "hybrids_off": False, } @@ -553,6 +557,7 @@ def test_get_connected_components_two_bins_different_edge_params(self): "record_type": bs_enums.RECORD_TYPE.REGION, "legacy_classify": True, "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, "hybrids_off": False, } diff --git a/test/network/test_network.py b/test/network/test_network.py index 431389cd..0b768cff 100644 --- a/test/network/test_network.py +++ b/test/network/test_network.py @@ -369,6 +369,7 @@ def test_is_ref_only_connected_component(self): run = { "record_type": bs_enums.RECORD_TYPE.REGION, "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, } # create a bunch of gbk files @@ -429,6 +430,7 @@ def test_get_connected_component_id(self): run = { "record_type": bs_enums.RECORD_TYPE.REGION, "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, } # create a bunch of gbk files gbks = [] @@ -463,6 +465,7 @@ def test_remove_connected_component(self): run = { "record_type": bs_enums.RECORD_TYPE.REGION, "alignment_mode": bs_enums.ALIGNMENT_MODE.AUTO, + "extend_strategy": bs_enums.EXTEND_STRATEGY.LEGACY, } # create a bunch of gbk files