changeset 513:b02cfa3b36dd draft default tip

Uploaded
author francesco_lapi
date Wed, 08 Oct 2025 13:01:47 +0000
parents f32d3c9089fc
children
files COBRAxy/ras_generator.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/COBRAxy/ras_generator.py	Wed Oct 08 12:05:27 2025 +0000
+++ b/COBRAxy/ras_generator.py	Wed Oct 08 13:01:47 2025 +0000
@@ -309,9 +309,15 @@
     if any(dataset.index.duplicated(keep=False)):
         genes_duplicates=orig_gene_list[dataset.index.duplicated(keep=False)]
         genes_duplicates_in_model=[elem for elem in genes_duplicates if elem in rules_total_string]
+
         if len(genes_duplicates_in_model)>0:#metabolic genes have duplicated entries in the dataset
             list_str=", ".join(genes_duplicates_in_model)
-            raise ValueError(f"ERROR: Duplicate entries in the gene dataset present in one or more GPR. The following metabolic genes are duplicated: "+list_str)       
+            list_genes=f"ERROR: Duplicate entries in the gene dataset present in one or more GPR. The following metabolic genes are duplicated: "+list_str
+            raise ValueError(list_genes)       
+        else:
+            list_str=", ".join(genes_duplicates)
+            list_genes=f"INFO: Duplicate entries in the gene dataset. The following genes are duplicated in the dataset but not mentioned in the GPRs: "+list_str           
+            utils.logWarning(list_genes,ARGS.out_log)  
 
     #check if nan value must be ignored in the GPR 
     if ARGS.none:
@@ -335,7 +341,7 @@
     if len(genes_not_mapped)>0: 
         genes_not_mapped_str=", ".join(genes_not_mapped)
         utils.logWarning(
-        f"The following genes are mentioned in the GPR rules but don't appear in the dataset: "+genes_not_mapped_str,
+        f"INFO: The following genes are mentioned in the GPR rules but don't appear in the dataset: "+genes_not_mapped_str,
         ARGS.out_log)  
  
     print("Execution succeeded")