Commit 6d4c200e authored by BARGAIN Orianne's avatar BARGAIN Orianne
Browse files

add hill reaction detection

parent 4c2dca7f
E+S => ES.
ES => E+S.
ES => EP.
EP => E+P.
E+P => EP.
E+S=>SE.
SE+S=>SSE.
SSE=>SE+P.
SE=>E+P.
E+S=>ES.
ES+S=>SES.
E+S=>SE.
SE+S=>SES.
SES=>E+P.
E+S=>ES.
ES+S=>SES+X.
E+S=>SE.
SE+S=>SES.
SES=>E+P.
S+E=>ES.
S+ES=>X+SES.
S+E=>SE.
S+SE=>SES.
SES=>P+E.
E+S=>ES.
ES+S=>SES.
E+S=>SE.
SE+S=>SES.
SES=>E+P.
E+Y=>X.
......@@ -20,6 +20,7 @@
:- initial(option(r_2: no)).
:- initial(option(ep: no)).
:- initial(option(enzyme: yes)).
:- initial(option(hill_reaction: no)).
pattern_reduction(Input_file) :-
......@@ -30,6 +31,7 @@ pattern_reduction(Input_file) :-
option(r_1, yesno, MM_R_1, 'michaelis menten with R-1 reaction'),
option(r_2, yesno, MM_R_2, 'michaelis menten with R-2 reaction'),
option(ep, yesno, MM_EP, 'michaelis menten with EP specie'),
option(hill_reaction, yesno, Hill, 'specifies if reducing hill patterns'),
option(enzyme, yesno, MM_E, 'michaelis menten reduced reaction with enzyme'),
debug(motif, "Debugging motif reduction", []),
debug(motif, "Option: R_1:~w", [MM_R_1]),
......@@ -43,10 +45,20 @@ pattern_reduction(Input_file) :-
atom_concat(Root, "_reduced.bc", Output_file),
open(Output_file, write, Stream),
(
MM_complete=yes
MM_complete = yes
->
michaelis_menten_detection(Graph, Stream, Dict_arcs_direct, Dict_arcs_indirect, MM_R_1, MM_R_2, MM_EP, MM_E),
debug(motif, "Done looking for Michaelis Menten motifs", [])
;
true
),
(
Hill = yes
->
hill_detection(Graph, Stream, Dict_arcs_direct, Dict_arcs_indirect),
debug(motif, "Done looking for Hill motifs", [])
;
true
),
write_reactions(Graph, Stream, Dict_arcs_direct, Dict_arcs_indirect),
close(Stream).
......@@ -382,3 +394,116 @@ michaelis_menten_motif(ES, Dict_arcs_direct, Dict_arcs_indirect, E, S, P, MM_R_1
),
assert(seen(R1)),
assert(seen(R2)).
/* hill_detection */
/* hill_detection(+Graph, +Stream, +Dict_arcs_direct, +Dict_arcs_indirect)
-> looks for hill reactions
+Graph: the graph
+Stream: where to write the new graph
+Dict_arcs_direct: dict of directed arcs
+Dict_arcs_indirect: dict of undirected arcs */
hill_detection(Graph, Stream, Dict_arcs_direct, Dict_arcs_indirect):-
Graph = [Number_vertex, Number_species, _, Id],
assert(seen(Number_vertex)),
Number_species_1 is Number_species - 1,
numlist(0, Number_species_1, Species_list),
set_counter(hill_pattern_count, 0),
forall(
(
member(SES, Species_list)
),
(
(
not(seen(SES)),
once(hill_reaction(SES, Dict_arcs_direct, Dict_arcs_indirect, E, S, P))
->
debug(motif, "Hill reaction with E:~w S:~w P:~w SES:~w", [E, S, P, SES]),
write_reaction([E, S], [E, P], Id, Stream),
count(hill_pattern_count, _)
;
true
)
)
),
peek_count(hill_pattern_count, Nb_hill_reaction),
write('\nNumber of Hill patterns: '),
write(Nb_hill_reaction),
write('\n').
/* hill_reaction */
/* hill_reaction(+SES, +Dict_arcs_direct, +Dict_arcs_indirect, +E, +S, +P)
-> checks if the concerned species and reactions form a hill reaction
+SES: catalyser
+Dict_arcs_direct: dict of directed arcs
+Dict_arcs_indirect: dict of undirected arcs
+E: enzyme
+S: substrate
+P: product */
hill_reaction(SES, Dict_arcs_direct, Dict_arcs_indirect, E, S, P):-
get_dict(SES, Dict_arcs_indirect, Targets_SES),
(
Targets_SES = [R12, R22]
;
Targets_SES = [R22, R12]
),
get_dict(SES, Dict_arcs_direct, Goals_SES),
Goals_SES = [R3],
get_dict(R3, Dict_arcs_indirect, Targets_R3),
Targets_R3 = [SES],
get_dict(R3, Dict_arcs_direct, Goals_R3),
(
Goals_R3 = [E, P]
;
Goals_R3 = [P, E]
),
get_dict(R12, Dict_arcs_indirect, Targets_R12),
(
Targets_R12 = [S, ES]
;
Targets_R12 = [ES, S]
),
get_dict(R12, Dict_arcs_direct, Goals_R12),
Goals_R12 = [SES],
get_dict(R22, Dict_arcs_indirect, Targets_R22),
(
Targets_R22 = [S, SE]
;
Targets_R22 = [SE, S]
),
get_dict(R22, Dict_arcs_direct, Goals_R22),
Goals_R22 = [SES],
get_dict(ES, Dict_arcs_indirect, Targets_ES),
Targets_ES = [R11],
get_dict(ES, Dict_arcs_direct, Goals_ES),
Goals_ES = [R12],
get_dict(SE, Dict_arcs_indirect, Targets_SE),
Targets_SE = [R21],
get_dict(SE, Dict_arcs_direct, Goals_SE),
Goals_SE = [R22],
get_dict(R11, Dict_arcs_indirect, Targets_R11),
(
Targets_R11 = [S, E]
;
Targets_R11 = [E, S]
),
get_dict(R11, Dict_arcs_direct, Goals_R11),
Goals_R11 = [ES],
get_dict(R21, Dict_arcs_indirect, Targets_R21),
(
Targets_R21 = [S, E]
;
Targets_R21 = [E, S]
),
get_dict(R21, Dict_arcs_direct, Goals_R21),
Goals_R21 = [SE],
assert(seen(R11)),
assert(seen(R12)),
assert(seen(R21)),
assert(seen(R22)),
assert(seen(R3)),
assert(seen(ES)),
assert(seen(SE)),
assert(seen(SES)).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment