-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
862 additions
and
617 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
from __future__ import annotations | ||
|
||
from biodivine_aeon.biodivine_aeon import RegulatoryGraph, BooleanNetwork # type: ignore | ||
from biodivine_aeon import RegulatoryGraph, BooleanNetwork | ||
|
||
def remove_static_constraints(network: BooleanNetwork) -> BooleanNetwork: | ||
""" | ||
A method that removes all information about regulation monotonicity and | ||
essentiality from the given `BooleanNetwork`. | ||
|
||
This is mostly done to allow handling of randomly generated or otherwise | ||
machine pre-processed files that can contain subtle logical redundancies | ||
that AEON would otherwise detect as warnings. | ||
""" | ||
rg = RegulatoryGraph([network.get_variable_name(var) for var in network.variables()]) | ||
for reg in network.graph().regulations(): | ||
rg.add_regulation({ | ||
'source': network.get_variable_name(reg['source']), | ||
'target': network.get_variable_name(reg['target']), | ||
'observable': False, | ||
}) | ||
def remove_static_constraints(network: BooleanNetwork) -> BooleanNetwork: | ||
""" | ||
A method that removes all information about regulation monotonicity and | ||
essentiality from the given `BooleanNetwork`. | ||
bn = BooleanNetwork(rg) | ||
for var in network.variables(): | ||
bn.set_update_function( | ||
network.get_variable_name(var), | ||
network.get_update_function(var) | ||
) | ||
This is mostly done to allow handling of randomly generated or otherwise | ||
machine pre-processed files that can contain subtle logical redundancies | ||
that AEON would otherwise detect as warnings. | ||
""" | ||
rg = RegulatoryGraph([network.get_variable_name(var) | ||
for var in network.variables()]) | ||
for reg in network.graph().regulations(): | ||
rg.add_regulation({ | ||
'source': network.get_variable_name(reg['source']), | ||
'target': network.get_variable_name(reg['target']), | ||
'observable': False, | ||
}) | ||
|
||
return bn | ||
bn = BooleanNetwork(rg) | ||
for var in network.variables(): | ||
bn.set_update_function( | ||
network.get_variable_name(var), | ||
network.get_update_function(var) | ||
) | ||
|
||
return bn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
490fef4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report