API

Microbes

Base.positionFunction
position(m::AbstractMicrobe)

Return the position of the microbe.

source
MicrobeAgents.speedFunction
speed(m::AbstractMicrobe)

Return the speed of the microbe.

source
speed(motility::Motility)

Return the speed distribution of the current motile state.

source
MicrobeAgents.stateFunction
state(m::AbstractMicrobe)

Return the internal state of the microbe.

source
state(motility::Motility)

Return the index of active motile state.

source
MicrobeAgents.transition_weightsFunction
transition_weights(motility::Motility, i::Integer)

Return the transition weights from the state with index i towards the other motile states.

source
Missing docstring.

Missing docstring for angle. Check Documenter's build log for details.

MicrobeAgents.distanceFunction
distance(a, b, model)

Evaluate the euclidean distance between a and b respecting the boundary conditions of the model

source

Chemoattractants

MicrobeAgents.AbstractChemoattractantType
AbstractChemoattractant{D,T}

Abstract type for chemoattractants. Requires dimensionality (D) and number type (T, typically Float64).

The interface is defined by four core functions that operate on AgentBasedModels:

  • chemoattractant: returns the chemoattractant object
  • concentration: returns the function for the concentration field
  • gradient: returns the function for the concentration gradient
  • time_derivative: returns the function for the concentration ramp
  • chemoattractant_diffusivity: returns the thermal diffusivity of the chemoattractant
source
MicrobeAgents.GenericChemoattractantType
GenericChemoattractant{D,T} <: AbstractChemoattractant{D,T}

Type for a generic chemoattractant field. Concentration field, gradient and time derivative default to zero values. Diffusivity defaults to 608 μm^2/s.

source
MicrobeAgents.concentrationFunction
concentration(model)

Returns the function f that defines the concentration field. The returned function has signature f(pos, model) and returns a scalar.

source
MicrobeAgents.gradientFunction
gradient(model)

Returns the function f that defines the gradient of the concentration field. The returned function has signature f(pos, model) and returns a SVector with the same dimensionality as the microbe position pos.

source
MicrobeAgents.time_derivativeFunction
time_derivative(model)

Returns the function f that defines the time derivative of the concentration field. The returned function has signature f(pos, model) and returns a scalar.

source

Utils

MicrobeAgents.Analysis.adf_to_matrixFunction
adf_to_matrix(adf, sym)

Collect quantity sym from the agent dataframe adf and return it in matrix form with dimensions (times, microbes). Requires all microbes to exist from start to end of the simulations (no removals or insertions).

source
Missing docstring.

Missing docstring for Analysis.unfold. Check Documenter's build log for details.

MeanSquaredDisplacement.unfold!Function
unfold!(adf, model; key=:position)
unfold!(adf, extent; key=:position)
unfold!(gdf, model; key=:position)
unfold!(gdf, extent; key=:position)

Unfold the periodic trajectories contained in the agent dataframe adf or in the grouped dataframe gdf where each microbe trajectory was grouped by :id. The second argument can be either the spatial extent of the model, or the model itself from which the extent is automatically extracted.

The keyword argument key=:position determines what column of the dataframe has to be unfolded.

source

Data analysis

MicrobeAgents.Analysis.detect_turns!Function
detect_turns!(adf; threshold_angle=0.0, kwargs...)

Detect reorientations in the microbe trajectories in adf. Requires adf to have a velocity column. In order to be detected, a reorientation must be larger than the threshold_angle (in radians); the threshold defaults to 0.

A new column is added to the dataframe, with values true when the microbe has turned with respect to the previous frame, or false otherwise.

Keywords

  • vel_key::Symbol = :velocity: name of the column containing microbe velocities
  • new_key::Symbol = :has_turned: name of the new column storing turn statistics
source
MicrobeAgents.Analysis.run_durationsFunction
run_durations(adf; turns_key=:has_turned)

Evaluate the duration (in frames) of all runs detected during a simulation. The dataframe should already contain a column of Bools with values true for frames when a turn has occurred and false otherwise (see detect_turns!). The function returns a vector of run durations for each microbe.

turns_key defines the name of the column where the turn statistics is stored (defaults to :has_turned).

source
MicrobeAgents.Analysis.driftvelocity_point!Function
driftvelocity_point!(adf, target; normalize=false, kwargs...)
driftvelocity_point!(gdf, target; normalize=false, kwargs...)

Evaluate the drift velocity of microbes towards a target point, extracting their positions and velocities from the agent dataframe adf or from the grouped dataframe gdf (grouped by :id). Requires the existence of columns containing the position and velocity of microbes. By convention the drift velocity will be positive for motion towards the target point.

Keywords

  • normalize = false: whether drift velocities should be normalized by the instantaneous speed of the microbes
  • pos_key::Symbol = :position: name of the column containing microbe positions
  • vel_key::Symbol = :velocity: name of the column containing microbe velocities
source
MicrobeAgents.Analysis.driftvelocity_direction!Function
driftvelocity_direction!(adf, target; normalize=false, kwargs...)
driftvelocity_direction!(gdf, target; normalize=false, kwargs...)

Evaluate the drift velocity of microbes along a target direction, extracting their positions and velocities from the agent dataframe adf or from the grouped dataframe gdf (grouped by :id). Requires the existence of a column containing the velocity of microbes. By convention the drift velocity will be positive for motion along the target directoin.

Keywords

  • normalize = false: whether drift velocities should be normalized by the instantaneous speed of the microbes
  • vel_key::Symbol = :velocity: name of the column containing microbe velocities
source
Missing docstring.

Missing docstring for msd. Check Documenter's build log for details.

Missing docstring.

Missing docstring for acf. Check Documenter's build log for details.