Commit b3940f4f authored by Sylvain Soliman's avatar Sylvain Soliman

Merge branch 'release/4.4.8'

parents 13e89b17 53d11d0b
......@@ -12,7 +12,7 @@ ifndef $(PREFIX)
PREFIX=/usr/local
endif
$(foreach var, CC PLBASE PLARCH PLLIB PLCFLAGS PLLDFLAGS PLSOEXT PLVERSION, \
$(foreach var, CC PLBASE PLARCH PLLIB PLLIBDIR PLCFLAGS PLLDFLAGS PLSOEXT PLVERSION, \
$(eval \
$(shell \
swipl --dump-runtime-variables | \
......@@ -37,7 +37,8 @@ endif
CFLAGS=$(addprefix -I, $(INCLUDEDIRS)) $(PLCFLAGS)
CXXFLAGS=$(CFLAGS) -std=c++11 `pkg-config --cflags libgvc`
LDFLAGS=$(PLLDFLAGS) $(RPATH) $(addprefix -L, $(PLBASE)/lib/$(PLARCH)/)
# FIXME PLLDFLAGS always empty?
LDFLAGS=$(PLLDFLAGS) $(RPATH) -L $(PLLIBDIR)
LIBSBML=$(shell pkg-config --silence-errors --libs libsbml)
ifeq ($(strip $(LIBSBML)),)
......
......@@ -8,7 +8,7 @@
about/0
]).
version('4.4.7').
version('4.4.8').
copyright(
'Copyright (C) 2003-2020 Inria, EPI Lifeware, Saclay-Île de France, France'
......
FROM registry.gitlab.inria.fr/lifeware/biocham:v4.4.7
FROM registry.gitlab.inria.fr/lifeware/biocham:v4.4.8
{
"name": "gui",
"version": "4.4.7",
"version": "4.4.8",
"description": "biocham gui in jupyter notebook",
"main": "src/index.js",
"scripts": {
......
......@@ -90,7 +90,6 @@ commands = [
"export_plot_to_png",
"export_sbml",
"export_table",
"find_reaction_prefixed",
"function",
"generate_ctl",
"generate_ctl_not",
......
"""Example magic"""
__version__ = '4.4.7'
__version__ = '4.4.8'
......@@ -31,8 +31,8 @@ def display_data_for_image(filename, handle=None, data_source=None, comm=None):
gui_fig, gui_cds = create_bokeh_plot(gui_plot_data, gui=True)
against = plot_data['against']
return handle_bokeh_plot(fig, gui_fig, against, cds=cds, gui_cds=gui_cds,
old_handle=handle, old_data=data_source, comm=comm)
old_handle=handle, old_data=data_source, comm=comm)
with open(filename, 'rb') as file:
image = file.read()
os.unlink(filename)
......@@ -53,7 +53,7 @@ def display_data_for_image(filename, handle=None, data_source=None, comm=None):
'image_type': image_type,
'image_data': image_data,
});
publish_display_data(data={image_type: image_data})
return None
......@@ -73,7 +73,7 @@ def get_data_and_meta(filename):
with open(filename, newline='') as csvfile:
lines = list(csv.reader(csvfile))
os.unlink(filename)
return {'lines': lines,
'logscale': logscale,
'to_show': to_show,
......@@ -89,11 +89,11 @@ def create_bokeh_plot(data, gui=False):
headers = lines.pop(0)
headers[0] = 'Time'
cds = ColumnDataSource({name: [float(lines[i][index])
for i in range(len(lines))]
for index, name in enumerate(headers)})
global bokeh_loaded # pylint:disable=global-statement,invalid-name
if not bokeh_loaded:
output_notebook(INLINE, hide_banner=True)
......@@ -114,7 +114,7 @@ def create_bokeh_plot(data, gui=False):
background_fill_color='oldlace',
sizing_mode=('fixed' if not gui else 'scale_width'),
)
fig.add_tools(HoverTool(tooltips=[
("x,y,name", "$x, $y, $name"),
]))
......@@ -127,7 +127,7 @@ def create_bokeh_plot(data, gui=False):
headers.remove(against)
if against != 'Time':
headers.remove('Time')
for idx, val in enumerate(headers):
color = Category10_10[idx % 10]
fig.line(x=against, y=val,
......@@ -148,7 +148,7 @@ def create_bokeh_plot(data, gui=False):
else:
minimum = min(minimum, min(cds.data[val]))
maximum = max(maximum, max(cds.data[val]))
if to_show != ['{}']:
if maximum == minimum:
maximum, minimum = minimum + 1, minimum - 1
......@@ -182,12 +182,12 @@ def create_bokeh_plot(data, gui=False):
y_range.renderers = legend.items.map(item => item.renderers[0].visible && item.renderers[0])
y_range.renderers.some(elem => elem) && Bokeh.index[fig.id].plot_canvas_view.update_dataranges()
"""
)
)
if against == 'Time':
for item in fig.legend[0].items:
item.renderers[0].js_on_change("visible", callback)
return fig, cds
......@@ -208,9 +208,9 @@ def handle_bokeh_plot(fig, gui_fig, against, cds=None, gui_cds=None, old_handle=
if comm.target_name == 'from_gui':
return
return show(layout, notebook_handle=True), cds
# set the data of the old plot to what we just read
old_data.data = cds.data
old_data.data = dict(cds.data)
# and display it
push_notebook(old_handle)
return old_handle, old_data
......@@ -246,11 +246,11 @@ def animation_callback(source):
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
cb_obj.label = "Tracing"
cb_obj.disabled = true
var data = source.data
async function update() {
for (let i=0; i<data.Time.length; i++) {
var ti = data.Time[i]
......@@ -259,7 +259,7 @@ def animation_callback(source):
source.selected.indices = [...Array(i+1).keys()]
await sleep(dt)
}
cb_obj.disabled = false
cb_obj.label = "Animate"
}
......
......@@ -197,6 +197,8 @@ generate_ctl(Formula):-
biocham_command,
type(Formula, ctl),
doc('adds to the CTL specification all the CTL formulas that are true, not subsumed by another CTL formula in the specification, and that match the argument formula in which the names that are not molecules are treated as wildcards and replaced by distinct molecules of the network. This command is a variant with subsumption test of \\command{add_ctl} if all names match network molecule names, otherwise it enumerates all m^v instances (where m is the number of molecules and v the number of wildcards in the formula).'),
option(boolean_initial_states, boolean_initial_states, NusmvInitialState,
'specifies whether the truth value of a formula is for all or some completion of the initial states (present/absent/undefined).'),
normalize_query(Formula,F,Leaves),
enumerate_molecules(Molecules),
subtract(Leaves,Molecules,L),
......@@ -208,7 +210,10 @@ generate_ctl(Formula):-
enumerate_instances(Wildcards,Molecules),
\+ cleanup_ctl(S),
\+ cleanup_ctl(Spec),
ctl_truth(S, true),
with_option(
boolean_trace: no,
check_ctl_impl(S, NusmvInitialState, true)
),
print(Spec),nl,
\+ add_ctl(Spec)
).
......
......@@ -21,12 +21,6 @@
:- doc('
First, the influence hypergraph of an influence network or a reaction network depicts the structure of the influences between the constituants of a model. It is represented by a bipartite molecule-influence graph.').
:- doc('Second, the influence graph of a reaction or influence network is a signed directed simple graph between the molecular species.
This graph an abstraction defined from the stoichiometry of the reactions, which is equivalent, under general conditions, to the influence graph defined by the signs of the Jacobian matrix of the ODEs \\cite{FS08fmsb,FGS15tcs}.').
:- doc('Third, the multistability graph is a multigraph variant of the influence graph in which the influence arcs are labelled by the reactions from which they originate.
This labelled graph can be used for checking very efficiently necessary conditions for the existence of oscillations and multiple steady states \\cite{BFS18jtb} (\\command{check_multistability/0}).').
:- devdoc('\\section{Commands}').
......@@ -54,10 +48,13 @@ draw_influence_hypergraph :-
).
:- doc('Second, the influence graph of a reaction or influence network is a signed directed simple graph between the molecular species.
This graph an abstraction defined from the stoichiometry of the reactions, which is equivalent, under general conditions, to the influence graph defined by the signs of the Jacobian matrix of the ODEs \\cite{FS08fmsb,FGS15tcs}.').
influence_graph :-
biocham_command,
doc('builds the influence graph between molecular species without distinguishing the different influences.'),
doc('builds the influence graph between molecular species of the current model without distinguishing between reaction and influence rules.'),
delete_items([kind: graph, key: influence_graph]),
new_graph,
set_graph_name(influence_graph),
......@@ -68,7 +65,7 @@ influence_graph :-
draw_influences :-
biocham_command,
doc('
Draws the influence graph between molecular species of the current model, by merging the different influences. Equivalent to \\texttt{influence_graph. draw_graph}.
draws the influence graph between molecular species of the current model. Equivalent to \\texttt{influence_graph. draw_graph}.
\\begin{example}
'),
biocham_silent(clear_model),
......
......@@ -32,14 +32,18 @@ list_stable_states :-
BoolSem,
'Use positive or negative boolean semantics for inhibitors.'
),
option(boolean_state_display, boolean_state_display, _,
'choice of display of the boolean states.'),
list_stable_states(BoolSem),
forall(
stable_state(NState),
findall(
NState,
(
write_bool_state(NState),
nl
)
).
stable_state(BState),
maplist(number_state, BState, NState)
),
States
),
display_vectors(States).
:- dynamic(stable_state/1).
......@@ -81,6 +85,8 @@ list_tscc_candidates :-
Components (TSCC) of the state transition graph corresponding to the
positive semantics of the current influence model.
'),
option(boolean_state_display, boolean_state_display, _,
'choice of display of the boolean states.'),
retractall(candidate(_)),
statistics(walltime, _),
with_influence_model(influence_properties:(
......@@ -93,6 +99,7 @@ list_tscc_candidates :-
close(Stream),
run_sat_iteratively(FileName, Solutions),
debug(tscc, "solutions: ~w", [Solutions]),
display_vector_header,
forall(
member(Solution, Solutions),
(
......@@ -300,7 +307,7 @@ number_state(N, S-V) :-
write_bool_state(BoolState) :-
maplist(number_state, BoolState, BoolList),
write(BoolList).
display_vector(BoolList).
enumerate_objects(Objects) :-
......@@ -385,7 +392,7 @@ candidates_in_positive_tscc(NCandidates, NTSCCs) :-
(
fail, % too slow for negative semantics unfortunately
with_option(
[boolean_semantics: negative, nusmv_counter_example: no],
[boolean_semantics: negative, boolean_trace: no],
check_ctl_impl(TSCCSpec, all, Result)
),
write(Result),nl,
......@@ -426,7 +433,7 @@ can_reach_stable(Spec) :-
maplist(reachable_spec(Spec), Stables, Reachables),
join_with_op(Reachables, '\\/', AnyReachable),
with_option(
[nusmv_counter_example: no, boolean_semantics: positive],
[boolean_trace: no, boolean_semantics: positive],
check_ctl_impl(AnyReachable, all, Result)
),
Result == true.
......
......@@ -50,7 +50,7 @@ test(
cleanup(clear_model)
]
) :-
with_output_to(atom(Output), list_tscc_candidates),
with_output_to(atom(Output), with_option(boolean_state_display: vector, list_tscc_candidates)),
sub_atom(Output, _, _, _, '[G-1,L-1,PC-1] terminal'),
!.
......@@ -61,7 +61,7 @@ test(
cleanup(clear_model)
]
) :-
with_output_to(atom(Output), list_tscc_candidates),
with_output_to(atom(Output), with_option(boolean_state_display: vector, list_tscc_candidates)),
sub_atom(Output, Before, _, After, '[C-1,D-1,N-1,P-0] terminal'),
!,
\+ sub_atom(Before, _, _, _, '] terminal'),
......
......@@ -45,7 +45,10 @@ then
if [[ $release == "xenial" || $release == "bionic" ]]
then
sudo apt-get -qy install software-properties-common
sudo apt-add-repository -y ppa:swi-prolog/stable
sudo apt-get -qy install swi-prolog libsbml5-dev
sudo cp /usr/lib/swi-prolog/lib/x86_64-linux/libswipl.* /usr/lib/
if [[ $release == "bionic" ]]
then
sudo apt-get -qy install zlib1g-dev
......@@ -55,7 +58,7 @@ then
call_cleanup(
(
current_prolog_flag(version, Version),
Version >= 70203,
Version >= 80003,
halt(0)
),
halt(1)
......@@ -64,12 +67,12 @@ then
# Compiling swi-prolog from source, expecting that a newer version of
# swi-prolog should be packaged in the next releases of Ubuntu
sudo apt-get -qy install libreadline-dev libgmp-dev
if [[ ! -d swipl-7.2.3 ]]
if [[ ! -d swipl-8.0.3 ]]
then
curl -fsSLO http://www.swi-prolog.org/download/stable/src/swipl-7.2.3.tar.gz
tar -xf swipl-7.2.3.tar.gz
curl -fsSLO http://www.swi-prolog.org/download/stable/src/swipl-8.0.3.tar.gz
tar -xf swipl-8.0.3.tar.gz
fi
pushd swipl-7.2.3
pushd swipl-8.0.3
./configure
make
sudo make install
......
% Transmembrane inputs
MA(k25) for glucoseext => glucose.
MA(k26) for acetoneext => acetone.
% Glucose pathway to NADH
MA(k19) for G_1DH + NAD => Cia1.
MA(k20) for Cia1 => G_1DH + NAD.
MA(k21) for Cia1 + glucose => Cib1.
MA(k22) for Cib1 => Cia1 + glucose.
MA(k23) for Cib1 => Cfa1 + NADH.
MA(k24) for Cfa1 => G_1DH + gluconolacrone.
% Acetone pathway to Resorufin by consuming NADH
MA(k13) for ADH + NADH => Cia2.
MA(k14) for Cia2 => ADH + NADH.
MA(k15) for Cia2 + acetone => Cib2.
MA(k16) for Cib2 => Cia2 + acetone.
MA(k17) for Cib2 => Cfa2 + NAD.
MA(k18) for Cfa2 => ADH + isopropanol.
MA(k1) for HRP + H_2O_2 => Cia5.
MA(k2) for Cia5 => HRP + H_2O_2.
MA(k3) for Cia5 + resazurin => Cib5.
MA(k4) for Cib5 => Cia5 + resazurin.
MA(k5) for Cib5 => HRP + resorufin.
MA(k6) for HRP2 + NADH => Cf4.
MA(k7) for Cf4 => HRP2 + NADH.
MA(k8) for Cf4 => HRP2 + NADN.
MA(k9) for AO + isopropanol => Cf3.
MA(k10) for Cf3 => AO + isopropanol.
MA(k11) for Cf3 => Cio3 + H_2O_2.
MA(k12) for Cio3 => AO + HRP2.
% kinetic parameters
parameter(k1= 1.15157e-5).
parameter(k2=24).
parameter(k3=7.77313e-006).
parameter(k4=1).
parameter(k5=240).
parameter(k6=2.91492e-009).
parameter(k7=0.0009).
parameter(k8=0.009).
parameter(k9=5.82985e-008).
parameter(k10=15).
parameter(k11=150).
parameter(k12=10000).
parameter(k13=9.50049e-012).
parameter(k14=0.033).
parameter(k15=1.08824e-006).
parameter(k16=0.07).
parameter(k17=0.7).
parameter(k18=0.33).
parameter(k19=1.8077e-006).
parameter(k20=40).
parameter(k21=9.71641e-009).
parameter(k22=20).
parameter(k23=200).
parameter(k24=400).
parameter(k25=5e-3).
parameter(k26=1e-2).
% initial conditions
present(G_1DH, c).
present(ADH, a).
present(NADH, 31533).
present(NAD, 1576691971).
present(resazurin, 315338394).
present(HRP, 6565).
present(AO, b).
present(HRP2, 6565).
present(glucoseext, glu).
present(acetoneext, ace).
parameter(a=92078816, b=175012, c=2232595).
parameter(glu=3e8, ace=3e8).
option(show:{NADH, resorufin}, time:3600).
......@@ -40,7 +40,7 @@
"* acetoneext\n",
"* Lactateext\n",
"* ethanol ```EtOHext```\n",
"* nitric oxydes ```NO2, NO3```\n",
"* nitric oxydes ```NO2ext, NO3ext```\n",
"\n",
"### reactions producing outputs visible by color or fluorescence: \n",
"* resorufin\n",
......@@ -52,6 +52,7 @@
"* ABTS\n",
"* NADH\n",
"* NAD\n",
"* LO\n",
"* resazurin\n",
"* HRP\n",
"* AO\n",
......@@ -284,23 +285,29 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
" [(MA(0.005)for glucoseext=>glucose),(MA(9.71641e-9)for CCia1+glucose=>CCib1),(MA(200)for CCib1=>CCfa1+NADH)]\r\n",
"[(MA(0.01)for acetoneext=>acetone),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.000119706)for DDia1+NAD=>DDfa1),(MA(308)for DDfa1=>DDio1+acetaldehyde),(MA(10000)for DDio1=>ADH+NADH),(MA(0.000204045)for Cia2+NADH=>Cfa2),(MA(210)for Cfa2=>Cio2+NO2),(MA(10000)for Cio2=>NR+NAD)]\r\n",
"[(MA(0.01)for acetoneext=>acetone),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.000119706)for DDia1+NAD=>DDfa1),(MA(308)for DDfa1=>DDio1+acetaldehyde),(MA(10000)for DDio1=>ADH+NADH),(MA(1.94328e-6)for Cia3+NADH=>Cfa3),(MA(2)for Cfa3=>Cio3+NO),(MA(10000)for Cio3=>NR+NAD)]\r\n",
"NADH+NR=>Cib3\r\n",
"[(MA(0.2)for Cib3=>NR+NADH),(MA(9.50049e-12)for ADH+NADH=>CCia2),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.33)for CCfa2=>ADH+isopropanol),(MA(5.82985e-8)for AO+isopropanol=>CCf3),(MA(150)for CCf3=>CCio3+H_2O_2),(MA(1.15157e-5)for HRP+H_2O_2=>CCia5),(MA(7.77313e-6)for CCia5+resazurin=>CCib5),(MA(240)for CCib5=>HRP+resorufin)]\r\n",
"[ADH,AO,CCia1,CCia2,Cia2,DDia1,HRP,acetone,resazurin]\r\n",
"[ADH,AO,CCia1,CCia2,Cia3,DDia1,HRP,acetone,resazurin]\r\n",
"\r\n",
"[(MA(0.005)for glucoseext=>glucose),(MA(9.71641e-9)for CCia1+glucose=>CCib1),(MA(200)for CCib1=>CCfa1+NADH),(MA(0.000204045)for Cia2+NADH=>Cfa2),(MA(210)for Cfa2=>Cio2+NO2),(MA(1.05042e-6)for NR+NO2=>Cia3)]\r\n",
"[(MA(0.01)for acetoneext=>acetone),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.000119706)for DDia1+NAD=>DDfa1),(MA(308)for DDfa1=>DDio1+acetaldehyde),(MA(10000)for DDio1=>ADH+NADH)]\r\n",
"Cia3+NADH=>Cfa3\r\n",
"[(MA(2)for Cfa3=>Cio3+NO),(MA(10000)for Cio3=>NR+NAD),(MA(3.37961e-7)for G_1DH+NAD=>Cia1),(MA(9.71641e-9)for Cia1+glucose=>Cib1),(MA(200)for Cib1=>Cfa1+NADH),(MA(9.50049e-12)for ADH+NADH=>CCia2),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.33)for CCfa2=>ADH+isopropanol),(MA(5.82985e-8)for AO+isopropanol=>CCf3),(MA(150)for CCf3=>CCio3+H_2O_2),(MA(1.15157e-5)for HRP+H_2O_2=>CCia5),(MA(7.77313e-6)for CCia5+resazurin=>CCib5),(MA(240)for CCib5=>HRP+resorufin)]\r\n",
"[ADH,AO,CCia1,CCia2,Cia2,DDia1,G_1DH,HRP,NR,acetone,glucose,resazurin]\r\n",
"\r\n",
"[(MA(0.005)for glucoseext=>glucose),(MA(9.71641e-9)for CCia1+glucose=>CCib1),(MA(200)for CCib1=>CCfa1+NADH),(MA(400)for CCfa1=>G_1DH+gluconolacrone)]\r\n",
"[(MA(0.01)for acetoneext=>acetone),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD)]\r\n",
"G_1DH+NAD=>Cia1\r\n",
"[(MA(9.71641e-9)for Cia1+glucose=>Cib1),(MA(200)for Cib1=>Cfa1+NADH),(MA(9.50049e-12)for ADH+NADH=>CCia2),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.33)for CCfa2=>ADH+isopropanol),(MA(5.82985e-8)for AO+isopropanol=>CCf3),(MA(150)for CCf3=>CCio3+H_2O_2),(MA(1.15157e-5)for HRP+H_2O_2=>CCia5),(MA(7.77313e-6)for CCia5+resazurin=>CCib5),(MA(240)for CCib5=>HRP+resorufin)]\r\n",
"[ADH,AO,CCia1,CCia2,HRP,acetone,glucose,resazurin]\r\n",
"[(MA(0.005)for glucoseext=>glucose),(MA(9.71641e-9)for CCia1+glucose=>CCib1),(MA(200)for CCib1=>CCfa1+NADH),(MA(1.94328e-6)for NR+NADH=>Cib3)]\r\n",
"[(MA(0.01)for acetoneext=>acetone),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.000119706)for DDia1+NAD=>DDfa1),(MA(308)for DDfa1=>DDio1+acetaldehyde),(MA(10000)for DDio1=>ADH+NADH),(MA(0.000204045)for Cia2+NADH=>Cfa2),(MA(210)for Cfa2=>Cio2+NO2)]\r\n",
"Cib3+NO2=>Cfb3\r\n",
"[(MA(2)for Cfb3=>Cio3+NO),(MA(10000)for Cio3=>NR+NAD),(MA(3.37961e-7)for G_1DH+NAD=>Cia1),(MA(9.71641e-9)for Cia1+glucose=>Cib1),(MA(200)for Cib1=>Cfa1+NADH),(MA(9.50049e-12)for ADH+NADH=>CCia2),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.33)for CCfa2=>ADH+isopropanol),(MA(5.82985e-8)for AO+isopropanol=>CCf3),(MA(150)for CCf3=>CCio3+H_2O_2),(MA(1.15157e-5)for HRP+H_2O_2=>CCia5),(MA(7.77313e-6)for CCia5+resazurin=>CCib5),(MA(240)for CCib5=>HRP+resorufin)]\r\n",
"[ADH,AO,CCia1,CCia2,Cia2,DDia1,G_1DH,HRP,NR,acetone,glucose,resazurin]\r\n",
"\r\n",
"[(MA(0.005)for glucoseext=>glucose),(MA(9.71641e-9)for CCia1+glucose=>CCib1),(MA(200)for CCib1=>CCfa1+NADH),(MA(9.50049e-12)for ADH+NADH=>CCia2)]\r\n",
"[(MA(0.01)for acetoneext=>acetone)]\r\n",
......@@ -308,28 +315,22 @@
"[(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.33)for CCfa2=>ADH+isopropanol),(MA(5.82985e-8)for AO+isopropanol=>CCf3),(MA(150)for CCf3=>CCio3+H_2O_2),(MA(1.15157e-5)for HRP+H_2O_2=>CCia5),(MA(7.77313e-6)for CCia5+resazurin=>CCib5),(MA(240)for CCib5=>HRP+resorufin)]\r\n",
"[ADH,AO,CCia1,HRP,resazurin]\r\n",
"\r\n",
"[(MA(0.005)for glucoseext=>glucose),(MA(9.71641e-9)for CCia1+glucose=>CCib1),(MA(200)for CCib1=>CCfa1+NADH),(MA(1.94328e-6)for NR+NADH=>Cib3)]\r\n",
"[(MA(0.01)for acetoneext=>acetone),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.000119706)for DDia1+NAD=>DDfa1),(MA(308)for DDfa1=>DDio1+acetaldehyde),(MA(10000)for DDio1=>ADH+NADH),(MA(0.000204045)for Cia2+NADH=>Cfa2),(MA(210)for Cfa2=>Cio2+NO2)]\r\n",
"Cib3+NO2=>Cfb3\r\n",
"[(MA(0.2)for Cfb3=>Cib3+NO2),(MA(0.2)for Cib3=>NR+NADH),(MA(9.50049e-12)for ADH+NADH=>CCia2),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.33)for CCfa2=>ADH+isopropanol),(MA(5.82985e-8)for AO+isopropanol=>CCf3),(MA(150)for CCf3=>CCio3+H_2O_2),(MA(1.15157e-5)for HRP+H_2O_2=>CCia5),(MA(7.77313e-6)for CCia5+resazurin=>CCib5),(MA(240)for CCib5=>HRP+resorufin)]\r\n",
"[ADH,AO,CCia1,CCia2,Cia2,DDia1,HRP,NR,acetone,resazurin]\r\n",
"\r\n",
"[(MA(0.005)for glucoseext=>glucose),(MA(9.71641e-9)for CCia1+glucose=>CCib1),(MA(200)for CCib1=>CCfa1+NADH),(MA(0.000204045)for Cia2+NADH=>Cfa2),(MA(210)for Cfa2=>Cio2+NO2),(MA(1.05042e-6)for NR+NO2=>Cia3)]\r\n",
"[(MA(0.01)for acetoneext=>acetone),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.000119706)for DDia1+NAD=>DDfa1),(MA(308)for DDfa1=>DDio1+acetaldehyde),(MA(10000)for DDio1=>ADH+NADH)]\r\n",
"Cia3+NADH=>Cfa3\r\n",
"[(MA(2)for Cfa3=>Cio3+NO),(MA(10000)for Cio3=>NR+NAD),(MA(0.000119706)for DDia1+NAD=>DDfa1),(MA(308)for DDfa1=>DDio1+acetaldehyde),(MA(10000)for DDio1=>ADH+NADH),(MA(9.50049e-12)for ADH+NADH=>CCia2),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.33)for CCfa2=>ADH+isopropanol),(MA(5.82985e-8)for AO+isopropanol=>CCf3),(MA(150)for CCf3=>CCio3+H_2O_2),(MA(1.15157e-5)for HRP+H_2O_2=>CCia5),(MA(7.77313e-6)for CCia5+resazurin=>CCib5),(MA(240)for CCib5=>HRP+resorufin)]\r\n",
"[AO,CCia1,CCia2,Cia2,DDia1,HRP,NR,acetone,resazurin]\r\n",
"[(MA(0.005)for glucoseext=>glucose),(MA(9.71641e-9)for CCia1+glucose=>CCib1),(MA(200)for CCib1=>CCfa1+NADH),(MA(0.000204045)for Cia2+NADH=>Cfa2),(MA(210)for Cfa2=>Cio2+NO2)]\r\n",
"[(MA(0.01)for acetoneext=>acetone),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.000119706)for DDia1+NAD=>DDfa1),(MA(308)for DDfa1=>DDio1+acetaldehyde),(MA(10000)for DDio1=>ADH+NADH),(MA(1.94328e-6)for Cia3+NADH=>Cfa3),(MA(2)for Cfa3=>Cio3+NO),(MA(10000)for Cio3=>NR+NAD)]\r\n",
"NO2+NR=>Cia3\r\n",
"[(MA(1.94328e-6)for Cia3+NADH=>Cfa3),(MA(2)for Cfa3=>Cio3+NO),(MA(10000)for Cio3=>NR+NAD),(MA(3.37961e-7)for G_1DH+NAD=>Cia1),(MA(9.71641e-9)for Cia1+glucose=>Cib1),(MA(200)for Cib1=>Cfa1+NADH),(MA(9.50049e-12)for ADH+NADH=>CCia2),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.33)for CCfa2=>ADH+isopropanol),(MA(5.82985e-8)for AO+isopropanol=>CCf3),(MA(150)for CCf3=>CCio3+H_2O_2),(MA(1.15157e-5)for HRP+H_2O_2=>CCia5),(MA(7.77313e-6)for CCia5+resazurin=>CCib5),(MA(240)for CCib5=>HRP+resorufin)]\r\n",
"[ADH,AO,CCia1,CCia2,Cia2,Cia3,DDia1,G_1DH,HRP,NADH,acetone,glucose,resazurin]\r\n",
"\r\n",
"[(MA(0.005)for glucoseext=>glucose),(MA(9.71641e-9)for CCia1+glucose=>CCib1),(MA(200)for CCib1=>CCfa1+NADH),(MA(1.94328e-6)for Cia3+NADH=>Cfa3),(MA(2)for Cfa3=>Cio3+NO),(MA(10000)for Cio3=>NR+NAD),(MA(5.44119e-5)for NR+NO3=>Cia2)]\r\n",
"[(MA(0.01)for acetoneext=>acetone),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.000119706)for DDia1+NAD=>DDfa1),(MA(308)for DDfa1=>DDio1+acetaldehyde),(MA(10000)for DDio1=>ADH+NADH)]\r\n",
"Cia2+NADH=>Cfa2\r\n",
"[(MA(210)for Cfa2=>Cio2+NO2),(MA(10000)for Cio2=>NR+NAD),(MA(0.000119706)for DDia1+NAD=>DDfa1),(MA(308)for DDfa1=>DDio1+acetaldehyde),(MA(10000)for DDio1=>ADH+NADH),(MA(9.50049e-12)for ADH+NADH=>CCia2),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.33)for CCfa2=>ADH+isopropanol),(MA(5.82985e-8)for AO+isopropanol=>CCf3),(MA(150)for CCf3=>CCio3+H_2O_2),(MA(1.15157e-5)for HRP+H_2O_2=>CCia5),(MA(7.77313e-6)for CCia5+resazurin=>CCib5),(MA(240)for CCib5=>HRP+resorufin)]\r\n",
"[AO,CCia1,CCia2,Cia3,DDia1,HRP,NO3,acetone,resazurin]\r\n",
"[(MA(210)for Cfa2=>Cio2+NO2),(MA(10000)for Cio2=>NR+NAD),(MA(3.37961e-7)for G_1DH+NAD=>Cia1),(MA(9.71641e-9)for Cia1+glucose=>Cib1),(MA(200)for Cib1=>Cfa1+NADH),(MA(9.50049e-12)for ADH+NADH=>CCia2),(MA(1.08824e-6)for CCia2+acetone=>CCib2),(MA(0.7)for CCib2=>CCfa2+NAD),(MA(0.33)for CCfa2=>ADH+isopropanol),(MA(5.82985e-8)for AO+isopropanol=>CCf3),(MA(150)for CCf3=>CCio3+H_2O_2),(MA(1.15157e-5)for HRP+H_2O_2=>CCia5),(MA(7.77313e-6)for CCia5+resazurin=>CCib5),(MA(240)for CCib5=>HRP+resorufin)]\r\n",
"[ADH,AO,CCia1,CCia2,Cia3,DDia1,G_1DH,HRP,NO3,acetone,glucose,resazurin]\r\n",
"\r\n",
"[G=_39928,GR=_39930,A=_39936,AR=_39938,R=_39950,RR=_39962,Reactants=_39986]\r\n"
"[G=_166722,GR=_166724,A=_166730,AR=_166732,R=_166744,RR=_166756,Reactants=_166780]\r\n"
]
},
"execution_count": 1,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
......
This diff is collapsed.
:- module(partialfraction, [
partial_fraction/5
]).
degree/2,
partial_fraction/5
]).
% :- use_foreign_library(foreign(roots)).
......@@ -15,11 +16,9 @@ small(A) :-
% calculates the degree of a polynomial
% with the null polynomial being of degree -1 instead of -infinity.
degree([], -1).
degree([_|A_next], D) :-
degree(A_next, D_next),
D is D_next + 1.
degree(Polynomial, Degree) :-
length(Polynomial, N),
Degree is N - 1.
% calculates the oppisite polynomial, i.e. -P.
opposite([], []).
......
......@@ -11,6 +11,7 @@
:- use_module(doc).
:- use_module(counters).
:- use_module(invariants).
:- use_module(lemon).
:- use_module(multistability_command).
......@@ -18,6 +19,141 @@
:- devdoc('\\section{Commands}').
:- doc('Third, the multistability graph is a multigraph variant of the influence graph in which the influence arcs are labelled by the reactions from which they originate.
This labelled graph can be used for checking very efficiently necessary conditions for the existence of oscillations and multiple steady states \\cite{BFS18jtb} (\\command{check_multistability/0}).').
:- initial(option(force_graph: no)).
multistability_graph(GraphId) :-
lemon:number_reactions,
retractall(reactions(_, _)),
set_counter(reactions, 1),
retractall(correspond_vertex_name_id(_, _)),
\+ (
(
item([kind: reaction, item: Item]),
reaction(Item, [
reactants: Reactants,
inhibitors: Inhibitors,
products: Products
]),
Origin = Item,
substract_list(Reactants, Products, Difference),
(
member(_ * Input, Reactants),
InputSign = +
;
member(Input, Inhibitors),
InputSign = -
),
member(Coefficient * Output, Difference),
(Coefficient > 0
->
RuleSign = +
;
RuleSign = -
)
;
item([kind: influence, item: Item]),
influence(Item, [
positive_inputs: PositiveInputs,
negative_inputs: NegativeInputs,
sign: RuleSign,
output: Output
]),
Origin = Item,
(
member(Input, PositiveInputs),
InputSign = +
;
member(Input, NegativeInputs),
InputSign = -
)
),
\+ (
lemon:normalize_reaction(Origin, Normalized, Negated),
(
reactions(Normalized, RId)
->
(