From 3ac6c0916b03f82fe385b2c7bc96ef17cf90cb57 Mon Sep 17 00:00:00 2001 From: St3451 Date: Wed, 27 May 2026 12:53:12 +0200 Subject: [PATCH 1/2] fix: optimize gene filtering for mutability status reporting --- scripts/run/clustering.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/run/clustering.py b/scripts/run/clustering.py index ba0e63e..c7796ef 100644 --- a/scripts/run/clustering.py +++ b/scripts/run/clustering.py @@ -604,8 +604,9 @@ def run_clustering(input_path, init_mutabilities_module(mutab_config) seq_df = seq_df[seq_df["Reference_info"] == 1] seq_df['Exons_coord'] = seq_df['Exons_coord'].apply(eval) - genes_to_process = [gene for gene in genes_to_process if gene in seq_df["Gene"].unique()] - genes_not_mutability = [gene for gene in genes_to_process if gene not in seq_df["Gene"].unique()] + genes_in_seq_df = set(seq_df["Gene"].unique()) + genes_not_mutability = [gene for gene in genes_to_process if gene not in genes_in_seq_df] + genes_to_process = [gene for gene in genes_to_process if gene in genes_in_seq_df] logger.debug("Computing probabilities..") miss_prob_dict = get_miss_mut_prob_dict(mut_rate_dict=None, seq_df=seq_df, mutability=True, mutability_config=mutab_config) From 033c6a867e6a06c3ad06c784df0c2bf0e526a34b Mon Sep 17 00:00:00 2001 From: St3451 Date: Wed, 27 May 2026 12:54:28 +0200 Subject: [PATCH 2/2] fix: update 'Mut_in_gene' assignment to use gene values directly --- scripts/run/clustering.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run/clustering.py b/scripts/run/clustering.py index c7796ef..7edc236 100644 --- a/scripts/run/clustering.py +++ b/scripts/run/clustering.py @@ -616,7 +616,7 @@ def run_clustering(input_path, result_gene = pd.DataFrame({"Gene" : genes_not_mutability, "Uniprot_ID" : np.nan, "F" : np.nan, - "Mut_in_gene" : np.nan, + "Mut_in_gene" : genes.loc[genes_not_mutability].values, "Ratio_not_in_structure" : np.nan, "Ratio_WT_mismatch" : np.nan, "Mut_zero_mut_prob" : np.nan,