From e550a6a347df9169a0f6f72c83118b7d6bed1d8a Mon Sep 17 00:00:00 2001 From: Thomas Hopf Date: Thu, 23 Oct 2025 16:54:30 +0200 Subject: [PATCH] only lowercase columns if at least one column affected, fixes #327 --- evcouplings/align/protocol.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/evcouplings/align/protocol.py b/evcouplings/align/protocol.py index a38adce..7c7ce2c 100644 --- a/evcouplings/align/protocol.py +++ b/evcouplings/align/protocol.py @@ -943,10 +943,11 @@ def modify_alignment(focus_ali, target_seq_index, target_seq_id, region_start, * min_col_cov /= 100 lc_cols = ali.count(ali._match_gap, axis="pos") > 1 - min_col_cov - ali = ali.lowercase_columns(lc_cols) - # if we remove columns, we have to update list of positions - pos_list = pos_list[~lc_cols] + if lc_cols.sum() > 0: + ali = ali.lowercase_columns(lc_cols) + # if we remove columns, we have to update list of positions + pos_list = pos_list[~lc_cols] else: lc_cols = None