Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotations + BooleanNetworks = 💸 #35

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

daemontus
Copy link
Member

This PR provides a much tighter integration between ModelAnnotation and BooleanNetwork. In the long-term, we want to have some annotations that are "officially supported" by AEON, and this should get us there. Annotations are still "fully general" in the sense that you can put any data into annotations, but now some of that data gets special type-safe access methods.

This is currently a work in progress; the exact data that is "officially supported" can still change.

How does it work:

  1. The Python version of the RegulatoryGraph (and by extension BooleanNetwork) now also has an optional ModelAnnotationRoot. Whenever a model is loaded from or saved into .aeon, this annotation object is deserialized or serialized with the rest of the network. So it is virtually a part of the network now.
  2. We now have a bunch of "annotation objects" that inherit from ModelAnnotation and provide type-safe access to "commonly recognized" data. So, for example model.annotation().variable('x').gene_names() gives a list of genes that is associated with a variable. However, you can also obtain the same data using model.annotation()['variable']['x']['gene_name'].lines().
  3. For the full list of supported annotations, have a look at the new type annotations in the .pyi module.
  4. Most operations that modify the BooleanNetwork (remove regulation, change variable name, etc.) should correctly update affected annotations. But in some cases (e.g. variable inlining), it is not very clear what the result should be. So in that case, we usually have a "best effort" solution that merges as much of the available data as possible.

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 83.36052% with 102 lines in your changes missing coverage. Please review.

Project coverage is 78.93%. Comparing base (d52e970) to head (0093346).

Files with missing lines Patch % Lines
src/bindings/lib_param_bn/regulatory_graph.rs 75.72% 42 Missing ⚠️
src/bindings/lib_param_bn/model_annotation.rs 83.09% 24 Missing ⚠️
src/bindings/annotations/network_variable.rs 81.35% 22 Missing ⚠️
src/bindings/annotations/regulatory_graph.rs 84.37% 10 Missing ⚠️
src/bindings/lib_param_bn/boolean_network.rs 97.53% 2 Missing ⚠️
...ngs/pbn_control/asynchronous_perturbation_graph.rs 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   78.74%   78.93%   +0.18%     
==========================================
  Files          61       65       +4     
  Lines       10322    10861     +539     
==========================================
+ Hits         8128     8573     +445     
- Misses       2194     2288      +94     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant