Commit 1cc91806 authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain
Browse files

conservations handled, doc added, real command

parent 3e5c40d2
......@@ -15,6 +15,7 @@
% :- use_module(doc).
:- use_module(counters).
:- use_module(invariants).
%! export_lemon_graph(+OutputFile) is det.
......@@ -22,6 +23,12 @@
% exports the current influence graph to OutputFile (adding '.lgf' extension
% if needed)
export_lemon_graph(OutputFile) :-
biocham_command,
doc('exports the current influence graph to \\argument{OutputFile} in Lemon
graph format (\\url{http://lemon.cs.elte.hu/trac/lemon}) (adding ".lgf"
extension if needed). Computes the conservation laws of the model in order
to do so.'),
type(OutputFile, output_file),
automatic_suffix(OutputFile, '.lgf', write, FilenameLgf),
setup_call_cleanup(
open(FilenameLgf, write, Stream),
......@@ -34,6 +41,7 @@ export_lemon_graph(OutputFile) :-
%
% exports the current influence graph to the given Stream
export_lemon_stream(Stream) :-
with_output_to(atom(_), invariants:find_pinvar),
setup_call_cleanup(
new_graph(GraphId),
(
......@@ -53,8 +61,6 @@ export_lemon_stream(Stream) :-
%! export_lemon_stream(+Id, +Stream) is det.
%
% exports the graph associated to Id to the stream Stream
%
% @tbd export conservation laws
export_lemon_stream(Id, Stream) :-
write(Stream, '@nodes\nlabel\tspecies\n'),
set_counter(species, 0),
......@@ -93,7 +99,18 @@ export_lemon_stream(Id, Stream) :-
)
),
% TODO conservation laws
write(Stream, '@attributes\n').
write(Stream, '@attributes\nconserv '),
findall(
Conserv,
(
invariants:base_mol(List),
atomic_list_concat(List, ',', Conserv)
),
ConservList
),
atomic_list_concat(ConservList,';', ConservAtom),
write(Stream, ConservAtom),
write(Stream, ';\n').
%! reactions(-Reaction, -Uid) is nondet.
......
......@@ -45,6 +45,7 @@
- influence_editor.pl
** Influence graph
- influence_graphs.pl
- lemon.pl
* Events
- events.pl
* Importing and Exporting BIOCHAM Models
......
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