Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
be57ad5
Change default parameter handling
Oct 24, 2022
9d952fc
Remove unnecessary line from test
Oct 24, 2022
2297bf9
Add first 4 models. Add tests to generate .mmt and graph files
Oct 24, 2022
ae770ab
Add tests for connectedness as reversibility. Add models 4,5
Oct 25, 2022
0b6f9d8
Fix draw_graph handling of transition rates
Nov 1, 2022
d502827
Add more models
Nov 1, 2022
beacf8f
Fix get_transition_matrix. Fix reversibility check. Add show_html swi…
Apr 28, 2023
8904c6b
Merge branch 'master' into fix_transition_matrix
Apr 28, 2023
051a36f
Add models 11 and 30. Remove duplicated test file
May 3, 2023
a4b97e2
Merge branch 'fix_transition_matrix' of github.com:CardiacModelling/M…
May 3, 2023
5310b55
Lint and isort
May 3, 2023
57415dc
Update test_parameterise_rates
May 3, 2023
f199b6f
Add test_30_models.py
May 3, 2023
79f7295
Add myokit files for testing
May 3, 2023
7e21caf
Update pytest.yml
May 3, 2023
0afb97b
Update pytest.yml
May 3, 2023
bc4c4c9
Make single quote use more consistent
Jun 13, 2023
2d6c990
Fix indentation. Distribute trajectories according to number of traje…
Jun 13, 2023
17027f4
Fix sympy depreciation warning (latex output)
Jun 13, 2023
fe4f333
Add test for dataclass exception (must be subclass of state_attribute…
Jun 13, 2023
23835be
Merge branch 'fix_transition_matrix' of github.com:CardiacModelling/M…
Jun 13, 2023
b6ef7da
Raise TypeError not Exception
Jun 13, 2023
215898f
Remove old, broken test output
Jun 13, 2023
de33024
Fix test_bad_dataclass_exception
Jun 13, 2023
4d86220
Remove unnecessary checks on attribute dataclass
Jun 13, 2023
fef0edf
Lint
Jun 13, 2023
f1e03cb
Add models
Jun 13, 2023
f58dcc7
Add some models with HH-style gating
Jun 16, 2023
c2ccada
Sort imports
Jun 16, 2023
93b454f
Fix myokit model generation
Jun 16, 2023
663313a
Modify model3 to be disconnected model
Aug 2, 2023
351f199
Update tests for disceonnected model_03. Add auxiliary_variables dict…
Aug 2, 2023
fed5036
Change model parameterisation
Sep 5, 2023
846a079
Standardise model parameterisation
Sep 6, 2023
205efd3
Fix model generation
Nov 14, 2023
6ed6f62
Simplify Kemp model into two connected components
Dec 6, 2023
a1a2777
Replace depcreciated np.NaN with np.nan
Jun 25, 2024
a9916e4
NaN -> nan
Jul 8, 2024
f440e56
Add model 20
Mar 17, 2025
aa7b755
Add model20.py
Mar 17, 2025
ab8aed9
Parameterise Mazhari model. Fix parameter bug
Mar 18, 2025
b5e072c
Change order of state addition
Mar 18, 2025
c4843a3
Reorder parameters
Mar 18, 2025
2f43fa2
Strenghten test for "get_eliminate_state..." Move permutation code to…
Oct 6, 2025
909b14b
Remove print
Oct 6, 2025
bd92d1c
Fix doctstring
Oct 7, 2025
a3dbc80
Update build system
Nov 20, 2025
a1206b3
Fix whitespace
Nov 20, 2025
cb10d50
Update docstrings, .gitignore, and type hints
Nov 27, 2025
b37b182
Update init and use clearer param names. Update models
Nov 27, 2025
1fc213e
Update models and tests
Nov 27, 2025
d277853
Simplify exception for undefined parameters
Nov 27, 2025
2c29004
Change error type to align with code
Nov 27, 2025
c62b4bd
More docstring change. Variable name change
Nov 28, 2025
7ee29d3
Lint
Nov 28, 2025
09c802a
Add drug_bound field by default
Nov 28, 2025
84f6bf2
Update param names. Remove debug format string
Nov 28, 2025
b997979
Turn off E501 "line too long"
Nov 28, 2025
f3da65d
Lint
Nov 28, 2025
b39677f
Remove () from class defn
Nov 28, 2025
3f166b5
Fix unused var
Nov 28, 2025
4654c81
Modify project setup for isort
Nov 28, 2025
94ecad8
Merge branch 'master' into HEAD
Nov 28, 2025
035f681
Update workflow
Nov 28, 2025
f42b1df
Update isort conf
Nov 28, 2025
32c6d39
Update isort settings (again)
Nov 28, 2025
95dedd7
Change isort settings
Nov 28, 2025
afd9926
Update isort settings
Nov 28, 2025
fb54457
Remove unnecessary "get" function
Nov 28, 2025
d6f257c
Fix docstrings using ruff. Add ruff and sphinx to docs optional depen…
Dec 2, 2025
66f65b8
Delete setup.py
Dec 5, 2025
2ea48f7
Add extra models
Dec 16, 2025
9bfa6e8
Improve exception messages
Dec 16, 2025
fc56ad3
Lint
Dec 16, 2025
563a76e
Lint and isort
Dec 16, 2025
43bf6ef
Revert ah<->bh swap
joeyshuttleworth Dec 17, 2025
2e8f31f
Fix mangled model file
Dec 17, 2025
b43c386
Remove `open_state` logic form 30 models
Dec 17, 2025
3e734d0
Fix tests and use pytest
Dec 17, 2025
756ced2
Split readme sentences onto newlines
Dec 17, 2025
fdbfa36
Lint, isort
Dec 17, 2025
a61969c
Remove old config
Dec 17, 2025
fe63345
move config to toml
Dec 17, 2025
3f3a02d
Tidy 30 new models
Dec 17, 2025
dc04819
Restore flake8 file
Dec 17, 2025
73ae5fc
isort
Dec 17, 2025
e7ac78c
Fix model 0 parameter
Dec 18, 2025
0631f15
Eliminate correct state in test comparison
Dec 18, 2025
4874485
Remove redundant 'open_state' vars
Dec 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion markov_builder/models/thirty_models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,28 @@
from .model12 import model_12
from .model13 import model_13
from .model14 import model_14
from .model15 import model_15
from .model16 import model_16
from .model17 import model_17
from .model18 import model_18
from .model19 import model_19
from .model20 import model_20
from .model21 import model_21
from .model22 import model_22
from .model23 import model_23
from .model24 import model_24
from .model25 import model_25
from .model26 import model_26
from .model27 import model_27
from .model28 import model_28
from .model29 import model_29
from .model30 import model_30


__all__ = ['model_00', 'model_01', 'model_02', 'model_03', 'model_04',
'model_05', 'model_06', 'model_07', 'model_08', 'model_09',
'model_10', 'model_11', 'model_12', 'model_13', 'model_14',
'model_20', 'model_30']
'model_15', 'model_16', 'model_17', 'model_18', 'model_19',
'model_20', 'model_21', 'model_22', 'model_23', 'model_24',
'model_25', 'model_26', 'model_27', 'model_28', 'model_29',
'model_30']
82 changes: 82 additions & 0 deletions markov_builder/models/thirty_models/model15.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
from numpy import nan
from markov_builder.MarkovChain import MarkovChain


class model_15(MarkovChain):
description = "IKr Markov model 15 (Sanmitra Ghosh)"

# States
states = ('C3', 'C2', 'C1', 'O', 'I')

# Transitions derived directly from dot() equations
rates = [
('C3', 'C2', 'a1', 'b1'),
('C2', 'C1', 'a2', 'b2'),
('C1', 'O', 'a3', 'b3'),
('O', 'I', 'a4', 'b4'),
]

# Open state
open_state = 'O'

# Rate expressions (verbatim from .mmt)
rate_dictionary = {
'a1': ('p1 * exp(p2 * V)',),
'b1': ('p3 * exp(-p4 * V)',),

'a2': ('p5 * exp(p6 * V)',),
'b2': ('p7 * exp(-p8 * V)',),

'a3': ('p9 * exp(p10 * V)',),
'b3': ('p11 * exp(-p12 * V)',),

'a4': ('p13 * exp(p14 * V)',),
'b4': ('p15 * exp(-p16 * V)',),
}

# Shared variables and parameters
shared_variables_dict = {
'V': nan,

'p1': 2.26e-4,
'p2': 0.06990,
'p3': 3.45e-5,
'p4': 0.05462,

'p5': 0.08730,
'p6': 8.91e-3,
'p7': 5.15e-3,
'p8': 0.03158,

'p9': 2.26e-4,
'p10': 0.06990,
'p11': 3.45e-5,
'p12': 0.05462,

'p13': 0.08730,
'p14': 8.91e-3,
'p15': 5.15e-3,
'p16': 0.03158,

'p17': 0.15240,
}

# Current expression
auxiliary_expression = 'p17 * state_O * (V - E_Kr)'
auxiliary_symbol = 'I_Kr'

auxiliary_parameters = {
'E_Kr': -88,
}

def __init__(self):
super().__init__(
states=self.states,
open_state=self.open_state,
transition_rates=self.rates,
rate_expressions=self.rate_dictionary,
auxiliary_expression=self.auxiliary_expression,
auxiliary_symbol=self.auxiliary_symbol,
shared_variables=self.shared_variables_dict,
auxiliary_parameters=self.auxiliary_parameters,
)
81 changes: 81 additions & 0 deletions markov_builder/models/thirty_models/model16.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
from numpy import nan
from markov_builder.MarkovChain import MarkovChain


class model_16(MarkovChain):
description = "IKr Markov model 16 (Wang et al. 1997, Sanmitra Ghosh)"

# States
states = ('C3', 'C2', 'C1', 'O', 'I')

# Transitions derived from dot() equations
rates = [
('C3', 'C2', 'a1', 'b1'),
('C2', 'C1', 'a2', 'b2'),
('C1', 'O', 'a3', 'b3'),
('O', 'I', 'a4', 'b4'),
]

# Open state
open_state = 'O'

# Rate expressions (verbatim from .mmt)
rate_dictionary = {
'a1': ('p1 * exp(p2 * V)',),
'b1': ('p3 * exp(-p4 * V)',),

'a3': ('p5 * exp(p6 * V)',),
'b3': ('p7 * exp(-p8 * V)',),

'a4': ('p9 * exp(p10 * V)',),
'b4': ('p11 * exp(-p12 * V)',),

# Voltage-independent rates
'a2': ('p13',),
'b2': ('p14',),
}

# Shared variables and parameters
shared_variables_dict = {
'V': nan,

'p1': 2.26e-4,
'p2': 0.06990,
'p3': 3.45e-5,
'p4': 0.05462,

'p5': 0.08730,
'p6': 8.91e-3,
'p7': 5.15e-3,
'p8': 0.03158,

'p9': 0.08730,
'p10': 8.91e-3,
'p11': 5.15e-3,
'p12': 0.03158,

'p13': 0.08730,
'p14': 8.91e-3,

'p15': 0.15240,
}

# Current expression
auxiliary_expression = 'p15 * state_O * (V - E_Kr)'
auxiliary_symbol = 'I_Kr'

auxiliary_parameters = {
'E_Kr': -85,
}

def __init__(self):
super().__init__(
states=self.states,
open_state=self.open_state,
transition_rates=self.rates,
rate_expressions=self.rate_dictionary,
auxiliary_expression=self.auxiliary_expression,
auxiliary_symbol=self.auxiliary_symbol,
shared_variables=self.shared_variables_dict,
auxiliary_parameters=self.auxiliary_parameters,
)
77 changes: 77 additions & 0 deletions markov_builder/models/thirty_models/model17.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
from numpy import nan
from markov_builder.MarkovChain import MarkovChain


class model_17(MarkovChain):
description = "IKr Markov model (Sanmitra Ghosh)"

# States
states = ('C3', 'C2', 'C1', 'O', 'I')

# Transitions inferred directly from dot() equations
rates = [
# C3 <-> C2
('C3', 'C2', '3*am', 'bm'),

# C2 <-> C1
('C2', 'C1', '2*am', '2*bm'),

# C1 <-> O
('C1', 'O', 'am', '3*bm'),

# C1 <-> I
('C1', 'I', 'a2', 'b2'),

# O <-> I
('O', 'I', 'a1', 'b1'),
]

# Open state
open_state = 'O'

# Rate expressions (verbatim from .mmt)
rate_dictionary = {
'am': ('p1 * exp(p2 * V)',),
'bm': ('p3 * exp(-p4 * V)',),
'a1': ('p5 * exp(p6 * V)',),
'b1': ('p7 * exp(-p8 * V)',),
'a2': ('p9 * exp(p10 * V)',),
'b2': ('(a2 * 3 * bm * b1) / (am * a1)',),
}

# Shared variables and parameters
shared_variables_dict = {
'V': nan,

'p1': 2.26e-4,
'p2': 0.06990,
'p3': 3.45e-5,
'p4': 0.05462,
'p5': 0.08730,
'p6': 8.91e-3,
'p7': 5.15e-3,
'p8': 0.03158,
'p9': 5.15e-3,
'p10': 0.03158,
'p11': 0.15240,
}

# Current expression
auxiliary_expression = 'p11 * state_O * (V - E_Kr)'
auxiliary_symbol = 'I_Kr'

auxiliary_parameters = {
'E_Kr': -85,
}

def __init__(self):
super().__init__(
states=self.states,
open_state=self.open_state,
transition_rates=self.rates,
rate_expressions=self.rate_dictionary,
auxiliary_expression=self.auxiliary_expression,
auxiliary_symbol=self.auxiliary_symbol,
shared_variables=self.shared_variables_dict,
auxiliary_parameters=self.auxiliary_parameters,
)
98 changes: 98 additions & 0 deletions markov_builder/models/thirty_models/model18.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
from numpy import nan
from markov_builder.MarkovChain import MarkovChain


class model_18(MarkovChain):
description = "IKr Markov model 18 (Sanmitra Ghosh)"

# States
states = ('C3', 'C2', 'C1', 'O', 'I')

# Transitions derived directly from dot() equations
rates = [
# C3 <-> C2
('C3', 'C2', 'a1', 'b1'),

# C2 <-> C1
('C2', 'C1', 'a2', 'b2'),

# C1 <-> O
('C1', 'O', 'a3', 'b3'),

# O <-> I
('O', 'I', 'a4', 'b4'),

# C1 <-> I
('C1', 'I', 'a5', 'b5'),
]

# Open state
open_state = 'O'

# Rate expressions (verbatim from .mmt)
rate_dictionary = {
'a1': ('p1 * exp(p2 * V)',),
'b1': ('p3 * exp(-p4 * V)',),

'a2': ('p5 * exp(p6 * V)',),
'b2': ('p7 * exp(-p8 * V)',),

'a3': ('p9 * exp(p10 * V)',),
'b3': ('p11 * exp(-p12 * V)',),

'a4': ('p13 * exp(p14 * V)',),
'b4': ('p15 * exp(-p16 * V)',),

'a5': ('p17 * exp(p18 * V)',),
'b5': ('(a5 * b3 * b4) / (a3 * a4)',),
}

# Shared variables and parameters
shared_variables_dict = {
'V': nan,

'p1': 2.26e-4,
'p2': 0.06990,
'p3': 3.45e-5,
'p4': 0.05462,

'p5': 0.08730,
'p6': 8.91e-3,
'p7': 5.15e-3,
'p8': 0.03158,

'p9': 5.15e-3,
'p10': 0.03158,
'p11': 2.26e-4,
'p12': 0.06990,

'p13': 3.45e-5,
'p14': 0.05462,
'p15': 0.08730,
'p16': 8.91e-3,

'p17': 5.15e-3,
'p18': 0.03158,

'p19': 0.15240,
}

# Current expression
auxiliary_expression = 'p19 * state_O * (V - E_Kr)'
auxiliary_symbol = 'I_Kr'

auxiliary_parameters = {
'E_Kr': -85,
}

def __init__(self):
super().__init__(
states=self.states,
open_state=self.open_state,
transition_rates=self.rates,
rate_expressions=self.rate_dictionary,
auxiliary_expression=self.auxiliary_expression,
auxiliary_symbol=self.auxiliary_symbol,
shared_variables=self.shared_variables_dict,
auxiliary_parameters=self.auxiliary_parameters,
)
Loading