Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 04f6bec2 authored by Mathieu Hemery's avatar Mathieu Hemery

Improvement on correct_model, now split reactions when there rate is a polynomial

parent 1cfcc645
......@@ -35,7 +35,7 @@ correct_model :-
(
remove_null_kinetic(Reaction),!
;
split_bidirectional_reaction(List_Molecule, Reaction),!
split_reaction(List_Molecule, Reaction),!
;
reverse_reaction(Reaction),!
;
......@@ -61,32 +61,51 @@ remove_null_kinetic(Expression for Reaction) :-
delete_reaction(Expression for Reaction)
).
%! split_bidirectional_reaction(+List_Mol, +Reaction)
%! split_reaction(+List_Mol, +Reaction)
%
% Split a bidirection reaction in two
split_bidirectional_reaction(List_Mol, Expression for Reactant => Product) :-
split_reaction(List_Mol, Expression for Reactant => Product) :-
(
ode:substitute_functions(Expression, Expr),
distribute(Expr, DistExpr),
DistExpr = Up - Down,
% test if it is effectively a bidir. reaction
member(P, List_Mol),
models:formal_product(P, Reactant => Product),
present_in_kinetics(P, Down)
->
delete_reaction(Expression for Reactant => Product),
(
Reactant = Reac/Inhib
DistExpr = _A + _B
->
add_reaction(Up for Reactant => Product),
add_reaction(Down for Product/Inhib => Reac)
delete_reaction(Expression for Reactant => Product),
split_reaction_sr(List_Mol, DistExpr for Reactant => Product)
;
add_reaction(Up for Reactant => Product),
add_reaction(Down for Product => Reactant)
DistExpr = _Up - Down,
% test if it is effectively a bidir. reaction
member(P, List_Mol),
models:formal_product(P, Reactant => Product),
present_in_kinetics(P, Down)
->
delete_reaction(Expression for Reactant => Product),
split_reaction_sr(List_Mol, DistExpr for Reactant => Product)
)
).
split_reaction_sr(List_Mol, Expression + Monomial for Reactant => Product) :-
!,
add_reaction(Monomial for Reactant => Product),
split_reaction_sr(List_Mol, Expression for Reactant => Product).
split_reaction_sr(List_Mol, Expression - Monomial for Reactant => Product) :-
!,
(
Reactant = Reac/Inhib
->
add_reaction(Monomial for Product/Inhib => Reac)
;
add_reaction(Monomial for Product => Reactant)
),
split_reaction_sr(List_Mol, Expression for Reactant => Product).
split_reaction_sr(_List_Mol, Expression for Reactant => Product) :-
add_reaction(Expression for Reactant => Product).
%! reverse_reaction(+Reaction)
%
% Reverse a reaction if its kinetic is negative
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment