src/context.jl
MEDYAN.MembraneSpeciesParams
Membrane protein physical parameters.
diffusion_coeff::Float64: Membrane diffusion coefficients (nm^2/s).area::Float64: Protein area projected onto the surface (nm^2).kbend::Float64: Bending rigidity (pN nm).eqcurv::Float64: The protein’s own spontaneous mean curvature (/nm). Can be used in bending energy computations with curvatures.
MEDYAN.Context
agent_names::MEDYAN.AgentNamessys_def::MEDYAN.SysDefcompartments::Vector{MEDYAN.Compartment}grid::Anytime::Ref{Float64}: time (s)stats::MEDYAN.PerformanceStatsβ::Float64: inverse kT (1/(nm*pN))base_diffusion_coeffs::Vector{Float64}: Diffusion coefficients indexed by diffusing species id (nm²/s)membrane_species_params::StaticArraysCore.SVector{NUM_MEMBRANEDIFFUSINGSPECIES, MEDYAN.MembraneSpeciesParams} where NUM_MEMBRANEDIFFUSINGSPECIES: Membrane species parameters indexed by membrane diffusing species id.min_compartment_volume_ratio::Float64: Smallest volume a compartment can have before being deactivated as a ratio to a full compartment volume.chemistryengine::MEDYAN.RDMESampler: The reaction diffusion master equation sampler, contains the diffusing and regular fixed species statechem_cylinders::Vector{MEDYAN.ChemCylinders}: Data about filament cylinders, indexed by filament type idballs::StructArrays.StructVector{MEDYAN.Ball, @NamedTuple{position::Vector{StaticArraysCore.SVector{3, Float64}}, radius::Vector{Float32}, stiffness::Vector{Float32}, state::Vector{StaticArraysCore.SVector{3, Int64}}}, Int64}membranes::Vector: All membrane meshes.link_manager::MEDYAN.LinkManagerdecimated_2mon_site_managers::Vector{MEDYAN.AbstractDecimated2MonSiteManager}: Site managers, indexed by site idfilamentsites::Tuple{Vararg{Tuple{Vararg{MEDYAN.SiteData}}}}: The filament site definitions, indexed by filament type id, filament site id to get a SiteData with fields of id, site, fxsidfilamentendsites::Tuple{Vararg{Tuple{Vararg{MEDYAN.SiteData}}}}: The filamentend site definitions, indexed by filament type id, filamentend site id to get a SiteData with fields of id, site, fxsidmaxfilsite_plusrange::Vector{Int64}: The maximum plus range in monomers that any filament site or end site can see. Indexed by filament type idmaxfilsite_minusrange::Vector{Int64}: The maximum minus range in monomers that any filament site or end site can see. Indexed by filament type idmembranesites::Tuple{Vararg{MEDYAN.SiteData}}: Maps membrane site id to a SiteData with fields of id, site, fxsid.map_membranediffusingspeciesindex_membranesiteindices::Tuple{Vararg{Vector{Int64}}}: Maps membrane diffusing species index to a list of membrane sites using this species as reactant. This is initialized during context init and should not be changed.decimated_2mon_sites::Vector{MEDYAN.SiteData}: Site definitions, indexed by site id to get a SiteData with fields of id, site, fxsidpossiblecadherinsite_managers::Tuple{Vararg{MEDYAN.AbstractPossibleCadherinSiteManager}}: Site managers, indexed by site idcheck_sitecount_error::Bool: If true site counts are checked for errors on every chem update. This is extremely slow, but useful for testing chem update errors.compartmentreactioncallbacks::Anybulkreactioncallbacks::Anymemdiff_bulks_index::Int64: Mock bulk species index for membrane diffusion.viscosity::Float64: viscosity (pNs/nm² or MPas) water is about 1E-9g_tol::Float64: maximum force magnitude after minimization (pN)nforce_fractbit::Int64: number of fractional bits used to scale force values into Int64nenergy_fractbit::Int64: number of fractional bits used to scale energy values into Int64shake_before_minimization::Float64: Standard deviation of noise added to coordinates before starting minimization.iter_max_cg_minimization::Int64: Max number of steps in conjugate gradient minimization.maxstep::Float64: max step to take during line search (nm)check_neighborlist_error::Bool: If true neighborlists are checked for errors on every force calc. This is extremely slow, but useful for testing neighborlist errors.nthreads::Int64: Experimental Set to more than 1 to enable multi threading. This is currently may result in non bitwise reproducable simulations. Results should be statistcally identical, but this is currently not well tested.enable_collision::Ref{Bool}: Are collision forces calculatedcollision_skin::Float64: Extra collision neighbor list cutoff radius in nm. The neighbor lists are reset after something moves over this amountcollision_switchover_scale_unitless::Float32: Smoothing scale to avoid sharp forces when two cylinders are collinearfilamentmechparams::Vector{MEDYAN.FilamentMechParams}: The filament mechanical parameters, indexed by filament type idmembranemechparams::Vector{MEDYAN.MembraneMechParams}: Membrane mechanical parameters, indexed by membrane type id.func_membranespeciespotentialenergy::Any: Membrane species potential energy function. See docs on default function for more info.external_energy_forces!::Any: External energy/force expressions. This should be a mutating function taking a(fc::MEDYAN.ForceContext, vectorized_x), which adds tofc.forces, fc.energies, and fc.energy. The energy and force must be consistent, and this is not checked. This can be used as ad-hoc solutions to experiment with uncommon forces, such as specifically designed attachments, etc. If this variable is used often, consider moving it into MEDYAN.chemboundary::MEDYAN.Boundary: chemical boundary, updates compartment volumes and diffusion ratesmeshindex_as_chemboundary::Ref{Int64}: The membrane index used as chemical boundary. If values other than 0 is used, the actual interior region of the chemical boundary is the intersection between- the interior of
chemboundary, and - the interior of the membrane mesh at this index.
Note: Since the membrane may change its shape often,
set_chemboundary!might need to be called often accordingly to update volumes of compartments.- the interior of
mechboundary::MEDYAN.Boundary: mechanical boundarysharedtypedconfigs::MEDYAN.SharedTypedConfigs: Shared configurations stored in type parameters.validflags::MEDYAN.ValidFlags: Interval system consistency validation flags.profiler::ZoneProfilers.Profiler
MEDYAN.set_time!
MEDYAN.get_time
MEDYAN.set_enable_collision!
MEDYAN.set_chemboundary!
Set chemical boundary and update compartment volumes and diffusion rates. Note, the chemboundary should be outside the mechboundary so that it is rare for filaments to go outside the chemboundary.
Calling this will invalidate the chem cache.
See also Boundary
Keyword Arguments
planes::Vector{SVector{4,Float64}} = []
Planes that make up the chemical boundary of the simulation
inside = signbit(pos ⋅ planes[bi][1:3] - planes[bi][4])
For example, a plane [1,0,0,3] is inside if x < 3 nm.
2.0*[1,0,0,3] is also inside if x < 3 nm.
capsules::Vector{SVector{8,Float64}} = []
Capsules that make up the chemical boundary of the simulation.
capsules[bi][1:3] is the starting point of the spine line segment (nm). capsules[bi][4:6] is the axis of the spine line segment (nm). capsules[bi][7] is the radius (nm). capsules[bi][8] is ignored.
if capsules[bi][4:6] is zero then the capsule is a sphere. Capsule boundaries can be combined with plane boundaries to create cylinder boundaries.
meshindex_as_chemboundary::Int = 0: Index of membrane mesh that further restricts the chem boundary. 0 for none.
The system geometry information must be up-to-date. This mesh index is not stored in the boundary object, but is directly set in the context.
MEDYAN.set_mechboundary!
See also Boundary
MEDYAN.chem_adddiffusingcount!
MEDYAN.add_diffusing_count!
MEDYAN.chem_addfixedcount!
MEDYAN.adddiffusingcount_rand!
MEDYAN.addmembranediffusingcount_rand!
MEDYAN.run_chemistry!
MEDYAN.defer_chem_caching!
This should only be used for advanced optimizations.
During chemistry, the context mutating functions will typically try to avoid invalidating various cached data needed to quickly sample sites.
However, if you want to mutate the context outside of chemistry, for example right before or after minimization, you may not want to pay the cost of revalidating all the caches because minimization will already invalidate the caches. Caching will be enabled again and caches will be made valid the next time chemistry is run. Caching can also be manually refreshed and reenabled with: refresh_chem_cache!
MEDYAN.refresh_chem_cache!
MEDYAN.is_chem_cache_valid
Base.empty!
MEDYAN.newmembrane!
Add a new membrane to the system.
Keyword Arguments
type::Int: Membrane type index (must have corresponding entry inc.membranemechparams)meshinit: Structure containing mesh shape initialization information, such as a named tuple(vertlist, trilist)containing vertex coordinates and triangle list,MeshInitEllipsoid,MeshInitPlaneor a generalMeshInitSurfaceFunc.mechparams::Union{Nothing, MembraneMechParams}=nothing: Mechanical parameters for this membrane. Ifnothing, copies fromc.membranemechparams[type].