API
Main CellAdhesion data structures
CellAdhesion.Bond — Type
Bond
Bond(state::{Bool}, f::{CellAdhesionFloat}, model)
`Bond` struct contains sate, force and model of a single bond
# Fields
- `state`: false (0) = open, true (1) = closed
- `f`: force
- `t`: time
- `model`: BondModel describing the bond binding-unbinding dynamicsCellAdhesion.Cluster — Type
Cluster(u::Vector{Bond,Cluster}, state::{Bool}, f::{CellAdhesionFloat}, f_model::{Symbol}, n::{CellAdhesionInt}, l::{CellAdhesionFloat})Processing functions
CellAdhesion.update! — Function
update!(v, dt)
Updates the state of an interface (that can be made of bonds or it can be a hierarchical structure).
Input parameters:
- v: interface (this can be a cluster or a bond)
- dt: time step of the simulation
CellAdhesion.runcluster — Function
runcluster(v, force, dt::Float64; max_steps::Integer = 1000, verbose::Bool = false)
Simulates a junction subjected to an external force using a Montecarlo algorithm.
Input paramters:
- v: structure of type Cluster
- force: it can either be an constant number (if the junction is subjected to a constant force), or a vector (if the junction is subjected to a varing force)
- dt: time step for the simulation
- max_steps: maximum number of iterations if the junction doesn't break
Output paramters:
- state of the whole Cluster
- force at which it breaks
- time at which it breaks
- number of steps after which it breaks
Utility functions
CellAdhesion.state! — Function
state!(v)
Updates the state field of a Cluster or a Bond. When all the subunits are open, then the state of the structure is set to open. Otherwise, it is close.
Input parameters:
- v: interface that can either be a Cluster or a Bond.
Output: State of the cluster/bond, false for broken, true otherwise.
CellAdhesion.bond_state_force — Function
bondstateforce(v; output=:flat, time=missing)
Return bond state/force information for a Bond, a Cluster{Bond}, or nested Cluster.
- output=:flat (default) returns tuples (states, forces) identical to previous API.
- output=:nested returns a Dict with keys "time", "states", "force", preserving hierarchy:
- Bond -> Bool and scalar float
- Cluster{Bond} -> Vector of Bool / Float
- nested Cluster -> nested Vector structures
Closed bonds are assigned NaN in force output.
CellAdhesion.print_cluster — Function
print_cluster(x)
Nice screen print of Cluster structure or Bond (x)
Dynamics functions
CellAdhesion.setforce! — Function
setforce!(v::Cluster{Bond{T}}, F::CellAdhesionFloat)
Input parameters:
- v: Cluster structure
- F: Force applied to the cluster
Output parameters:
- Updated the force applied to each Cluster structure (within the hierarchical structure)
CellAdhesion.force_global — Function
force_global(v::Cluster)
Computer force distribution by equally dividing the force within the closed bonds
CellAdhesion.force_local — Function
force_local(v::Cluster)
Computer force distribution by accounting for the distance of each link from its two closest neighbours
CellAdhesion.distance — Function
distance(v::BitVector, n::Integer)
Compute the distance of each from its two closest closed link on each side. Used to compute a "local" load distributions across closed bonds. Periodic bondary conditions for the edges.
Input parameters:
- v: vector with the state of each single bond
- n: number of bonds in the interface
Output parameters:
- l: vector of CellAdhesionFloat containing the distance for each closed bond