src/links/place-types.jl
MEDYAN.FilaIdx
An index identifying a specific filament in the simulation. This is a lightweight reference that becomes invalid after filament mutations (removal or reordering).
Unlike the Place subtypes, FilaIdx is not taggable — filaments do not have a stable identity because of operations like severing. To maintain a long-term reference to a filament, store a Tag{FilaTipIdx} or Tag{FilaMonoIdx} instead, and resolve back to a FilaIdx when needed.
Constructors
FilaIdx(typeid::Integer, idx::Integer): Direct constructor with filament type ID and filament indexFilaIdx(c::Context, f::FilaIdx): Re-resolve a filament indexFilaIdx(c::Context, ft::FilaTipIdx): Extract the filament index from a filament tip indexFilaIdx(c::Context, t::Tag): Construct from a context and a filament-related tag (e.g.,Tag{FilaTipIdx}orTag{FilaMonoIdx})FilaIdx(c::Context, fm::FilaMonoIdx): Extract the filament index from a filament monomer index
Fields
typeid::UInt32: The filament type ID (usefila_typeid(c; type=:actin)to get this)idx::UInt32: The index of the filament within its type (1-based)
Example
Related Functions
See num_fila, fila_typeid, fila_mono_ids, fila_mono_states, fila_node_positions, fila_tip_tags.
MEDYAN.FilaTipIdx
An index identifying a specific filament tip (either the minus end or plus end).
This index may be invalidated by mutations (e.g., filament removal or severing). Use a Tag{FilaTipIdx} for a long-term reference that remains valid across mutations.
Constructors
FilaTipIdx(): Creates a null tip indexFilaTipIdx(fila_idx::FilaIdx, is_minus_end::Bool): Creates a tip index for the specified filament and endFilaTipIdx(c::Context, x, ::typeof(-)): Get the minus-end tipFilaTipIdx(c::Context, x, ::typeof(+)): Get the plus-end tipFilaTipIdx(c::Context, f::FilaTipIdx): Re-resolve a tip indexFilaTipIdx(c::Context, t::Tag{FilaTipIdx}): Construct from a tagFilaTipIdx(c::Context, x::Union{FilaIdx, FilaMonoIdx, FilaTipIdx, Tag}, is_minus_end::Bool): Construct from various filament references
Fields
fila_idx::FilaIdx: The filament this tip belongs tois_minus_end::Bool:truefor minus end,falsefor plus end
Related Functions
See fila_tip_tags, make_fila!.
MEDYAN.num_directions
MEDYAN.FilaMonoIdx
An index identifying a specific monomer on a filament. This is used for reactions and links that target individual monomers rather than filament tips.
This index may be invalidated by mutations (e.g., filament removal or severing). Use a Tag{FilaMonoIdx} for a long-term reference that remains valid across mutations.
Constructors
FilaMonoIdx(): Creates a null monomer indexFilaMonoIdx(fila_idx::FilaIdx, mid::Integer): Creates a monomer index for the specified filament and monomer IDFilaMonoIdx(c::Context, f::FilaIdx, m::Integer): Creates a monomer index from a filament index and monomer IDFilaMonoIdx(c::Context, ft::FilaTipIdx, offset::Integer=0): Creates a monomer index relative to a tip positionFilaMonoIdx(c::Context, fm::FilaMonoIdx, offset::Integer=0): Re-resolve a monomer index with optional offsetFilaMonoIdx(c::Context, x, y::Union{typeof(+), typeof(-)}, offset::Integer=0): Creates a monomer index from a tip directionFilaMonoIdx(c::Context, t::Tag, offset::Integer=0): Creates a monomer index from a tag with optional offset
Fields
fila_idx::FilaIdx: The filament this monomer belongs tomid::Int64: The monomer ID (can be obtained fromfila_mono_ids)
Example
Related Functions
MEDYAN.MembVertIdx
An index identifying a specific vertex on a membrane mesh. Membranes are represented as triangular meshes, and vertices can participate in chemical reactions and mechanical links.
This index may be invalidated by mesh adaptation or membrane removal. Use a Tag{MembVertIdx} for a long-term reference that remains valid across mutations.
Constructors
MembVertIdx(): Creates a null vertex index with both indices set to 0MembVertIdx(memb_idx::Integer, vert_idx::Integer): Creates a vertex index for the specified membrane and vertexMembVertIdx(c::Context, memb_idx::Integer, vert_idx::Integer): Creates a vertex index for the specified membrane and vertex
Fields
memb_idx::UInt32: Index of the membrane in the contextvert_idx::UInt32: Index of the vertex within the membrane mesh
Related Functions
MEDYAN.Anchor
A position and directions fixed in the simulation frame. Useful for creating links to a point that doesn’t move with any dynamic elements.
Constructors
Anchor(): Creates a null anchor with NaN position, NaN directions, and state 0Anchor(pos::SVector{3, Float64}): Creates an anchor at the given position with NaN directions and state 0Anchor(pos::SVector{3, Float64}, dirs::SVector{2, SVector{3, Float64}}): Creates an anchor at the given position with specified directions and state 0Anchor(pos::SVector{3, Float64}, dirs::SVector{2, SVector{3, Float64}}, state::Int64): Full constructor with position, directions, and stateAnchor(c::Context, pos, dirs, state): Construct from context with position, directions, and stateAnchor(c::Context, pos::SVector{3, Float64}): Construct from context at the given position
Fields
pos::SVector{3, Float64}: 3D position coordinatesdirs::SVector{2, SVector{3, Float64}}: Two direction vectorsstate::Int64: State identifier for chemical reactions
MEDYAN.BallIdx
An index referring to a ball (spherical particle) in the simulation. Balls are stored in the balls vector of the Context and represent spherical objects with position, radius, and stiffness that can participate in mechanical interactions and chemical reactions.
This index may be invalidated by ball removal or reordering. Use a Tag{BallIdx} for a long-term reference that remains valid across mutations.
Constructors
BallIdx(): Creates a null ball index with idx 0BallIdx(idx::Int64): Creates a ball index pointing to the ball at positionidxin the context’s balls vectorBallIdx(c::Context, idx::Integer): Construct from context with indexBallIdx(c::Context, b::BallIdx): Re-resolve a ball indexBallIdx(c::Context, t::Tag{BallIdx}): Construct from a tag
Fields
idx::Int64: Index of the ball in the context’sballsvector
Related Functions
See make_ball!, remove_ball!, and update_ball! for creating, removing, and modifying balls.