Catalyst.jl icon indicating copy to clipboard operation
Catalyst.jl copied to clipboard

`@compartment`/`@subsystem`/similar option for the DSL

Open TorkelE opened this issue 4 months ago • 0 comments

Potentially (not fully sure, I don't really work much with this kind of models) it might make hierarchical modelling easier if one could define submodels directly in the DSL.

I.e. for a model of a protein which gets created in the nucleus and transported to the cytosol, one could do something like

@reaction_network begin
    @compartment nucleus begin
        (p,d), 0 <--> X
    end
    @compartment cytosol begin
        d, X --> 0
    end
    k, nucleus.X --> cytosol.X
end

(here we use the @compartment option twice, something we currently do not allow for

Another alternative is to allow subsystems to be interpolated directly into a model

rn1 = ...
rn2 = ...
@reaction_network begin
    @subsystems $rn1 rn2
    ...
end

Right now I am not sure if either actually makes any sense, or has any advantage compared to just writing it out in full. But if there is at some point specific compartment support it might at least be worth considering.

TorkelE avatar Jun 21 '25 16:06 TorkelE