Commit 170ff3fe authored by FAGES Francois's avatar FAGES Francois

modif sur tropical

parent ea540c92
......@@ -114,5 +114,5 @@ biocham_command(_) :-
unlimited number of arguments.
The additional arguments are given as a list in the last parameter.').
:-devcom('FF: big question ! should not we make biocham commands functional ? We need to know the result type for the gui... Furthermore, the show, list, enumerate,... commands are not so nice. The print result should be a text or a widget associated to the returned type.').
:-devcom('\\begin{todo}Make biocham commands functional. We need to know the result type for the gui... Furthermore, the show, list, enumerate,... commands are not so nice. The print result should be a text or a widget associated to the returned type.\\end{todo}').
......@@ -58,7 +58,7 @@ biocham_silent(_).
environment(remark, 'Remark', 'border: solid 1pt black; padding: 1em;').
environment(todo, 'TODO', 'border: solid 1pt red; padding: 1em; color: red;').
environment(todo, 'To do', 'border: solid 1pt gray; padding: 1em; color: gray;').
:- devdoc('
\\begin{remark}
......@@ -484,7 +484,7 @@ format_doc_html(label(Key)) :-
format('<a id="~a" />', [Key]).
format_doc_html(cite(Key)) :-
format('<a href="#~a">~a</a>', [Key, Key]).
format('<a href="http://lifeware.inria.fr/wiki/publications/#~a">[~a]</a>', [Key, Key]).
format_doc_tex(document_opening(Title)) :-
......@@ -1966,8 +1966,8 @@ write_command(section, Argument) :-
write_doc(Argument),
format_doc(end_local_section(SectionLevel)).
:- devdoc('
\\begin{todo}[Thierry]
:- devcom('
\\begin{todo}
Bibliography handling.
\\end{todo}
').
......@@ -2081,5 +2081,5 @@ index_use_id(Key, Id) :-
append(List, [Counters - Id], NewList),
assertz(index_contents(Key, NewList)).
:- devcom('FF En fait il faudrait lister dans le developper manual toutes les commandes exportees').
:- devcom('\\begin{todo}Add to the developper manual all the commands exported in the API.\\end{todo}').
......@@ -463,9 +463,9 @@ multiply_PIVP([D1, PV1, IV1], [D2, PV2, IV2], [D, PV, IV]) :-
append([[Q], PV1d, PV2d], PV),
append([[I], IV1, IV2], IV).
:- devdoc('TODO : ^, log, compose PIVP').
:- devcom('\\begin{todo} ^, log, compose PIVP\\end{todo}').
:- devdoc('TODO : automatic simulation time horizon option for having stabilization on one component at epsilon from the middle (or two third) of the time horizon').
:- devcom('\\begin{todo}automatic simulation time horizon option for having stabilization on one component at epsilon from the middle (or two third) of the time horizon\\end{todo}').
invert_PIVP([D1, PV1, IV1], [D, PV, IV]) :-
......@@ -497,7 +497,7 @@ g_to_c_PIVP([D, PV, IV], [Dc, PVc, IVc], X) :-
append([[X], [0], IV], IVc).
:- devdoc('TODO compilation option for not splitting the variables, assumed positive.').
:- devcom('\\begin{todo}compilation option for not splitting the variables, assumed positive.\\end{todo}').
compile_PIVP([D, PV, IV], Input, Output) :-
assert(input_name(Input)),
......
......@@ -34,9 +34,7 @@ find_pinvar :-
find_pinvar(4).
%% find_pinvar(+ForcedMax)
%
% find a set of minimal P-invariants with a given max value
:- devcom('find_pinvar(+ForcedMax) find a set of minimal P-invariants with a given max value.').
find_pinvar(ForcedMax) :-
find_invar_aux(ForcedMax, 'is_place', 'is_transition', '#=').
......
......@@ -10,6 +10,8 @@
:- dynamic(is_boolean/0).
:- dynamic(last_time/1). % last written state's time
:- devcom('
stochastic_simulation(Until, Propensities, Time, Boolean).').
stochastic_simulation(Until, Propensities, Time, Boolean) :-
(
......
......@@ -32,7 +32,7 @@
:- doc('In Biocham v4, a reaction system is a multiset of reactions. Reactions can thus be in multiple copies in which case their reaction rates are summed.').
:- devcom('FF: For several reasons, I am wondering whether we should automatically introduce kinetic parameters k_1, k_2, etc. for the default mass action law kinetics of reactions given without kinetic expression. The same could go for initial_state concentrations which BTW should be definable by parameters or functions, introducing concentration parameters c_1, c_2, etc. for present molecules. The pros are an encouragement to use parameters, parameter search, sensitivity and robustness analyses. The cons are an irrelevant encouragement for logical models (until it becomes relevant). ').
:- devcom('\\begin{todo}For several reasons, we should automatically introduce kinetic parameters k_1, k_2, etc. for the default mass action law kinetics of reactions given without kinetic expression. The same could go for initial_state concentrations which BTW should be definable by parameters or functions, introducing concentration parameters c_1, c_2, etc. for present molecules. The pros are an encouragement to use parameters, parameter search, sensitivity and robustness analyses. The cons are an irrelevant encouragement for logical models. \\end{todo}').
add_reaction(Reaction) :-
biocham_command,
......
......@@ -16,13 +16,13 @@
:- devdoc('\\section{Commands}').
:- devcom('FF: It would be nice to have a notion of input/output and draw graphs accordingly, with inputs on top and outputs bottom in all (reaction or influence) graphs.
:- devcom('\\begin{todo}It would be nice to have a notion of input/output and draw graphs accordingly, with inputs on top and outputs bottom in all (reaction or influence) graphs.
The input species could be those present at initial_state. The output species could be those not reactant (nor catalyst) of any reaction, nor source of any nfluence.
Alternatively we could have input/output annotations on molecular species which could also be useful also for some analyses.
Also the linear invariants could be used to enforce theur drawing in row like in MAPK...').
Also the linear invariants could be used to enforce theur drawing in row like in MAPK...\\end{todo}').
reaction_graph :-
biocham_command,
......
......@@ -2,9 +2,7 @@
reduce,
[
reduce_model/1,
reduce_model/0,
delete_molecule/1,
merge_molecules/2
reduce_model/0
]
).
......@@ -14,14 +12,14 @@
:- use_module(nusmv).
:- use_module(util).
:- doc('This section describes commands to reduce a reaction model by deleting species, deleting reactions, merging species and merging reactions. We refer to \\cite{GSF10bi} for the use of these operations for detecting model reduction relationships in BioModels, and to \\cite{GFS14dam} for the theory of these graphical operations which are equivalent to subgraph epimorphisms (SEPI). We also provide a model reduction command which automatically finds a model reduction preserving the CTL specification of the behavior.').
:- doc('This section describes commands to reduce a reaction model by deleting species and reactions, while preserving a CTL specification of the behaviour.').
:- devcom('FF: These commands should be generalized,
first, to deletions and merge of molecules and reactions (easy SEPI linear for deletions quadratic for mergings) done!
:- devcom('\\begin{todo}These commands should be generalized,
first, to deletions and merge of molecules and reactions,
second, to influence systems and hybrid reaction-influence systems (great SEPI unification), See CMSB 2017 paper ;-)
second, to influence systems and hybrid reaction-influence systems,
and third, to hybrid attractors, CTL, FOLTL, trace specifications of the behavior.').
and third, to hybrid specifications of behaviors with attractors, CTL, FOLTL, traces.\\end{todo}').
:- devdoc('\\section{Commands}').
......@@ -73,63 +71,6 @@ biocham: dose_response('RAFK',1e-5,1e-3, time:200, show:'MAPK~{p1,p2}').
\\end{example}
").
:- devcom(
'FF: todo with options sepi_reduce_model Deletes and/or merges molecules and/or reactions (aka subgraph epimorphism, SEPI reduction) as long as the specification of the behavior given by a CTL formula passed as
argument remains satisfied in the current initial state.
').
% delete_molecules(Query, MoleculesRemoved),
% format('molecules removed ~p\n',[MoleculesRemoved]),
% merge_molecules(Query, MoleculesMerged),
% format('removed ~p\n',[MoleculesMerged]),
% delete_reactions(Query, ReactionsRemoved),
% format('removed ~p\n',[ReactionsRemoved]),
% merge_reactions(Query, ReactionsMerged),
% format('removed ~p\n',[ReactionsMerged])
delete_molecule(M):-
biocham_command,
doc('Deletes a molecule and its aliases from the current model, by replacing them by a parameter set to the initial value of the concentration.'),
get_initial_concentration(M, C),
\+ (
item([kind: initial_state, id: Id, key:M]),
\+ (
delete_item(Id)
)
),
set_parameter(M, C),
\+ (
item([kind: reaction, id: Id, item: Reaction]),
reaction(Reaction, [
reactants: Reactants,
inhibitors: Inhibitors,
products: Products
]),
(member(_ * M, Reactants) ; member(_ * M, Inhibitors) ; member(_ * M, Products)),
\+ (
delete_item(Id),
rewrite_molecule_in_reaction(M, Reaction, SimplifiedReaction),
add_item([kind: reaction, item: SimplifiedReaction])
)
).
merge_molecules(M,N):-
biocham_command,
type(M, object),
type(N, object),
doc('
merges two molecules by creating an alias making the second molecule canonical, and with initial concentration set to the sum of the initial concentrations of the merged molecules.
'),
devcom('FF should be the semantics of alias which should be synonymous'),
get_initial_concentration(M, CM),
get_initial_concentration(N, CN),
alias(M=N),
canonical(N),
C is CM+CN,
present(N,C).
:- devdoc('\\section{Public API}').
......
......@@ -15,7 +15,7 @@
:- doc('This section describes commands to revise a reaction model in order to satisfy a given CTL specification of the behavior. The revision algorithm is described in \\cite{CCFS05tcsb}').
:- devcom('FF: These commands should be generalized, first, to influence systems and hybrid reaction-influence systems, and perhaps second, to hybrid specifications of the behavior with attractors and CTL formulas, and per any chance third, in combination with parameter search, to numerical specifications of the behavior with FOLTL formulas and traces').
:- devcom('\\begin{todo}These commands should be generalized, first, to influence systems and hybrid reaction-influence systems, and perhaps second, to hybrid specifications of the behavior with attractors and CTL formulas, and per any chance third, in combination with parameter search, to numerical specifications of the behavior with FOLTL formulas and traces.\\end{todo}').
revise_model(Query) :-
biocham_command,
......
:- module(
sepi,
[
delete_molecule/1,
merge_molecules/2,
delete_reaction/1,
merge_reactions/2,
sepi_reduces/2,
siso_reduces/2,
minor_reduces/2
]
).
:- doc('CURRENTLY NOT INCLUDED. This section describes commands to reduce a reaction model by deleting species, deleting reactions, merging species and merging reactions. We refer to \\cite{GSF10bi} for the use of these operations for detecting model reductions in model repositories such as BioModels. We refer to \\cite{GFS14dam} for the theory of these graphical operations which are equivalent to subgraph epimorphisms (SEPI). We also provide a model reduction command which automatically finds a model reduction preserving the CTL specification of the behavior.').
:- devcom('\\begin{todo}These commands should be generalized,
first, to deletions and merge of molecules and reactions,
second, to influence systems and hybrid reaction-influence systems (great SEPI unification),
and third, to hybrid specifications of behaviors with attractors, CTL, FOLTL, traces.\\end{todo}').
:- devcom(
'todo with options sepi_reduce_model Deletes and/or merges molecules and/or reactions (aka subgraph epimorphism, SEPI reduction) as long as the specification of the behavior given by a CTL formula passed as
argument remains satisfied in the current initial state.
').
% delete_molecules(Query, MoleculesRemoved),
% format('molecules removed ~p\n',[MoleculesRemoved]),
% merge_molecules(Query, MoleculesMerged),
% format('removed ~p\n',[MoleculesMerged]),
% delete_reactions(Query, ReactionsRemoved),
% format('removed ~p\n',[ReactionsRemoved]),
% merge_reactions(Query, ReactionsMerged),
% format('removed ~p\n',[ReactionsMerged])
delete_molecule(M):-
biocham_command,
doc('Deletes a molecule and its aliases from the current model, by replacing them by a parameter set to the initial value of the concentration.'),
get_initial_concentration(M, C),
\+ (
item([kind: initial_state, id: Id, key:M]),
\+ (
delete_item(Id)
)
),
set_parameter(M, C),
\+ (
item([kind: reaction, id: Id, item: Reaction]),
reaction(Reaction, [
reactants: Reactants,
inhibitors: Inhibitors,
products: Products
]),
(member(_ * M, Reactants) ; member(_ * M, Inhibitors) ; member(_ * M, Products)),
\+ (
delete_item(Id),
rewrite_molecule_in_reaction(M, Reaction, SimplifiedReaction),
add_item([kind: reaction, item: SimplifiedReaction])
)
).
merge_molecules(M,N):-
biocham_command,
type(M, object),
type(N, object),
doc('
merges two molecules by creating an alias making the second molecule canonical, and with initial concentration set to the sum of the initial concentrations of the merged molecules.
'),
devcom('should be the semantics of alias which should be synonymous'),
get_initial_concentration(M, CM),
get_initial_concentration(N, CN),
alias(M=N),
canonical(N),
C is CM+CN,
present(N,C).
delete_reaction(R).
merge_reactions(R,S).
sepi_reduces(A,B).
siso_reduces(A,B).
minor_reduces(A,B).
......@@ -14,7 +14,7 @@
:- doc('Tropical algebra can be used to reason about orders of magnitude of molecular concentrations, kinetic parameters and reactions rates.
The solutions to tropical equilibration problems provide candidates for regimes exhibiting fast-slow dynamics leading to model reductions \\cite{SFR14almob}.').
The solutions to tropical equilibration problems provide candidates for regimes exhibiting fast-slow dynamics leading to model reductions \\cite{SFR14amb}.').
% store monomials of -inf degree
......
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