A <-> B catalyzed when ligand L binds to site 1 of macromolecule M1¶In Part 1 we consider the un-catalyzed reaction A <-> B
In Part 2 we'll see what happens when catalysis is added
LAST REVISED: Dec. 3, 2023
import set_path # Importing this module will add the project's home directory to sys.path
Added 'D:\Docs\- MY CODE\BioSimulations\life123-Win7' to sys.path
from src.modules.chemicals.chem_data import ChemData
from src.modules.reactions.reaction_dynamics import ReactionDynamics
import plotly.express as px
A <-> B by itself¶# Initialize the system
chem1 = ChemData(names=["A", "B"])
# Reaction A <-> B , without catalysis (slow forward rate, relative to what we'll see in Part 2)
chem1.add_reaction(reactants="A", products="B",
forward_rate=1. , delta_G= -5000)
chem1.describe_reactions()
Number of reactions: 1 (at temp. 25 C)
0: A <-> B (kF = 1 / kR = 0.13306 / delta_G = -5,000 / K = 7.5156) | 1st order in all reactants & products
Set of chemicals involved in the above reactions: {'B', 'A'}
# Set the initial concentrations of all the chemicals
dynamics1 = ReactionDynamics(chem_data=chem1)
dynamics1.set_conc(conc={"A": 100., "B": 20.},
snapshot=True)
dynamics1.describe_state()
SYSTEM STATE at Time t = 0:
2 species:
Species 0 (A). Conc: 100.0
Species 1 (B). Conc: 20.0
Set of chemicals involved in reactions: {'B', 'A'}
# Take the system to equilibrium
dynamics1.set_diagnostics() # To save diagnostic information about the call to single_compartment_react()
# All of these settings are currently close to the default values... but subject to change; set for repeatability
dynamics1.set_thresholds(norm="norm_A", low=0.6, high=1.0, abort=1.44)
dynamics1.set_thresholds(norm="norm_B", low=0.04, high=0.6, abort=1.5)
dynamics1.set_step_factors(upshift=1.2, downshift=0.7, abort=0.4)
dynamics1.set_error_step_factor(0.3)
dynamics1.single_compartment_react(initial_step=0.02, reaction_duration=4.0,
variable_steps=True, explain_variable_steps=False)
* INFO: the tentative time step (0.02) leads to a least one norm value > its ABORT threshold:
-> will backtrack, and re-do step with a SMALLER delta time, multiplied by 0.4 (set to 0.008) [Step started at t=0, and will rewind there]
80 total step(s) taken
#dynamics1.explain_time_advance()
dynamics1.plot_history(colors=['darkorange', 'green'], show_intervals=True, title_prefix="WITHOUT catalysis")
# Verify that the reaction has reached equilibrium
dynamics1.is_in_equilibrium(tolerance=5)
0: A <-> B
Final concentrations: [A] = 14.63 ; [B] = 105.4
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 7.20163
Formula used: [B] / [A]
2. Ratio of forward/reverse reaction rates: 7.515573071036746
Discrepancy between the two values: 4.177 %
Reaction IS in equilibrium (within 5% tolerance)
True
# Initialize the system
chem2 = ChemData(names=["A", "B", "L"])
chem2.add_macromolecules("M1")
chem2.set_binding_site_affinity("M1", site_number=1, ligand="L", Kd=5.0)
chem2.show_binding_affinities() # Review the values we have given for the dissociation constants
M1 : Site 1 - Kd (dissociation const) for L : 5.0
# Reaction A <-> B , without catalysis (same as he had in part 1)
chem2.add_reaction(reactants="A", products="B",
forward_rate=1. , delta_G= -5000)
# Reaction A <-> B , WITH catalysis (fast forward rate)
#rxn = chem2.add_reaction(reactants="A", products="B",
# forward_rate=10. , delta_G= -5000)
#rxn.set_macro_enzyme(macromolecule="M1", site_number=1)
chem2.describe_reactions()
Number of reactions: 1 (at temp. 25 C)
0: A <-> B (kF = 1 / kR = 0.13306 / delta_G = -5,000 / K = 7.5156) | 1st order in all reactants & products
Set of chemicals involved in the above reactions: {'B', 'A'}
L present; hence, only the slow reaction is in effect¶# Set the initial concentrations of all the chemicals, including the macromolecule
dynamics2 = ReactionDynamics(chem_data=chem2)
dynamics2.set_conc(conc={"A": 100., "B": 20., "L": 0.},
snapshot=True) # The macromolecule ligand L is absent
dynamics2.set_macromolecules() # By default, set counts to 1 for all the registered macromolecules
dynamics2.describe_state()
SYSTEM STATE at Time t = 0:
3 species:
Species 0 (A). Conc: 100.0
Species 1 (B). Conc: 20.0
Species 2 (L). Conc: 0.0
Macro-molecules, with their counts: {'M1': 1}
Fractional Occupancy at the various binding sites for each macro-molecule:
M1 || 1: 0.0 (L)
Set of chemicals involved in reactions: {'B', 'A'}
dynamics2.set_diagnostics() # To save diagnostic information about the call to single_compartment_react()
# All of these settings are currently close to the default values... but subject to change; set for repeatability
dynamics2.set_thresholds(norm="norm_A", low=0.6, high=1.0, abort=1.44)
dynamics2.set_thresholds(norm="norm_B", low=0.04, high=0.6, abort=1.5)
dynamics2.set_step_factors(upshift=1.2, downshift=0.7, abort=0.4)
dynamics2.set_error_step_factor(0.3)
dynamics2.single_compartment_react(initial_step=0.02, reaction_duration=4.0,
variable_steps=True, explain_variable_steps=False)
* INFO: the tentative time step (0.02) leads to a least one norm value > its ABORT threshold:
-> will backtrack, and re-do step with a SMALLER delta time, multiplied by 0.4 (set to 0.008) [Step started at t=0, and will rewind there]
80 total step(s) taken
dynamics2.explain_time_advance()
From time 0 to 0.008, in 1 step of 0.008 From time 0.008 to 0.0464, in 4 steps of 0.0096 From time 0.0464 to 0.08096, in 3 steps of 0.0115 From time 0.08096 to 0.2054, in 9 steps of 0.0138 From time 0.2054 to 0.3713, in 10 steps of 0.0166 From time 0.3713 to 0.5305, in 8 steps of 0.0199 From time 0.5305 to 0.6977, in 7 steps of 0.0239 From time 0.6977 to 0.8697, in 6 steps of 0.0287 From time 0.8697 to 1.042, in 5 steps of 0.0344 From time 1.042 to 1.207, in 4 steps of 0.0413 From time 1.207 to 1.355, in 3 steps of 0.0495 From time 1.355 to 1.534, in 3 steps of 0.0594 From time 1.534 to 1.676, in 2 steps of 0.0713 From time 1.676 to 2.019, in 4 steps of 0.0856 From time 2.019 to 2.224, in 2 steps of 0.103 From time 2.224 to 2.471, in 2 steps of 0.123 From time 2.471 to 2.767, in 2 steps of 0.148 From time 2.767 to 2.944, in 1 step of 0.177 From time 2.944 to 3.157, in 1 step of 0.213 From time 3.157 to 3.413, in 1 step of 0.256 From time 3.413 to 3.719, in 1 step of 0.307 From time 3.719 to 4.087, in 1 step of 0.368 (80 steps total)
dynamics2.plot_history(colors=['darkorange', 'green', 'darkblue'], show_intervals=True, title_prefix="WITHOUT catalysis")
# Verify that the reaction has reached equilibrium
dynamics2.is_in_equilibrium(tolerance=5)
0: A <-> B
Final concentrations: [A] = 14.63 ; [B] = 105.4
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 7.20163
Formula used: [B] / [A]
2. Ratio of forward/reverse reaction rates: 7.515573071036746
Discrepancy between the two values: 4.177 %
Reaction IS in equilibrium (within 5% tolerance)
True