BNMPy.steady_state¶
- class BNMPy.steady_state.SteadyStateCalculator(network)[source]¶
Steady-state calculation for Boolean and Probabilistic Boolean Network Supports both Two-State Markov Chain (TSMC) and Monte Carlo methods Reference: pbnStationary_TS.m from optPBN (Trairatphisan et al. 2014)
Methods
compute_stationary_deterministic
([n_runs, ...])Find attractors (fixed points and cycles) in a synchronous Boolean network via random restarts.
compute_stationary_mc
([n_runs, n_steps, ...])Monte Carlo steady-state calculation, handle input nodes and constant nodes
compute_stationary_tsmc
([epsilon, r, s, ...])Two-State Markov Chain steady-state calculation In addition to the original function, handle input nodes and constant nodes
compute_steady_state
([method])steady-state calculation If BN, run deterministic steady-state calculation.
Get information about convergence properties
Reset network to original state
set_experimental_conditions
([stimuli, ...])Set experimental conditions for steady state calculation.
- compute_stationary_deterministic(n_runs: int = 100, n_steps: int = 1000, verbose: bool = True, seed: int | None = None) Dict[str, List[ndarray] | List[List[ndarray]]] [source]¶
Find attractors (fixed points and cycles) in a synchronous Boolean network via random restarts.
- Returns:
- {
“fixed_points”: [state_vec, …], # each np.ndarray (0/1) “cyclic_attractors” : [[state_vec1, state_vec2, …], # one list per cycle
…]
- }
- compute_stationary_mc(n_runs: int = 10, n_steps: int = 1000, p_noise: float = 0, analyze_convergence: bool = False, output_node: str | None = None, verbose: bool = False, seed: int | None = None) ndarray | Tuple[ndarray, Dict] [source]¶
Monte Carlo steady-state calculation, handle input nodes and constant nodes
- compute_stationary_tsmc(epsilon: float = 0.001, r: float = 0.025, s: float = 0.95, p_noise: float = 0, p_mir: float = 0.001, initial_nsteps: int = 100, max_iterations: int = 500, freeze_constant: bool = False, verbose: bool = False, seed: int | None = None) ndarray [source]¶
Two-State Markov Chain steady-state calculation In addition to the original function, handle input nodes and constant nodes
Ref: pbnStationary_TS.m Approach 1
- compute_steady_state(method: str = 'tsmc', **kwargs) ndarray [source]¶
steady-state calculation If BN, run deterministic steady-state calculation. If PBN, run Two-State Markov Chain or Monte Carlo.
- set_experimental_conditions(stimuli: List[str] | None = None, stimuli_efficacy: List[float] | None = None, inhibitors: List[str] | None = None, inhibitors_efficacy: List[float] | None = None, node_dict: Dict[str, int] | None = None)[source]¶
Set experimental conditions for steady state calculation. First sets all input nodes to 0 by default, then applies specified stimuli and inhibitors.