Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lifeware
biocham
Commits
8594410a
Commit
8594410a
authored
Jan 06, 2020
by
FAGES Francois
Browse files
TD1 et TD2, doc de plot et odefunction
parent
e923d6f7
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
8594410a
...
...
@@ -112,7 +112,7 @@ unit_tests: biocham_debug
# slow tests too
test
:
biocham_debug
echo
"flag(slow_test, _,
tru
e), run_tests_and_halt."
| ./biocham_debug
echo
"flag(slow_test, _,
fals
e), run_tests_and_halt."
| ./biocham_debug
$(MAKE)
jupyter_tests
jupyter_tests
:
install_kernel
...
...
@@ -120,7 +120,7 @@ jupyter_tests: install_kernel
# runs test unit %
test_%
:
biocham_debug
echo
"flag(slow_test, _,
tru
e), run_tests_and_halt('
$*
')."
| ./biocham_debug
echo
"flag(slow_test, _,
fals
e), run_tests_and_halt('
$*
')."
| ./biocham_debug
install_kernel
:
biocham $(KERNEL_DIR)/commands.js $(KERNEL_DIR)/commands.py $(WORKFLOWS_DIR)/workflows.js
-
pip3
install
--user
$(JUPYTER_DIR)
/kernel
||
pip
install
--user
$(JUPYTER_DIR)
/kernel
...
...
library/examples/C2-19-Biochemical-Programming/TD1_lotka_volterra.ipynb
View file @
8594410a
This diff is collapsed.
Click to expand it.
library/examples/C2-19-Biochemical-Programming/TD2_enzyme_kinetics.ipynb
View file @
8594410a
This diff is collapsed.
Click to expand it.
odefunction.pl
View file @
8594410a
...
...
@@ -407,30 +407,11 @@ add_function(FunctionList) :-
import_reactions_from_ode_system
(
OdeSystem
),
delete_item
(
OdeSystem
).
%% compile_program_file(+InputFile:input_file) is det
%
% Compile the high-level language program from file.
% Transform the terms in a file into internal list format of 'add_function'.
compile_program_file
(
InputFile
)
:-
biocham_command
,
type
(
InputFile
,
input_file
),
option
(
'simplify_variable_init'
,
yesno
,
_
,
'set if the variable initialization in program need to be simplified to \\emph{present} command'
),
option
(
'zero_ultra_mm'
,
yesno
,
_
,
'set the kinetics of zero-order ultrasensitivity to Michaelis-Menten kinetics'
),
devdoc
(
"Transform the terms in a file into internal list format of 'add_function'."
),
doc
(
"Compile the high-level language program from file."
),
access_file
(
InputFile
,
read
),
!,
open
(
InputFile
,
read
,
File
),
compile
(
File
),
close
(
File
).
%% compile_program(+InputFile:atom) is det
%
% Compile
the
high-level
languag
e program from a
tom
.
% Transform the terms in
an atom
into internal list format
o
f 'add_function'.
% Compile
s a
high-level
imperativ
e program from a
string
.
% Transform the terms in
the string
into
an
internal list format f
or
'add_function'.
compile_program
(
Program
)
:-
biocham_command
,
type
(
Program
,
atom
),
...
...
@@ -450,9 +431,9 @@ compile_program( Program ) :-
biocham
(
numerical_simulation
(
time
:
20
)
),
biocham
(
plot
(
show
:
{
x_p
,
x_n
,
y_p
,
y_n
,
z_p
,
z_n
}
)
),
doc
(
"Here is an example shows the compilation result of euclid division: "
),
biocham_silent
(
clear_model
),
biocham
(
compile_program
(
'a := 7, b := 3. while( a >= b ). t1 := a - b, t2 := q + 1. a := t1, q := t2. endwhile. r := a.'
,
simplify_variable_init
:
yes
,
zero_ultra_mm
:
yes
)
),
%
doc( "Here is an example shows the compilation result of euclid division: "),
%
biocham_silent( clear_model ),
%
biocham( compile_program( 'a := 7, b := 3. while( a >= b ). t1 := a - b, t2 := q + 1. a := t1, q := t2. endwhile. r := a.', simplify_variable_init: yes, zero_ultra_mm: yes ) ),
% FIXME tooooooo slow
% biocham( numerical_simulation( time: 200 ) ),
% biocham( plot( show:{ a_p, a_n, b_p, b_n, q_p, q_n, r_p, r_n } ) ),
...
...
@@ -464,6 +445,27 @@ compile_program( Program ) :-
compile
(
Stream
),
close
(
Stream
).
%% compile_program_file(+InputFile:input_file) is det
%
% Compiles a high-level imperative program file.
% Transforms the terms in the file into an internal list format for 'add_function'.
compile_program_file
(
InputFile
)
:-
biocham_command
,
type
(
InputFile
,
input_file
),
option
(
'simplify_variable_init'
,
yesno
,
_
,
'set if the variable initialization in program need to be simplified to \\emph{present} command'
),
option
(
'zero_ultra_mm'
,
yesno
,
_
,
'set the kinetics of zero-order ultrasensitivity to Michaelis-Menten kinetics'
),
devdoc
(
"Transform the terms in a file into internal list format of 'add_function'."
),
doc
(
"Compile the high-level language program from file."
),
access_file
(
InputFile
,
read
),
!,
open
(
InputFile
,
read
,
File
),
compile
(
File
),
close
(
File
).
%% create_ode(+FunctionList:list, +OdeSystem:'ode system') is det
%
% Compile the _FunctionList_ into PIVP.
...
...
plot.pl
View file @
8594410a
...
...
@@ -40,7 +40,7 @@ plot :-
),
option
(
show
,
{
object
},
Show
,
'Restricts the plot to the given set of objects; everything will be
'Restricts the plot to the given set of objects
and functions
; everything will be
plotted if the set is empty'
),
option
(
...
...
@@ -48,7 +48,7 @@ plot :-
'Selects the X axis for the plot, defaulting to Time.'
),
doc
(
'
plots the current trace.
plots the current trace.
After a simulation, the trace is composed of molecular concentrations and user-defined functions over time.
\\begin{example}'
),
handle_show
(
Show
),
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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