Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lifeware
biocham
Commits
0018af7d
Commit
0018af7d
authored
Jan 22, 2016
by
FAGES Francois
Browse files
Merge branch 'master' of
git+ssh://scm.gforge.inria.fr/gitroot/biocham/biocham
parents
c7008174
1ff94d9d
Changes
9
Hide whitespace changes
Inline
Side-by-side
filename.pl
View file @
0018af7d
...
...
@@ -30,8 +30,10 @@ filename(Filename, ExpandedFilename) :-
library_path
(
LibraryPath
),
Options
=
[
relative_to
(
LibraryPath
)]
;
Options
=
[],
SubFilename
=
Filename
SubFilename
=
Filename
,
%Options = [], !bugwar: relative_to(Dir)!
working_directory
(
Dir
,
Dir
),
Options
=
[
relative_to
(
Dir
)]
),
absolute_file_name
(
SubFilename
,
ExpandedFilename
,
[
expand
(
true
)
|
Options
]).
...
...
numerical_simulation.pl
View file @
0018af7d
...
...
@@ -173,6 +173,10 @@ convert_expression(- A, - AIndexed) :-
!,
convert_expression
(
A
,
AIndexed
).
convert_expression
([
A
],
-
AIndexed
)
:-
!,
convert_expression
(
A
,
AIndexed
).
convert_expression
(
A
+
B
,
AIndexed
+
BIndexed
)
:-
!,
convert_expression
(
A
,
AIndexed
),
...
...
nusmv.pl
View file @
0018af7d
...
...
@@ -219,5 +219,3 @@ reserved('EX').
reserved
(
'xor'
).
reserved
(
'R'
).
ode.pl
View file @
0018af7d
...
...
@@ -3,7 +3,8 @@
[
list_ODE
/
0
,
compute_ode
/
0
,
ode
/
2
ode
/
2
,
load_ode
/
1
]).
:-
dynamic
(
ode
/
2
).
...
...
@@ -79,3 +80,40 @@ print_ode :-
format
(
'~f \td[~w]/dt=~w\n'
,
[
InitialConcentration
,
Molecule
,
Equation
])
)
).
load_ode
(
InputFile
)
:-
biocham_command
,
type
(
InputFile
,
input_file
),
doc
(
'
creates a new Biocham model (reaction rules, initial state, parameters and
macros) inferred from an xppaut .ode file (preferably written with
parameters).
'
),
external_convert_ode
(
InputFile
,
'external_ode.bc'
),
load_biocham
(
'external_ode.bc'
).
add_ode
(
InputFile
)
:-
biocham_command
,
type
(
InputFile
,
input_file
),
doc
(
'
adds reaction rules, initial state, parameters and
macros inferred from an xppaut .ode file (preferably written with
parameters).
'
),
external_convert_ode
(
InputFile
,
'external_ode.bc'
),
add_biocham
(
'external_ode.bc'
).
external_convert_ode
(
InputFile
,
OutputFile
)
:-
setup_call_cleanup
(
open
(
'external_load_ode.bc'
,
write
,
Ode_bc
),
(
portray_clause
(
Ode_bc
,
load_ode
(
InputFile
)),
portray_clause
(
Ode_bc
,
export_biocham
(
OutputFile
)),
portray_clause
(
Ode_bc
,
'quit'
)
),
close
(
Ode_bc
)
),
call_subprocess
(
path
(
biocham
),
[
'external_load_ode.bc'
],
[
stdout
(
pipe
(
_
))]).
ode.plt
View file @
0018af7d
...
...
@@ -13,4 +13,21 @@ test('compute_ode', [true(ODEs == [ode(b, a), ode(a, -a)])]) :-
ODEs).
test('load_ode', [true(Reactions = [[a] for a => b])]) :-
clear_model,
setup_call_cleanup(
open('test.ode', write, TestOde),
write(TestOde, '
init a = 0
init b = 0
da/dt = -a
db/dt = a
done
'),
close(TestOde)
),
load_ode('test.ode'),
all_items([kind: reaction], Reactions).
:- end_tests(ode).
plot.pl
View file @
0018af7d
...
...
@@ -64,8 +64,9 @@ export_plot(FileTemplate, Options) :-
export_table
(
CsvFile
),
get_table_data
([
HeaderRow
|
_
]),
HeaderRow
=..
[
row
,
_TimeHeader
|
Headers
],
absolute_file_name
(
PlotFile
,
AbsolutePlotFile
),
setup_call_cleanup
(
open
(
PlotFile
,
write
,
Stream
),
open
(
Absolute
PlotFile
,
write
,
Stream
),
export_plot_stream
(
Stream
,
CsvFile
,
Headers
,
Options
),
close
(
Stream
)
).
...
...
reaction_rules.pl
View file @
0018af7d
...
...
@@ -117,6 +117,10 @@ kinetics((SimpleKinetics0, SimpleKinetics1)) :-
:-
grammar
(
simple_kinetics
).
simple_kinetics
([
A
])
:-
simple_kinetics
(
A
).
simple_kinetics
(
SimpleKinetics0
+
SimpleKinetics1
)
:-
simple_kinetics
(
SimpleKinetics0
),
simple_kinetics
(
SimpleKinetics1
).
...
...
tables.pl
View file @
0018af7d
...
...
@@ -74,7 +74,9 @@ export_table(OutputFile) :-
TitleRow
=..
[
row
|
ColumnNames
],
Table
=
[
TitleRow
|
Data
]
),
csv_write_file
(
FilenameCsv
,
Table
).
working_directory
(
Dir
,
Dir
),
absolute_file_name
(
FilenameCsv
,
AbsoluteFilenameCsv
,
[
relative_to
(
Dir
)]),
csv_write_file
(
AbsoluteFilenameCsv
,
Table
).
list_tables
:-
...
...
test.bc
View file @
0018af7d
A <=> B.
list_ODE.
numerical_simulation.
quit.
\ No newline at end of file
% BIOCHAM model file
% Reaction rules
[a] for a=>b.
% Initial state
absent(a).
absent(b).
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