Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
biocham
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
21
Issues
21
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Lifeware
biocham
Commits
493cc46a
Commit
493cc46a
authored
Jan 18, 2021
by
SOLIMAN Sylvain
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/4.5.1'
parents
569495ee
280e652c
Changes
57
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
8767 additions
and
6483 deletions
+8767
-6483
Makefile
Makefile
+2
-1
about.pl
about.pl
+1
-1
aliases.pl
aliases.pl
+1
-0
arithmetic_rules.pl
arithmetic_rules.pl
+195
-95
arithmetic_rules.plt
arithmetic_rules.plt
+15
-0
binder/Dockerfile
binder/Dockerfile
+1
-1
biocham_jupyter/guinbextension/package.json
biocham_jupyter/guinbextension/package.json
+7
-7
biocham_jupyter/guinbextension/src/config/workflows/commands.py
...m_jupyter/guinbextension/src/config/workflows/commands.py
+2
-0
biocham_jupyter/kernel/biocham_kernel/__init__.py
biocham_jupyter/kernel/biocham_kernel/__init__.py
+1
-1
biochamlib.sh
biochamlib.sh
+9
-0
biochamlib_ode2sbml.pl
biochamlib_ode2sbml.pl
+81
-0
biochamlib_quadratization.pl
biochamlib_quadratization.pl
+85
-0
commandline.pl
commandline.pl
+1
-1
foltl.pl
foltl.pl
+63
-12
formal_derivation.plt
formal_derivation.plt
+1
-1
initial_state.pl
initial_state.pl
+1
-0
kinetics.pl
kinetics.pl
+3
-0
library/examples/C2-19-Biochemical-Programming/TD1_lotka_volterra.bc
...mples/C2-19-Biochemical-Programming/TD1_lotka_volterra.bc
+0
-1
library/examples/C2-19-Biochemical-Programming/TD1_lotka_volterra.ipynb
...es/C2-19-Biochemical-Programming/TD1_lotka_volterra.ipynb
+6
-3
library/examples/C2-19-Biochemical-Programming/TD2_enzyme_kinetics.ipynb
...s/C2-19-Biochemical-Programming/TD2_enzyme_kinetics.ipynb
+628
-700
library/examples/C2-19-Biochemical-Programming/TD4_genetic_switch.ipynb
...es/C2-19-Biochemical-Programming/TD4_genetic_switch.ipynb
+648
-718
library/examples/C2-19-Biochemical-Programming/TD5_protein_switch.ipynb
...es/C2-19-Biochemical-Programming/TD5_protein_switch.ipynb
+618
-687
library/examples/C2-19-Biochemical-Programming/TD6_oscillators.ipynb
...mples/C2-19-Biochemical-Programming/TD6_oscillators.ipynb
+700
-772
library/examples/C2-19-Biochemical-Programming/TD7_rate_independence.ipynb
...C2-19-Biochemical-Programming/TD7_rate_independence.ipynb
+602
-671
library/examples/C2-19-Biochemical-Programming/TD7_switches.ipynb
...examples/C2-19-Biochemical-Programming/TD7_switches.ipynb
+635
-705
library/examples/C2-19-Biochemical-Programming/TD8_mapk_signalling.ipynb
...s/C2-19-Biochemical-Programming/TD8_mapk_signalling.ipynb
+1151
-1213
library/examples/C2-19-Biochemical-Programming/TD9_doctor_in_the_cell.ipynb
...2-19-Biochemical-Programming/TD9_doctor_in_the_cell.ipynb
+676
-756
model_correction.pl
model_correction.pl
+82
-40
model_correction.plt
model_correction.plt
+1
-0
models.pl
models.pl
+13
-7
modules/sbml/sbml_swiprolog.c
modules/sbml/sbml_swiprolog.c
+92
-8
modules/sbml/sbml_utils.pl
modules/sbml/sbml_utils.pl
+34
-4
nbrefs/GluONe.bc
nbrefs/GluONe.bc
+77
-0
nbrefs/TD2_enzyme_kinetics.out.ref
nbrefs/TD2_enzyme_kinetics.out.ref
+73
-0
nbrefs/TD4_genetic_switch.out.ref
nbrefs/TD4_genetic_switch.out.ref
+63
-0
nbrefs/TD5_protein_switch.out.ref
nbrefs/TD5_protein_switch.out.ref
+58
-0
nbrefs/TD6_oscillators.out.ref
nbrefs/TD6_oscillators.out.ref
+88
-0
nbrefs/TD7_rate_independence.out.ref
nbrefs/TD7_rate_independence.out.ref
+5
-0
nbrefs/TD7_switches.out.ref
nbrefs/TD7_switches.out.ref
+30
-0
nbrefs/TD8_mapk_signalling.out.ref
nbrefs/TD8_mapk_signalling.out.ref
+1303
-0
nbrefs/TD9_doctor_in_the_cell.out.ref
nbrefs/TD9_doctor_in_the_cell.out.ref
+134
-0
nbrefs/diagnosis.out.ref
nbrefs/diagnosis.out.ref
+5
-7
numerical_simulation.pl
numerical_simulation.pl
+12
-2
nusmv.pl
nusmv.pl
+4
-4
ode.pl
ode.pl
+239
-55
ode.plt
ode.plt
+1
-0
podeize.pl
podeize.pl
+178
-0
podeize.plt
podeize.plt
+28
-0
reaction_editor.pl
reaction_editor.pl
+6
-1
revision.pl
revision.pl
+7
-1
rosenbrock.pl
rosenbrock.pl
+1
-1
sbml_files.pl
sbml_files.pl
+11
-0
toc.org
toc.org
+1
-0
util.pl
util.pl
+64
-3
util.plt
util.plt
+19
-0
web/index.html
web/index.html
+1
-1
xpp_parser.pl
xpp_parser.pl
+4
-3
No files found.
Makefile
View file @
493cc46a
...
...
@@ -53,7 +53,8 @@ KERNEL_DIR=$(JUPYTER_DIR)/kernel/biocham_kernel
WORKFLOWS_DIR
=
$(JUPYTER_DIR)
/guinbextension/src/config/workflows
# NOTEBOOKS=$(shell find . -type f -name '*.ipynb' -print)
NOTEBOOKS
=
library/examples/C2-19-Biochemical-Programming/TD1_lotka_volterra.ipynb library/examples/doctor_in_the_cell/diagnosis.ipynb
NOTEBOOKS
=
library/examples/C2-19-Biochemical-Programming/TD1_lotka_volterra.ipynb library/examples/C2-19-Biochemical-Programming/TD2_enzyme_kinetics.ipynb library/examples/C2-19-Biochemical-Programming/TD4_genetic_switch.ipynb library/examples/C2-19-Biochemical-Programming/TD5_protein_switch.ipynb library/examples/C2-19-Biochemical-Programming/TD6_oscillators.ipynb library/examples/C2-19-Biochemical-Programming/TD7_switches.ipynb library/examples/C2-19-Biochemical-Programming/TD7_rate_independence.ipynb library/examples/C2-19-Biochemical-Programming/TD8_mapk_signalling.ipynb
REFDIR
=
nbrefs
all
:
biocham biocham_debug quick doc/index.html pldoc install_kernel install_gui
...
...
about.pl
View file @
493cc46a
...
...
@@ -8,7 +8,7 @@
about
/
0
]).
version
(
'4.
4.15
'
).
version
(
'4.
5.1
'
).
copyright
(
'Copyright (C) 2003-2020 Inria, EPI Lifeware, Saclay-Île de France, France'
...
...
aliases.pl
View file @
493cc46a
...
...
@@ -11,6 +11,7 @@
]
).
:-
use_module
(
doc
).
:-
devdoc
(
'\\section{Commands}'
).
...
...
arithmetic_rules.pl
View file @
493cc46a
...
...
@@ -6,9 +6,13 @@
additive_normal_form
/
2
,
always_negative
/
1
,
always_positive
/
1
,
determine_sign
/
2
,
normalize_number
/
2
,
is_null
/
1
,
modulo
/
3
zero_like
/
1
,
modulo
/
3
,
is_numeric
/
2
,
is_numeric
/
1
]).
% Insert here for separate compilation and linting
...
...
@@ -270,29 +274,41 @@ extract_coefficient(+ CA, C, A) :-
extract_coefficient
(
CA
,
C
,
A
),
!.
extract_coefficient
(
A
*
B
,
A
,
B
)
:-
number
(
A
),
!.
extract_coefficient
(
A
/
B
,
A
,
1
/
B
)
:-
number
(
A
),
!.
extract_coefficient
(
A
*
B
,
B
,
A
)
:-
number
(
B
),
!.
extract_coefficient
(
A
/
B
,
BInv
,
A
)
:-
number
(
B
),
extract_coefficient
(
A
*
B
,
SubCoeff
,
Others
)
:-
extract_coefficient
(
A
,
ACoeff
,
AOthers
),
extract_coefficient
(
B
,
BCoeff
,
BOthers
),
!,
BInv
is
1
/
B
.
(
AOthers
=
1
->
Others
=
BOthers
;
BOthers
=
1
->
Others
=
AOthers
;
Others
=
AOthers
*
BOthers
),
SubCoeff
is
ACoeff
*
BCoeff
.
extract_coefficient
(
CA
*
B
,
C
,
A
*
B
)
:-
extract_coefficient
(
CA
,
C
,
A
),
!.
extract_coefficient
(
A
/
B
,
SubCoeff
,
Others
)
:-
extract_coefficient
(
A
,
ACoeff
,
AOthers
),
extract_coefficient
(
B
,
BCoeff
,
BOthers
),
!,
(
AOthers
=
1
->
Others
=
BOthers
;
BOthers
=
1
->
Others
=
AOthers
;
Others
=
AOthers
/
BOthers
),
SubCoeff
is
ACoeff
/
BCoeff
.
extract_coefficient
(
A
*
CB
,
C
,
A
*
B
)
:-
extract_coefficient
(
CB
,
C
,
B
).
extract_coefficient
(
A
,
1
,
A
).
extract_powers
(
sqrt
(
Expr
),
Power
,
Sub
)
:-
...
...
@@ -637,6 +653,11 @@ rewrite_additive_normal_form(A * (B * C), D * C) :-
rewrite_additive_normal_form
(
A
*
(
B
*
C
),
B
*
(
A
*
C
))
:-
number
(
B
).
rewrite_additive_normal_form
((
A
*
B
)
/
C
,
D
*
B
)
:-
number
(
A
),
number
(
C
),
D
is
A
/
C
.
rewrite_additive_normal_form
((
A
*
B
)
/
C
,
A
*
(
B
/
C
))
:-
number
(
A
).
...
...
@@ -665,105 +686,132 @@ arithmetic_operation(- _).
arithmetic_operation
(
_
^
_
).
always_negative
(
A
)
:-
rewrite
(
rewrite_simplify
,
A
,
B
),
B
\
=
A
,
!,
always_negative
(
B
).
always_negative
(
A
)
:-
number
(
A
),
!,
A
=<
0
.
always_negative
(
-
A
)
:-
always_positive
(
A
).
always_negative
(
A
+
B
)
:-
always_negative
(
A
),
always_negative
(
B
).
always_negative
(
A
-
B
)
:-
always_negative
(
A
),
always_positive
(
B
).
%! always_negative(+Expr)
%! always_positive(+Expr)
%
% Check if Expr is assure to be always negative/positive, fail if it can change sign
% or if it is impossible to decide
always_negative
(
A
*
B
)
:-
always_negative
(
A
),
always_positive
(
B
).
always_negative
(
Expr
)
:-
determine_sign
(
Expr
,
zero
);
determine_sign
(
Expr
,
neg
).
always_negative
(
0
*
_
)
:-
!.
always_positive
(
Expr
)
:-
determine_sign
(
Expr
,
zero
);
determine_sign
(
Expr
,
pos
).
always_negative
(
A
*
B
)
:-
always_positive
(
A
),
always_negative
(
B
).
always_negative
(
A
/
B
)
:-
always_negative
(
A
),
always_positive
(
B
).
%! determine_sign(+Expr, -Sign)
%
% Try to infer the sign of Expr, Sign will be unified to: neg/pos/zero/dnk (do not know)
always_negative
(
A
/
B
)
:-
always_positive
(
A
),
always_negative
(
B
).
% TODO : Verify if it needs rewriting
%always_negative(A) :-
% rewrite(rewrite_simplify, A, B),
% B \= A,
% !,
% always_negative(B).
determine_sign
(
A
,
zero
)
:-
is_null
(
A
),
!.
always_positive
(
A
)
:-
rewrite
(
rewrite_simplify
,
A
,
B
),
B
\
=
A
,
determine_sign
(
Expr
,
Sign
)
:-
is_numeric
(
Expr
,
A
),
!,
always_positive
(
B
).
(
A
=
0
->
Sign
=
zero
;
A
<
0
->
Sign
=
neg
;
Sign
=
pos
).
always_positive
(
A
)
:-
number
(
A
),
determine_sign
(
-
A
,
NSign
)
:-
determine_sign
(
A
,
Sign
),
!,
A
>=
0
.
always_positive
(
A
):-
% assumed for concentrations, parameters
atom
(
A
),
!.
always_positive
(
-
A
)
:-
always_negative
(
A
).
(
Sign
=
pos
->
NSign
=
neg
;
Sign
=
neg
->
NSign
=
pos
;
NSign
=
Sign
).
always_positive
(
_A
^
B
)
:-
number
(
B
)
,
determine_sign
(
A
+
B
,
Sign
)
:-
!
,
(
modulo
(
B
,
2
,
0
)
determine_sign
(
A
,
SignAB
),
determine_sign
(
B
,
SignAB
)
->
true
Sign
=
SignAB
;
Sign
=
dnk
).
always_positive
(
A
^
_B
)
:-
always_positive
(
A
).
determine_sign
(
A
-
B
,
Sign
)
:-
!,
determine_sign
(
A
+
(
-
B
),
Sign
).
always_positive
(
A
+
B
)
:-
always_positive
(
A
),
always_positive
(
B
).
determine_sign
(
A
*
B
,
Sign
)
:-
!,
determine_sign
(
A
,
SignA
),
determine_sign
(
B
,
SignB
),
(
(
SignA
=
zero
;
SignB
=
zero
)
->
Sign
=
zero
;
(
SignA
=
dnk
;
SignB
=
dnk
)
->
Sign
=
dnk
;
SignA
=
SignB
->
Sign
=
pos
;
Sign
=
neg
).
always_positive
(
A
-
B
)
:-
always_positive
(
A
),
always_negative
(
B
).
determine_sign
(
A
/
B
,
Sign
)
:-
!,
(
is_null
(
B
)
->
throw
(
error
(
division_by_zero
,
arithmetic_rules_determine_sign
))
;
true
),
determine_sign
(
A
*
B
,
Sign
).
always_positive
(
0
*
_
)
:-
determine_sign
(
A
,
pos
)
:-
% concentrations and parameters are assumed positive
atom
(
A
),
!.
always_positive
(
A
*
B
)
:-
always_negative
(
A
),
always_negative
(
B
).
determine_sign
(
_A
^
B
,
pos
)
:-
is_integer
(
B
,
Value
),
(
modulo
(
Value
,
2
,
0
)
->
!,
true
).
always_positive
(
A
*
B
)
:-
always_positive
(
A
),
always_positive
(
B
).
determine_sign
(
A
^
_B
,
Sign
)
:-
determine_sign
(
A
,
Sign
).
always_positive
(
A
/
B
)
:-
always_positive
(
A
),
always_positive
(
B
).
determine_sign
(
exp
(
_A
),
pos
).
always_positive
(
A
/
B
)
:-
always_negative
(
A
),
always_negative
(
B
).
always_positive
(
exp
(
_A
)).
normalize_number
(
N
,
Norm
)
:-
(
...
...
@@ -796,6 +844,14 @@ is_null_sr(_A^(-_N)) :- !, false.
is_null_sr
(
A
^
_N
)
:-
is_null_sr
(
A
).
%! zero_like(+Expr)
%
% A more drastic version of is_null
zero_like
(
0
).
zero_like
(
0.0
).
%! modulo(+A, +B)
%
% compute C is mod(A,B) but fail instead of raising an error when A or B are not integer
...
...
@@ -807,4 +863,48 @@ modulo(A, B, C) :-
fail
).
%! is_numeric(+Expr, -Value)
%! is_numeric(+Expr)
%
% determine if an expression is a simple numeric value (eventualy with parameters)
is_numeric
(
N
)
:-
is_numeric
(
N
,
_V
).
is_numeric
(
N
,
Value
)
:-
item
([
kind
:
parameter
,
key
:
N
,
item
:
parameter
(
N
=
Value
)]),
!.
is_numeric
(
N
,
Value
)
:-
% needed for parameters attached to ode system
get_current_ode_system
(
Id
),
item
([
parent
:
Id
,
kind
:
parameter
,
item
:
par
(
N
=
Value
)]),
!.
is_numeric
(
N
,
N
)
:-
number
(
N
).
is_numeric
(
A
+
B
,
Vab
)
:-
!,
is_numeric
(
A
,
Va
),
is_numeric
(
B
,
Vb
),
Vab
is
Va
+
Vb
.
is_numeric
(
A
-
B
,
Vab
)
:-
!,
is_numeric
(
A
,
Va
),
is_numeric
(
B
,
Vb
),
Vab
is
Va
-
Vb
.
is_numeric
(
-
(
A
),
Vma
)
:-
!,
is_numeric
(
A
,
Va
),
Vma
is
-
Va
.
is_numeric
(
A
*
B
,
Vab
)
:-
!,
is_numeric
(
A
,
Va
),
is_numeric
(
B
,
Vb
),
Vab
is
Va
*
Vb
.
is_numeric
(
A
^
N
,
Van
)
:-
!,
is_numeric
(
N
,
Vn
),
is_numeric
(
A
,
Va
),
Van
is
Va
^
Vn
.
is_numeric
(
A
/
N
,
Van
)
:-
!,
is_numeric
(
N
,
Vn
),
is_numeric
(
A
,
Va
),
Van
is
Va
/
Vn
.
arithmetic_rules.plt
View file @
493cc46a
...
...
@@ -2,6 +2,10 @@
:- begin_tests(arithmetic_rules, [setup((clear_model, reset_options))]).
test('simplify1', []) :-
simplify(a+2*a, 3*a),
simplify(-1*a/b+2*a/b, a/b).
test('distribute1', [true(Out == a * a + a * b + c)]) :-
distribute(a * (a + b) + c, Out).
...
...
@@ -9,6 +13,17 @@ test('distribute2', []) :-
distribute((a+b)^2, a*a+a*b+(b*a+b*b)),
distribute((a+b)^ -2, (a+b)^ -2).
test('determine_sign', []) :-
parameter([k1 = 2, k2 = 3]),
determine_sign((a+1)^2, pos),
determine_sign((a-1)^3, dnk),
determine_sign(-exp(a), neg),
determine_sign(a/(a+1), pos),
determine_sign((2+a)*0, zero),
determine_sign((x-1)^k1, pos),
determine_sign((x-1)^k2, dnk).
test('is_null', []) :-
is_null(a*0*1/2),
\+(is_null(a*b/0)).
...
...
binder/Dockerfile
View file @
493cc46a
FROM
registry.gitlab.inria.fr/lifeware/biocham:v4.
4.15
FROM
registry.gitlab.inria.fr/lifeware/biocham:v4.
5.1
biocham_jupyter/guinbextension/package.json
View file @
493cc46a
{
"name"
:
"gui"
,
"version"
:
"4.
4.15
"
,
"version"
:
"4.
5.1
"
,
"description"
:
"biocham gui in jupyter notebook"
,
"main"
:
"src/index.js"
,
"scripts"
:
{
...
...
@@ -26,21 +26,21 @@
"babel-loader"
:
"^8.0.0"
,
"classnames"
:
"^2.2.6"
,
"clean-webpack-plugin"
:
"^0.1.19"
,
"css-loader"
:
"^0.28.10"
,
"file-loader"
:
"^1.1.11"
,
"html-webpack-plugin"
:
"^3.2.0"
,
"jest"
:
"^23.6.0"
,
"jsdoc"
:
"^3.5.5"
,
"lodash"
:
"^4.17.11"
,
"react-test-renderer"
:
"^16.6.0"
,
"redux-devtools-extension"
:
"^2.13.8"
,
"redux-logger"
:
"^3.0.6"
,
"style-loader"
:
"^0.20.3"
,
"ttf-loader"
:
"^1.0.2"
,
"url-loader"
:
"^1.1.2"
,
"css-loader"
:
"^0.28.10"
,
"file-loader"
:
"^1.1.11"
,
"webpack"
:
"^4.22.0"
,
"webpack-bundle-analyzer"
:
"^3.3.2"
,
"webpack-cli"
:
"^3.1.1"
,
"jest"
:
"^23.6.0"
,
"jsdoc"
:
"^3.5.5"
,
"lodash"
:
"^4.17.11"
"webpack-cli"
:
"^3.1.1"
},
"dependencies"
:
{
"@material-ui/core"
:
"^3.1.0"
,
...
...
biocham_jupyter/guinbextension/src/config/workflows/commands.py
View file @
493cc46a
...
...
@@ -101,6 +101,7 @@ commands = [
"hybrid_static_simulation"
,
"import_ode"
,
"import_reactions_from_graph"
,
"infer_hidden_molecules"
,
"influence_graph"
,
"influence_hypergraph"
,
"influence_model"
,
...
...
@@ -184,6 +185,7 @@ commands = [
"place"
,
"plot"
,
"polynomial_ODE"
,
"polynomize_ode"
,
"present"
,
"prolog"
,
"quadratic_reduction_ODE"
,
...
...
biocham_jupyter/kernel/biocham_kernel/__init__.py
View file @
493cc46a
"""Example magic"""
__version__
=
'4.
4.15
'
__version__
=
'4.
5.1
'
biochamlib.sh
0 → 100644
View file @
493cc46a
#!/usr/bin/bash
# quadratization
swipl
--goal
=
main
--stand_alone
=
true
-DSWIPL_LINKER_FLAGS
=
"-static"
-DSWIPL_SHARED_LIB
=
OFF
\
--foreign
=
save
-o
quadratization
-c
biochamlib_quadratization.pl
# ODE2SBML
swipl
--goal
=
main
--stand_alone
=
true
-DSWIPL_LINKER_FLAGS
=
"-static"
-DSWIPL_SHARED_LIB
=
OFF
\
--foreign
=
save
-o
ODE2SBML
-c
biochamlib_ode2sbml.pl
biochamlib_ode2sbml.pl
0 → 100644
View file @
493cc46a
#!/usr/bin/prolog
/*
* The prolog script to create the stand-alone saved state for conversion of an ODE to an
* SBML file.
* Coder: M. Hemery
*/
% Loading libraries
:-
use_module
(
aliases
).
:-
use_module
(
arithmetic_rules
).
:-
use_module
(
biocham
).
:-
use_module
(
counters
).
:-
use_module
(
doc
).
:-
use_module
(
filename
).
:-
use_module
(
formal_derivation
).
:-
use_module
(
functions
).
:-
use_module
(
initial_state
).
:-
use_module
(
kinetics
).
:-
use_module
(
models
).
:-
use_module
(
molecules
).
:-
use_module
(
namespace
).
:-
use_module
(
objects
).
:-
use_module
(
ode
).
:-
use_module
(
parameters
).
:-
use_module
(
reaction_editor
).
:-
use_module
(
reaction_rules
).
:-
use_module
(
sbml_files
).
:-
use_module
(
toplevel
).
:-
use_module
(
types
).
:-
use_module
(
util
).
:-
use_module
(
xpp_parser
).
set_my_option
(
Option
,
Value
)
:-
change_item
([],
option
,
Option
,
option
(
Option
:
Value
)).
% parse_arguments(+Arguments, -Input)
%
% Handle the various option of the standalone:
% -i: input file
parse_arguments
([],
none
).
parse_arguments
([
'-i'
,
Input
|
Argv
],
Input
)
:-
parse_arguments
(
Argv
,
_I
).
parse_arguments
([
'--help'
|
_Argv
],
_I
,
_M
,
_T
)
:-
print_help
.
% print_help
print_help
:-
format
(
"help~n"
,
[]),
halt
.
% main(+argv)
main
(
Argv
)
:-
(
Argv
=
[]
->
print_help
;
true
),
% Handling naming and options
parse_arguments
(
Argv
,
Input
),
file_name_extension
(
InputBase
,
'ode'
,
Input
),
file_name_extension
(
InputBase
,
'sbml'
,
Output
),
format
(
"Input: ~w~nOutput: ~w~n"
,
[
Input
,
Output
]),
% Initialization (see biocham:initialize)
set_prolog_flag
(
allow_variable_name_as_functor
,
true
),
set_counter
(
list_item_counter
,
0
),
set_counter
(
item_id
,
0
),
set_counter
(
model
,
0
),
set_counter
(
molecule_id
,
0
),
set_counter
(
parameter_id
,
1
),
nb_setval
(
ode_viewer
,
inline
),
nb_setval
(
current_models
,
[]),
new_model
,
set_my_option
(
import_reactions_with_inhibitors
,
yes
),
% Main procedure
read_xpp
(
Input
),
list_ode
,
add_reactions_from_ode_system
,
export_sbml
(
Output
).
biochamlib_quadratization.pl
0 → 100644
View file @
493cc46a
#!/usr/bin/prolog
/*
* The prolog script to create the stand-alone saved state for quadratization, it reads
* and returns an .ode file.
* Coder: M. Hemery
*/
% Loading libraries
:-
use_module
(
arithmetic_rules
).
:-
use_module
(
biocham
).
:-
use_module
(
counters
).
:-
use_module
(
doc
).
:-
use_module
(
kinetics
).
:-
use_module
(
models
).
:-
use_module
(
namespace
).
:-
use_module
(
ode
).
:-
use_module
(
quadratic_reduction
).
:-
use_module
(
sat
).
:-
use_module
(
toplevel
).
:-
use_module
(
types
).
:-
use_module
(
util
).
:-
use_module
(
xpp_parser
).
set_my_option
(
Option
,
Value
)
:-
change_item
([],
option
,
Option
,
option
(
Option
:
Value
)).
% parse_arguments(+Arguments, -Input, -Method, -Timeout)
%
% Handle the various option of the standalone:
% --method: method used to perform the reduction
% --timeout: timeout for sat call
% --help: print help and quit
% -i: input file
parse_arguments
([],
none
,
sat_species
,
120
).
parse_arguments
([
'--method'
,
Method
|
Argv
],
Input
,
Method
,
Timeout
)
:-