Skip to content

Commit

Permalink
Merge pull request #14 from dtu-qmcm/structure_shrink
Browse files Browse the repository at this point in the history
Structure shrink
  • Loading branch information
teddygroves authored Aug 20, 2024
2 parents 3b65a5a + e6fad25 commit 968843f
Show file tree
Hide file tree
Showing 5 changed files with 619 additions and 538 deletions.
85 changes: 68 additions & 17 deletions src/enzax/examples/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,79 @@
log_drain=jnp.array([]),
)
structure = KineticModelStructure(
S=jnp.array([[-1, 0, 0], [1, -1, 0], [0, 1, -1], [0, 0, 1]]),
water_stoichiometry=jnp.array([0, 0, 0]),
S=jnp.array(
[[-1, 0, 0], [1, -1, 0], [0, 1, -1], [0, 0, 1]], dtype=jnp.float64
),
balanced_species=jnp.array([1, 2]),
rate_to_enzyme_ix=[[0], [1], [2]],
rate_to_km_ixs=jnp.array([[0, 1], [2, 3], [4, 5]]),
species_to_metabolite_ix=jnp.array([0, 0, 1, 1]),
rate_to_subunits=jnp.array([1, 1, 1]),
rate_to_tc_ix=[[0], [1], []],
rate_to_dc_ixs_activation=[[0], [], []],
rate_to_dc_ixs_inhibition=[[], [1], []],
rate_to_drain_ix=[[], [], []],
drain_sign=[],
dc_to_species_ix=jnp.array([2, 1]),
ki_to_species_ix=jnp.array([1]),
rate_to_ki_ixs=[[], [0], []],
unbalanced_species=jnp.array([0, 3]),
)

unparameterised_model = UnparameterisedKineticModel(
structure,
[
AllostericReversibleMichaelisMenten,
AllostericReversibleMichaelisMenten,
ReversibleMichaelisMenten,
AllostericReversibleMichaelisMenten(
kcat_ix=0,
enzyme_ix=0,
km_ix=jnp.array([0, 1], dtype=jnp.int16),
ki_ix=jnp.array([], dtype=jnp.int16),
reactant_stoichiometry=jnp.array([-1, 1], dtype=jnp.int16),
reactant_to_dgf=jnp.array([0, 0], dtype=jnp.int16),
ix_ki_species=jnp.array([], dtype=jnp.int16),
substrate_km_positions=jnp.array([0], dtype=jnp.int16),
substrate_reactant_positions=jnp.array([0], dtype=jnp.int16),
ix_substrate=jnp.array([0], dtype=jnp.int16),
ix_product=jnp.array([1], dtype=jnp.int16),
ix_reactants=jnp.array([0, 1], dtype=jnp.int16),
product_reactant_positions=jnp.array([1], dtype=jnp.int16),
product_km_positions=jnp.array([1], dtype=jnp.int16),
water_stoichiometry=jnp.array(0.0),
tc_ix=0,
ix_dc_inhibition=jnp.array([], dtype=jnp.int16),
ix_dc_activation=jnp.array([0], dtype=jnp.int16),
species_activation=jnp.array([2], dtype=jnp.int16),
species_inhibition=jnp.array([], dtype=jnp.int16),
subunits=1,
),
AllostericReversibleMichaelisMenten(
kcat_ix=1,
enzyme_ix=1,
km_ix=jnp.array([2, 3], dtype=jnp.int16),
ki_ix=jnp.array([0]),
reactant_stoichiometry=jnp.array([-1, 1], dtype=jnp.int16),
reactant_to_dgf=jnp.array([0, 1], dtype=jnp.int16),
ix_ki_species=jnp.array([1]),
substrate_km_positions=jnp.array([0], dtype=jnp.int16),
substrate_reactant_positions=jnp.array([0], dtype=jnp.int16),
ix_substrate=jnp.array([1], dtype=jnp.int16),
ix_product=jnp.array([2], dtype=jnp.int16),
ix_reactants=jnp.array([1, 2], dtype=jnp.int16),
product_reactant_positions=jnp.array([1], dtype=jnp.int16),
product_km_positions=jnp.array([1], dtype=jnp.int16),
water_stoichiometry=jnp.array(0.0),
tc_ix=1,
ix_dc_inhibition=jnp.array([1], dtype=jnp.int16),
ix_dc_activation=jnp.array([], dtype=jnp.int16),
species_activation=jnp.array([], dtype=jnp.int16),
species_inhibition=jnp.array([1], dtype=jnp.int16),
subunits=1,
),
ReversibleMichaelisMenten(
kcat_ix=2,
enzyme_ix=2,
km_ix=jnp.array([4, 5], dtype=jnp.int16),
ki_ix=jnp.array([], dtype=jnp.int16),
ix_substrate=jnp.array([2], dtype=jnp.int16),
ix_product=jnp.array([3], dtype=jnp.int16),
ix_reactants=jnp.array([2, 3], dtype=jnp.int16),
reactant_to_dgf=jnp.array([1, 1], dtype=jnp.int16),
reactant_stoichiometry=jnp.array([-1, 1], dtype=jnp.int16),
ix_ki_species=jnp.array([], dtype=jnp.int16),
substrate_km_positions=jnp.array([0], dtype=jnp.int16),
substrate_reactant_positions=jnp.array([0], dtype=jnp.int16),
product_reactant_positions=jnp.array([1], dtype=jnp.int16),
product_km_positions=jnp.array([1], dtype=jnp.int16),
water_stoichiometry=jnp.array(0.0),
),
],
)
model = KineticModel(parameters, unparameterised_model)
Expand Down
Loading

0 comments on commit 968843f

Please sign in to comment.