Skip to content
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

Enabling creation of bundled reactions (using vector variables/parameters) #947

Open
TorkelE opened this issue Jun 11, 2024 · 3 comments
Open

Comments

@TorkelE
Copy link
Member

TorkelE commented Jun 11, 2024

Imagine if we have a vector-valued species:

using Catalyst
t = default_t()
@species X[1:100]

where each degrades at the same rate d, it would be neat to declare this as a single reaction:

@parameters d
rxs = Reaction(d, X, [])

If we could somehow represent this as a single reaction, without unfolding it into 100 different one, we might utilise the new JuliaSimCompiler to gain a lot of efficiency.

This concept is quite similar to the limited reaction bundling we already do in the DSL (although these are unfolded into multiple reactions):

rn = @reaction_network begin
    p, 0 --> X1
    k1, X1 --> X2
    k2, X2 --> X3
    d, (X1, X2, X3) --> 0 # The three degradation reaction bundles into a single line
end

At some point, it might be possible to create a general bundled reaction structure and use it under these circumstances.

I am not sure what the status of JuliaSimCompiler is though. If we wish to hook into it, we should probably want until that is fully settled.

@isaacsas
Copy link
Member

isaacsas commented Jun 11, 2024

I think this starts getting into wanting to support something akin to the BNGL language, which has all kinds of expressiveness to specify collections of reactions. Building up such functionality would be great (though I have to say I find bngl super confusing / hard to read so I'm not sure we should just mimic their approach).

@TorkelE
Copy link
Member Author

TorkelE commented Jun 11, 2024

That's a good point, sounds like something like this and #703 is probably better handled at the same time.

Going in this direction would be a very significant endeavour though, probably best just keeping in mind that we might want to go there for now, and store any related ideas we have.

@isaacsas
Copy link
Member

There are I guess two aspects here, vectorizing the generated mathematical models and a more flexible DSL for specifying collections of reactions with similar structure. The later is what I was refering to with BNGL, but could presumably hook into both flattening of the models (expanding all reactions) and something like an equation free solver should we ever get that setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants