src/filament/functions.jl

MEDYAN.num_fila_types

num_fila_types(c::MEDYAN.Context) -> Int64

Return the number of filament types.

MEDYAN.fila_type_name

fila_type_name(c::Context, f::Union{Tag, FilaIdx})::Symbol
fila_type_name(c::Context; type::Union{Symbol, Integer})::Symbol

Return the name of the f’s type, or the name associated with type

MEDYAN.fila_typeid

fila_typeid(c::Context, f::Union{Tag, FilaIdx})::Int
fila_typeid(c::Context; type::Union{Symbol,Integer})::Int

Return the typeid of a filament f or associated with type.

MEDYAN.num_fila

num_fila(c::MEDYAN.Context; type) -> Int64

Return the number of filaments of a given type.

MEDYAN.fila_mono_ids

fila_mono_ids(
    c::MEDYAN.Context,
    f::MEDYAN.FilaIdx
) -> UnitRange{Int64}

Return a UnitRange{Int64} of monomer IDs on a filament.

MEDYAN.fila_mono_states

fila_mono_states(
    c::MEDYAN.Context,
    f::MEDYAN.FilaIdx
) -> Vector{UInt8}

Return a read only Vector of monomer states on a filament.

This can be invalid after any mutations to context, so copy if needed.

MEDYAN.fila_num_nodes

fila_num_nodes(
    c::MEDYAN.Context,
    f::MEDYAN.FilaIdx
) -> Int64

Return the number of mechanical node positions of a filament.

MEDYAN.fila_node_mids

fila_node_mids(
    c::MEDYAN.Context,
    f::MEDYAN.FilaIdx
) -> Vector{Int64}

Return the node_mids of the filament.

The node_mids are the monomer ids at (slightly plus side of) the node_positions

                                 |
                      -----+-----|-----+-----
  minus end <----       M  |  M  | (M) |  M        ----> plus end
                      -----+-----|-----+-----
                                 |
                                 ^ A node position is indicated by the line.

The monomer id with parenthesis (M) will in `node_mids`

The first monomer id is the first monomer id on the filament. The last monomer id is the last monomer id on the filament + 1

MEDYAN.fila_node_positions

fila_node_positions(
    c::MEDYAN.Context,
    f::MEDYAN.FilaIdx
) -> Vector{StaticArraysCore.SVector{3, Float64}}

Return the node positions of the filament at cylinder boundaries.

These are NOT adjusted for tip extension. Use get_position(c, FilaTipIdx(...)) to get the tip position with extension applied.

MEDYAN.fila_chem_positions

fila_chem_positions(
    c::MEDYAN.Context,
    f::MEDYAN.FilaIdx
) -> Vector{StaticArraysCore.SVector{3, Float64}}

Return a view of the chemistry cylinder endpoint positions for the filament.

These are the raw positions used for chemistry calculations, at the boundaries between cylinders. Unlike fila_node_positions, the first and last positions are NOT adjusted for partial cylinders or tip extension. Use get_position(c, FilaTipIdx(...)) for the actual tip positions. This can be invalid after any mutations to context, so copy if needed.

MEDYAN.fila_tip_tags

fila_tip_tags(
    c::MEDYAN.Context,
    f::MEDYAN.FilaIdx
) -> Pair{MEDYAN.Tag{MEDYAN.FilaTipIdx}, MEDYAN.Tag{MEDYAN.FilaTipIdx}}

Return the pair of minus end, plus end filament tip tags.

MEDYAN.fila_num_unmin_ends

fila_num_unmin_ends(
    c::MEDYAN.Context,
    fila_idx::MEDYAN.FilaIdx
) -> Pair{Int64, Int64}

Return a pair (minus => plus) of the number of unminimized monomers on the minus and plus end of a filament.

This will be reset to (0 => 0) by minimize_energy!

When an end is depolymerized this will decrease, but saturate at 0. When an end is polymerized this will increase.

For example if after minimization a filament has a plus end depolymerization, this function will return (0 => 0). Then if a plus end polymerization happens, this function will return (0 => 1), even though the net change in filament length is zero.

MEDYAN.fila_load_force

fila_load_force(
    c::MEDYAN.Context,
    tip::MEDYAN.FilaTipIdx
) -> Float64

Return the end load force for the given filament tip in pN.

Values are always ≥ 0: the compressive force component pushing inward on the tip projected along the filament axis.

Load forces are computed during minimize_energy! and baoab!. They are zero before the first mechanics cycle and after filament creation.

These load forces slow polymerization/depolymerization rates via a Boltzmann factor exp(-β × spacing × load_force).

MEDYAN.fila_tip_snapshot

fila_tip_snapshot(
    c::MEDYAN.Context,
    tip::MEDYAN.FilaTipIdx
) -> StaticArraysCore.SVector{3, Float64}

Return the snapshotted tip position for the given filament tip.

Tip positions are set from the actual tip position at the end of minimize_energy! and baoab! (whenever load forces are updated). Before the first mechanics cycle, positions are NaN.

These snapshotted positions are used by fila_tip_cutoff reactions to count nearby tips.

MEDYAN.fila_tip_extension

fila_tip_extension(
    c::MEDYAN.Context,
    tip::MEDYAN.FilaTipIdx
) -> Float64

Return the tip extension for the given filament tip in monomer spacings.

The extension controls how far the tip position extends outward from the last monomer center. It affects both the chemistry tip position ([get_position] for FilaTipIdx) and the mechanical endpoint used in energy minimization (volume exclusion, equilibrium length):

  • 0.0: tip at the monomer center
  • > 0.0: tip extends further outward (e.g. bulky end-binding protein)
  • < 0.0: tip moves inward past the monomer center

The mechanical node positions (fila_node_positions) remain at cylinder boundaries and are not affected by the extension.

See also set_fila_tip_extension!.

MEDYAN.is_minimized

is_minimized(c::Context, p::Union{FilaMonoIdx, FilaTipIdx, Tag})::Bool

Return true iff the monomer or tip has been minimized. Throw an error if p doesn’t exist.

MEDYAN.pick_rand_fila_mono_site

pick_rand_fila_mono_site(c::Context, chem_voxel, fila_typeid, fsid)::Union{FilaMonoIdx, Nothing}

Return a FilaMonoIdx of a random filamonosite, or return nothing if rejected weighted by counts, using the default RNG.

MEDYAN.pick_rand_fila_tip_site

pick_rand_fila_tip_site(c::Context, chem_voxel, fila_typeid, fesid)::Union{FilaTipIdx, Nothing}

Return a FilaTipIdx of a random filaendsite, or return nothing if rejected weighted by counts, using the default RNG.

MEDYAN.set_chem_cylinder_cell_list_grid_spacing!

set_chem_cylinder_cell_list_grid_spacing!(c::Context, fil_typeid::Int, spacing::Real)::Nothing

Set the grid spacing (nm) for the chem cylinder cell list of filament type fil_typeid. Changing the spacing will invalidate the cell list cache of those chem cylinders.

MEDYAN.set_fila_tip_cell_list_grid_spacing!

set_fila_tip_cell_list_grid_spacing!(c::Context, fil_typeid::Int, spacing::Real)::Nothing

Set the grid spacing (nm) for the tip cell lists of filament type fil_typeid. Changing the spacing will invalidate both tip cell list caches of those chem cylinders.