src/links/place-types.jl

MEDYAN.FilaIdx

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 index
  • FilaIdx(c::Context, f::FilaIdx): Re-resolve a filament index
  • FilaIdx(c::Context, ft::FilaTipIdx): Extract the filament index from a filament tip index
  • FilaIdx(c::Context, t::Tag): Construct from a context and a filament-related tag (e.g., Tag{FilaTipIdx} or Tag{FilaMonoIdx})
  • FilaIdx(c::Context, fm::FilaMonoIdx): Extract the filament index from a filament monomer index

Fields

  • typeid::UInt32: The filament type ID (use fila_typeid(c; type=:actin) to get this)
  • idx::UInt32: The index of the filament within its type (1-based)

Example

# Iterate over all filaments of a given type
ftid = fila_typeid(c; type=:actin)
for i in 1:num_fila(c; type=:actin)
    fidx = FilaIdx(ftid, i)
    states = fila_mono_states(c, fidx)
    positions = fila_node_positions(c, fidx)
end

MEDYAN.FilaTipIdx

FilaTipIdx <: Place

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 index
  • FilaTipIdx(fila_idx::FilaIdx, is_minus_end::Bool): Creates a tip index for the specified filament and end
  • FilaTipIdx(c::Context, x, ::typeof(-)): Get the minus-end tip
  • FilaTipIdx(c::Context, x, ::typeof(+)): Get the plus-end tip
  • FilaTipIdx(c::Context, f::FilaTipIdx): Re-resolve a tip index
  • FilaTipIdx(c::Context, t::Tag{FilaTipIdx}): Construct from a tag
  • FilaTipIdx(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 to
  • is_minus_end::Bool: true for minus end, false for plus end

MEDYAN.num_directions

num_directions(::Union{Place, Type{<:Place}})::Int

Return the number of directions associated with a place.

MEDYAN.FilaMonoIdx

FilaMonoIdx <: Place

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 index
  • FilaMonoIdx(fila_idx::FilaIdx, mid::Integer): Creates a monomer index for the specified filament and monomer ID
  • FilaMonoIdx(c::Context, f::FilaIdx, m::Integer): Creates a monomer index from a filament index and monomer ID
  • FilaMonoIdx(c::Context, ft::FilaTipIdx, offset::Integer=0): Creates a monomer index relative to a tip position
  • FilaMonoIdx(c::Context, fm::FilaMonoIdx, offset::Integer=0): Re-resolve a monomer index with optional offset
  • FilaMonoIdx(c::Context, x, y::Union{typeof(+), typeof(-)}, offset::Integer=0): Creates a monomer index from a tip direction
  • FilaMonoIdx(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 to
  • mid::Int64: The monomer ID (can be obtained from fila_mono_ids)

Example

# Get a specific monomer on a filament
fidx = FilaIdx(ftid, 1)
mono_ids = fila_mono_ids(c, fidx)
mono_idx = FilaMonoIdx(fidx, first(mono_ids))  # First monomer (minus end)

MEDYAN.MembVertIdx

MembVertIdx <: Place

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 0
  • MembVertIdx(memb_idx::Integer, vert_idx::Integer): Creates a vertex index for the specified membrane and vertex
  • MembVertIdx(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 context
  • vert_idx::UInt32: Index of the vertex within the membrane mesh

MEDYAN.Anchor

Anchor <: Place

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 0
  • Anchor(pos::SVector{3, Float64}): Creates an anchor at the given position with NaN directions and state 0
  • Anchor(pos::SVector{3, Float64}, dirs::SVector{2, SVector{3, Float64}}): Creates an anchor at the given position with specified directions and state 0
  • Anchor(pos::SVector{3, Float64}, dirs::SVector{2, SVector{3, Float64}}, state::Int64): Full constructor with position, directions, and state
  • Anchor(c::Context, pos, dirs, state): Construct from context with position, directions, and state
  • Anchor(c::Context, pos::SVector{3, Float64}): Construct from context at the given position

Fields

  • pos::SVector{3, Float64}: 3D position coordinates
  • dirs::SVector{2, SVector{3, Float64}}: Two direction vectors
  • state::Int64: State identifier for chemical reactions

MEDYAN.BallIdx

BallIdx <: Place

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 0
  • BallIdx(idx::Int64): Creates a ball index pointing to the ball at position idx in the context’s balls vector
  • BallIdx(c::Context, idx::Integer): Construct from context with index
  • BallIdx(c::Context, b::BallIdx): Re-resolve a ball index
  • BallIdx(c::Context, t::Tag{BallIdx}): Construct from a tag

Fields

  • idx::Int64: Index of the ball in the context’s balls vector