-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Structural Identifiability Extension #709
Conversation
e515d03
to
1bd1900
Compare
THIS PR is now ready. There are two outstanding issues:
|
Hi Torkel! Thanks again for working on this ! I think the tutorial looks very good. I wanted to add a couple more simple tests but it looks like I cannot push to this PR. So I will just paste it here, feel free to add these to tests: # Test some examples explicitly
let
rs = @reaction_network begin
k1, x1 --> x2
end
# Measure the source
id_report = assess_identifiability(rs, measured_quantities = [:x1])
@test sym_dict(id_report) == Dict(
:x1 => :globally,
:x2 => :nonidentifiable,
:k1 => :globally
)
# Measure the target instead
id_report = assess_identifiability(rs, measured_quantities = [:x2])
@test sym_dict(id_report) == Dict(
:x1 => :globally,
:x2 => :globally,
:k1 => :globally
)
# Example from
# Identifiability of chemical reaction networks
# DOI: 10.1007/s10910-007-9307-x
# The rate constants a, b, c are not identifiable even if all of the species
# are observed.
rs = @reaction_network begin
a, A0 --> 2A1
b, A0 --> 2A2
c, A0 --> A1 + A2
end
id_report = assess_identifiability(rs, measured_quantities = [:A0, :A1, :A2])
@test sym_dict(id_report) == Dict(
:A0 => :globally,
:A1 => :globally,
:A2 => :globally,
:a => :nonidentifiable,
:b => :nonidentifiable,
:c => :nonidentifiable
)
# Test with no parameters
rs = @reaction_network begin
1, x1 --> x2
1, x2 --> x3
end
id_report = assess_identifiability(rs, measured_quantities = [:x3])
@test sym_dict(id_report) == Dict(
:x1 => :globally,
:x2 => :globally,
:x3 => :globally,
)
# Will probably be fixed in the 0.5 release of SI.jl
@test_broken find_identifiable_functions(rs, measured_quantities = [:x3])
end |
A couple of papers with examples that can be used for testing:
|
@TorkelE does this work with Symbolics instead of symbols? I'm concerned that across these PRs you are adding you are making the interface rely on Symbols all over the place. This is likely to be a major break from ModelingToolkit, and could lead us to have to change all this code down the line. @ChrisRackauckas can you comment on this? Both the PETab intergration and now the structural identifiability extension are written to use symbols instead of symbolics as the workflow. Is this going to cause issues / inconsistencies with MTK? |
Actually, I think the BifurcationKit extension also uses symbols instead of symbolics right? |
Great! |
Which functionality in SI would you need? Note also, it is tricky to use conservation laws together with So, one feasible thing would be to do this in StructuralIdentfiability instead of Catalyst. There is some ongoing work on this |
Solving this: SciML/StructuralIdentifiability.jl#236 should make it relatively easy to enable conservation laws. There is also some discussion in the Issue on alternative ways to do it, but it will be less straightforward, and I'm still not really sure how. Yes, handling it all in StructuralIdentfiability would be preferable, since it could cover a wide range of cases. The advantage right now in Catalyst is that we have algorithms implemented that finds these laws on reaction networks, which we then can apply, while SI would need to implement more general methods (but which then would benefit all systems). Long term that would be preferable, but it might also take more time to get everything into place. |
A question for everyone involved: :X => :globally
:p => :globally
:d => :globally In Catalyst, the various components have a natural order (initial conditions followed by parameters, each with their own separate order). Currently, when identifability is printed, this can appear quite jumbled, e.g.: :d => :globally
:X => :globally
:p => :globally (mixing parameters and initial conditions etc.) I think it would be nicer to impose order, so that when the user prints the entire identifiability dictionary, they are ordered initial conditions followed by parameters. This would require the making the output an |
I agree, some order can be helpful, especially if there are a lot of quantities. I opened an issue: |
This is fixed in the current dev version of |
f9e3934
to
909ad5d
Compare
Thanks! This will make things much neater |
ed8eb5c
to
5d54fbf
Compare
f20d62a
to
f624106
Compare
c87fe14
to
e1e07a3
Compare
now rebased on master |
e1e07a3
to
40274e6
Compare
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
…tifiability_extension.jl Co-authored-by: Sam Isaacson <[email protected]>
…tifiability_extension.jl Co-authored-by: Sam Isaacson <[email protected]>
…tifiability_extension.jl Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
…tifiability_extension.jl Co-authored-by: Sam Isaacson <[email protected]>
…tifiability_extension.jl Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
Co-authored-by: Sam Isaacson <[email protected]>
1771b45
to
90ab89e
Compare
Creates an extension for Catalyst and the StructuralIdentifiability package (https://github.com/SciML/StructuralIdentifiability.jl).
Implements:
assess_local_identifiability
onReactionSystem
sassess_identifiability
onReactionSystem
sfind_identifiable_functions
onReactionSystem
smake_si_ode
function, which takes a CatalystReactionSystem
and creates a ODE model of the form used in StructuralIdentifiability.jl, that can be used for some of its more detailed features.Example usage:
here, we assess global identifiability for the model, given us being able to measure
M
.