simulation.readdy.post_processor

Class for post processing ReaDDy trajectories.

Module Attributes

ACTIN_START_PARTICLE_PHRASE

Phrases indicating actin start particle.

ACTIN_PARTICLE_TYPES

Actin particle types from simularium/readdy-models.

IDEAL_ACTIN_POSITIONS

Ideal actin positions measured from crystal structure.

IDEAL_ACTIN_VECTOR_TO_AXIS

Ideal actin vector to axis.

Classes

ReaddyPostProcessor

Get views of ReaDDy trajectory for different analysis purposes.

ACTIN_START_PARTICLE_PHRASE: list[str] = ['pointed']

Phrases indicating actin start particle.

ACTIN_PARTICLE_TYPES: list[str] = ['actin#', 'actin#ATP_', 'actin#mid_', 'actin#mid_ATP_', 'actin#fixed_', 'actin#fixed_ATP_', 'actin#mid_fixed_', 'actin#mid_fixed_ATP_', 'actin#barbed_', 'actin#barbed_ATP_', 'actin#fixed_barbed_', 'actin#fixed_barbed_ATP_']

Actin particle types from simularium/readdy-models.

IDEAL_ACTIN_POSITIONS: ndarray = array([[24.738, 20.881, 26.671],        [27.609, 24.061, 27.598],        [30.382, 21.19 , 25.725]])

Ideal actin positions measured from crystal structure.

IDEAL_ACTIN_VECTOR_TO_AXIS: ndarray = array([-0.01056751, -1.47785105, -0.65833209])

Ideal actin vector to axis.

class ReaddyPostProcessor[source]

Get views of ReaDDy trajectory for different analysis purposes.

__init__(trajectory: list[FrameData], box_size: ndarray, periodic_boundary: bool = False)[source]
trajectory: list[FrameData]

ReaDDy data trajectory from ReaddyLoader(h5_file_path).trajectory().

box_size: ndarray

The size of the x,y,z dimensions of the simulation volume (shape = 3).

periodic_boundary: bool

True if simulation had periodic boundary, False otherwise.

times() ndarray[source]

Get simulation time at each timestep.

Returns:

Array of time stamps in simulation time for each timestep (shape = n_timesteps).

Return type:

times

rotate_positions(positions: ndarray, rotation: ndarray) ndarray[source]

Rotate an x,y,z position (or an array of them) around the x-axis with the given rotation matrix.

align_trajectory(fiber_points: list[list[ndarray]]) tuple[ndarray, list[list[ndarray]]][source]

Align the positions of particles in the trajectory so that the furthest point from the x-axis is aligned with the positive y-axis at the last time point.

Parameters:
  • fiber_points – How many numbers are used to represent the relative identity of particles in the chain?

  • start_particle_phrases – List of phrases in particle type names for the first particles in the linear chain.

  • other_particle_types – List of particle type names (without polymer numbers at the end) for the particles other than the start particles.

Returns:

  • positions – Array (shape = timesteps x 1 x n x 3) containing the x,y,z positions of actin monomer particles at each timestep.

  • fiber_points – List of lists of arrays (shape = n x 3) containing the x,y,z positions of control points for each fiber at each time.

linear_fiber_chain_ids(polymer_number_range: int, start_particle_phrases: list[str] = ['pointed'], other_particle_types: list[str] = ['actin#', 'actin#ATP_', 'actin#mid_', 'actin#mid_ATP_', 'actin#fixed_', 'actin#fixed_ATP_', 'actin#mid_fixed_', 'actin#mid_fixed_ATP_', 'actin#barbed_', 'actin#barbed_ATP_', 'actin#fixed_barbed_', 'actin#fixed_barbed_ATP_']) list[list[list[int]]][source]

Get particle IDs for particles in each linear fiber at each timestep.

Parameters:
  • polymer_number_range – How many numbers are used to represent the relative identity of particles in the chain?

  • start_particle_phrases – List of phrases in particle type names for the first particles in the linear chain.

  • other_particle_types – List of particle type names (without polymer numbers at the end) for the particles other than the start particles.

Returns:

List of lists of lists of the particle IDs for each particle for each fiber at each time.

linear_fiber_axis_positions(fiber_chain_ids: list[list[list[int]]], ideal_positions: ndarray = array([[24.738, 20.881, 26.671], [27.609, 24.061, 27.598], [30.382, 21.19, 25.725]]), ideal_vector_to_axis: ndarray = array([-0.01056751, -1.47785105, -0.65833209])) tuple[list[list[ndarray]], list[list[list[int]]]][source]

Get x,y,z axis positions for each particle in each linear fiber at each timestep.

Parameters:
  • fiber_chain_ids – List of list of lists of particle IDs for each particle in each fiber at each time.

  • ideal_positions – The x,y,z positions for 3 particles in an ideal chain (shape = 3 x 3).

  • ideal_vector_to_axis – Vector from the second ideal position to the axis of the fiber (shape = 3).

Returns:

  • axis_positions – Lists of lists of arrays (shape = n x 3) containing the x,y,z positions of the closest point on the fiber axis to the position of each particle in each fiber at each time.

  • new_chain_ids – List of lists of lists of particle IDs matching the axis_positions for each particle in each fiber at each time.

linear_fiber_normals(fiber_chain_ids: list[list[list[int]]], axis_positions: list[list[ndarray]], normal_length: float = 5) list[list[ndarray]][source]

Get x,y,z positions defining start and end points for normals for each particle in each fiber at each timestep.

Parameters:
  • fiber_chain_ids – List of lists of lists of particle IDs for particles in each fiber at each time.

  • axis_positions – List of lists of arrays (shape = n x 3) containing the x,y,z positions of the closest point on the fiber axis to the position of each particle in each fiber at each time.

  • normal_length – Length of the resulting normal vectors in the trajectory’s spatial units.

Returns:

List of lists of arrays (shape = 2 x 3) containing the x,y,z normals of each particle in each fiber at each time.

static linear_fiber_control_points(axis_positions: list[list[ndarray]], n_points: int) list[list[ndarray]][source]

Resample the fiber line defined by each array of axis positions to get the requested number of points between x,y,z control points for each linear fiber at each timestep.

Parameters:
  • axis_positions – List of lists of arrays (shape = n x 3) containing the x,y,z positions of the closest point on the fiber axis to the position of each particle in each fiber at each time.

  • n_points – Number of control points (spaced evenly) on resulting fibers.

Returns:

List of lists of arrays (shape = n x 3) containing the x,y,z positions of control points for each fiber at each time.

fiber_bond_energies(fiber_chain_ids: list[list[list[int]]], ideal_lengths: dict[int, float], ks: dict[int, float], stride: int = 1) tuple[dict[int, ndarray], ndarray][source]

Get the strain energy using the harmonic spring equation and the bond distance between particles with a given polymer number offset.

Parameters:
  • fiber_chain_ids – List of lists of lists of particle IDs for particles in each fiber at each time.

  • ideal_lengths – Ideal bond length for each of the polymer number offsets.

  • ks – Bond energy constant for each of the polymer number offsets.

  • stride – Calculate bond energy every stride timesteps.

Returns:

  • bond_energies – Map of polymer number offset to array (shape = time x bonds) of bond energy for each bond at each time.

  • filament_positions – Array (shape = time x bonds) of position in the filament from the starting end for the first particle in each bond at each time.

edge_positions() list[list[ndarray]][source]

Get the edges between particles as start and end positions.

Returns:

List of list of edges as position of each of the two connected particles for each edge at each time.