mastrof / bactos.jl Goto Github PK
View Code? Open in Web Editor NEWAgent-based modeling framework for bacterial behavior, based on Agents.jl
License: MIT License
Agent-based modeling framework for bacterial behavior, based on Agents.jl
License: MIT License
Allow extra kwargs to be passed to the ABM
constructor via initialise_model
, so all its functionalities can be accessed.
Remove the update_model!
keyword from model_step!
and set model_step!
as an internal property (model.update!
); modifications to the basic model_step!
will then be obtained by chaining functions to model.update!
The Behavioral Variability model should be implemented.
Relevant references:
At current stage, however, this model can only simulate intrinsic CheYP noise in motility, cannot simulate actual chemotaxis.
@JuliaRegistrator register()
azimuthal
should use Arccos()
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
Must implement differential equations solvers via OrdinaryDiffEq
(I see no clear need for the other diff eq modules at the moment).
This need to be accompanied by the implementation of a set of default finite difference schemes.
Standard finite differences should be enough for the evolution of typical concentration fields, but including flow fields might be a bigger task.
RunReverseFlick
defaults to polar_backward = Degenerate(π/2)
but it should be changed to
polar_backward = [-π/2, π/2]
to account for reorentations in both directions.
No need for the extra verbosity in these names
A general interface to detect collisions between bacteria and another body (whatever that is) should be implemented; something like encounters(body, is_encounter::Function, model::ABM)
which can be passed to update_model!
.
The user can supply a specific is_encounter(microbe::AbstractMicrobe, body, model::ABM)
function that defines what an encounter is. encounters
then loops over all microbes in the model and evaluates how many encounters occurred in the current step.
For certan simple cases (e.g. ObstacleSphere
s), the is_encounter
function will be provided by the library.
rotate
functionA comprehensive and up-to-date test suite is absolutely necessary.
An enumerated type (via @enum
) should be used instead of the current approach
Implement swimming dynamics in flow (after #8)
Some improvements can be made to the initialise_model
function.
concentration_field
, concentration_gradient
and concentration_time_derivative
should be auto-initialised by default to (pos,model) -> 0.0
for field and time derivative, and (pos,model) -> zero.(pos)
since they are required by all microbe types with chemotaxiscompound_diffusivity
which is required for all microbe types with noisy chemotaxisDefault turn angle distributions for RunTumble should be modified such that, in D-dimensions, rotations are uniform on the D-sphere.
At the moment, this is not true for D=3.
In 3 dimensions, the two angles should be sampled as
The default constructor should define
The arccos distribution will be defined by a custom distribution type
Currently, mixed species models require the type of the population to be specified explicitly.
microbes = [MicrobeBrumley{1}(id=1), MicrobeBrownBerg{1}(id=2)]
returns a Vector{AbstractMicrobe{1}}
but initialise_model
expects eltype(microbes)
to be concrete, i.e. we must specify
microbes = Union{MicrobeBrumley{1},MicrobeBrownBerg{1}}[MicrobeBrumley{1}(id=1), MicrobeBrownBerg{1}(id=2)]
to avoid errors.
This is cumbersome and should be managed either directly by initialise_models
or by a new dedicated function that expands the microbe types.
Not sure if needed, might make sense for consistency with other measurement functions
Originally posted by @mastrof in #2 (comment)
Add a model of chemotaxis for marine bacteria following Xie, L., Lu, C. & Wu, X.-L. Marine Bacterial Chemoresponse to a Stepwise Chemoattractant Stimulus. Biophys. J. 108, 766–774 (2015).
They develop the analytical form and provide parameters for V. alginolyticus.
Numerical implementation of the model requires an approach similar to that adopted for the Celani model (#13), where by the dynamics of the instantaneous tumbling rate is regulated by internal Markovian variables.
The extraction of random speed in microbe type constructors is inconsistent and bugged.
It must be fixed by introducing a rand_speed(motility)
function which dispatches on AbstractMotilityOneStep
and AbstractMotilityTwoStep
.
Current approach to evaluate encounter rates can be unintuitive in some cases. Might even lead to errors if custom microbe_step!
functions are used.
Instead of predicting whether an encounter will happen in the next step, the previous position of bacteria should be stored as a model property (updated at every step), and encounters can be tested by using their current position.
Not breaking, since all the changes happen internally.
The initialise_model
function should probably provide by default a t
parameter, keeping track of current simulation time.
It will be useful to implement analytical time-dependent fields.
If implemented this would require to change affect!
functons and expect all concentration field related functions to accept t
as parameter
Develop an extra module for plotting bacteria and bacteria in fields.
Makie might allow for more freedom and control, but I at first I will probably rely on Plots since I know it much better.
Possibly, in the future two "equivalent" modules, based respectively on Plots and Makie, could be made available
Can be included in the validation section of the docs
Implement reading of external flow fields (computable e.g. via WaterLily.jl); solve scalar transport on top of provided flows (might be better suited for a submodule or even an independent package)
motility
in Xie
and XieNoisy
should default to RunReverseFlick
rather than RunReverse
They are not necessary, can be completely removed.
Removing the typed global consts should also allow ensure compatibility with julia versions pre-1.8
Motility types should implement an easy way to distinguish between the motile stages.
Currently only RunReverseFlick
implements a motile_state
.
For a complete implementation of Xie
chemotactic model, this is also required for RunReverse
.
The abstract motile_state
with values 0 and 1 should possibly be replaced by more meaningful "forward" and "backward" states, directly associated with the direction of flagellar motor rotation (and hence of motion)
Maybe this line should become
σ = Π * 0.04075 * sqrt(3*u / (π*a*Dc*Δt^3)) # noise
where 0.04075 is a correction factor arising from proper unit conversions (calculations explained in enclosed pdf)
Noise in the Brumley-Carrara model of chemotaxis.pdf
Such a correction affects the resulting behavior crucially.
Main problem here is that solvers are not included in DiffEqBase.jl so this would be a breaking change.
Requiring users to explicitly import OrdinaryDiffEq.jl just to choose the solver algorithm is not a big deal in itself, but it might be off-putting for someone which is not very familiar with differential equations (thinking about the more bio audience) and seems like boilerplate which could be easily abstracted away.
On the other hand, OrdinaryDiffEq.jl is a huge dependency.
Many breaking changes happened, and most examples might be broken. They should be updated
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.