# Julia packages for Multiscale Modelling of Multicellular Tissues?

I’m using Julia to program multicellular simulations.
It’s working well and the simulations are very fast, but basically I was never able to use other packages in the core of my simulations.

which contains this plot of software frameworks for multicellular simulations

Are there some frameworks/packages in Julia which would come close to that? Or which are aiming to provide this in the future.

Similar packages:

• DifferentialEquations.jl (+related packages) is great but my simulation is numerically trivial but complex due to a list of biological effects (changing parameters etc). That makes DifferentialEquations.jl unattractive for my case. (Maybe that would change if some domain specific packages are build on top).
• Agents.jl is cool, but like every interface, I find it challenging to fit my model into it. Some parts are non-intuitive and I cannot control the numerical algorithms as I want.
• BioJulia is more aimed at DNA related things.
(Anyway, I love those packages, don’t get me wrong!)

What differentiates the projects mentioned in the preprint from existing Julia packages seems to be a strong history of implemented and non-trivial models and a very extendable framework to include all kinds of crazy biological effects.

1 Like

While at the Center for Multiscale Cell Fate Research I created a few packages to complement DifferentialEquations.jl, specifically:

is the one that really got the most use. But another great package which helps modeling multiscale systems is component arrays:

An entirely different way to do multiscale hierarchical modeling is symbolically, which is being built out in ModelingToolkit:

https://mtk.sciml.ai/dev/tutorials/acausal_components/

Which is being used as the symbolic bed on which Catalyst.jl is being built for multiscale chemical reaction networks and reaction-diffusion-master-equation models:

https://catalyst.sciml.ai/dev/

What kind of multiscale problem are you specifically working with? All of those are methods to try and handle large-scale stiff multiscale systems which mix deterministic and stochastic (jump and SDE) terms.

2 Likes

I forgot that those packages exists, they fit quite well to my simulation. I should use them! Thanks

I don’t want to bother you with the specifics of my model, in short, the results look like this (for reference I have written it down below.)

I am preparing a MWE with questions specific about how to implement my model painlessly with ModellingToolkit.jl. Since, that might be the ideal solution to share the model with others.

Anyway, general points:

• As often in biology, most of the code is not about the implementation of the mathematics, but taking care of millions of parameters and all the special things which can happen, like cell division etc. Here, probably many people implement similar functionality over and over again.
• Another challenge is to combine models, e.g. like in: SOFA – Scene Graph
(I know that Julia is in general great at this point (the infamous ‘multiple dispatch magic’), but as far as I understand it is still necessary to have some established common types/interfaces to allow the automatic coupling of different models.)

The code I am dreaming of looks like

using SimulationA, SimulationB, ...
model_1 = ...
model_2 = ...

combined_model = define_interaction!(model_1, model_2, ...)

simulate(combined_model)


of course, that’s pretty much like the last example here

PS: If you really want to see the model:

The multiscale problems I work on are of the form

\tilde X_{n+1} = X_n + \Delta t F(X_n; P_n) \\ X_{n+1} = \mathrm{Proj}( \tilde X_{n+1} ) \\ P_{n+1} = \text{very ugly rules with special cases (like cell division)}

where
F = \sum_{i = 1}^N \sum_{j = 1}^N F_{ij} ~ + ~ ...
and the computationally dominating term is

F_{ij} = \begin{cases} - \alpha (\Vert x_i - x_j \Vert - \eta(t) ) \frac{X_i - X_j}{\Vert X_i - X_j \Vert}, & \text{if} \Vert X_i - X_j \Vert < R_i + R_j \\ 0 & \text{else} \end{cases}

with X_n = (x_1,\dots,x_k).
I use verlet list method to do fast allocation free overlap-detection.
Also, cells have a cell cycle at which they change parameters at specific cell phases and they can divide or change their type.

(I want to make it open source, but cannot do it yet.)

1 Like

Hi there,

Agents.jl is cool, but like every interface, I find it challenging to fit my model into it. Some parts are non-intuitive and I cannot control the numerical algorithms as I want.

Please be a bit specific and help us: which parts are not intuitive? Could you open an issue at Agents.jl GitHub page and list those parts?

You cannot control numerical algorithms in Agents.jl because, in a sense, there aren’t any. The time evolution is written exclusively by the user and passed into Agents.jl directly as either agent or model stepping functions. We do literally everything else, like running the model, collecting data, providing functions so that you can write your time evolution, but in the end of the day you have to write the time evolution yourself.

Hi,
Since this is the internet, let me say first that my formulation about Agents.jl as ‘non-intuitive’ wasn’t perfect! For all the range of models it supports the API is very, very simple! I just got stuck at a few places which is probably my fault. (I edited the post to delete that part.)

I will open an issue to describe at which points I found it challenging to use Agents.jl for my application. I think most parts are related to aspects of ContiniousSpace which somehow stopped me from using it.