booldog

booldog: A Python package for analyses of Boolean and semi-quantitative Boolean networks

Submodules

Attributes

__version__

logger

Classes

BoolDogModel

A class to represent a Boolean network.

BooleanStateSpace

Class to contain a subspace of a Boolean Network.

Functions

get_pkg_version()

Get version of booldog package

setup_logger([level])

Set up logger for BoolDog

Package Contents

booldog.get_pkg_version()

Get version of booldog package

Returns:

version – Version of booldog package

Return type:

str

booldog.setup_logger(level=logging.INFO)

Set up logger for BoolDog

class booldog.BoolDogModel(nodes=None, primes=None, modelinfo=None)

Bases: booldog.boolean.BooleanNetworkMixin, booldog.boolean.BooleanNetworkModificationMixin, booldog.continuous.ContinuousMixin, booldog.io.BoolDogModelIOFromMixin, booldog.io.BoolDogModelIOToMixin

A class to represent a Boolean network.

n

The number of nodes/variables in the network

Type:

int

primes

Prime implicants of the Boolean network. See PyBoolNet:prime implicants for more information.

Type:

dict

nodes

List of booldog.network.BoolDogNode objects representing the nodes

Type:

tuple of str

index

Dictionary of node name to integer index for indexing arrays

Type:

dict

nodes
_primes_cached = True
modifications = []
_set_node_ids_and_index()

Set the sorted node identifiers and index mapping to integers.

property n

Number of nodes in the network

property primes

Prime implicants of the Boolean network. See PyBoolNet:prime implicants <https://pyboolnet.readthedocs.io/en/latest/Manual.html #prime-implicants> for more information.

__repr__()
__len__()
class booldog.BooleanStateSpace(network, state_space)

Class to contain a subspace of a Boolean Network.

network
state_space
set_node_state(node_id, state)

Set the state of a node in all states of the state space.

Parameters:
  • node_id (str) – The identifier of the node to set the state for.

  • state (int) – The state to set for the node (0 or 1).

Raises:

ValueError – If node_id is not a valid node identifier in the network, or if state is not 0 or 1.

plot_state_space(title='State Heatmap', cmap=None)

Plot the states of the Boolean network as a heatmap.

Parameters:
  • title (str, optional) – Title of the heatmap, default is “State Heatmap”.

  • cmap (ListedColormap, optional) – Colormap to use for the heatmap. Default is binary with green (1) and grey (0).

__repr__()
booldog.__version__
booldog.logger