cytocalc.csmsimulation module

class cytocalc.csmsimulation.CSMSimulation[source]

Bases: object

Contains a set of CSMFrames that form a simulation. Also contains the simulation parameters.

add_frame(csmframe)[source]

Adds a CSMFrame to the simulation at the correct time (frame1.time < frame2.time)

bound_couple_vs_time(start_frame: int = 0, end_frame: int = -1)[source]

Get the number of bound hands as a function of time

Parameters:
  • start_frame – int, frame number for starting calculation, defaults to the first frame

  • end_frame – int, frame at which calculation ends, defaults to the last (-1) frame

Returns:

dict, with time as key and corresponding bound crosslinker count `s value

compute_msd(start_frame: int = 0, end_frame: int = -1)[source]

Compute Mean Squared Displacement (direct) of objects.

Parameters:
  • start_frame – int, frame number for starting MSD calculation, defaults to the first frame

  • end_frame – int, frame at which MSD calculation ends, defaults to the last (-1) frame

Returns:

dict, with time difference as key and corresponding MSD as value

compute_time_avg_msd(start_frame: int = 0, end_frame: int = -1, box_size: List[float] = [])[source]

Computes a ‘time averaged MSD’ i.e using all distinct displacements to extract more data. See [1] for futher details

[1] https://en.wikipedia.org/wiki/Mean_squared_displacement#Definition_of_MSD_for_time_lags

Parameters:
  • start_frame – int, frame number for starting MSD calculation, defaults to the first frame

  • end_frame – int, frame at which MSD calculation ends, defaults to the last (-1) frame

  • box_size – List[float], dimensions of box (assumes periodicty), ignore if non-periodic

Returns:

dict, with time difference as key and corresponding MSD as value

contraction_rate(start_frame=None, end_frame=None, r_sq=0.9)[source]

Obtain the contraction rate (rate of decrease in radius of network) between start_frame and end_frame

get_np_object(start_frame='0', end_frame=None)[source]

Constructs a numpy object from csm frame data of shape (n_frames,n_particles,3)