biocham.pl 3.69 KB
Newer Older
Thierry Martinez's avatar
Thierry Martinez committed
1 2 3
:- module(
  biocham,
  [
Thierry Martinez's avatar
Thierry Martinez committed
4 5
    start/0,
    initialize/0,
Thierry Martinez's avatar
Thierry Martinez committed
6
    biocham_command/0,
Thierry Martinez's avatar
Thierry Martinez committed
7 8
    biocham_command/1,
    library_path/1
Thierry Martinez's avatar
Thierry Martinez committed
9 10
  ]).

Thierry Martinez's avatar
Thierry Martinez committed
11 12 13
:- doc('
  The Biochemical Abstract Machine (Biocham) is a software environment for
  modeling and analyzing biochemical systems.
14
  Biocham is mainly composed of:
Thierry Martinez's avatar
Thierry Martinez committed
15 16 17
  \\begin{itemize}
  \\item a rule-based language for modeling biochemical systems (compatible with
    SBML and SBGN),
FAGES Francois's avatar
FAGES Francois committed
18 19 20 21 22 23
  \\item static analysers for inferring various dynamical properties from the structure of the model;
  \\item simulators for the different semantics: continuous (differential equations), stochastic, asynchronous Boolean;
  \\item a temporal logic based language to formalize the temporal behaviours of
    biological systems, validate models with respect to such specifications by model-checking methods,
    infer parameter values in high dimension with temporal logic constraints,
    measure parameter sensitivity indices and robustness of temporal properties;
Thierry Martinez's avatar
Thierry Martinez committed
24
  \\item unique features for developing/correcting/completing/reducing/coupling
FAGES Francois's avatar
FAGES Francois committed
25
    models.
Thierry Martinez's avatar
Thierry Martinez committed
26 27 28 29
  \\end{itemize}
  Biocham is a free software protected by the GNU General Public License GPL
  version 2. This is an Open Source license that allows free usage of this
  software.
Thierry Martinez's avatar
Thierry Martinez committed
30
').
Thierry Martinez's avatar
Thierry Martinez committed
31

FAGES Francois's avatar
FAGES Francois committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
% FF ca cree un bug que je ne comprends pas
%:- doc('
%Biocham file names are suffixed by \\texttt{.bc}. In a Biocham file, everything following the character percent is a comment.
%Some other file formats are used.
%Biocham models can be imported from, and exported to, other file formats using the following suffixes:
%\\begin{itemize}
%\\item \\texttt{.xml} for Systems Biology Markup Language (SBML) files, more precisely SBML2 files for reaction systems and SBML3qual files for influence systems;
%\\item \\texttt{.ode} for Ordinary Differential Equation files (ODEs in XXPAUT format), allowing us to import a reaction system from ODEs using a heuristic inference algorithm described in \\cite{FGS15tcs}.
%\\end{itemize}
%Biocham numerical data time series can be imported/exported in 
%\\begin{itemize}
%\\item \\texttt{.csv} comma-separated values format (spreadsheet format).
%\\end{itemize}
%The following files can also be used to export some Biocham objects:
%\\begin{itemize}
%\\item \\texttt{.tex} LaTeX format for exporting ODEs and graphs;
%\\item \\texttt{.dot} for exporting graphs;
%\\item \\texttt{.plot} for exporting numerical data time series;
%\\item \\texttt{.smv} for exporting boolean transition systems and Computation Tree Logic (CTL) queries for the NuSMV model-checker;
%\\item \\texttt{.dot} for exporting graphs.
%\\end{itemize}
%').


Thierry Martinez's avatar
Thierry Martinez committed
56 57 58 59 60 61
start :-
  about,
  initialize,
  do_arguments.


62 63 64 65 66 67 68
:- dynamic(initialized/0).


initialize :-
  initialized,
  !.

Thierry Martinez's avatar
Thierry Martinez committed
69
initialize :-
Thierry Martinez's avatar
Thierry Martinez committed
70
  initialize_library_path,
Thierry Martinez's avatar
Thierry Martinez committed
71
  set_prolog_flag(allow_variable_name_as_functor, true),
Thierry Martinez's avatar
Thierry Martinez committed
72
  prolog_history(enable),
Thierry Martinez's avatar
Thierry Martinez committed
73
  set_counter(item_id, 0),
Thierry Martinez's avatar
Thierry Martinez committed
74
  set_plot_driver(gnu_plot),
Thierry Martinez's avatar
SBML  
Thierry Martinez committed
75 76 77
  set_image_viewer_driver(open_file),
  set_draw_graph_driver(graph_pdf),
  nb_setval(graph_pdf, 0),
Thierry Martinez's avatar
Thierry Martinez committed
78 79
  nb_setval(current_models, []),
  load_biocham('library:initial'),
80 81
  new_model,
  assertz(initialized).
Thierry Martinez's avatar
Thierry Martinez committed
82 83


Thierry Martinez's avatar
Thierry Martinez committed
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
:- dynamic(library_path/1).


initialize_library_path :-
  (
    getenv('BIOCHAMLIB', LibraryPath)
  ->
    true
  ;
    executable_filename(ExecutableFilename),
    absolute_file_name(
      'library/gsl_solver.c',
      LibraryFile,
      [relative_to(ExecutableFilename)]
    ),
    file_directory_name(LibraryFile, LibraryPath)
  ),
  assertz(library_path(LibraryPath)).


Thierry Martinez's avatar
Thierry Martinez committed
104 105
biocham_command :-
  doc('Declares a command for the top-level.').
Thierry Martinez's avatar
Thierry Martinez committed
106 107


Thierry Martinez's avatar
Thierry Martinez committed
108 109 110 111 112
biocham_command(_) :-
  doc('
    With a * : declares a command for the top-level that can take an
    unlimited number of arguments.
    The additional arguments are given as a list in the last parameter.').