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
6cfdcbcb
Commit
6cfdcbcb
authored
Jan 29, 2020
by
Sylvain Soliman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/4.3.10'
parents
6bd75701
02b2fd51
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
2326 additions
and
301 deletions
+2326
-301
about.pl
about.pl
+1
-1
biocham_jupyter/guinbextension/package.json
biocham_jupyter/guinbextension/package.json
+1
-1
biocham_jupyter/kernel/biocham_kernel/__init__.py
biocham_jupyter/kernel/biocham_kernel/__init__.py
+1
-1
foltl.pl
foltl.pl
+3
-0
install.sh
install.sh
+1
-0
library/examples/C2-19-Biochemical-Programming/TD4_genetic_switch.ipynb
...es/C2-19-Biochemical-Programming/TD4_genetic_switch.ipynb
+1128
-167
library/examples/C2-19-Biochemical-Programming/TD5_protein_switch.ipynb
...es/C2-19-Biochemical-Programming/TD5_protein_switch.ipynb
+1092
-109
numerical_simulation.pl
numerical_simulation.pl
+4
-5
plot.pl
plot.pl
+43
-1
rosenbrock.pl
rosenbrock.pl
+41
-8
rosenbrock.plt
rosenbrock.plt
+2
-2
tmpnb/tmpnb_panama.sh
tmpnb/tmpnb_panama.sh
+1
-1
tropical.pl
tropical.pl
+2
-2
web/index.html
web/index.html
+6
-3
No files found.
about.pl
View file @
6cfdcbcb
...
...
@@ -8,7 +8,7 @@
about
/
0
]).
version
(
'4.3.
9
'
).
version
(
'4.3.
10
'
).
copyright
(
'Copyright (C) 2003-2020 Inria, EPI Lifeware, Saclay-Île de France, France'
...
...
biocham_jupyter/guinbextension/package.json
View file @
6cfdcbcb
{
"name"
:
"gui"
,
"version"
:
"4.3.
9
"
,
"version"
:
"4.3.
10
"
,
"description"
:
"biocham gui in jupyter notebook"
,
"main"
:
"src/index.js"
,
"scripts"
:
{
...
...
biocham_jupyter/kernel/biocham_kernel/__init__.py
View file @
6cfdcbcb
"""Example magic"""
__version__
=
'4.3.
9
'
__version__
=
'4.3.
10
'
foltl.pl
View file @
6cfdcbcb
...
...
@@ -524,6 +524,9 @@ expand_expression(Expression, ExpandedExpression) :-
!,
expand_expression
(
NewBody
,
ExpandedExpression
).
expand_expression
(
Parameter
,
Value
)
:-
parameter_value
(
Parameter
,
Value
),
!.
expand_expression
(
Expression
,
ExpandedExpression
)
:-
grammar_map
(
...
...
install.sh
View file @
6cfdcbcb
...
...
@@ -162,6 +162,7 @@ else
fi
echo
"installing python packages (
$packages
)…"
python3
-m
pip
install
-U
$packages
jupyter nbextension
enable
--py
widgetsnbextension
### trust all our notebooks but make them read-only
find
.
-name
'*.ipynb'
-print0
| xargs
-0
jupyter trust
...
...
library/examples/C2-19-Biochemical-Programming/TD4_genetic_switch.ipynb
View file @
6cfdcbcb
This diff is collapsed.
Click to expand it.
library/examples/C2-19-Biochemical-Programming/TD5_protein_switch.ipynb
View file @
6cfdcbcb
This diff is collapsed.
Click to expand it.
numerical_simulation.pl
View file @
6cfdcbcb
...
...
@@ -370,20 +370,19 @@ solve :-
add_table
(
'numerical_simulation'
,
Table
).
gather_fields
(
Events
,
Fields
)
:-
gather_fields
(
Events
,
[
'Time'
:
t
|
Fields_tail
]
)
:-
findall
(
Field
,
(
Field
=
'Time'
:
t
;
enumerate_variables
(
Field
)
;
enumerate_nonconstant_parameters
(
Events
,
Field
)
;
enumerate_nonparametric_functions
(
Field
)
),
Fields
).
Fields_unsorted
),
sort
(
Fields_unsorted
,
Fields_tail
).
enumerate_variables
(
Header
:
x
(
VariableIndex
))
:-
...
...
plot.pl
View file @
6cfdcbcb
...
...
@@ -34,7 +34,10 @@ axes(xy).
:-
initial
(
option
(
show
:
{})).
:-
initial
(
option
(
logscale
:
''
)).
:-
initial
(
option
(
against
:
'Time'
)).
:-
initial
(
option
(
xmin
:
42
)).
:-
initial
(
option
(
ymin
:
42
)).
:-
initial
(
option
(
xmax
:
42
)).
:-
initial
(
option
(
ymax
:
42
)).
plot
:-
biocham_command
,
...
...
@@ -51,6 +54,22 @@ plot :-
against
,
object
,
Against
,
'Selects the X axis for the plot, defaulting to Time.'
),
option
(
xmin
,
number
,
_Xmin
,
'Select the axes for the current plot (42 is overwrite to *)'
),
option
(
ymin
,
number
,
_Ymin
,
'Select the axes for the current plot (42 is overwrite to *)'
),
option
(
xmax
,
number
,
_Xmax
,
'Select the axes for the current plot (42 is overwrite to *)'
),
option
(
ymax
,
number
,
_Ymax
,
'Select the axes for the current plot (42 is overwrite to *)'
),
doc
(
'
plots the current trace. After a simulation, the trace is composed of molecular concentrations and user-defined functions over time.
\\begin{example}'
...
...
@@ -216,6 +235,8 @@ set format "%.5g"
set style data lines
set datafile separator ","
'
),
get_axes
(
Xmin
,
Xmax
,
Ymin
,
Ymax
),
format
(
Stream
,
"set xrange [~w:~w]~nset yrange [~w:~w]~n"
,
[
Xmin
,
Xmax
,
Ymin
,
Ymax
]),
logscale
(
Axes
),
(
Axes
==
''
...
...
@@ -276,5 +297,26 @@ handle_show(Show) :-
).
%! get_axes(-Xmin, -Xmax, -Ymin, -Ymax)
%
% retrieve the option values for the axes of gnuplot
get_axes
(
Xmin
,
Xmax
,
Ymin
,
Ymax
)
:-
get_one_axe
(
xmin
,
Xmin
),
get_one_axe
(
xmax
,
Xmax
),
get_one_axe
(
ymin
,
Ymin
),
get_one_axe
(
ymax
,
Ymax
).
get_one_axe
(
Name
,
Value
)
:-
get_option
(
Name
,
RawV
),
(
RawV
=
42
->
Value
=
'*'
;
Value
=
RawV
).
unquoted_term_to_atom
(
T
,
A
)
:-
with_output_to
(
atom
(
A
),
write
(
T
)).
rosenbrock.pl
View file @
6cfdcbcb
...
...
@@ -62,7 +62,7 @@ rosenbrock_init(Epsilon_abs) :-
% Start of the ode solver, cf numerical_simulation.pl for Options
ode_solver
([
fields
:
_
,
fields
:
Fields
,
equations
:
Equations
,
initial_values
:
InitialState
,
initial_parameter_values
:
InitialParameters
,
...
...
@@ -102,8 +102,9 @@ ode_solver([
),
nb_getval
(
variable_list
,
VariableList
),
initialize_functions_list
,
add_functions_names
(
VariableList
,
Var_Func_List
),
assertz
(
saved_row
([
'#''Time'
|
Var_Func_List
])),
%initialize the label of the numerical table
% add_functions_names(VariableList, Var_Func_List),
initialize_names
(
Fields
,
Names
),
assertz
(
saved_row
(
Names
)),
%initialize the label of the numerical table
eval_state
(
InitialState
,
InitialParameters
,
TrueInitialState
),
split_events
(
Events
,
RegularEvents
,
TimeEvents
),
nb_setval
(
events_list
,
RegularEvents
),
...
...
@@ -114,11 +115,11 @@ ode_solver([
add_functions_values
(
TrueInitialState
,
InitialTime
,
FullState
),
SecondRow
=..
[
row
,
InitialTime
|
FullState
],
nb_setval
(
last_row
,
SecondRow
),
assertz
(
saved_row
([
InitialTime
|
FullState
])
),
log_current_row
(
InitialTime
,
FullState
,
Fields
),
TrueInitialTime
is
InitialTime
),
rosenbrock_init
(
Epsilon_abs
),
rosenbrock
(
Equations
,
TrueInitialTime
,
Duration
,
MaxStSz
,
MinStSz
,
Jacobian
),
rosenbrock
(
Equations
,
TrueInitialTime
,
Duration
,
MaxStSz
,
MinStSz
,
Jacobian
,
Fields
),
retractall
(
k_fail
).
...
...
@@ -187,6 +188,37 @@ add_functions_names(VarName, VarFuncName) :-
give_function_name
(
function
(
Name
,
_Expr
),
Name
).
%! initialize_names(+Fields, -Names)
%
% Extract the name of the different fields to be plotted
initialize_names_int
([],
[]).
initialize_names_int
([
Name
:
_
|
FTail
],
[
Name
|
NTail
])
:-
initialize_names_int
(
FTail
,
NTail
).
initialize_names
([
Name
:
_
|
FTail
],
[
NName
|
NTail
])
:-
atom_concat
(
'# '
,
Name
,
NName
),
initialize_names_int
(
FTail
,
NTail
).
%! log_current_row(+Time, +State, +Fields)
log_current_row
(
Time
,
State
,
Fields
)
:-
prepare_row
(
Time
,
State
,
Fields
,
ToSave
),
assertz
(
saved_row
(
ToSave
)).
prepare_row
(
_Time
,
_State
,
[],
[])
:-
!.
prepare_row
(
Time
,
State
,
[
_N
:
t
|
FTail
],
[
Time
|
VTail
])
:-
!,
prepare_row
(
Time
,
State
,
FTail
,
VTail
).
prepare_row
(
Time
,
State
,
[
_N
:
x
(
N
)|
FTail
],
[
Val
|
VTail
])
:-
nth0
(
N
,
State
,
Val
),
prepare_row
(
Time
,
State
,
FTail
,
VTail
).
%! add_functions_values(+State, +Time, -FullState)
%
% Add the value of all functions to construct the FullState list
...
...
@@ -350,13 +382,13 @@ get_last_row(Time,CurrentState):-
/*
Rosenbrock method
*/
/*
*******************
*/
%! rosenbrock(+Equations, +InitialTime, +Duration, +
Jacobian
)
%! rosenbrock(+Equations, +InitialTime, +Duration, +
Max, +Min, +Jacobian, +Fields
)
%
% Parameters are stored within the global variable parameters_list
% The current state of the simulation if obtained in the final row of the global
% variable numerical_table
rosenbrock
(
Equations
,
InitialTime
,
Duration
,
MaxStSz
,
MinStSz
,
Jacobian
)
:-
rosenbrock
(
Equations
,
InitialTime
,
Duration
,
MaxStSz
,
MinStSz
,
Jacobian
,
Fields
)
:-
FinalTime
is
InitialTime
+
Duration
,
StepSizeMax
is
Duration
*
MaxStSz
,
StepSizeMin
is
Duration
*
MinStSz
,
...
...
@@ -402,7 +434,8 @@ rosenbrock(Equations, InitialTime, Duration, MaxStSz, MinStSz, Jacobian) :-
add_functions_values
(
Next_state
,
Time2
,
Next_state_full
),
NewLine
=..
[
row
,
Time2
|
Next_state_full
],
nb_setval
(
last_row
,
NewLine
),
assertz
(
saved_row
([
Time2
|
Next_state_full
])),
log_current_row
(
Time2
,
Next_state_full
,
Fields
),
% assertz(saved_row([Time2|Next_state_full])),
nb_setval
(
last_time
,
Time2
),
Time2
>=
FinalTime
,!,
%Collect the data for numerical table
...
...
rosenbrock.plt
View file @
6cfdcbcb
...
...
@@ -8,7 +8,7 @@ check_integration_1([], _Epsilon) :- !.
check_integration_1([Head|Tail], Epsilon) :-
Head = row(T,A,B),
Sum is A+B, near(1.0, Sum, Epsilon),
Value is exp(-T), near(
B
, Value, Epsilon),
Value is exp(-T), near(
A
, Value, Epsilon),
check_integration_1(Tail, Epsilon).
check_integration_2([], _Epsilon) :- !.
...
...
@@ -76,7 +76,7 @@ test(test_time_event, [setup(command(clear_model)), cleanup(command(clear_model)
command(add_event('Time'>=4, k=1)),
command(numerical_simulation(method:rsbk, time:5)),
get_table_data(D),
last(D, row(T,
_B,A
)),
last(D, row(T,
A,_B
)),
near(A, exp(2-T), 1e-5).
:- end_tests(rosenbrock).
tmpnb/tmpnb_panama.sh
View file @
6cfdcbcb
...
...
@@ -2,4 +2,4 @@
export
TOKEN
=
$(
head
-c
30 /dev/urandom | xxd
-p
)
docker run
-d
--restart
=
always
--net
=
host
-e
CONFIGPROXY_AUTH_TOKEN
=
$TOKEN
--expose
8000
--name
=
proxy jupyterhub/configurable-http-proxy
--default-target
http://127.0.0.1:9999
docker run
-d
--restart
=
always
--net
=
host
-e
CONFIGPROXY_AUTH_TOKEN
=
$TOKEN
--name
=
tmpnb
-v
/var/run/docker.sock:/docker.sock jupyter/tmpnb python orchestrate.py
--image
=
'registry.gitlab.inria.fr/lifeware/biocham:v4.
1.2
9'
--pool-size
=
40
--command
=
'start.sh biocham --notebook --NotebookApp.base_url={base_path} --NotebookApp.token={token} --ip=0.0.0.0 --port {port}'
docker run
-d
--restart
=
always
--net
=
host
-e
CONFIGPROXY_AUTH_TOKEN
=
$TOKEN
--name
=
tmpnb
-v
/var/run/docker.sock:/docker.sock jupyter/tmpnb python orchestrate.py
--image
=
'registry.gitlab.inria.fr/lifeware/biocham:v4.
3.
9'
--pool-size
=
40
--command
=
'start.sh biocham --notebook --NotebookApp.base_url={base_path} --NotebookApp.token={token} --ip=0.0.0.0 --port {port}'
tropical.pl
View file @
6cfdcbcb
...
...
@@ -235,7 +235,7 @@ subst_deg_and_vars(A/N, Vars, Ai, AA - D) :-
!,
subst_deg_and_vars
(
A
,
Vars
,
Ai
,
AA
).
% Only accept
division by
constants
% Only accept
addition of
constants
subst_deg_and_vars
(
N
+
M
,
_Vars
,
_Ai
,
D
)
:-
const_degree
(
N
+
M
,
D
),
!.
...
...
@@ -263,7 +263,7 @@ const_eval(N, N) :-
const_eval
(
Term
,
D
)
:-
Term
=..
[
Op
,
A
,
B
],
member
(
Op
,
[
'+'
,
'*'
,
'-'
,
'/'
]),
member
(
Op
,
[
'+'
,
'*'
,
'-'
,
'
^'
,
'
/'
]),
const_eval
(
A
,
AA
),
const_eval
(
B
,
BB
),
TTerm
=..
[
Op
,
AA
,
BB
],
...
...
web/index.html
View file @
6cfdcbcb
...
...
@@ -32,7 +32,7 @@
</head>
<body>
<h1>
The Biochemical Abstract Machine BIOCHAM 4
</h1>
<h1>
version 4.3.
9
January 2020
</h1>
<h1>
version 4.3.
10
January 2020
</h1>
<div
class=
"authors"
>
<p>
...
...
@@ -143,8 +143,11 @@ synthesizing reaction systems for executing imperative programs or computing rea
</l>
<br>
<li><span
style=
"text-decoration: underline;"
>
docker images:
</span>
<a
href=
"https://gitlab.inria.fr/lifeware/biocham"
>
https://gitlab.inria.fr/lifeware/biocham/container_registry
</a>
.
</li>
<a
href=
"https://gitlab.inria.fr/lifeware/biocham/container_registry"
>
https://gitlab.inria.fr/lifeware/biocham/container_registry
</a>
.
<br/>
Launch
with
<pre>
docker run -p 8888:8888 registry.gitlab.inria.fr/lifeware/biocham:[tag]
</pre>
You can add
<pre>
start.sh biocham --notebook --NotebookApp.token=''
</pre>
if you don't want
token-based authentication.
</li>
<br>
<li><span>
current notebook version online:
</span>
<a
href=
"http://lifeware.inria.fr/biocham4/online/"
>
biocham4 notebook
</a>
.
</li>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment