pub struct SDC {Show 15 fields
pub strand_names: Vec<String>,
pub glue_names: Vec<String>,
pub quencher_id: Option<Tile>,
pub quencher_concentration: Molar,
pub reporter_id: Option<Tile>,
pub fluorophore_concentration: Molar,
pub scaffold: Array1<Glue>,
pub strand_concentration: Array1<Molar>,
pub scaffold_concentration: Molar,
pub strand_glues: Array2<Glue>,
pub colors: Vec<[u8; 4]>,
pub kf: PerMolarSecond,
pub friends_btm: Vec<Vec<Tile>>,
pub delta_g_matrix: Array2<KcalPerMol>,
pub entropy_matrix: Array2<KcalPerMolKelvin>,
/* private fields */
}Fields§
§strand_names: Vec<String>§glue_names: Vec<String>§quencher_id: Option<Tile>Identifies the strand that serves as a binding site for the quencher
quencher_concentration: MolarConcentration of the quencher
reporter_id: Option<Tile>Name of the reporter tile
fluorophore_concentration: MolarConcentration of the fluorophore,
scaffold: Array1<Glue>Glues on the scaffold. We only allow a single 1D scaffold here, which is repeated over the i-axis.
strand_concentration: Array1<Molar>All strands in the system, they are represented by tiles with only glue on the south, west, and east (nothing can stick to the top of a strand)
scaffold_concentration: MolarThe concentration of the scaffold
strand_glues: Array2<Glue>Glues of a given strand by id
Note that the glues will be sorted in the following manner: [ (0) – [left glue, bottom glue, right glue] … (n) – [left glue, bottom glue, right glue] ]
colors: Vec<[u8; 4]>Each strand will be given a color so that it can be easily identified when illustrated
kf: PerMolarSecondThe (de)attachment rates will depend on this constant(for the system) value
friends_btm: Vec<Vec<Tile>>Set of tiles that can stick to scaffold gap with a given glue
delta_g_matrix: Array2<KcalPerMol>Delta G at 37 degrees C in the formula to generate the glue strengths
entropy_matrix: Array2<KcalPerMolKelvin>S in the formula to generate the glue strengths
Implementations§
Source§impl SDC
impl SDC
Sourcepub fn change_temperature_to(&mut self, temperature: impl Into<Kelvin>)
pub fn change_temperature_to(&mut self, temperature: impl Into<Kelvin>)
Update the systems temperature. Accepts either Celsius or Kelvin as input.
pub fn n_scaffolds<S: State>(&self, state: &S) -> usize
pub fn total_tile_count<S: State>(&self, state: &S, tile: Tile) -> usize
Sourcepub fn fill_energy_array(&mut self)
pub fn fill_energy_array(&mut self)
Fill the energy_bonds array
pub fn monomer_detachment_rate_at_point<S: State>( &self, state: &S, scaffold_point: PointSafe2, ) -> PerSecond
pub fn monomer_change_rate_at_point<S: State>( &self, state: &S, scaffold_point: PointSafe2, ) -> PerSecond
pub fn choose_monomer_change_at_point<S: State>( &self, state: &S, point: PointSafe2, acc: PerSecond, ) -> (bool, PerSecond, Event, f64)
pub fn choose_monomer_attachment_at_point<S: State>( &self, state: &S, point: PointSafe2, acc: PerSecond, ) -> (bool, PerSecond, Event, f64)
pub fn choose_monomer_detachment_at_point<S: State>( &self, state: &S, point: PointSafe2, acc: PerSecond, ) -> (bool, PerSecond, Event, f64)
pub fn system_states(&self) -> Vec<Vec<u32>>
pub fn boltzman_function(&self, attachments: &[u32]) -> f64
pub fn partition_function_full(&self) -> f64
Sourcepub fn partition_function(&self) -> BigFloat
pub fn partition_function(&self) -> BigFloat
Notes:
- This only works for a single scaffold type.
Sourcepub fn partial_partition_function(
&self,
constrain_at_loc: Vec<Vec<Tile>>,
) -> BigFloat
pub fn partial_partition_function( &self, constrain_at_loc: Vec<Vec<Tile>>, ) -> BigFloat
This calculates a partial partition for the system. At each location, it takes a Vec. If the Vec is empty, then no constraints are applied. If the Vec is not empty, then the partition function is only calculated for the tiles in the Vec. 0 corresponds to the site being empty.
pub fn log_partition_function(&self) -> f64
pub fn log_partial_partition_function( &self, constrain_at_loc: Vec<Vec<Tile>>, ) -> f64
pub fn probability_of_constrained_configurations( &self, constrain_at_loc: Vec<Vec<Tile>>, ) -> f64
pub fn probability_of_state(&self, system: &[u32]) -> f64
Source§impl SDC
impl SDC
Sourcepub fn mfe_configuration(&self) -> (Vec<Tile>, f64)
pub fn mfe_configuration(&self) -> (Vec<Tile>, f64)
Get the mfe configuration, as well as its energy
Source§impl SDC
impl SDC
Sourcepub fn py_evolve<'py>(
&mut self,
state: PyStateOrStates<'py>,
for_events: Option<u64>,
total_events: Option<u64>,
for_time: Option<f64>,
total_time: Option<f64>,
size_min: Option<u32>,
size_max: Option<u32>,
for_wall_time: Option<f64>,
require_strong_bound: bool,
show_window: bool,
start_window_paused: bool,
parallel: bool,
initial_timescale: Option<f64>,
initial_max_events_per_sec: Option<u64>,
py: Python<'py>,
) -> PyResult<Py<PyAny>>
pub fn py_evolve<'py>( &mut self, state: PyStateOrStates<'py>, for_events: Option<u64>, total_events: Option<u64>, for_time: Option<f64>, total_time: Option<f64>, size_min: Option<u32>, size_max: Option<u32>, for_wall_time: Option<f64>, require_strong_bound: bool, show_window: bool, start_window_paused: bool, parallel: bool, initial_timescale: Option<f64>, initial_max_events_per_sec: Option<u64>, py: Python<'py>, ) -> PyResult<Py<PyAny>>
Evolve a state (or states), with some bounds on the simulation.
If evolving multiple states, the bounds are applied per-state.
§Parameters
state : State or Sequence[State] The state or states to evolve. for_events : int, optional Stop evolving each state after this many events. total_events : int, optional Stop evelving each state when the state’s total number of events (including previous events) reaches this. for_time : float, optional Stop evolving each state after this many seconds of simulated time. total_time : float, optional Stop evolving each state when the state’s total time (including previous steps) reaches this. size_min : int, optional Stop evolving each state when the state’s number of tiles is less than or equal to this. size_max : int, optional Stop evolving each state when the state’s number of tiles is greater than or equal to this. for_wall_time : float, optional Stop evolving each state after this many seconds of wall time. require_strong_bound : bool Require that the stopping conditions are strong, i.e., they are guaranteed to be eventually satisfied under normal conditions. show_window : bool Show a graphical UI window while evolving (requires rgrow-gui to be installed, and a single state). start_window_paused : bool If show_window is True, start the GUI window in a paused state. Defaults to True. parallel : bool Use multiple threads. initial_timescale : float, optional If show_window is True, set the initial timescale (sim_time/real_time) in the GUI. None means unlimited. initial_max_events_per_sec : int, optional If show_window is True, set the initial max events per second limit in the GUI. None means unlimited.
§Returns
EvolveOutcome or ListEvolveOutcome The outcome (stopping condition) of the evolution. If evolving a single state, returns a single outcome.
pub fn print_debug(&self)
Sourcepub fn write_json(&self, filename: &str) -> Result<(), RgrowError>
pub fn write_json(&self, filename: &str) -> Result<(), RgrowError>
Sourcepub fn read_json(filename: &str) -> Result<Self, RgrowError>
pub fn read_json(filename: &str) -> Result<Self, RgrowError>
Sourcepub fn py_place_tile(
&self,
state: &mut PyState,
point: (usize, usize),
tile: u32,
replace: bool,
) -> Result<f64, RgrowError>
pub fn py_place_tile( &self, state: &mut PyState, point: (usize, usize), tile: u32, replace: bool, ) -> Result<f64, RgrowError>
Place a tile at a point in the given state.
This updates tile counts and rates but does not increment the event counter or record events in the state tracker.
§Parameters
state : PyState The state to modify. point : tuple of int The coordinates at which to place the tile (i, j). tile : int The tile number to place. replace : bool, optional If True (default), any existing tile at the target site is removed first. If False, raises an error if the site is occupied.
§Returns
float The energy change from placing the tile.
pub fn py_find_first_critical_state( &mut self, end_state: &PyState, config: CriticalStateConfig, py: Python<'_>, ) -> PyResult<Option<CriticalStateResult>>
pub fn py_find_last_critical_state( &mut self, end_state: &PyState, config: CriticalStateConfig, py: Python<'_>, ) -> PyResult<Option<CriticalStateResult>>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SDC
impl<'de> Deserialize<'de> for SDC
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<SDC> for SystemEnum
impl From<SDC> for SystemEnum
Source§fn from(v: SDC) -> SystemEnum
fn from(v: SDC) -> SystemEnum
Source§impl<'py> IntoPyObject<'py> for SDC
impl<'py> IntoPyObject<'py> for SDC
Source§type Output = Bound<'py, <SDC as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <SDC as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClassBaseType for SDC
impl PyClassBaseType for SDC
type LayoutAsBase = PyClassObject<SDC>
type BaseNativeType = <SDC as PyClassImpl>::BaseNativeType
type Initializer = PyClassInitializer<SDC>
type PyClassMutability = <SDC as PyClassImpl>::PyClassMutability
Source§impl PyClassImpl for SDC
impl PyClassImpl for SDC
Source§const IS_BASETYPE: bool = true
const IS_BASETYPE: bool = true
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = c"\x00"
const RAW_DOC: &'static CStr = c"\x00"
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<SDC>
type ThreadChecker = SendablePyClass<SDC>
type Inventory = Pyo3MethodsInventoryForSDC
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyTypeInfo for SDC
impl PyTypeInfo for SDC
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Source§impl System for SDC
impl System for SDC
fn update_after_event<St: State>(&self, state: &mut St, event: &Event)
Source§fn perform_event<St: State>(&self, state: &mut St, event: &Event) -> f64
fn perform_event<St: State>(&self, state: &mut St, event: &Event) -> f64
Source§fn event_rate_at_point<St: State>(
&self,
state: &St,
p: PointSafeHere,
) -> PerSecond
fn event_rate_at_point<St: State>( &self, state: &St, p: PointSafeHere, ) -> PerSecond
choose_event_at_point.Source§fn choose_event_at_point<St: State>(
&self,
state: &St,
point: PointSafe2,
acc: PerSecond,
) -> (Event, f64)
fn choose_event_at_point<St: State>( &self, state: &St, point: PointSafe2, acc: PerSecond, ) -> (Event, f64)
acc (which should be less than the total rate at the point),
return the event that should take place, and the rate of that particular event.Source§fn seed_locs(&self) -> Vec<(PointSafe2, Tile)>
fn seed_locs(&self) -> Vec<(PointSafe2, Tile)>
Source§fn calc_mismatch_locations<St: State>(&self, state: &St) -> Array2<usize>
fn calc_mismatch_locations<St: State>(&self, state: &St) -> Array2<usize>
fn set_param( &mut self, name: &str, value: Box<dyn Any>, ) -> Result<NeededUpdate, GrowError>
fn get_param(&self, name: &str) -> Result<Box<dyn Any>, GrowError>
fn list_parameters(&self) -> Vec<ParameterInfo>
fn system_info(&self) -> String
fn new_state<St: StateWithCreate + State>( &self, params: St::Params, ) -> Result<St, GrowError>
fn calc_n_tiles<St: State>(&self, state: &St) -> NumTiles
fn take_single_step<St: State>( &self, state: &mut St, max_time_step: Second, ) -> StepOutcome
fn evolve<St: State>( &self, state: &mut St, bounds: EvolveBounds, ) -> Result<EvolveOutcome, GrowError>
fn evolve_states<St: State>( &mut self, states: &mut [St], bounds: EvolveBounds, ) -> Vec<Result<EvolveOutcome, GrowError>>
fn set_point<St: State>( &self, state: &mut St, point: Point, tile: Tile, ) -> Result<&Self, GrowError>
fn set_safe_point<St: State>( &self, state: &mut St, point: PointSafe2, tile: Tile, ) -> &Self
fn set_points<St: State>( &self, state: &mut St, changelist: &[(Point, Tile)], ) -> &Self
fn set_safe_points<St: State>( &self, state: &mut St, changelist: &[(PointSafe2, Tile)], ) -> &Self
Source§fn place_tile<St: State>(
&self,
state: &mut St,
point: PointSafe2,
tile: Tile,
replace: bool,
) -> Result<f64, GrowError>
fn place_tile<St: State>( &self, state: &mut St, point: PointSafe2, tile: Tile, replace: bool, ) -> Result<f64, GrowError>
fn configure_empty_state<St: State>( &self, state: &mut St, ) -> Result<(), GrowError>
fn calc_mismatches<St: State>(&self, state: &St) -> usize
fn update_points<St: State>(&self, state: &mut St, points: &[PointSafeHere])
fn update_state<St: State>(&self, state: &mut St, needed: &NeededUpdate)
fn extract_model_name(info: &str) -> String
fn evolve_in_window<St: State>( &mut self, state: &mut St, block: Option<usize>, start_paused: bool, bounds: EvolveBounds, initial_timescale: Option<f64>, initial_max_events_per_sec: Option<u64>, ) -> Result<EvolveOutcome, RgrowError>
Source§fn calc_dimers(&self) -> Result<Vec<DimerInfo>, GrowError>
fn calc_dimers(&self) -> Result<Vec<DimerInfo>, GrowError>
fn clone_state<St: StateWithCreate>(&self, initial_state: &St) -> St
fn clone_state_into_state<St: StateWithCreate>( &self, initial_state: &St, target: &mut St, )
fn clone_state_into_empty_state<St: StateWithCreate>( &self, initial_state: &St, target: &mut St, )
Source§impl TileBondInfo for SDC
impl TileBondInfo for SDC
fn tile_colors(&self) -> &Vec<[u8; 4]>
fn tile_names(&self) -> &[String]
fn bond_names(&self) -> &[String]
fn tile_color(&self, tile_number: Tile) -> [u8; 4]
fn tile_name(&self, tile_number: Tile) -> &str
fn bond_name(&self, bond_number: usize) -> &str
Source§fn tile_style(&self, tile_number: Tile) -> TileStyle
fn tile_style(&self, tile_number: Tile) -> TileStyle
Source§fn tile_pixels(&self, tile_number: Tile, size: usize) -> SpriteSquare
fn tile_pixels(&self, tile_number: Tile, size: usize) -> SpriteSquare
Source§fn tile_blocker_mask(&self, _tile_number: Tile) -> u8
fn tile_blocker_mask(&self, _tile_number: Tile) -> u8
Source§impl TryInto<SDC> for SystemEnum
impl TryInto<SDC> for SystemEnum
impl DerefToPyAny for SDC
impl ExtractPyClassWithClone for SDC
Auto Trait Implementations§
impl Freeze for SDC
impl RefUnwindSafe for SDC
impl Send for SDC
impl Sync for SDC
impl Unpin for SDC
impl UnsafeUnpin for SDC
impl UnwindSafe for SDC
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> DynSystem for S
impl<S> DynSystem for S
Source§fn evolve(
&self,
state: &mut StateEnum,
bounds: EvolveBounds,
) -> Result<EvolveOutcome, GrowError>
fn evolve( &self, state: &mut StateEnum, bounds: EvolveBounds, ) -> Result<EvolveOutcome, GrowError>
Source§fn evolve_states(
&mut self,
states: &mut [&mut StateEnum],
bounds: EvolveBounds,
) -> Vec<Result<EvolveOutcome, GrowError>>
fn evolve_states( &mut self, states: &mut [&mut StateEnum], bounds: EvolveBounds, ) -> Vec<Result<EvolveOutcome, GrowError>>
fn setup_state(&self, state: &mut StateEnum) -> Result<(), GrowError>
fn evolve_in_window( &mut self, state: &mut StateEnum, block: Option<usize>, start_paused: bool, bounds: EvolveBounds, initial_timescale: Option<f64>, initial_max_events_per_sec: Option<u64>, ) -> Result<EvolveOutcome, RgrowError>
fn calc_mismatches(&self, state: &StateEnum) -> usize
fn calc_mismatch_locations( &self, state: &StateEnum, ) -> ArrayBase<OwnedRepr<usize>, Dim<[usize; 2]>>
fn set_param( &mut self, name: &str, value: Box<dyn Any>, ) -> Result<NeededUpdate, GrowError>
fn get_param(&self, name: &str) -> Result<Box<dyn Any>, GrowError>
fn update_state(&self, state: &mut StateEnum, needed: &NeededUpdate)
fn run_ffs(&mut self, config: &FFSRunConfig) -> Result<FFSRunResult, RgrowError>
fn system_info(&self) -> String
fn calc_committor( &mut self, initial_state: &StateEnum, cutoff_size: u32, max_time: Option<f64>, max_events: Option<u64>, num_trials: usize, ) -> Result<f64, GrowError>
fn calc_committor_adaptive( &self, initial_state: &StateEnum, cutoff_size: u32, max_time: Option<f64>, max_events: Option<u64>, conf_interval_margin: f64, ) -> Result<(f64, usize), GrowError>
fn calc_committors_adaptive( &self, initial_states: &[&StateEnum], cutoff_size: u32, max_time: Option<f64>, max_events: Option<u64>, conf_interval_margin: f64, ) -> Result<(Vec<f64>, Vec<usize>), GrowError>
fn calc_forward_probability( &mut self, initial_state: &StateEnum, forward_step: u32, max_time: Option<f64>, max_events: Option<u64>, num_trials: usize, ) -> Result<f64, GrowError>
fn calc_forward_probability_adaptive( &self, initial_state: &StateEnum, forward_step: u32, max_time: Option<f64>, max_events: Option<u64>, conf_interval_margin: f64, ) -> Result<(f64, usize), GrowError>
fn calc_forward_probabilities_adaptive( &self, initial_states: &[&StateEnum], forward_step: u32, max_time: Option<f64>, max_events: Option<u64>, conf_interval_margin: f64, ) -> Result<(Vec<f64>, Vec<usize>), GrowError>
Source§fn calc_committor_threshold_test(
&mut self,
initial_state: &StateEnum,
cutoff_size: u32,
threshold: f64,
z_level: f64,
max_time: Option<f64>,
max_events: Option<u64>,
max_trials: Option<usize>,
return_on_max_trials: bool,
) -> Result<(bool, f64, usize, bool), GrowError>
fn calc_committor_threshold_test( &mut self, initial_state: &StateEnum, cutoff_size: u32, threshold: f64, z_level: f64, max_time: Option<f64>, max_events: Option<u64>, max_trials: Option<usize>, return_on_max_trials: bool, ) -> Result<(bool, f64, usize, bool), GrowError>
fn find_first_critical_state( &mut self, end_state: &StateEnum, config: &CriticalStateConfig, ) -> Result<Option<CriticalStateResult>, GrowError>
fn find_last_critical_state( &mut self, end_state: &StateEnum, config: &CriticalStateConfig, ) -> Result<Option<CriticalStateResult>, GrowError>
Source§impl<'a, 'py, T> FromPyObject<'a, 'py> for T
impl<'a, 'py, T> FromPyObject<'a, 'py> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.