boolforge 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- boolforge-1.0.0/LICENSE +21 -0
- boolforge-1.0.0/PKG-INFO +215 -0
- boolforge-1.0.0/README.md +173 -0
- boolforge-1.0.0/boolforge/__init__.py +67 -0
- boolforge-1.0.0/boolforge/_version.py +1 -0
- boolforge-1.0.0/boolforge/bio_models.py +380 -0
- boolforge-1.0.0/boolforge/boolean_function.py +2073 -0
- boolforge-1.0.0/boolforge/boolean_network.py +4476 -0
- boolforge-1.0.0/boolforge/generate.py +2358 -0
- boolforge-1.0.0/boolforge/modularity.py +380 -0
- boolforge-1.0.0/boolforge/utils.py +514 -0
- boolforge-1.0.0/boolforge/wiring_diagram.py +1311 -0
- boolforge-1.0.0/boolforge.egg-info/PKG-INFO +215 -0
- boolforge-1.0.0/boolforge.egg-info/SOURCES.txt +17 -0
- boolforge-1.0.0/boolforge.egg-info/dependency_links.txt +1 -0
- boolforge-1.0.0/boolforge.egg-info/requires.txt +32 -0
- boolforge-1.0.0/boolforge.egg-info/top_level.txt +1 -0
- boolforge-1.0.0/pyproject.toml +60 -0
- boolforge-1.0.0/setup.cfg +4 -0
boolforge-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Claus Kadelka
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
boolforge-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: boolforge
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Methods to generate and analyze random Boolean functions and Boolean networks, with a focus on canalization.
|
|
5
|
+
Author-email: Claus Kadelka <ckadelka@iastate.edu>, Benjamin Coberly <ckadelka@iastate.edu>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://ckadelka.github.io/BoolForge/
|
|
8
|
+
Project-URL: Documentation, https://ckadelka.github.io/BoolForge/
|
|
9
|
+
Project-URL: Repository, https://github.com/ckadelka/BoolForge
|
|
10
|
+
Project-URL: Issues, https://github.com/ckadelka/BoolForge/issues
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: numpy
|
|
17
|
+
Requires-Dist: networkx
|
|
18
|
+
Requires-Dist: pandas
|
|
19
|
+
Provides-Extra: cana
|
|
20
|
+
Requires-Dist: cana; extra == "cana"
|
|
21
|
+
Provides-Extra: bio
|
|
22
|
+
Requires-Dist: requests; extra == "bio"
|
|
23
|
+
Provides-Extra: plot
|
|
24
|
+
Requires-Dist: matplotlib; extra == "plot"
|
|
25
|
+
Provides-Extra: speed
|
|
26
|
+
Requires-Dist: numba; extra == "speed"
|
|
27
|
+
Provides-Extra: symbolic
|
|
28
|
+
Requires-Dist: pyeda; extra == "symbolic"
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: jupytext; extra == "dev"
|
|
31
|
+
Requires-Dist: jupyterlab; extra == "dev"
|
|
32
|
+
Requires-Dist: cana; extra == "dev"
|
|
33
|
+
Requires-Dist: matplotlib; extra == "dev"
|
|
34
|
+
Requires-Dist: requests; extra == "dev"
|
|
35
|
+
Provides-Extra: all
|
|
36
|
+
Requires-Dist: cana; extra == "all"
|
|
37
|
+
Requires-Dist: requests; extra == "all"
|
|
38
|
+
Requires-Dist: matplotlib; extra == "all"
|
|
39
|
+
Requires-Dist: numba; extra == "all"
|
|
40
|
+
Requires-Dist: pyeda; extra == "all"
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
|
|
43
|
+
# BoolForge
|
|
44
|
+
|
|
45
|
+
**BoolForge** is a Python toolbox for generating, sampling, and analyzing
|
|
46
|
+
Boolean functions and Boolean networks, with a particular emphasis on
|
|
47
|
+
**canalization** and the uniform random generation of functions with prescribed structure.
|
|
48
|
+
|
|
49
|
+
While many existing tools focus on simulation and dynamical analysis,
|
|
50
|
+
BoolForge emphasizes **controlled generation and analysis**
|
|
51
|
+
of Boolean functions and networks, enabling systematic studies of
|
|
52
|
+
canalization, robustness, and ensemble properties.
|
|
53
|
+
|
|
54
|
+
The package provides tools for:
|
|
55
|
+
|
|
56
|
+
- random sampling of Boolean functions with prescribed canalizing structure,
|
|
57
|
+
- generation of Boolean networks with controlled update rules and wiring diagrams,
|
|
58
|
+
- analysis of canalization, activity, sensitivity, and related structural measures,
|
|
59
|
+
- interoperability with other Boolean network software and model formats.
|
|
60
|
+
|
|
61
|
+
BoolForge is designed for researchers working with regulatory networks,
|
|
62
|
+
discrete dynamical systems, and random Boolean network ensembles in
|
|
63
|
+
systems biology and network science.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
|
|
69
|
+
### Stable release (recommended)
|
|
70
|
+
|
|
71
|
+
Install the latest stable version from PyPI:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pip install boolforge
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
BoolForge requires **Python 3.10 or later**.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
### Development version
|
|
82
|
+
|
|
83
|
+
To install the latest development version directly from GitHub:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pip install git+https://github.com/ckadelka/BoolForge
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Optional dependencies (extended functionality)
|
|
92
|
+
|
|
93
|
+
BoolForge is fully usable with its core dependencies, but some features rely on
|
|
94
|
+
optional packages that can be installed via *extras*.
|
|
95
|
+
|
|
96
|
+
### Performance acceleration
|
|
97
|
+
|
|
98
|
+
Some internal routines are automatically accelerated if
|
|
99
|
+
[numba](https://numba.pydata.org/) is available.
|
|
100
|
+
|
|
101
|
+
To enable numba acceleration:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
pip install boolforge[speed]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
When numba is not installed, BoolForge transparently falls back to
|
|
108
|
+
pure-Python implementations.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
### Plotting and visualization
|
|
113
|
+
|
|
114
|
+
Plotting of wiring diagrams and network structure requires
|
|
115
|
+
[matplotlib](https://matplotlib.org/).
|
|
116
|
+
|
|
117
|
+
To enable plotting:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
pip install boolforge[plot]
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### CANA integration
|
|
126
|
+
|
|
127
|
+
Some methods interface with the
|
|
128
|
+
[CANA](https://github.com/CASCI-lab/CANA) package for advanced canalization
|
|
129
|
+
measures.
|
|
130
|
+
|
|
131
|
+
To enable CANA-based functionality:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
pip install boolforge[cana]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
### Symbolic logic and expression minimization
|
|
140
|
+
|
|
141
|
+
Symbolic representations and logical expression minimization rely on
|
|
142
|
+
[PyEDA](https://pyeda.readthedocs.io/).
|
|
143
|
+
|
|
144
|
+
To enable symbolic functionality:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
pip install boolforge[symbolic]
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
### Biological model retrieval
|
|
153
|
+
|
|
154
|
+
The retrival and loading of hundreds of published biological Boolean
|
|
155
|
+
network models relies on the
|
|
156
|
+
[requests](https://requests.readthedocs.io/en/latest/) package for web access.
|
|
157
|
+
|
|
158
|
+
To enable biological model retrieval:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
pip install boolforge[bio]
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
### All optional features
|
|
167
|
+
|
|
168
|
+
To install BoolForge with **all optional dependencies**:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
pip install boolforge[all]
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Compatibility and interoperability
|
|
177
|
+
|
|
178
|
+
BoolForge supports import and export of Boolean network representations used by
|
|
179
|
+
other software packages.
|
|
180
|
+
|
|
181
|
+
In particular, BoolForge supports the **BNet format** commonly used by
|
|
182
|
+
[pyboolnet](https://github.com/hklarner/pyboolnet), without requiring pyboolnet
|
|
183
|
+
itself to be installed.
|
|
184
|
+
|
|
185
|
+
BoolForge also supports conversion to and from the format used by
|
|
186
|
+
[CANA](https://github.com/CASCI-lab/CANA).
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Documentation
|
|
191
|
+
|
|
192
|
+
Full documentation, including tutorials and API reference, is available at:
|
|
193
|
+
|
|
194
|
+
https://ckadelka.github.io/BoolForge/
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Citation
|
|
199
|
+
|
|
200
|
+
If you use BoolForge in your research, please cite the accompanying
|
|
201
|
+
application note:
|
|
202
|
+
|
|
203
|
+
Kadelka, C., & Coberly, B. (2025).
|
|
204
|
+
*BoolForge: A Python toolbox for Boolean functions and Boolean networks*.
|
|
205
|
+
arXiv:2509.02496.
|
|
206
|
+
https://arxiv.org/abs/2509.02496
|
|
207
|
+
|
|
208
|
+
A machine-readable citation file (`CITATION.cff`) is included in the repository
|
|
209
|
+
and can be used directly by GitHub, Zenodo, and reference managers.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## License
|
|
214
|
+
|
|
215
|
+
BoolForge is released under the MIT License.
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# BoolForge
|
|
2
|
+
|
|
3
|
+
**BoolForge** is a Python toolbox for generating, sampling, and analyzing
|
|
4
|
+
Boolean functions and Boolean networks, with a particular emphasis on
|
|
5
|
+
**canalization** and the uniform random generation of functions with prescribed structure.
|
|
6
|
+
|
|
7
|
+
While many existing tools focus on simulation and dynamical analysis,
|
|
8
|
+
BoolForge emphasizes **controlled generation and analysis**
|
|
9
|
+
of Boolean functions and networks, enabling systematic studies of
|
|
10
|
+
canalization, robustness, and ensemble properties.
|
|
11
|
+
|
|
12
|
+
The package provides tools for:
|
|
13
|
+
|
|
14
|
+
- random sampling of Boolean functions with prescribed canalizing structure,
|
|
15
|
+
- generation of Boolean networks with controlled update rules and wiring diagrams,
|
|
16
|
+
- analysis of canalization, activity, sensitivity, and related structural measures,
|
|
17
|
+
- interoperability with other Boolean network software and model formats.
|
|
18
|
+
|
|
19
|
+
BoolForge is designed for researchers working with regulatory networks,
|
|
20
|
+
discrete dynamical systems, and random Boolean network ensembles in
|
|
21
|
+
systems biology and network science.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
### Stable release (recommended)
|
|
28
|
+
|
|
29
|
+
Install the latest stable version from PyPI:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install boolforge
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
BoolForge requires **Python 3.10 or later**.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
### Development version
|
|
40
|
+
|
|
41
|
+
To install the latest development version directly from GitHub:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install git+https://github.com/ckadelka/BoolForge
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Optional dependencies (extended functionality)
|
|
50
|
+
|
|
51
|
+
BoolForge is fully usable with its core dependencies, but some features rely on
|
|
52
|
+
optional packages that can be installed via *extras*.
|
|
53
|
+
|
|
54
|
+
### Performance acceleration
|
|
55
|
+
|
|
56
|
+
Some internal routines are automatically accelerated if
|
|
57
|
+
[numba](https://numba.pydata.org/) is available.
|
|
58
|
+
|
|
59
|
+
To enable numba acceleration:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install boolforge[speed]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
When numba is not installed, BoolForge transparently falls back to
|
|
66
|
+
pure-Python implementations.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
### Plotting and visualization
|
|
71
|
+
|
|
72
|
+
Plotting of wiring diagrams and network structure requires
|
|
73
|
+
[matplotlib](https://matplotlib.org/).
|
|
74
|
+
|
|
75
|
+
To enable plotting:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pip install boolforge[plot]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### CANA integration
|
|
84
|
+
|
|
85
|
+
Some methods interface with the
|
|
86
|
+
[CANA](https://github.com/CASCI-lab/CANA) package for advanced canalization
|
|
87
|
+
measures.
|
|
88
|
+
|
|
89
|
+
To enable CANA-based functionality:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pip install boolforge[cana]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### Symbolic logic and expression minimization
|
|
98
|
+
|
|
99
|
+
Symbolic representations and logical expression minimization rely on
|
|
100
|
+
[PyEDA](https://pyeda.readthedocs.io/).
|
|
101
|
+
|
|
102
|
+
To enable symbolic functionality:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pip install boolforge[symbolic]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### Biological model retrieval
|
|
111
|
+
|
|
112
|
+
The retrival and loading of hundreds of published biological Boolean
|
|
113
|
+
network models relies on the
|
|
114
|
+
[requests](https://requests.readthedocs.io/en/latest/) package for web access.
|
|
115
|
+
|
|
116
|
+
To enable biological model retrieval:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pip install boolforge[bio]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### All optional features
|
|
125
|
+
|
|
126
|
+
To install BoolForge with **all optional dependencies**:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
pip install boolforge[all]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Compatibility and interoperability
|
|
135
|
+
|
|
136
|
+
BoolForge supports import and export of Boolean network representations used by
|
|
137
|
+
other software packages.
|
|
138
|
+
|
|
139
|
+
In particular, BoolForge supports the **BNet format** commonly used by
|
|
140
|
+
[pyboolnet](https://github.com/hklarner/pyboolnet), without requiring pyboolnet
|
|
141
|
+
itself to be installed.
|
|
142
|
+
|
|
143
|
+
BoolForge also supports conversion to and from the format used by
|
|
144
|
+
[CANA](https://github.com/CASCI-lab/CANA).
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Documentation
|
|
149
|
+
|
|
150
|
+
Full documentation, including tutorials and API reference, is available at:
|
|
151
|
+
|
|
152
|
+
https://ckadelka.github.io/BoolForge/
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Citation
|
|
157
|
+
|
|
158
|
+
If you use BoolForge in your research, please cite the accompanying
|
|
159
|
+
application note:
|
|
160
|
+
|
|
161
|
+
Kadelka, C., & Coberly, B. (2025).
|
|
162
|
+
*BoolForge: A Python toolbox for Boolean functions and Boolean networks*.
|
|
163
|
+
arXiv:2509.02496.
|
|
164
|
+
https://arxiv.org/abs/2509.02496
|
|
165
|
+
|
|
166
|
+
A machine-readable citation file (`CITATION.cff`) is included in the repository
|
|
167
|
+
and can be used directly by GitHub, Zenodo, and reference managers.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## License
|
|
172
|
+
|
|
173
|
+
BoolForge is released under the MIT License.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Core public classes
|
|
2
|
+
from .boolean_function import (
|
|
3
|
+
BooleanFunction,
|
|
4
|
+
display_truth_table,
|
|
5
|
+
get_layer_structure_from_canalized_outputs
|
|
6
|
+
)
|
|
7
|
+
from .boolean_network import (
|
|
8
|
+
BooleanNetwork,
|
|
9
|
+
get_entropy_of_basin_size_distribution
|
|
10
|
+
)
|
|
11
|
+
from .wiring_diagram import WiringDiagram
|
|
12
|
+
|
|
13
|
+
# Canonical public generators
|
|
14
|
+
from .generate import (
|
|
15
|
+
random_function,
|
|
16
|
+
random_NCF,
|
|
17
|
+
random_k_canalizing_function,
|
|
18
|
+
random_wiring_diagram,
|
|
19
|
+
random_network,
|
|
20
|
+
random_null_model,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
from .utils import (
|
|
24
|
+
bin2dec,
|
|
25
|
+
dec2bin,
|
|
26
|
+
get_left_side_of_truth_table,
|
|
27
|
+
hamming_weight_to_ncf_layer_structure,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
from .modularity import (
|
|
31
|
+
compress_trajectories,
|
|
32
|
+
product_of_trajectories,
|
|
33
|
+
plot_trajectory,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
from .bio_models import get_bio_models_from_repository
|
|
37
|
+
|
|
38
|
+
# Version
|
|
39
|
+
try:
|
|
40
|
+
from ._version import __version__
|
|
41
|
+
except ImportError:
|
|
42
|
+
__version__ = "unknown"
|
|
43
|
+
|
|
44
|
+
__all__ = [
|
|
45
|
+
"bin2dec",
|
|
46
|
+
"dec2bin",
|
|
47
|
+
"get_left_side_of_truth_table",
|
|
48
|
+
"hamming_weight_to_ncf_layer_structure",
|
|
49
|
+
"BooleanFunction",
|
|
50
|
+
"display_truth_table",
|
|
51
|
+
"get_layer_structure_from_canalized_outputs",
|
|
52
|
+
"BooleanNetwork",
|
|
53
|
+
"get_entropy_of_basin_size_distribution",
|
|
54
|
+
"WiringDiagram",
|
|
55
|
+
"random_function",
|
|
56
|
+
"random_NCF",
|
|
57
|
+
"random_k_canalizing_function",
|
|
58
|
+
"random_wiring_diagram",
|
|
59
|
+
"random_network",
|
|
60
|
+
"random_null_model",
|
|
61
|
+
"get_bio_models_from_repository",
|
|
62
|
+
"__version__",
|
|
63
|
+
|
|
64
|
+
"compress_trajectories",
|
|
65
|
+
"product_of_trajectories",
|
|
66
|
+
"plot_trajectory"
|
|
67
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.0.0'
|