Skip to content

Commit

Permalink
fix: reaction bounds in _add_cycle_free function are assigned accordi…
Browse files Browse the repository at this point in the history
…ng to the description in CycleFreeFlux paper
  • Loading branch information
alexpan00 authored and Midnighter committed Feb 18, 2024
1 parent 893593d commit abfe5f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cobra/flux_analysis/loopless.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ def _add_cycle_free(model: "Model", fluxes: Dict[str, float]) -> None:
rxn.bounds = (flux, flux)
continue
if flux >= 0:
rxn.bounds = max(0, rxn.lower_bound), max(flux, rxn.upper_bound)
rxn.bounds = max(0, rxn.lower_bound), min(flux, rxn.upper_bound)
objective_vars.append(rxn.forward_variable)
else:
rxn.bounds = min(flux, rxn.lower_bound), min(0, rxn.upper_bound)
rxn.bounds = max(flux, rxn.lower_bound), min(0, rxn.upper_bound)
objective_vars.append(rxn.reverse_variable)

model.objective.set_linear_coefficients({v: 1.0 for v in objective_vars})
Expand Down

0 comments on commit abfe5f6

Please sign in to comment.