doc('Improve wellformedness and strictness of a CRN model by removing reactions of null kinetics, splitting reactions that are implicitely reversible in two and adding correct annotation for modifiers.'),
single_model(ModelId),
setof(
Molecule,
...
...
@@ -70,12 +70,20 @@ split_bidirectional_reaction(Expression for Reactant => Product) :-
ode:substitute_functions(Expression,Expr),
distribute(Expr,DistExpr),
DistExpr=Up-Down,
% test if it is effectively a bidir. reaction
models:formal_product(P,Reactant=>Product),
present_in_kinetics(P,Down)
->
delete_reaction(ExpressionforReactant=>Product),
add_reaction(UpforReactant=>Product),
add_reaction(DownforProduct=>Reactant)
(
Reactant=Reac/Inhib
->
add_reaction(UpforReactant=>Product),
add_reaction(DownforProduct/Inhib=>Reac)
;
add_reaction(UpforReactant=>Product),
add_reaction(DownforProduct=>Reactant)
)
).
%! reverse_reaction(+Reaction)
...
...
@@ -110,6 +118,11 @@ correct_modifiers(List_Molecule, Expression_raw for Reaction) :-