flins.support package¶
Subpackages¶
Submodules¶
flins.support.binding_site module¶
What is bound to what.
Let different proteins link to and unlink from each other.
-
class
flins.support.binding_site.
BindingSite
(parent)[source]¶ Bases:
object
A link between this (thing) and that (thing)
Create the binding site
- Parameters
parent (protein) – Protein on which this binding site is located
-
property
bound
¶ Are you currently bound?
-
property
linked
¶ Return the parent object of the linked site (None if unbound)
flins.support.diffuse module¶
Stagger around.
Allow random diffusion of various shapes in various directions.
-
class
flins.support.diffuse.
Drag
[source]¶ Bases:
object
Drag coefficients drawn from Howard_2001, Pg 107 and Berg_1983. We assume that our coefficient of viscosity, \(\eta\), defaults to that of water (0.0114 poise at 288K), referenced from units
-
class
Cylinder
[source]¶ Bases:
object
Drag coefficients for cylinders. The cylinder has a length \(L\), a radius \(r\), and is in a fluid of viscosity \(\eta\). This assumes \(L>>r\) and an unbounded space.
-
long_axis_rotation
(r, eta=1.14e-09)[source]¶ Drag coefficient for cylinder rotating about the long axis
-
long_axis_translation
(r, eta=1.14e-09)[source]¶ Drag coefficient for cylinder moving along long axis
-
-
class
Ellipsoid
[source]¶ Bases:
object
Drag coefficients for an ellipsoid. The ellipsoid has a minor axis radius of \(a\), a major axis radius of \(b\), and immersion in a fluid of viscosity \(\eta\). This assumes \(b>>a\) and an unbounded space.
-
long_axis_rotation
(a, eta=1.14e-09)[source]¶ Drag coefficient for an ellipsoid rotating about the long axis
-
long_axis_translation
(a, eta=1.14e-09)[source]¶ Drag coefficient for an ellipsoid moving along long axis
-
-
class
-
flins.support.diffuse.
Dx
(f_drag)[source]¶ How far do we move because of diffusion subject to drag? From the Einstein-Smoluchowski relation via Berg_1983 we know that the diffusion coefficient for a particle subject to a viscous drag, \(f\) (in \(g/s\)) is \(D=kT/f\). Further, from the same source and Howard_2001 we know the drag on cylinders, ellipsoids, and spheres and calculate them above for reference.
We add a correction factor of 1/3.2 to account for the difference in diffusion between water and eukaryotic cytoplasm (Swaminathan_1997).
An alternate treatment would be to use the Stoke’s radius for all molecules, approximating them as spheres. There is an argument that anything beyond the spherical approximation is false precision.
-
flins.support.diffuse.
coerce_to_bounds
(mol_start, mol_end, boundaries)[source]¶ When a molecule has diffused out of bounds, coerce it back into bounds
A choice is made here to reflect the molecule back into bounds rather than stopping it dead at the boundary. This is to prevent the boundaries of the system from acting as absorbing ends that will tend to build up diffusing proteins over time.
- Parameters
mol_start (float) – X location of the right side of the protein
mol_end (float) – X location of left side of the protein
boundaries (tuple) – Upper and lower bounds of the 1D space the molecule is diffusing within
flins.support.kinetics module¶
Transitions are always hard.
Help us decide when we change from one state to another.
-
flins.support.kinetics.
rate_to_prob
(rate, obs_duration)[source]¶ Convert a rate to a probability, based on an observation duration length and the assumption that the rate is for a Poisson process. We are asking, what is the probability that at least one Poisson distributed value would occur during the timestep.
- Parameters
rate (float) – a per ms rate to convert to probability
obs_duration (float) – how many seconds we are watching over
- Returns
probability – probability the event occurs during the ms we watched
- Return type
float
-
flins.support.kinetics.
reverse_rate
(rate_12, free_energy_1, free_energy_2)[source]¶ What is the balanced reverse rate from state 2 to state 1?
- Parameters
rate_12 (float) – transition rate from state 1 to state 2
free_energy_1 (float) – free energy in state 1, state we are querying reversing into
free_energy_2 (float) – free energy in state 2, state we are currently in
- Returns
rate – per ms rate of transitioning from state 1 back to state 2
- Return type
float
flins.support.names module¶
Ged thinks such things are important.
Proving a shorter unique name with which to reference objects in the world.
flins.support.spring module¶
Spring forward, an elastic helper
Provide a linear spring that can be subject to thermal forcing.
-
class
flins.support.spring.
Spring
(k, rest)[source]¶ Bases:
object
A generic one-state spring
Give me a spring
The spring can be extensional or torsional, the module works in both cases.
- Parameters
k (float) – Spring constant in pN per nm
rest (float) – Rest angle or length of spring in radians or nm
-
bop_dx
()[source]¶ Bop for a displacement from rest length Assume an exponential energy distribution.
-
bop_length
()[source]¶ Bop for a new spring length that differs from rest value by dx Assume an exponential energy distribution.
-
energy
(length)[source]¶ Given a current length/angle, return stored energy
- Parameters
length (float) – a spring length or angle in radians or nm
- Returns
the energy required to achieve the given value
- Return type
energy
-
force
(length)[source]¶ Given a current length/angle, return the force/torque.
This is given signs as though the spring is attached at origin and we are looking at the force needed to hold the spring in place.
- Parameters
length (float) – a spring length or angle in radians or nm
- Returns
force exerted by the spring at current length/angle
- Return type
force
-
property
k
¶
flins.support.units module¶
To protect constants and serve unit conversions
Gather all the parameters that define the units in our universe, and the particular section of it we are interested in, into one spot.
-
class
flins.support.units.
constants
[source]¶ Bases:
object
Universal constants we don’t expect to change across runs
-
avogadro
= 6.0219999999999996e+23¶
-
boltzmann
= 0.013799999999999998¶
-
eta
= 1.14e-09¶
-
kT
= 3.9743999999999993¶
-
temperature
= 288¶
-
-
class
flins.support.units.
world
[source]¶ Bases:
object
Things that are constant for our (simulated) world
timestep is the number of ms we advance each tick
D_cyto_corr comes from the difference in diffusion between water and eukaryotic cytoplasm (Swaminathan_1997).
-
D_cyto_corr
= 3.2¶
-
timestep
= 0.001¶