Forward Flux Sampling¶
FFSRunConfig¶
rgrow.FFSRunConfig
¶
Configuration options for Forward Flux Sampling (FFS) simulations.
__doc__ = 'Configuration options for Forward Flux Sampling (FFS) simulations.'
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__module__ = 'rgrow.rgrow'
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
canvas_size
property
¶
Canvas dimensions (width, height) for the simulation.
Defines the size of the 2D lattice on which tile assembly occurs. Must be large enough to accommodate the largest expected structures.
canvas_type
property
¶
Type of boundary conditions for the simulation canvas.
Determines how the edges of the canvas are handled: - Periodic: opposite edges are connected (torus topology) - Square: finite canvas with hard boundaries - Tube: periodic in one dimension, finite in the other
constant_variance
property
¶
Use constant-variance, variable-configurations-per-surface method.
When true, the number of configurations generated at each surface is determined dynamically to achieve a target variance of the forward probablity relative to the mean squared (var_per_mean2). When false, exactly max_configs configurations are generated at each surface.
cutoff_number
property
¶
Number of consecutive high-probability surfaces required for early cutoff.
FFS terminates early only after this many consecutive surfaces exceed cutoff_probability. Prevents premature termination due to statistical fluctuations. Only used when early_cutoff is true.
cutoff_probability
property
¶
Success probability threshold for early cutoff.
If early_cutoff is true and the success probability exceeds this value for cutoff_number consecutive surfaces, FFS terminates early.
early_cutoff
property
¶
Enable early termination when success probabilities become very high.
When true, FFS will terminate early if the success probability exceeds cutoff_probability for cutoff_number consecutive surfaces, provided the structure size is at least min_cutoff_size.
init_bound
property
¶
Evolution bounds for the initial dimer-to-n-mer surface, to avoid infinite simulations.
keep_configs
property
¶
Configuration data retention mode for each surface.
Controls what data is retained during FFS simulation: - ConfigRetentionMode.None: No configuration data retained (minimal memory) - ConfigRetentionMode.DataFrameOnly: Only dataframe-compatible data retained (default) - ConfigRetentionMode.Full: Full state objects retained (maximum memory, allows full access)
For backward compatibility, bool values are also accepted: - False -> ConfigRetentionMode.None - True -> ConfigRetentionMode.Full
max_configs
property
¶
Maximum number of configurations to generate at each surface level.
When constant_variance is false, exactly this many configurations are generated. When constant_variance is true, this serves as an upper limit to prevent excessive computation when success probabilities are very low.
min_configs
property
¶
Minimum number of configurations to generate at each surface level.
Ensures a minimum sample size even when constant_variance is true and the target variance is achieved with fewer configurations.
min_cutoff_size
property
¶
Minimum structure size required before early cutoff can occur.
Prevents early termination when structures are still small, even if success probabilities are high. Ensures the simulation reaches a meaningful size before terminating. Only used when early_cutoff is true.
min_nuc_rate
property
¶
Minimum nucleation rate threshold for early termination.
If specified, FFS terminates early when the calculated nucleation rate falls below this threshold. Useful for avoiding excessive computation when nucleation rates become negligibly small. Units: M/s.
size_step
property
¶
Size increment between consecutive FFS surfaces.
The number of tiles by which the target size increases between consecutive surfaces.
start_size
property
¶
Initial cluster size for the first FFS surface.
The size (number of tiles) that defines the first surface. Must be >=2.
store_ffs_config
property
¶
Whether to store the FFS configuration in the result.
When true, the complete FFSRunConfig is saved with the results.
store_system
property
¶
Whether to store the tile system in the result.
subseq_bound
property
¶
Evolution bounds for subsequent surface-to-surface transitions, to avoid infinite simulations.
target_size
property
¶
Target structure size for FFS termination.
tracking
property
¶
Type of additional data tracking during simulation.
Controls what extra information is recorded during evolution: - None: no additional tracking (fastest, default) - Order: track attachment order of tiles - LastAttachTime: track when the tile at each location last attached - PrintEvent: print events as they occur (debugging) - Movie: record all events
var_per_mean2
property
¶
Target variance per mean squared for the constant-variance method.
Controls the statistical precision when constant_variance is true. Lower values require more configurations but provide better statistics. Typical values are 0.01 (1% variance) to 0.1 (10% variance). Only used when constant_variance is true.
__new__(*args, **kwargs)
builtin
¶
Create and return a new object. See help(type) for accurate signature.
FFSRunResult¶
rgrow.FFSRunResult
¶
__module__ = 'rgrow.rgrow'
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
dimerization_rate
property
¶
float: Dimerization rate, in M/s.
forward_vec
property
¶
list[float]: Forward probability vector.
nucleation_rate
property
¶
float: Nucleation rate, in M/s. Calculated from the forward probability vector, and dimerization rate.
previous_indices
property
¶
surfaces
property
¶
list[FFSLevelRef]: list of surfaces.
__repr__()
method descriptor
¶
Return repr(self).
__str__()
method descriptor
¶
Return str(self).
configs_dataframe()
method descriptor
¶
Returns:
| Type | Description |
|---|---|
DataFrame
|
|
into_resdf()
method descriptor
¶
Convert to FFSRunResultDF format.
states_to_polars()
method descriptor
¶
Returns:
| Type | Description |
|---|---|
DataFrame
|
|
surfaces_dataframe()
method descriptor
¶
Returns:
| Type | Description |
|---|---|
DataFrame
|
|
surfaces_to_polars()
method descriptor
¶
Returns:
| Type | Description |
|---|---|
DataFrame
|
|
write_files(prefix)
method descriptor
¶
Write dataframes and result data to files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prefix
|
str
|
Prefix for the filenames. The files will be named
|
required |
FFSLevelRef¶
rgrow.FFSLevelRef
¶
__module__ = 'rgrow.rgrow'
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
configs
property
¶
previous_indices
property
¶
states
property
¶
__repr__()
method descriptor
¶
Return repr(self).
get_state(i)
method descriptor
¶
Get a specific state from this surface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
i
|
int
|
Index of the state to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
FFSStateRef
|
The state at the given index. |
has_stored_states()
method descriptor
¶
Check if this surface has stored states.
Returns:
| Type | Description |
|---|---|
bool
|
True if states are stored, False otherwise. |
FFSStateRef¶
rgrow.rgrow.FFSStateRef
¶
__module__ = 'rgrow.rgrow'
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
canvas_view
property
¶
NDArray[np.uint]: a direct, mutable view of the state's canvas. This is potentially unsafe.
n_tiles
property
¶
int: the number of tiles in the state.
time
property
¶
float: the total time the state has simulated, in seconds.
total_events
property
¶
int: the total number of events that have occurred in the state.
total_rate
property
¶
float: the total rate of possible next events for the state.
__repr__()
method descriptor
¶
Return repr(self).
canvas_copy()
method descriptor
¶
Create a copy of the state's canvas. This is safe, but can't be modified and is slower than
canvas_view.
Returns:
| Type | Description |
|---|---|
NDArray[uint]
|
a copy of the state's canvas. |
clone_state()
method descriptor
¶
Return a copy of the state behind the reference as a mutable State object.
Returns:
| Type | Description |
|---|---|
State
|
|
rate_array()
method descriptor
¶
Return a cloned copy of an array with the total possible next event rate for each point in the canvas. This is the deepest level of the quadtree for tree-based states.
Returns:
| Type | Description |
|---|---|
NDArray[uint]
|
|
tracking_copy()
method descriptor
¶
Return a copy of the tracker's tracking data.
Returns:
| Type | Description |
|---|---|
Any
|
|