Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
cb1818f
modifying generate_with_effective_connectivity()
srikanth-iyer Jul 2, 2024
01f7dc1
made text changes in notebooks
srikanth-iyer Jul 2, 2024
79c26e1
text changes in notebooks
srikanth-iyer Jul 2, 2024
f6426c5
modified schema search tools
srikanth-iyer Jul 2, 2024
ee6560e
added fill_clashes option in fill_out_lut and from_partial_lut
srikanth-iyer Jul 2, 2024
3dca5e2
added annihilation generation rules
srikanth-iyer Jul 10, 2024
bce2468
added annihilation generation rules
srikanth-iyer Jul 10, 2024
f48cbc8
description modifications
srikanth-iyer Jul 10, 2024
0e95b0b
analysing Ke and Bias for DCT rules
srikanth-iyer Jul 10, 2024
4584e51
temp
srikanth-iyer Jul 10, 2024
b58befd
updated pdf
srikanth-iyer Jul 11, 2024
35847ca
Update progress_report.md
srikanth-iyer Jul 11, 2024
968c787
Update: plotting bias and Ke for generated automata rules
srikanth-iyer Jul 12, 2024
c777ece
Merge branch 'LUT-generation-and-schema-search' of https://github.com…
srikanth-iyer Jul 12, 2024
4852aa2
added maintenance rules function
srikanth-iyer Jul 14, 2024
19d8860
chore: Refactor code to improve readability and remove unused variables
srikanth-iyer Jul 14, 2024
70dfa38
Add test for annihilation_generation and maintenance rules
srikanth-iyer Jul 14, 2024
7ac5f8e
Modified plots and progress report
srikanth-iyer Jul 14, 2024
4da519d
added maintenance rule to automata tutorial
srikanth-iyer Jul 14, 2024
590816f
added schema generator and plotting tools
srikanth-iyer Jul 15, 2024
59d9258
Code cleanup
srikanth-iyer Jul 15, 2024
02e66ff
plots to check distribution of shuffled schemata generator
srikanth-iyer Jul 16, 2024
a918cd0
added function to return generator with missing outputs filled randomly
srikanth-iyer Jul 17, 2024
307ba01
new plots
srikanth-iyer Jul 17, 2024
f43dfb4
for DCT genetic algorithms
srikanth-iyer Jul 18, 2024
29fad0f
added plots and modified progress report
srikanth-iyer Jul 19, 2024
e513dcd
added type descriptions
srikanth-iyer Jul 19, 2024
807456f
added modules
srikanth-iyer Jul 19, 2024
3be417b
added test for fill_missing_outputs_as_maintenance()
srikanth-iyer Jul 19, 2024
00911b2
modified: automata/genetic_algorithm.ipynb
srikanth-iyer Jul 24, 2024
06d434a
annihilation generation rules for node, input symmetry for anni_gen
srikanth-iyer Jul 28, 2024
ae73d75
input symmetry mean for anni_gen
srikanth-iyer Jul 28, 2024
c7a175f
removed excess schema search functions
srikanth-iyer Jul 28, 2024
f288bd1
chore: Add temporary files to .gitignore
srikanth-iyer Jul 28, 2024
1258412
refactor: Remove unnecessary code for crossover in GA mechanism
srikanth-iyer Jul 28, 2024
6d41864
automata.ipynb
srikanth-iyer Jul 28, 2024
95c3f98
chore: removed plots and progress report from public branch
srikanth-iyer Jul 29, 2024
571454b
updated ks_for_anni_gen.ipynb
srikanth-iyer Jul 29, 2024
09372df
exception handling if no annigen found
srikanth-iyer Aug 15, 2024
d34df8a
Corrected Famoust DCT automata rules
srikanth-iyer Aug 30, 2024
5cca926
anni_gen lut coverage, anni_gen input redundancy and effective connec…
srikanth-iyer Aug 30, 2024
4e5fcbd
plot_schemata for anni_gen of a given node. with ts.
srikanth-iyer Sep 25, 2024
a0bbd95
fixed error in anni_gen_coverage
srikanth-iyer Oct 14, 2024
358d3cd
modified annigen coverage func
srikanth-iyer Nov 18, 2024
037f6e8
added missing 'f' to effective_graph
srikanth-iyer Dec 2, 2024
f4fb288
anni_gen rules and coverage
srikanth-iyer Jan 27, 2025
767de2e
fixed annigen redundancy func
srikanth-iyer Feb 17, 2025
3b4c38d
correcting division by zero error for no annigen rules
srikanth-iyer Feb 23, 2025
e5aaba1
division by zero error fix
srikanth-iyer Feb 25, 2025
c9b1955
updated annigen input symmetry func
srikanth-iyer Feb 27, 2025
9f173d9
updated automata rules
srikanth-iyer Feb 27, 2025
491722a
changed helper file position, and modified annigen test
srikanth-iyer Feb 27, 2025
85c2005
division by zero error
srikanth-iyer Feb 27, 2025
e2184d6
Update README.md
fxcosta-phd Sep 3, 2025
de25baf
Merge remote-tracking branch 'upstream/master'
srikanth-iyer Sep 22, 2025
d19a709
Merge branch 'master' into LUT-generation-and-schema-search
srikanth-iyer Sep 22, 2025
f22f730
Generalizes middle-input index and ensures default xticks
srikanth-iyer Sep 22, 2025
4f0b665
Fix LUT plot color handling for output values and ensure correct text…
srikanth-iyer Sep 22, 2025
8e924b0
Add function to plot annihilation and generation Look-Up Tables side …
srikanth-iyer Sep 22, 2025
53cd258
Rename function for plotting annihilation and generation Look-Up Tabl…
srikanth-iyer Sep 22, 2025
a18be30
Rename wildcard coverage functions for annihilation and generation fo…
srikanth-iyer Oct 31, 2025
a514640
Fixed annigen_symmetry calculation
srikanth-iyer Oct 31, 2025
6f89133
Refactor BooleanNode methods for improved readability and performance…
srikanth-iyer Nov 6, 2025
030f1b5
Add Cython-accelerated boolean node helpers and dataset initializations
srikanth-iyer Nov 10, 2025
ca91d71
Make get_annihilation_generation_rules output deterministic via sorting
claude Jun 26, 2026
aa6fd08
Add tests asserting deterministic annihilation/generation rule output
claude Jun 27, 2026
fa0d9d7
perf: speed up two-symbol coverage and add TS memoization (anni_gen p…
claude Jun 30, 2026
aee2079
perf+fix: rewrite fill_out_lut (faster, documented, fixes '2' wildcard)
claude Jul 2, 2026
caeccbf
fix: make prime-implicant / schemata ordering deterministic across pr…
claude Jul 2, 2026
3751cec
test: add subprocess PYTHONHASHSEED determinism test for schemata ord…
claude Jul 2, 2026
88767ef
docs: add branch-specific CHANGELOG for LUT-generation-and-schema-search
claude Jul 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,6 @@ ENV/

# Rope project settings
.ropeproject

# TEMP files
temp_*
89 changes: 89 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Changelog — branch `LUT-generation-and-schema-search`

This is a **branch-specific** changelog. The `master` branch does not currently
maintain a changelog, so this file documents how the
`LUT-generation-and-schema-search` branch diverges from `master`
(branch point: commit `de25baf`). It is reconstructed from the branch's commit
history and is intended to be folded into a project-wide changelog if/when
`master` adopts one.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased] — `LUT-generation-and-schema-search`

### Added

- **Partial look-up table (LUT) generation.**
- `cana.utils.fill_out_lut()` — expand a partial LUT (with wildcard input
patterns) into a complete `2**k` LUT, marking unspecified states `'?'` and
conflicting states `'!'`.
- `BooleanNode.from_partial_lut()` — build a node from a partial LUT, with
`fill_clashes` and `fill_missing_output_randomly` options.
- `BooleanNode.generate_with_required_bias()` and
`generate_with_required_effective_connectivity()` — generators that fill in
missing (`'?'`) outputs to hit a target node bias / effective connectivity.
- `BooleanNode.fill_missing_output_randomly()` — generator filling `'?'`
outputs randomly.
- Tutorial `tutorials/Generating from Partial LUTs.ipynb` and
`tutorials/partial_LUT_demo_nodes.txt`.
- **Annihilation / generation ("anni_gen") analysis.**
- `BooleanNode.get_annihilation_generation_rules()` (wildcard and two-symbol
variants), `get_anni_gen_coverage()`, `input_symmetry_mean_anni_gen()`, and
annihilation/generation input-redundancy and effective-connectivity measures.
- `automata/schema_search_tools.py` — schema-search utilities
(`annihilation_generation_rules`, `maintenance_rules`,
`combine_output_lists`, `shuffle_and_generate`,
`shuffle_wildcards_in_schemata`).
- **Cython acceleration.**
- New `cana/cboolean_node.pyx` helpers, and fast two-symbol coverage helpers in
`cana/canalization/cboolean_canalization.pyx`
(`pi_covers_fast`, `expand_ts_logic_fast`, `ts_covers_fast`).
- **Drawing.**
- `cana/drawing/plot_look_up_table.py` and
`plot_anni_gen_schemata()` in `cana/drawing/schema_vis.py` (side-by-side
annihilation/generation schemata plots).
- **Datasets & tests.** `GP()` in `cana/datasets/bools.py`; new dataset package
inits; test suites `tests/test_fill_out_lut.py`, `tests/test_ts_coverage.py`,
`tests/test_schema_search_tools.py`, `tests/test_schemata_ordering.py`, and
extensive additions to `tests/test_boolean_node.py`.

### Changed

- **Deterministic, canonical ordering of schemata output (reproducibility fix).**
Prime implicants are stored as Python `set`s, whose iteration order is
randomized per process (`PYTHONHASHSEED`), so schemata output previously
permuted from run to run (content was always correct; only order varied). Output
order is now sorted / canonical everywhere it is exposed:
- `BooleanNode.schemata_look_up_table(type="pi")` iterates the PI set in sorted
order.
- `find_two_symbols_v2()` sorts both its prime-implicant input and its returned
two-symbol list, so `_two_symbols` (and every consumer — the `type="ts"`
schemata LUT, two-symbol coverage, the canalizing map, and the drawing code)
is reproducible.
- `computes_pi_coverage()` builds each covering list in sorted order.
- `cana/drawing/schema_vis.py` renders prime-implicant rows in sorted order.
- `BooleanNode.get_annihilation_generation_rules()` sorts its PI/TS output.
- **No content change** — only ordering is now stable across processes and
machines. Downstream code that pinned `PYTHONHASHSEED` to get reproducible
results no longer needs to.

### Fixed

- **`fill_out_lut` wildcard `'2'` bug.** `'2'` was accepted and routed into the
wildcard-expansion branch but never actually expanded, leaving spurious
non-binary keys (e.g. `"12"`) in the output and dropping coverage. `'2'` now
behaves like the other wildcards (`-`, `#`, `x`).
- Corrected a misleading comment in `automata/schema_search_tools.py` about clash
resolution: with `fill_clashes=True`, `fill_out_lut` keeps the **later** entry
(not the first).
- Various division-by-zero guards for nodes with no annihilation/generation rules.

### Performance

- **Two-symbol coverage.** `computes_ts_coverage()` rewritten with loop inversion
(expand each schema once and mark covered minterms directly instead of
re-expanding per input state), plus memoization of `find_two_symbols_v2()` on
`(k, frozenset(prime_implicants))`. Output is byte-for-byte identical.
- **`fill_out_lut`.** Rewritten to expand wildcards with integer bit math and emit
the LUT already in sorted order (no final sort), ~1.4–1.9× faster; output
identical for all previously-valid inputs.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ CANAlization: Control & Redundancy in Boolean Networks

This package implements a series of methods used to study control, canalization and redundancy in Boolean Networks.

Citation:
-------------

If you use `cana` in your research, please cite us and check out our related papers below!

- A.M. Marcus, J.C. Rozum, H. Sizek, L.M. Rocha [2025]. "[CANA v1.0.0: efficient quantification of canalization in automata networks](https://doi.org/10.1093/bioinformatics/btaf461)". *Bioinformatics*. btaf461. doi: 10.1093/bioinformatics/btaf461



Installation:
-------------

Expand Down Expand Up @@ -34,6 +43,8 @@ The full documentation can be found at: [casci-lab.github.io/CANA/](https://casc
Papers:
---------

- A.M. Marcus, J.C. Rozum, H. Sizek, L.M. Rocha [2025]. "[CANA v1.0.0: efficient quantification of canalization in automata networks](https://doi.org/10.1093/bioinformatics/btaf461)". *Bioinformatics*. btaf461. doi: 10.1093/bioinformatics/btaf461

- A.J. Gates, R.B. Correia, X. Wang, L.M. Rocha [2021]. "[The effective graph reveals redundancy, canalization, and control pathways in biochemical regulation and signaling](https://doi.org/10.1073/pnas.2022598118)". *Proceedings of the National Academy of Sciences (PNAS)*. 118(**12**). doi: 10.1073/pnas.20225981186

- R.B. Correia, A.J. Gates, X. Wang, L.M. Rocha [2018]. "[CANA: A python package for quantifying control and canalization in Boolean Networks](https://www.informatics.indiana.edu/rocha/publications/FSB18.php)". *Frontiers in Physiology*. **9**: 1046. doi: 10.3389/fphys.2018.01046
Expand Down
Loading