# HG changeset patch # User luca_milaz # Date 1728894150 0 # Node ID 7e1ce04cf192bb0f68c6e07b2891a85b41205218 # Parent 2121cc1aef456781b4d611c6baf7f8d04f8c913d Uploaded diff -r 2121cc1aef45 -r 7e1ce04cf192 COBRAxy/ras_to_bounds.py --- a/COBRAxy/ras_to_bounds.py Mon Oct 14 08:19:38 2024 +0000 +++ b/COBRAxy/ras_to_bounds.py Mon Oct 14 08:22:30 2024 +0000 @@ -123,9 +123,9 @@ Returns: None """ - for reaction in rxns_ids: - if reaction in ras_row.index and reaction not in mediumRxns_ids: - scaling_factor = ras_row[reaction] + for reaction in ras_row.index: + scaling_factor = ras_row[reaction] + if(scaling_factor not in [np.nan, None]): lower_bound=model.reactions.get_by_id(reaction).lower_bound upper_bound=model.reactions.get_by_id(reaction).upper_bound valMax=float((upper_bound)*scaling_factor) @@ -178,6 +178,7 @@ # Set medium conditions for reaction, value in medium.items(): if value is not None: + ## SOLO ENGRO2 if(reaction != "EX_thbpt_e" and reaction != "EX_lac__L_e"): model.reactions.get_by_id(reaction).lower_bound = -float(value) if(reaction == "EX_lac__L_e"): @@ -247,7 +248,8 @@ ras_combined = pd.concat(ras_list, axis=0) # Normalize the RAS values by max RAS ras_combined = ras_combined.div(ras_combined.max(axis=0)) - ras_combined = ras_combined.fillna(0) + #ras_combined = ras_combined.fillna(0) + #il ras c'è per tutti o non c'è per nessuno