BNMPy.PBN

class BNMPy.PBN.ProbabilisticBN(numberOfNodes, linkages, numberOfFunctions, functions, probabilities, initialNodeValues, outputFilePath='', nodeDict=None)[source]

Methods

buildK()

This rebuilds the K array and related attributes.

copy()

Create a deep copy of the PBN.

knockdown(key, value[, efficacy])

Sets a specific node with partial efficacy for experimental perturbation.

knockout(key, value)

Sets a specific node to be permanently fixed to a given value.

setInitialValue(key, value)

Sets a particular node to a given initial value, where the key is indexed in nodeDict.

setInitialValues(initialNodeValues)

Sets the initial values of the probabilistic boolean network.

undoKnockouts()

Undoes all knockouts and knockdowns.

update([iterations])

Update the network directly.

update_cumulative_probabilities()

Update cumulative probabilities for each node's functions.

update_noise(p[, iterations])

Update the network with noise parameter p over a given number of iterations.

update_one()

Asynchronous update: Update one random non-constant node for one step.

getBias

getMaxConnectivity

getMeanConnectivity

getRealization

getTrajectory

initializeOutput

stateToWrite

writeNetworkHistory

buildK()[source]

This rebuilds the K array and related attributes.

copy() ProbabilisticBN[source]

Create a deep copy of the PBN. Required for optimization to avoid modifying original network.

getBias()[source]
getMaxConnectivity()[source]
getMeanConnectivity()[source]
getRealization()[source]
getTrajectory()[source]
initializeOutput()[source]
knockdown(key, value, efficacy=1.0)[source]

Sets a specific node with partial efficacy for experimental perturbation. E.g., when using a drug to inhibit a gene, the efficacy is the probability of the drug being effective.

knockout(key, value)[source]

Sets a specific node to be permanently fixed to a given value.

setInitialValue(key, value)[source]

Sets a particular node to a given initial value, where the key is indexed in nodeDict.

setInitialValues(initialNodeValues)[source]

Sets the initial values of the probabilistic boolean network.

stateToWrite()[source]
undoKnockouts()[source]

Undoes all knockouts and knockdowns. Does not change initial values, however.

update(iterations=1)[source]

Update the network directly. Select a function for each node based on its probability distribution. Then, update the network state based on the selected function.

update_cumulative_probabilities()[source]

Update cumulative probabilities for each node’s functions. This is used for efficient function selection during simulation.

update_noise(p, iterations=1)[source]

Update the network with noise parameter p over a given number of iterations.

This method simulates the network’s evolution over time with added noise. Noise randomly flips node states with probability p after normal network update, but is never applied to constant nodes (knockouts).

update_one()[source]

Asynchronous update: Update one random non-constant node for one step.

This method randomly selects one non-constant node and updates only that node based on its Boolean function, while keeping all other nodes unchanged. This simulates asynchronous dynamics where nodes update at different times.

writeNetworkHistory()[source]