-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed dgf bug #463
Merged
Merged
Fixed dgf bug #463
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
93b51de
Fix case where multivariate dgfs don't initialise correctly
teddygroves a3fe311
Add test case for loading multivariate dgfs with inits
teddygroves ffe57e5
fix black
teddygroves 785bfb6
add linear_multidgf to list of packages
teddygroves 30c3907
add __init__.py to example input folders
teddygroves 79f5c19
make code in test a little nicer
teddygroves 209c3ab
delete commented lines from parameters files
teddygroves e0182f4
Update pyproject.toml, increase min python version, fix ruff warnings
teddygroves 619fde2
Document min python version
teddygroves ad35d87
Update tox workflow python versions
teddygroves File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name = "linear_multidgf" | ||
kinetic_model_file = "kinetic_model.toml" | ||
priors_file = "priors.toml" | ||
experiments_file = "experiments.toml" | ||
likelihood = true | ||
steady_state_threshold_abs = 1e-6 | ||
|
||
[cmdstanpy_config] | ||
refresh = 1 | ||
iter_warmup = 300 | ||
iter_sampling = 300 | ||
chains = 4 | ||
save_warmup = true | ||
seed = 1234 | ||
|
||
[ode_solver_config] | ||
abs_tol = 1e-4 | ||
rel_tol = 1e-6 | ||
max_num_steps = 1e6 | ||
|
||
[algebra_solver_config] | ||
abs_tol = 1e-4 | ||
rel_tol = 1e-6 | ||
max_num_steps = 1e6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[[experiment]] | ||
id = "condition1" | ||
is_train = true | ||
is_test = true | ||
temperature = 299.0 | ||
measurements = [ | ||
{target_type = "mic", metabolite = "M1", compartment = "c", value = 0.59, error_scale = 0.1}, | ||
{target_type = "mic", metabolite = "M1", compartment = "e", value = 1.09, error_scale = 0.05}, | ||
{target_type = "mic", metabolite = "M2", compartment = "e", value = 1.05, error_scale = 0.05}, | ||
{target_type = "flux", reaction = "r3", value = 0.19, error_scale = 0.1}, | ||
{target_type = "enzyme", enzyme = "r1", value = 1.5, error_scale = 0.1}, | ||
{target_type = "enzyme", enzyme = "r2", value = 1.5, error_scale = 0.1}, | ||
{target_type = "enzyme", enzyme = "r3", value = 1.5, error_scale = 0.1}, | ||
] | ||
initial_state = [ | ||
{metabolite = "M2", compartment = "c", value = 0.38}, | ||
] | ||
|
||
[[experiment]] | ||
id = "condition2" | ||
is_train = true | ||
is_test = true | ||
measurements = [ | ||
{target_type = "mic", metabolite = "M1", compartment = "c", value = 0.54, error_scale = 0.1}, | ||
{target_type = "mic", metabolite = "M2", compartment = "c", value = 0.38, error_scale = 0.1}, | ||
{target_type = "mic", metabolite = "M1", compartment = "e", value = 1.12, error_scale = 0.05}, | ||
{target_type = "mic", metabolite = "M2", compartment = "e", value = 1.14, error_scale = 0.05}, | ||
{target_type = "flux", reaction = "r3", value = 0.39, error_scale = 0.1}, | ||
{target_type = "enzyme", enzyme = "r1", value = 1.5, error_scale = 0.1}, | ||
{target_type = "enzyme", enzyme = "r2", value = 1.5, error_scale = 0.1}, | ||
{target_type = "enzyme", enzyme = "r3", value = 1.5, error_scale = 0.1}, | ||
] |
66 changes: 66 additions & 0 deletions
66
maud/data/example_inputs/linear_multidgf/kinetic_model.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name = "Example kinetic model" | ||
|
||
compartment = [ | ||
{id = 'c', name = 'cytosol', volume = 1}, | ||
{id = 'e', name = 'external', volume = 1}, | ||
] | ||
|
||
metabolite = [ | ||
{id = "M1", name = "Metabolite number 1"}, | ||
{id = "M2", name = "Metabolite number 2"}, | ||
] | ||
|
||
enzyme = [ | ||
{id = "r1", name = "r1ase", subunits = 1}, | ||
{id = "r2", name = "r2ase", subunits = 1}, | ||
{id = "r3", name = "r3ase", subunits = 1}, | ||
] | ||
|
||
metabolite_in_compartment = [ | ||
{metabolite_id = "M1", compartment_id = "e", balanced = false}, | ||
{metabolite_id = "M1", compartment_id = "c", balanced = true}, | ||
{metabolite_id = "M2", compartment_id = "c", balanced = true}, | ||
{metabolite_id = "M2", compartment_id = "e", balanced = false}, | ||
] | ||
enzyme_reaction = [ | ||
{enzyme_id = "r1", reaction_id = "r1"}, | ||
{enzyme_id = "r2", reaction_id = "r2"}, | ||
{enzyme_id = "r3", reaction_id = "r3"}, | ||
] | ||
|
||
[[reaction]] | ||
id = "r1" | ||
name = "Reaction number 1" | ||
mechanism = "reversible_michaelis_menten" | ||
stoichiometry = { M1_e = -1, M1_c = 1} | ||
|
||
[[reaction]] | ||
id = "r2" | ||
name = "Reaction number 2" | ||
mechanism = "irreversible_michaelis_menten" | ||
stoichiometry = { M1_c = -1, M2_c = 1} | ||
|
||
[[reaction]] | ||
id = "r3" | ||
name = "Reaction number 3" | ||
mechanism = "reversible_michaelis_menten" | ||
stoichiometry = { M2_c = -1, M2_e = 1} | ||
transported_charge = 1 | ||
|
||
[[allostery]] | ||
enzyme_id = "r1" | ||
metabolite_id = "M2" | ||
compartment_id = "c" | ||
modification_type = "activation" | ||
|
||
[[allostery]] | ||
enzyme_id = "r2" | ||
metabolite_id = "M1" | ||
compartment_id = "c" | ||
modification_type = "inhibition" | ||
|
||
[[competitive_inhibition]] | ||
enzyme_id = "r2" | ||
reaction_id = "r2" | ||
metabolite_id = "M1" | ||
compartment_id = "c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
kcat = [ | ||
{exploc = 1, scale = 0.6, reaction = "r1", enzyme = "r1"}, | ||
{exploc = 1, scale = 0.6, reaction = "r2", enzyme = "r2"}, | ||
{exploc = 1, scale = 0.6, reaction = "r3", enzyme = "r3"}, | ||
] | ||
|
||
km = [ | ||
{exploc = 1, scale = 0.6, metabolite = "M1", compartment = "e", enzyme = "r1"}, | ||
{exploc = 1, scale = 0.6, metabolite = "M1", compartment = "c", enzyme = "r1"}, | ||
{exploc = 1, scale = 0.6, metabolite = "M1", compartment = "c", enzyme = "r2"}, | ||
{exploc = 1, scale = 0.6, metabolite = "M2", compartment = "c", enzyme = "r3"}, | ||
{exploc = 1, scale = 0.6, metabolite = "M2", compartment = "e", enzyme = "r3"}, | ||
] | ||
|
||
transfer_constant = [ | ||
{exploc = 1, scale = 0.6, enzyme = "r1"}, | ||
{exploc = 1, scale = 0.6, enzyme = "r2"}, | ||
] | ||
|
||
dissociation_constant = [ | ||
{exploc = 1, scale = 0.6, enzyme = "r1", metabolite = "M2", compartment = "c", modification_type = "activation"}, | ||
{exploc = 1, scale = 0.6, enzyme = "r2", metabolite = "M1", compartment = "c", modification_type = "inhibition"}, | ||
] | ||
|
||
# dgf = [ | ||
# {location = -1, metabolite = "M1", scale = 0.05}, | ||
# {location = -2, metabolite = "M2", scale = 0.05}, | ||
# ] | ||
|
||
psi = [ | ||
{location = -0.95, scale = 0.2, experiment = "condition1"}, | ||
{location = -0.95, scale = 0.2, experiment = "condition2"}, | ||
] | ||
|
||
ki = [ | ||
{exploc = 1, scale = 0.6, enzyme = "r2", reaction = "r2", metabolite = "M1", compartment = "c"}, | ||
] | ||
|
||
[dgf] | ||
ids = [ "M1", "M2" ] | ||
mean_vector = [-1, -2] | ||
covariance_matrix = [ [0.5, 0.5], [0.5, 0.5] ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
kcat = [ | ||
{exploc = 1, scale = 0.6, reaction = "r1", enzyme = "r1"}, | ||
{exploc = 1, scale = 0.6, reaction = "r2", enzyme = "r2"}, | ||
{exploc = 1, scale = 0.6, reaction = "r3", enzyme = "r3"}, | ||
] | ||
|
||
km = [ | ||
{exploc = 1, scale = 0.6, metabolite = "M1", compartment = "e", enzyme = "r1"}, | ||
{exploc = 1, scale = 0.6, metabolite = "M1", compartment = "c", enzyme = "r1"}, | ||
{exploc = 1, scale = 0.6, metabolite = "M1", compartment = "c", enzyme = "r2"}, | ||
{exploc = 1, scale = 0.6, metabolite = "M2", compartment = "c", enzyme = "r3"}, | ||
{exploc = 1, scale = 0.6, metabolite = "M2", compartment = "e", enzyme = "r3"}, | ||
] | ||
|
||
transfer_constant = [ | ||
{exploc = 1, scale = 0.6, enzyme = "r1"}, | ||
{exploc = 1, scale = 0.6, enzyme = "r2"}, | ||
] | ||
|
||
dissociation_constant = [ | ||
{exploc = 1, scale = 0.6, enzyme = "r1", metabolite = "M2", compartment = "c", modification_type = "activation"}, | ||
{exploc = 1, scale = 0.6, enzyme = "r2", metabolite = "M1", compartment = "c", modification_type = "inhibition"}, | ||
] | ||
|
||
# dgf = [ | ||
# {location = -1, metabolite = "M1", scale = 0.05, fixed_value = -1}, | ||
# {location = -2, metabolite = "M2", scale = 0.05}, | ||
# ] | ||
|
||
psi = [ | ||
{location = -0.95, scale = 0.2, experiment = "condition1"}, | ||
{location = -0.95, scale = 0.2, experiment = "condition2"}, | ||
] | ||
|
||
ki = [ | ||
{exploc = 1, scale = 0.6, enzyme = "r2", reaction = "r2", metabolite = "M1", compartment = "c"}, | ||
] | ||
|
||
[dgf] | ||
ids = [ "M1", "M2" ] | ||
mean_vector = [ -10, -32] | ||
covariance_matrix = [ [5,2], [2,4] ] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can remove the commented data.