Mercurial > repos > bimib > cobraxy
diff COBRAxy/ras_to_bounds.py @ 506:ffc234ec80db draft
Uploaded
author | francesco_lapi |
---|---|
date | Wed, 01 Oct 2025 13:19:03 +0000 |
parents | 97eea560a10f |
children | 20e135a73cad |
line wrap: on
line diff
--- a/COBRAxy/ras_to_bounds.py Wed Oct 01 11:15:00 2025 +0000 +++ b/COBRAxy/ras_to_bounds.py Wed Oct 01 13:19:03 2025 +0000 @@ -178,10 +178,7 @@ bounds = modelUtils.generate_bounds(model) medium = modelUtils.get_medium(model) - try: - compartments = modelUtils.generate_compartments(model) - except: - compartments = None + compartments = modelUtils.generate_compartments(model) df_rules = pd.DataFrame(list(rules.items()), columns = ["ReactionID", "Rule"]) df_reactions = pd.DataFrame(list(reactions.items()), columns = ["ReactionID", "Reaction"]) @@ -191,9 +188,8 @@ merged = df_reactions.merge(df_rules, on = "ReactionID", how = "outer") merged = merged.merge(df_bounds, on = "ReactionID", how = "outer") - - # Add compartments only if they exist and model name is ENGRO2 - if compartments is not None and hasattr(ARGS, 'name') and ARGS.name == "ENGRO2": + # Add compartments only if they exist + if compartments is not None: merged = merged.merge(compartments, on = "ReactionID", how = "outer") merged = merged.merge(df_medium, on = "ReactionID", how = "left")