A down-regulates B , by being the limiting reagent in reaction A + 2 B <-> Y (mostly forward)¶1st-order kinetics.
If [A] is low and [B] is high, then [B] remains high. If [A] goes high, [B] goes low. However, at that point, A can no longer bring B up to any substantial extent.
Single-bin reaction
Based on experiment reactions_single_compartment/down_regulate_2
LAST REVISED: June 23, 2024 (using v. 1.0 beta34.1)
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 experiments.get_notebook_info import get_notebook_basename
from life123 import ChemData as chem
from life123 import BioSim1D
import plotly.express as px
from life123 import GraphicLog
# Initialize the HTML logging
log_file = get_notebook_basename() + ".log.htm" # Use the notebook base filename for the log file
# Set up the use of some specified graphic (Vue) components
GraphicLog.config(filename=log_file,
components=["vue_cytoscape_2"],
extra_js="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.21.2/cytoscape.umd.js")
-> Output will be LOGGED into the file 'down_regulation_1.log.htm'
# Initialize the system
chem_data = chem(names=["A", "B", "Y"]) # NOTE: Diffusion not applicable (just 1 bin)
# Reaction A + 2 B <-> Y , with 1st-order kinetics for all species
chem_data.add_reaction(reactants=[("A") , (2, "B", 1)], products=[("Y")],
forward_rate=8., reverse_rate=2.)
chem_data.describe_reactions()
# Send the plot of the reaction network to the HTML log file
chem_data.plot_reaction_network("vue_cytoscape_2")
Number of reactions: 1 (at temp. 25 C)
0: A + 2 B <-> Y (kF = 8 / kR = 2 / delta_G = -3,436.6 / K = 4) | 1st order in all reactants & products
Set of chemicals involved in the above reactions: {'A', 'Y', 'B'}
[GRAPHIC ELEMENT SENT TO LOG FILE `down_regulation_1.log.htm`]
bio = BioSim1D(n_bins=1, chem_data=chem_data)
bio.set_uniform_concentration(species_name="A", conc=5.) # Scarce
bio.set_uniform_concentration(species_name="B", conc=100.) # Plentiful
# Initially, no "Y" is present
bio.describe_state()
SYSTEM STATE at Time t = 0: 1 bins and 3 species: Species 0 (A). Diff rate: None. Conc: [5.] Species 1 (B). Diff rate: None. Conc: [100.] Species 2 (Y). Diff rate: None. Conc: [0.]
# Save the state of the concentrations of all species at bin 0 (the only bin in this system)
bio.add_snapshot(bio.bin_snapshot(bin_address = 0))
bio.get_history()
| SYSTEM TIME | A | B | Y | caption | |
|---|---|---|---|---|---|
| 0 | 0 | 5.0 | 100.0 | 0.0 |
bio.react(time_step=0.0005, n_steps=30, snapshots={"frequency": 2, "sample_bin": 0}) # At every other step, take a snapshot
# of all species at bin 0
bio.describe_state()
bio.get_history()
SYSTEM STATE at Time t = 0.015: 1 bins and 3 species: Species 0 (A). Diff rate: None. Conc: [0.01385228] Species 1 (B). Diff rate: None. Conc: [90.02770457] Species 2 (Y). Diff rate: None. Conc: [4.98614772]
| SYSTEM TIME | A | B | Y | caption | |
|---|---|---|---|---|---|
| 0 | 0.000 | 5.000000 | 100.000000 | 0.000000 | |
| 1 | 0.001 | 1.850000 | 93.700000 | 3.150000 | |
| 2 | 0.002 | 0.735332 | 91.470665 | 4.264668 | |
| 3 | 0.003 | 0.303911 | 90.607822 | 4.696089 | |
| 4 | 0.004 | 0.131501 | 90.263002 | 4.868499 | |
| 5 | 0.005 | 0.061738 | 90.123476 | 4.938262 | |
| 6 | 0.006 | 0.033369 | 90.066737 | 4.966631 | |
| 7 | 0.007 | 0.021809 | 90.043618 | 4.978191 | |
| 8 | 0.008 | 0.017095 | 90.034189 | 4.982905 | |
| 9 | 0.009 | 0.015172 | 90.030343 | 4.984828 | |
| 10 | 0.010 | 0.014387 | 90.028774 | 4.985613 | |
| 11 | 0.011 | 0.014067 | 90.028134 | 4.985933 | |
| 12 | 0.012 | 0.013936 | 90.027872 | 4.986064 | |
| 13 | 0.013 | 0.013883 | 90.027766 | 4.986117 | |
| 14 | 0.014 | 0.013861 | 90.027722 | 4.986139 | |
| 15 | 0.015 | 0.013852 | 90.027705 | 4.986148 |
A, as the scarse limiting reagent, stops the reaction.
When A is low, B is also low.
# Verify that the reaction has reached equilibrium
bio.reaction_dynamics.is_in_equilibrium(conc=bio.bin_snapshot(bin_address = 0))
0: A + 2 B <-> Y
Final concentrations: [A] = 0.01385 ; [B] = 90.03 ; [Y] = 4.986
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 3.99823
Formula used: [Y] / ([A][B])
2. Ratio of forward/reverse reaction rates: 4.0
Discrepancy between the two values: 0.0443 %
Reaction IS in equilibrium (within 1% tolerance)
True
fig = px.line(data_frame=bio.get_history(), x="SYSTEM TIME", y=["A", "B", "Y"],
title="Changes in concentrations (reaction A + 2 B <-> Y)",
color_discrete_sequence = ['red', 'blue', 'green'],
labels={"value":"concentration", "variable":"Chemical"})
fig.show()
bio.set_bin_conc(bin_address=0, species_index=0, conc=40.)
bio.describe_state()
SYSTEM STATE at Time t = 0.015: 1 bins and 3 species: Species 0 (A). Diff rate: None. Conc: [40.] Species 1 (B). Diff rate: None. Conc: [90.02770457] Species 2 (Y). Diff rate: None. Conc: [4.98614772]
# Save the state of the concentrations of all species at bin 0 (the only bin in this system)
bio.add_snapshot(bio.bin_snapshot(bin_address = 0))
bio.get_history()
| SYSTEM TIME | A | B | Y | caption | |
|---|---|---|---|---|---|
| 0 | 0.000 | 5.000000 | 100.000000 | 0.000000 | |
| 1 | 0.001 | 1.850000 | 93.700000 | 3.150000 | |
| 2 | 0.002 | 0.735332 | 91.470665 | 4.264668 | |
| 3 | 0.003 | 0.303911 | 90.607822 | 4.696089 | |
| 4 | 0.004 | 0.131501 | 90.263002 | 4.868499 | |
| 5 | 0.005 | 0.061738 | 90.123476 | 4.938262 | |
| 6 | 0.006 | 0.033369 | 90.066737 | 4.966631 | |
| 7 | 0.007 | 0.021809 | 90.043618 | 4.978191 | |
| 8 | 0.008 | 0.017095 | 90.034189 | 4.982905 | |
| 9 | 0.009 | 0.015172 | 90.030343 | 4.984828 | |
| 10 | 0.010 | 0.014387 | 90.028774 | 4.985613 | |
| 11 | 0.011 | 0.014067 | 90.028134 | 4.985933 | |
| 12 | 0.012 | 0.013936 | 90.027872 | 4.986064 | |
| 13 | 0.013 | 0.013883 | 90.027766 | 4.986117 | |
| 14 | 0.014 | 0.013861 | 90.027722 | 4.986139 | |
| 15 | 0.015 | 0.013852 | 90.027705 | 4.986148 | |
| 16 | 0.015 | 40.000000 | 90.027705 | 4.986148 |
bio.react(time_step=0.0005, n_steps=80, snapshots={"frequency": 2, "sample_bin": 0}) # At every other step, take a snapshot
# of all species at bin 0
bio.describe_state()
bio.get_history()
SYSTEM STATE at Time t = 0.055: 1 bins and 3 species: Species 0 (A). Diff rate: None. Conc: [0.97997411] Species 1 (B). Diff rate: None. Conc: [11.98765279] Species 2 (Y). Diff rate: None. Conc: [44.00617361]
| SYSTEM TIME | A | B | Y | caption | |
|---|---|---|---|---|---|
| 0 | 0.000 | 5.000000 | 100.000000 | 0.000000 | |
| 1 | 0.001 | 1.850000 | 93.700000 | 3.150000 | |
| 2 | 0.002 | 0.735332 | 91.470665 | 4.264668 | |
| 3 | 0.003 | 0.303911 | 90.607822 | 4.696089 | |
| 4 | 0.004 | 0.131501 | 90.263002 | 4.868499 | |
| 5 | 0.005 | 0.061738 | 90.123476 | 4.938262 | |
| 6 | 0.006 | 0.033369 | 90.066737 | 4.966631 | |
| 7 | 0.007 | 0.021809 | 90.043618 | 4.978191 | |
| 8 | 0.008 | 0.017095 | 90.034189 | 4.982905 | |
| 9 | 0.009 | 0.015172 | 90.030343 | 4.984828 | |
| 10 | 0.010 | 0.014387 | 90.028774 | 4.985613 | |
| 11 | 0.011 | 0.014067 | 90.028134 | 4.985933 | |
| 12 | 0.012 | 0.013936 | 90.027872 | 4.986064 | |
| 13 | 0.013 | 0.013883 | 90.027766 | 4.986117 | |
| 14 | 0.014 | 0.013861 | 90.027722 | 4.986139 | |
| 15 | 0.015 | 0.013852 | 90.027705 | 4.986148 | |
| 16 | 0.015 | 40.000000 | 90.027705 | 4.986148 | |
| 17 | 0.016 | 19.349973 | 48.727651 | 25.636175 | |
| 18 | 0.017 | 13.059681 | 36.147067 | 31.926466 | |
| 19 | 0.018 | 9.783622 | 29.594949 | 35.202526 | |
| 20 | 0.019 | 7.749528 | 25.526760 | 37.236620 | |
| 21 | 0.020 | 6.361385 | 22.750475 | 38.624763 | |
| 22 | 0.021 | 5.355704 | 20.739113 | 39.630443 | |
| 23 | 0.022 | 4.596387 | 19.220478 | 40.389761 | |
| 24 | 0.023 | 4.005510 | 18.038724 | 40.980638 | |
| 25 | 0.024 | 3.535038 | 17.097780 | 41.451110 | |
| 26 | 0.025 | 3.153653 | 16.335011 | 41.832494 | |
| 27 | 0.026 | 2.840021 | 15.707747 | 42.146127 | |
| 28 | 0.027 | 2.579079 | 15.185862 | 42.407069 | |
| 29 | 0.028 | 2.359876 | 14.747456 | 42.626272 | |
| 30 | 0.029 | 2.174254 | 14.376212 | 42.811894 | |
| 31 | 0.030 | 2.016004 | 14.059712 | 42.970144 | |
| 32 | 0.031 | 1.880314 | 13.788333 | 43.105833 | |
| 33 | 0.032 | 1.763400 | 13.554504 | 43.222748 | |
| 34 | 0.033 | 1.662239 | 13.352182 | 43.323909 | |
| 35 | 0.034 | 1.574392 | 13.176488 | 43.411756 | |
| 36 | 0.035 | 1.497866 | 13.023437 | 43.488281 | |
| 37 | 0.036 | 1.431022 | 12.889749 | 43.555125 | |
| 38 | 0.037 | 1.372496 | 12.772696 | 43.613652 | |
| 39 | 0.038 | 1.321146 | 12.669996 | 43.665002 | |
| 40 | 0.039 | 1.276010 | 12.579724 | 43.710138 | |
| 41 | 0.040 | 1.236273 | 12.500251 | 43.749875 | |
| 42 | 0.041 | 1.201240 | 12.430185 | 43.784907 | |
| 43 | 0.042 | 1.170317 | 12.368338 | 43.815831 | |
| 44 | 0.043 | 1.142991 | 12.313686 | 43.843157 | |
| 45 | 0.044 | 1.118820 | 12.265345 | 43.867328 | |
| 46 | 0.045 | 1.097423 | 12.222550 | 43.888725 | |
| 47 | 0.046 | 1.078466 | 12.184636 | 43.907682 | |
| 48 | 0.047 | 1.061660 | 12.151024 | 43.924488 | |
| 49 | 0.048 | 1.046752 | 12.121209 | 43.939395 | |
| 50 | 0.049 | 1.033522 | 12.094748 | 43.952626 | |
| 51 | 0.050 | 1.021774 | 12.071252 | 43.964374 | |
| 52 | 0.051 | 1.011338 | 12.050381 | 43.974809 | |
| 53 | 0.052 | 1.002065 | 12.031835 | 43.984083 | |
| 54 | 0.053 | 0.993822 | 12.015349 | 43.992326 | |
| 55 | 0.054 | 0.986493 | 12.000690 | 43.999655 | |
| 56 | 0.055 | 0.979974 | 11.987653 | 44.006174 |
# Verify that the reaction has reached equilibrium
bio.reaction_dynamics.is_in_equilibrium(conc=bio.bin_snapshot(bin_address = 0), tolerance=7)
0: A + 2 B <-> Y
Final concentrations: [A] = 0.98 ; [B] = 11.99 ; [Y] = 44.01
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 3.74597
Formula used: [Y] / ([A][B])
2. Ratio of forward/reverse reaction rates: 4.0
Discrepancy between the two values: 6.351 %
Reaction IS in equilibrium (within 7% tolerance)
True
fig = px.line(data_frame=bio.get_history(), x="SYSTEM TIME", y=["A", "B", "Y"],
title="Changes in concentrations (reaction A + 2 B <-> Y)",
color_discrete_sequence = ['red', 'blue', 'green'],
labels={"value":"concentration", "variable":"Chemical"})
fig.show()
A, still the limiting reagent, is again stopping the reaction.
The (transiently) high value of [A] led to a high value of [B]
bio.set_bin_conc(bin_address=0, species_index=0, conc=30.)
bio.describe_state()
SYSTEM STATE at Time t = 0.055: 1 bins and 3 species: Species 0 (A). Diff rate: None. Conc: [30.] Species 1 (B). Diff rate: None. Conc: [11.98765279] Species 2 (Y). Diff rate: None. Conc: [44.00617361]
# Save the state of the concentrations of all species at bin 0 (the only bin in this system)
bio.add_snapshot(bio.bin_snapshot(bin_address = 0))
bio.react(time_step=0.0005, n_steps=70, snapshots={"frequency": 2, "sample_bin": 0}) # At every other step, take a snapshot
# of all species at bin 0
bio.describe_state()
bio.get_history()
SYSTEM STATE at Time t = 0.09: 1 bins and 3 species: Species 0 (A). Diff rate: None. Conc: [24.26245387] Species 1 (B). Diff rate: None. Conc: [0.51256052] Species 2 (Y). Diff rate: None. Conc: [49.74371974]
| SYSTEM TIME | A | B | Y | caption | |
|---|---|---|---|---|---|
| 0 | 0.000 | 5.000000 | 100.000000 | 0.000000 | |
| 1 | 0.001 | 1.850000 | 93.700000 | 3.150000 | |
| 2 | 0.002 | 0.735332 | 91.470665 | 4.264668 | |
| 3 | 0.003 | 0.303911 | 90.607822 | 4.696089 | |
| 4 | 0.004 | 0.131501 | 90.263002 | 4.868499 | |
| ... | ... | ... | ... | ... | ... |
| 88 | 0.086 | 24.262458 | 0.512569 | 49.743715 | |
| 89 | 0.087 | 24.262456 | 0.512566 | 49.743717 | |
| 90 | 0.088 | 24.262455 | 0.512563 | 49.743718 | |
| 91 | 0.089 | 24.262454 | 0.512562 | 49.743719 | |
| 92 | 0.090 | 24.262454 | 0.512561 | 49.743720 |
93 rows × 5 columns
# Verify that the reaction has reached equilibrium
bio.reaction_dynamics.is_in_equilibrium(conc=bio.bin_snapshot(bin_address = 0))
0: A + 2 B <-> Y
Final concentrations: [A] = 24.26 ; [B] = 0.5126 ; [Y] = 49.74
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 3.99999
Formula used: [Y] / ([A][B])
2. Ratio of forward/reverse reaction rates: 4.0
Discrepancy between the two values: 0.0003695 %
Reaction IS in equilibrium (within 1% tolerance)
True
fig = px.line(data_frame=bio.get_history(), x="SYSTEM TIME", y=["A", "B", "Y"],
title="Changes in concentrations (reaction A + 2 B <-> Y)",
color_discrete_sequence = ['red', 'blue', 'green'],
labels={"value":"concentration", "variable":"Chemical"})
fig.show()
A, again the scarse limiting reagent, stops the reaction yet again
Note: A can down-regulate B, but it cannot bring it up.