From 29ea5a2d912df332723e231c53ec51b93239abd5 Mon Sep 17 00:00:00 2001 From: nlouwen Date: Thu, 5 Dec 2024 12:04:33 +0100 Subject: [PATCH] expand docs --- big_scape/comparison/lcs.py | 8 ++++++-- big_scape/output/legacy_output.py | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/big_scape/comparison/lcs.py b/big_scape/comparison/lcs.py index adb4a199..82204720 100644 --- a/big_scape/comparison/lcs.py +++ b/big_scape/comparison/lcs.py @@ -287,7 +287,9 @@ def find_domain_lcs_region( # Length - # clear the lists if it's not empty and the current match is longer + # clear the longest list if it's not empty and the current match is longer. + # also clear the central list as we do not care about a shorter LCS even if it + # is more central if len(use_longest_list) > 0 and length > use_longest_list[0][1]: use_longest_list.clear() use_central_list.clear() @@ -524,7 +526,9 @@ def find_domain_lcs_protocluster( # Length - # clear the lists if it's not empty and the current match is longer + # clear the longest list if it's not empty and the current match is longer. + # also clear the central list as we do not care about a shorter LCS even if it + # is more central if len(use_longest_list) > 0 and length > use_longest_list[0][1]: use_longest_list.clear() use_central_list.clear() diff --git a/big_scape/output/legacy_output.py b/big_scape/output/legacy_output.py index d34fee8f..47287b64 100644 --- a/big_scape/output/legacy_output.py +++ b/big_scape/output/legacy_output.py @@ -638,11 +638,13 @@ def write_network_file( .where(edge_params_table.c.weights.in_(incl_weights)) .where(edge_params_table.c.alignment_mode == aln_mode) .where(edge_params_table.c.extend_strategy == ext_strat) - .where(distance_table.c.distance < 1) ) if cutoff is not None: select_statement = select_statement.where(distance_table.c.distance < cutoff) + else: + # still do not include edges with a distance of 1 + select_statement = select_statement.where(distance_table.c.distance < 1) edgelist = set(DB.execute(select_statement).fetchall())