# HG changeset patch # User luca_milaz # Date 1734203225 0 # Node ID 4c0bb0186d387ad1352aad99a4452cc67995511d # Parent d0e2251fe8a6827a719c3249d605e0d9e1994651 Uploaded diff -r d0e2251fe8a6 -r 4c0bb0186d38 COBRAxy/ras_to_bounds.py --- a/COBRAxy/ras_to_bounds.py Sat Dec 14 19:02:16 2024 +0000 +++ b/COBRAxy/ras_to_bounds.py Sat Dec 14 19:07:05 2024 +0000 @@ -129,19 +129,18 @@ new_bounds = bounds.copy() for reaction in ras_row.index: scaling_factor = ras_row[reaction] - lower_bound=bounds.loc[reaction, "lower_bound"] - upper_bound=bounds.loc[reaction, "upper_bound"] - valMax=float((upper_bound)*scaling_factor) - valMin=float((lower_bound)*scaling_factor) - if np.isnan(scaling_factor): - warning(f"scaling_factor values for {reaction}is None") - if upper_bound!=0 and lower_bound==0: - new_bounds.loc[reaction, "upper_bound"] = valMax - if upper_bound==0 and lower_bound!=0: - new_bounds.loc[reaction, "lower_bound"] = valMin - if upper_bound!=0 and lower_bound!=0: - new_bounds.loc[reaction, "lower_bound"] = valMin - new_bounds.loc[reaction, "upper_bound"] = valMax + if not np.isnan(scaling_factor): + lower_bound=bounds.loc[reaction, "lower_bound"] + upper_bound=bounds.loc[reaction, "upper_bound"] + valMax=float((upper_bound)*scaling_factor) + valMin=float((lower_bound)*scaling_factor) + if upper_bound!=0 and lower_bound==0: + new_bounds.loc[reaction, "upper_bound"] = valMax + if upper_bound==0 and lower_bound!=0: + new_bounds.loc[reaction, "lower_bound"] = valMin + if upper_bound!=0 and lower_bound!=0: + new_bounds.loc[reaction, "lower_bound"] = valMin + new_bounds.loc[reaction, "upper_bound"] = valMax return new_bounds def process_ras_cell(cellName, ras_row, model, rxns_ids, output_folder):