\!\(\(\(\(BeginPackage["\"];\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(kMech::usage = \[IndentingNewLine]\t\t"\";\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(Begin["\<`Private`\>"];\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\( \ (*\ Name\ Concatenation\ for\ Enzyme - Substrates\ Complexes\ *) \)\(\[IndentingNewLine]\) \(\(Clear[NC];\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(NC[V_Symbol] := \ ToExpression[ StringJoin["\<$Complex$\>", ToString[V], "\<$\>"]];\)\(\[IndentingNewLine]\) \)\(\n\) \(NC[V__, W_Symbol] := \ ToExpression[ StringJoin[ToString[NC[V]], ToString[ W], "\<$\>"]];\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\( \ (*\ Name\ Concatenation\ for\ Multiple\ Inhibitors\ Reaction\ *) \)\(\ \[IndentingNewLine]\) \(Clear[NC2];\)\(\[IndentingNewLine]\)\(\ \)\(\[IndentingNewLine]\) \(\(NC2[V_] := ToExpression["\<$Complex$\>" <> ToString[V] <> "\<$\>"];\)\(\n\) \)\(\[IndentingNewLine]\) \(NC2[V__, W_] := ToExpression[ ToString[NC2[V]] <> ToString[ W]];\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\)\( (*\ Name\ Concatenation\ for\ Initial\ Condition\ \ *) \)\(\[IndentingNewLine]\) \(InitialCondition[varName_] = ToExpression[ ToString[varName] <> "\<[0]==0\>"];\)\(\[IndentingNewLine]\) \(\(InitialConditionGenerator[varList_] := Map[InitialCondition, varList];\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(End[\ ];\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\( (*\ Kf, \ Kr\ Estimation\ for\ Mass\ Action\ Model\ *) \)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\) \(\(Kf[Km_, Kcat_, Lamda_] := N[\(Lamda\[Times]Kcat\)\/Km];\)\(\[IndentingNewLine]\) \)\(\n\) \(\(Kf2S[Km1_, Km2_, Kcat_, Lamda_] := N[\(Lamda\[Times]Kcat\)\/\(Km1\ Km2\)];\)\(\[IndentingNewLine]\) \)\(\n\) \(\(Kf3S[Km1_, Km2_, Km3_, Kcat_, Lamda_] := N[\(Lamda\[Times]Kcat\)\/\(Km1\ Km2\ Km3\)];\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(Kr[Kcat_, Lamda_] := Max[0, N[\((Lamda - 1)\)\[Times]Kcat]];\)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\)\( (*\ Kfi, Kri\ Estimation\ for\ Inhibition\ model\ *) \)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\) \(Kfi[Km_, Kcat_, Lamda_, Omega_] := N[Omega\[Times]\(Lamda\[Times]Kcat\)\/Km];\)\(\[IndentingNewLine]\) \(Kri[Km_, Kcat_, Lamda_, Omega_, Ki_] := N[Omega\[Times]\(Lamda\[Times]Kcat\)\/Km\[Times]Ki];\)\(\ \[IndentingNewLine]\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\( (*\ Models\ of\ Inhibition\ *) \)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\ \)\( (*\ Competitive\ Inhibition\ *) \)\(\[IndentingNewLine]\) \(\(CompInh[S_, P_, En_, Inh_, {kf_, kr_, k_, kfi_, kri_}] := {\ \[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}}\)\(\n\) \)\(\[IndentingNewLine]\) \(\(Enz[\(S_ \[RightArrowLeftArrow] P_\)\+Inh_\%En_, kf_, kr_, k_, CI[kfi_, kri_]] := {\[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}}\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[\(S_ \[RightArrowLeftArrow] P_\)\&En_, kf_, kr_, k_, CI[inh_, kfi_, kri_]] := {\[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}}\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[List[Overscript[RightArrowLeftArrow[S_, P_], En_]], kf_, kr_, k_, CI[inh_, kfi_, kri_]] := {\[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}}\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\) \)\( (*\ Non - Competitive\ Inhibition, \ assume\ that\ inhibitor\ will\ not\ interfer\ substrate\ binding\ on\ \ enzyme, \[IndentingNewLine]\ \ means\ substrate\ still\ can\ bing\ Enzyme - Inhibitor\ complex\ *) \)\(\[IndentingNewLine]\) \(\(NonCompInh[S_, P_, En_, Inh_, {kf_, kr_, k_, kfi_, kri_}] := {\ \[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}, {NC[S, En] + Inh \[RightArrowLeftArrow] NC[S, En, Inh], kfi, kri}, \[IndentingNewLine]{S + NC[En, Inh] \[RightArrowLeftArrow] NC[S, En, Inh], kf, kr}\[IndentingNewLine]};\)\(\n\) \)\(\[IndentingNewLine]\) \(\(Enz[\(S_ \[RightArrowLeftArrow] P_\)\+Inh_\%En_, kf_, kr_, k_, NCI[kfi_, kri_]] := {\ \[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}, {NC[S, En] + Inh \[RightArrowLeftArrow] NC[S, En, Inh], kfi, kri}, \[IndentingNewLine]{S + NC[En, Inh] \[RightArrowLeftArrow] NC[S, En, Inh], kf, kr}\[IndentingNewLine]};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[\(S_ \[RightArrowLeftArrow] P_\)\&En_, kf_, kr_, k_, NCI[inh_, kfi_, kri_]] := {\ \[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}, {NC[S, En] + Inh \[RightArrowLeftArrow] NC[S, En, Inh], kfi, kri}, \[IndentingNewLine]{S + NC[En, Inh] \[RightArrowLeftArrow] NC[S, En, Inh], kf, kr}\[IndentingNewLine]};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(Enz[List[Overscript[RightArrowLeftArrow[S_, P_], En_]], kf_, kr_, k_, NCI[inh_, kfi_, kri_]] := {\ \[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}, {NC[S, En] + Inh \[RightArrowLeftArrow] NC[S, En, Inh], kfi, kri}, \[IndentingNewLine]{S + NC[En, Inh] \[RightArrowLeftArrow] NC[S, En, Inh], kf, kr}\[IndentingNewLine]};\)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\)\( (*\ Non - Competitive\ Inhibition, \ Enzyme - Inhibitor\ complex\ has\ residual\ enzyme\ activity, \ residualRate\ = \ 0\ to\ 1\ *) \)\(\[IndentingNewLine]\) \(\(NonCompInh[S_, P_, En_, Inh_, {kf_, kr_, k_, kfi_, kri_, residualRate_}] := {\ \[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}, {NC[S, En] + Inh \[RightArrowLeftArrow] NC[S, En, Inh], kfi, kri}, \[IndentingNewLine]{S + NC[En, Inh] \[RightArrowLeftArrow] NC[S, En, Inh], kf, kr}, {NC[S, En, Inh] \[ShortRightArrow] NC[En, Inh] + P, residualRate\[Times]k}\[IndentingNewLine]};\)\(\n\) \)\(\[IndentingNewLine]\) \(\(Enz[\(S_ \[RightArrowLeftArrow] P_\)\+Inh_\%En_, kf_, kr_, k_, NCI[kfi_, kri_, residualRate_]] := {\ \[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}, {NC[S, En] + Inh \[RightArrowLeftArrow] NC[S, En, Inh], kfi, kri}, \[IndentingNewLine]{S + NC[En, Inh] \[RightArrowLeftArrow] NC[S, En, Inh], kf, kr}, {NC[S, En, Inh] \[ShortRightArrow] NC[En, Inh] + P, residualRate\[Times]k}\[IndentingNewLine]};\)\(\[IndentingNewLine]\)\ \)\(\[IndentingNewLine]\) \(\(Enz[\(S_ \[RightArrowLeftArrow] P_\)\&En_, kf_, kr_, k_, NCI[inh_, kfi_, kri_, residualRate_]] := {\ \[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}, {NC[S, En] + Inh \[RightArrowLeftArrow] NC[S, En, Inh], kfi, kri}, \[IndentingNewLine]{S + NC[En, Inh] \[RightArrowLeftArrow] NC[S, En, Inh], kf, kr}, {NC[S, En, Inh] \[ShortRightArrow] NC[En, Inh] + P, residualRate\[Times] k}\[IndentingNewLine]};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(Enz[List[Overscript[RightArrowLeftArrow[S_, P_], En_]], kf_, kr_, k_, NCI[inh_, kfi_, kri_, residualRate_]] := {\ \[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}, {NC[S, En] + Inh \[RightArrowLeftArrow] NC[S, En, Inh], kfi, kri}, \[IndentingNewLine]{S + NC[En, Inh] \[RightArrowLeftArrow] NC[S, En, Inh], kf, kr}, {NC[S, En, Inh] \[ShortRightArrow] NC[En, Inh] + P, residualRate\[Times]k}\[IndentingNewLine]};\)\(\[IndentingNewLine]\)\ \(\[IndentingNewLine]\)\( (*\ Un - Competitive\ Inhibition\ *) \)\(\[IndentingNewLine]\) \(\(UnCompInh[S_, P_, En_, Inh_, {kf_, kr_, k_, kfi_, kri_}] := {\[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{NC[S, En] + Inh \[RightArrowLeftArrow] NC[S, En, Inh], kfi, kri}}\)\(\[IndentingNewLine]\) \)\(\n\) \(\(Enz[\(S_ \[RightArrowLeftArrow] P_\)\+Inh_\%En_, kf_, kr_, k_, UCI[kfi_, kri_]] := {\[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{NC[S, En] + Inh \[RightArrowLeftArrow] NC[S, En, Inh], kfi, kri}}\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[\(S_ \[RightArrowLeftArrow] P_\)\&En_, kf_, kr_, k_, UCI[inh_, kfi_, kri_]] := {\[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{NC[S, En] + Inh \[RightArrowLeftArrow] NC[S, En, Inh], kfi, kri}}\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[List[Overscript[RightArrowLeftArrow[S_, P_], En_]], kf_, kr_, k_, UCI[inh_, kfi_, kri_]] := {\[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}, \[IndentingNewLine]{NC[S, En] + Inh \[RightArrowLeftArrow] NC[S, En, Inh], kfi, kri}}\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\( (*\ Reaction\ Schema\ Translations\ for\ Multiple\ Substrates\ Reaction\ \ *) \)\(\[IndentingNewLine]\)\( (*\ Using\ Cellerator\ reactions\ as\ building\ blocks\ for\ the\ complicated\ \ enzymatic\ reactions\ *) \)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[\(S_ \[RightArrowLeftArrow] P_\)\&En_, kf_, kr_, k_] := {\[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}}\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[List[Overscript[RightArrowLeftArrow[S_, P_], En_]], kf_, kr_, k_] := {\[IndentingNewLine]{S + En \[RightArrowLeftArrow] NC[S, En], \ kf, \ kr}, {NC[S, En] \[ShortRightArrow] En + P, k}}\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\( (*\ Bi\ Bi\ or\ Sequential\ Model\ *) \)\(\[IndentingNewLine]\)\( (*\ \(\(S1 \ + S2 + En\)\(<\)\) -> \(ES1S2 \((X)\) -> En + P1 + P2\ kf\), kr, k\ *) \)\(\ \)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(BiBi[S1_, S2_, P1_, P2_, En_, {kf_, kr_, k_}] := \[IndentingNewLine]{{S1 + S2 + En \[RightArrowLeftArrow] NC[En, S1, S2], kf, kr}, \[IndentingNewLine]\ \ \ \ \ {NC[En, S1, S2] \[ShortRightArrow] En + P1 + P2, k}};\)\(\n\) \)\(\[IndentingNewLine]\) \(\(Enz[\({S1_, S2_} \[RightArrowLeftArrow] {P1_, P2_}\)\&En_, BiBi[kf_, kr_, k_]] := {{S1 + S2 + En \[RightArrowLeftArrow] NC[En, S1, S2], kf, kr}, {NC[En, S1, S2] \[ShortRightArrow] En + P1 + P2, k}};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[ List[Overscript[RightArrowLeftArrow[Plus[S1_, S2_], Plus[P1_, P2_]], En_]], BiBi[kf_, kr_, k_]] := {{S1 + S2 + En \[RightArrowLeftArrow] NC[En, S1, S2], kf, kr}, {NC[En, S1, S2] \[ShortRightArrow] En + P1 + P2, k}};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[\({S1_, S2_} \[RightArrowLeftArrow] {P1_, P2_}\)\&En_, OrderedBiBi[kf1_, kr1_, k1_, kf2_, kr2_, k2_]] := {{S1 + En \[RightArrowLeftArrow] NC[En, S1], kf1, kr1}, {S2 + NC[En, S1] \[RightArrowLeftArrow] NC[En, S1, S2], kf2, kr2}, \[IndentingNewLine]{NC[En, S1, S2] \[ShortRightArrow] NC[En, S2] + P1, k1}, {NC[En, S2] \[ShortRightArrow] En + P2, k2}};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[ List[Overscript[RightArrowLeftArrow[Plus[S1_, S2_], Plus[P1_, P2_]], En_]], OrderedBiBi[kf1_, kr1_, k1_, kf2_, kr2_, k2_]] := {{S1 + En \[RightArrowLeftArrow] NC[En, S1], kf1, kr1}, {S2 + NC[En, S1] \[RightArrowLeftArrow] NC[En, S1, S2], kf2, kr2}, \[IndentingNewLine]{NC[En, S1, S2] \[ShortRightArrow] NC[En, S2] + P1, k1}, {NC[En, S2] \[ShortRightArrow] En + P2, k2}};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(Enz[\({S1_, S2_} \[RightArrowLeftArrow] {P1_, P2_}\)\&En_, BiBi[kf_, kr_, k_], CI[Inh_, kfi_, kri_]] := {{S1 + S2 + En \[RightArrowLeftArrow] NC[En, S1, S2], kf, kr}, {NC[En, S1, S2] \[ShortRightArrow] En + P1 + P2, k}, {En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}};\)\(\n\)\(\[IndentingNewLine]\)\( (*\ More\ than\ two\ substrates\ and\ two\ products\ *) \)\(\ \[IndentingNewLine]\)\(\[IndentingNewLine]\) \(\(MulS[{S__}, {P__}, En_, {kf_, kr_, k_}] := {{Plus[S] + En \[RightArrowLeftArrow] NC[En, S], kf, kr}, {NC[En, S] \[ShortRightArrow] En + Plus[P], k}};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[\({S__} \[RightArrowLeftArrow] {P__}\)\&En_, MulS[kf_, kr_, k_]] := {{Plus[S] + En \[RightArrowLeftArrow] NC[En, S], kf, kr}, {NC[En, S] \[ShortRightArrow] En + Plus[P], k}};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[List[Overscript[RightArrowLeftArrow[S1__, P1__], En_]], MulS[kf_, kr_, k_]] := {{Plus[S] + En \[RightArrowLeftArrow] NC[En, S], kf, kr}, {NC[En, S] \[ShortRightArrow] En + Plus[P], k}};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[\({S1_, S2_} \[RightArrowLeftArrow] {P1_, P2_, P3_}\)\&En_, BiTri[kf_, kr_, k_]] := {{S1 + S2 + En \[RightArrowLeftArrow] NC[En, S1, S2], kf, kr}, {NC[En, S1, S2] \[ShortRightArrow] En + P1 + P2 + P3, k}};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(Enz[\({S1_, S2_, S3_} \[RightArrowLeftArrow] {P1_, P2_}\)\&En_, TriBi[kf_, kr_, k_]] := {{S1 + S2 + S3 + En \[RightArrowLeftArrow] NC[En, S1, S2, S3], kf, kr}, {NC[En, S1, S2, S3] \[ShortRightArrow] En + P1 + P2, k}};\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\( (*\ Ping\ Pong\ Model\ *) \)\(\[IndentingNewLine]\)\( (*\ \(\(A + En\)\(<\)\) -> \(\((EnA)\) -> Enx + C\)\ \ \ \ \ \ \ \ \ \ \ , kfA, krA, k1, En\ \ *) \)\(\[IndentingNewLine]\)\( (*\ \ \ \ \ \ \ \ \ \ \ \ \ \(\(Enx + B\)\(<\)\) -> \(EnxB -> E + F\)\ \ , kfB, krB, k2, En\ \ *) \)\(\[IndentingNewLine]\)\( (*\ \ \ \ \ \ \ \ \ \ \ x\ is\ a\ \ transfered\ functional\ group\ *) \)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\) \(\(PingPong[S1_, S2_, P1_, P2_, En_, Enx_, {kf1_, kr1_, k1_, kf2_, kr2_, k2_}] := \[IndentingNewLine] (*\ Could\ replace\ Enx\ argument\ with\ NC[En, X], \ X\ input\ or\ private\ *) \[IndentingNewLine]{{S1 + En \[RightArrowLeftArrow] NC[S1, En], \ kf1, \ kr1}, {NC[S1, En] \[ShortRightArrow] Enx + P1, k1}, \[IndentingNewLine]{S2 + Enx \[RightArrowLeftArrow] NC[S2, Enx], \ kf2, \ kr2}, {NC[S2, Enx] \[ShortRightArrow] En + P2, k2}};\)\(\[IndentingNewLine]\) \)\(\n\) \(\(Enz[\({S1_, S2_} \[RightArrowLeftArrow] {P1_, P2_}\)\&\(En_, Enx_\), PingPong[kf1_, kr1_, k1_, kf2_, kr2_, k2_]] := {{S1 + En \[RightArrowLeftArrow] NC[S1, En], \ kf1, \ kr1}, {NC[S1, En] \[ShortRightArrow] Enx + P1, k1}, \[IndentingNewLine]{S2 + Enx \[RightArrowLeftArrow] NC[S2, Enx], \ kf2, \ kr2}, {NC[S2, Enx] \[ShortRightArrow] En + P2, k2}};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(Enz[List[ Overscript[RightArrowLeftArrow[Plus[S1_, S2_], Plus[P1_, P2_]], En_, Enx_]], \[IndentingNewLine]PingPong[kf1_, kr1_, k1_, kf2_, kr2_, k2_]] := \[IndentingNewLine]{{S1 + En \[RightArrowLeftArrow] NC[S1, En], \ kf1, \ kr1}, {NC[S1, En] \[ShortRightArrow] Enx + P1, k1}, \[IndentingNewLine]{S2 + Enx \[RightArrowLeftArrow] NC[S2, Enx], \ kf2, \ kr2}, {NC[S2, Enx] \[ShortRightArrow] En + P2, k2}};\)\(\[IndentingNewLine]\)\(\[IndentingNewLine]\)\( (*\ PingPong\ Model\ with\ Non - Competitive\ Inhibition, \ 100 %\ inhibition\ when\ saturated\ with\ \(\(inhibitor\)\(.\)\)\ \ *) \)\(\[IndentingNewLine]\) \(\(Enz[\({S1_, S2_} \[RightArrowLeftArrow] {P1_, P2_}\)\&\(En_, Enx_\), PingPong[kf1_, kr1_, k1_, kf2_, kr2_, k2_], NCI[Inh_, kfi_, kri_]] := {{S1 + En \[RightArrowLeftArrow] NC[S1, En], \ kf1, \ kr1}, {NC[S1, En] \[ShortRightArrow] Enx + P1, k1}, \[IndentingNewLine]{S2 + Enx \[RightArrowLeftArrow] NC[S2, Enx], \ kf2, \ kr2}, {NC[S2, Enx] \[ShortRightArrow] En + P2, k2}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}, {NC[S1, En] + Inh \[RightArrowLeftArrow] NC[S1, En, Inh], kfi, kri}, \[IndentingNewLine]{Enx + Inh \[RightArrowLeftArrow] NC[Enx, Inh], kfi, kri}, {NC[S2, Enx] + Inh \[RightArrowLeftArrow] NC[S2, Enx, Inh], kfi, kri}, {S1 + NC[En, Inh] \[RightArrowLeftArrow] NC[S1, En, Inh], kf1, kr1}, {S2 + NC[Enx, Inh] \[RightArrowLeftArrow] NC[S2, Enx, Inh], kf2, kr2}\[IndentingNewLine]};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(Enz[List[ Overscript[RightArrowLeftArrow[Plus[S1_, S2_], Plus[P1_, P2_]], En_, Enx_]], \[IndentingNewLine]PingPong[kf1_, kr1_, k1_, kf2_, kr2_, k2_], NCI[Inh_, kfi_, kri_]] := \[IndentingNewLine]{{S1 + En \[RightArrowLeftArrow] NC[S1, En], \ kf1, \ kr1}, {NC[S1, En] \[ShortRightArrow] Enx + P1, k1}, \[IndentingNewLine]{S2 + Enx \[RightArrowLeftArrow] NC[S2, Enx], \ kf2, \ kr2}, {NC[S2, Enx] \[ShortRightArrow] En + P2, k2}, \[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}, {NC[S1, En] + Inh \[RightArrowLeftArrow] NC[S1, En, Inh], kfi, kri}, \[IndentingNewLine]{Enx + Inh \[RightArrowLeftArrow] NC[Enx, Inh], kfi, kri}, {NC[S2, Enx] + Inh \[RightArrowLeftArrow] NC[S2, Enx, Inh], kfi, kri}, {S1 + NC[En, Inh] \[RightArrowLeftArrow] NC[S1, En, Inh], kf1, kr1}, {S2 + NC[Enx, Inh] \[RightArrowLeftArrow] NC[S2, Enx, Inh], kf2, kr2}\[IndentingNewLine]};\)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\)\( (*\ PingPong\ Model\ with\ Non - Competitive\ Inhibition, \ has\ residual\ activity\ when\ saturated\ with\ \(\(inhibitor\)\(.\)\)\ *) \)\(\[IndentingNewLine]\)\( (*\ Inhibitor\ binds\ enzyme\ causing\ conformation\ change, \ 2\ substrates\ moving\ apart, reduce\ the\ catalytic\ activity, \ but\ not\ 100 %\ \(\(inhibition\)\(.\)\)\ *) \)\(\[IndentingNewLine]\)\( \ (*\ k2 : \ kcat\ without\ inhibitor, \ residualRate : \ residual\ enzyme\ activity\ \((0\ to\ 1)\)\ with\ saturated\ \ \(\(inhibitor\)\(.\)\)\ *) \)\(\[IndentingNewLine]\) \(\(Enz[\({S1_, S2_} \[RightArrowLeftArrow] {P1_, P2_}\)\&\(En_, Enx_\), PingPong[kf1_, kr1_, k1_, kf2_, kr2_, k2_], NCI[Inh_, kfi_, kri_, residualRate_]] := {{S1 + En \[RightArrowLeftArrow] NC[S1, En], \ kf1, \ kr1}, {NC[S1, En] \[ShortRightArrow] Enx + P1, \ k1}, \[IndentingNewLine]{S2 + Enx \[RightArrowLeftArrow] NC[S2, Enx], \ kf2, \ kr2}, {NC[S2, Enx] \[ShortRightArrow] En + P2, \ k2}, \[IndentingNewLine]\[IndentingNewLine]{S1 + NC[En, Inh] \[RightArrowLeftArrow] NC[S1, En, Inh], \ kf1, \ kr1}, {NC[S1, En, Inh] \[ShortRightArrow] NC[En, Inh] + P1, residualRate\[Times] k1}, \[IndentingNewLine]{S2 + NC[Enx, Inh] \[RightArrowLeftArrow] NC[S2, Enx, Inh], \ kf2, \ kr2}, {NC[S2, Enx, Inh] \[ShortRightArrow] NC[Enx, Inh] + P2, residualRate\[Times] k2}, \[IndentingNewLine]\[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}, {NC[S1, En] + Inh \[RightArrowLeftArrow] NC[S1, En, Inh], kfi, kri}, \[IndentingNewLine]{Enx + Inh \[RightArrowLeftArrow] NC[Enx, Inh], kfi, kri}, {NC[S2, Enx] + Inh \[RightArrowLeftArrow] NC[S2, Enx, Inh], kfi, kri}\[IndentingNewLine]};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[ List[Overscript[RightArrowLeftArrow[Plus[S1_, S2_], Plus[P1_, P2_]], En_, Enx_]], \[IndentingNewLine]PingPong[kf1_, kr1_, k1_, kf2_, kr2_, k2_], NCI[Inh_, kfi_, kri_, residualRate_]] := \[IndentingNewLine]{{S1 + En \[RightArrowLeftArrow] NC[S1, En], \ kf1, \ kr1}, {NC[S1, En] \[ShortRightArrow] Enx + P1, \ k1}, \[IndentingNewLine]{S2 + Enx \[RightArrowLeftArrow] NC[S2, Enx], \ kf2, \ kr2}, {NC[S2, Enx] \[ShortRightArrow] En + P2, \ k2}, \[IndentingNewLine]\[IndentingNewLine]{S1 + NC[En, Inh] \[RightArrowLeftArrow] NC[S1, En, Inh], \ kf1, \ kr1}, {NC[S1, En, Inh] \[ShortRightArrow] NC[En, Inh] + P1, residualRate\[Times]k1}, \[IndentingNewLine]{S2 + NC[Enx, Inh] \[RightArrowLeftArrow] NC[S2, Enx, Inh], \ kf2, \ kr2}, {NC[S2, Enx, Inh] \[ShortRightArrow] NC[Enx, Inh] + P2, residualRate\[Times] k2}, \[IndentingNewLine]\[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi, kri}, {NC[S1, En] + Inh \[RightArrowLeftArrow] NC[S1, En, Inh], kfi, kri}, \[IndentingNewLine]{Enx + Inh \[RightArrowLeftArrow] NC[Enx, Inh], kfi, kri}, {NC[S2, Enx] + Inh \[RightArrowLeftArrow] NC[S2, Enx, Inh], kfi, kri}\[IndentingNewLine]};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[\({S1_, S2_} \[RightArrowLeftArrow] {P1_, P2_}\)\&\(En_, Enx_\), PingPong[kf1_, kr1_, k1_, kf2_, kr2_, k2_], NCI[Inh_, kfi1_, kri1_, kfi2_, kri2_, residualRate_]] := {{S1 + En \[RightArrowLeftArrow] NC[S1, En], \ kf1, \ kr1}, {NC[S1, En] \[ShortRightArrow] Enx + P1, \ k1}, \[IndentingNewLine]{S2 + Enx \[RightArrowLeftArrow] NC[S2, Enx], \ kf2, \ kr2}, {NC[S2, Enx] \[ShortRightArrow] En + P2, \ k2}, \[IndentingNewLine]\[IndentingNewLine]{S1 + NC[En, Inh] \[RightArrowLeftArrow] NC[S1, En, Inh], \ kf1, \ kr1}, {NC[S1, En, Inh] \[ShortRightArrow] NC[En, Inh] + P1, residualRate\[Times] k1}, \[IndentingNewLine]{S2 + NC[Enx, Inh] \[RightArrowLeftArrow] NC[S2, Enx, Inh], \ kf2, \ kr2}, {NC[S2, Enx, Inh] \[ShortRightArrow] NC[Enx, Inh] + P2, residualRate\[Times] k2}, \[IndentingNewLine]\[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi1, kri1}, {NC[S1, En] + Inh \[RightArrowLeftArrow] NC[S1, En, Inh], kfi1, kri1}, \[IndentingNewLine]{Enx + Inh \[RightArrowLeftArrow] NC[Enx, Inh], kfi2, kri2}, {NC[S2, Enx] + Inh \[RightArrowLeftArrow] NC[S2, Enx, Inh], kfi2, kri2}\[IndentingNewLine]};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(Enz[List[ Overscript[RightArrowLeftArrow[Plus[S1_, S2_], Plus[P1_, P2_]], En_, Enx_]], \[IndentingNewLine]PingPong[kf1_, kr1_, k1_, kf2_, kr2_, k2_], NCI[Inh_, kfi1_, kri1_, kfi2_, kri2_, residualRate_]] := \[IndentingNewLine]{{S1 + En \[RightArrowLeftArrow] NC[S1, En], \ kf1, \ kr1}, {NC[S1, En] \[ShortRightArrow] Enx + P1, \ k1}, \[IndentingNewLine]{S2 + Enx \[RightArrowLeftArrow] NC[S2, Enx], \ kf2, \ kr2}, {NC[S2, Enx] \[ShortRightArrow] En + P2, \ k2}, \[IndentingNewLine]\[IndentingNewLine]{S1 + NC[En, Inh] \[RightArrowLeftArrow] NC[S1, En, Inh], \ kf1, \ kr1}, {NC[S1, En, Inh] \[ShortRightArrow] NC[En, Inh] + P1, residualRate\[Times] k1}, \[IndentingNewLine]{S2 + NC[Enx, Inh] \[RightArrowLeftArrow] NC[S2, Enx, Inh], \ kf2, \ kr2}, {NC[S2, Enx, Inh] \[ShortRightArrow] NC[Enx, Inh] + P2, residualRate\[Times] k2}, \[IndentingNewLine]\[IndentingNewLine]{En + Inh \[RightArrowLeftArrow] NC[En, Inh], kfi1, kri1}, {NC[S1, En] + Inh \[RightArrowLeftArrow] NC[S1, En, Inh], kfi1, kri1}, \[IndentingNewLine]{Enx + Inh \[RightArrowLeftArrow] NC[Enx, Inh], kfi2, kri2}, {NC[S2, Enx] + Inh \[RightArrowLeftArrow] NC[S2, Enx, Inh], kfi2, kri2}\[IndentingNewLine]};\)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\)\( (*\ PingPong\ Model\ with\ Competitive\ Inhibition\ for\ the\ 1 st\ substrate\ reaction, \ and\ Non - Competitive\ Inhibition\ for\ the\ 2 nd\ substrate\ reaction\ *) \)\(\[IndentingNewLine]\) \(\(Enz[\({S1_, S2_} \[RightArrowLeftArrow] {P1_, P2_}\)\&\(En_, Enx_\), PingPong[kf1_, kr1_, k1_, kf2_, kr2_, k2_], CI[Inh1_, kfi1_, kri1_], NCI[Inh2_, kfi2_, kri2_]] := {{S1 + En \[RightArrowLeftArrow] NC[S1, En], \ kf1, \ kr1}, {NC[S1, En] \[ShortRightArrow] Enx + P1, \ k1}, \[IndentingNewLine]{En + Inh1 \[RightArrowLeftArrow] NC[En, Inh1], kfi1, kri1}, \[IndentingNewLine]\[IndentingNewLine]{S2 + Enx \[RightArrowLeftArrow] NC[S2, Enx], \ kf2, \ kr2}, {NC[S2, Enx] \[ShortRightArrow] En + P2, \ k2}, \[IndentingNewLine]{Enx + Inh2 \[RightArrowLeftArrow] NC[Enx, Inh2], kfi2, kri2}, {NC[S2, Enx] + Inh2 \[RightArrowLeftArrow] NC[S2, Enx, Inh2], kfi2, kri2}, \[IndentingNewLine]{S2 + NC[Enx, Inh2] \[RightArrowLeftArrow] NC[S2, Enx, Inh2], kf2, kr2}\[IndentingNewLine]};\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(Enz[List[ Overscript[RightArrowLeftArrow[Plus[S1_, S2_], Plus[P1_, P2_]], En_, Enx_]], \[IndentingNewLine]PingPong[kf1_, kr1_, k1_, kf2_, kr2_, k2_], CI[Inh1_, kfi1_, kri1_], NCI[Inh2_, kfi2_, kri2_]] := \[IndentingNewLine]{{S1 + En \[RightArrowLeftArrow] NC[S1, En], \ kf1, \ kr1}, {NC[S1, En] \[ShortRightArrow] Enx + P1, \ k1}, \[IndentingNewLine]{En + Inh1 \[RightArrowLeftArrow] NC[En, Inh1], kfi1, kri1}, \[IndentingNewLine]\[IndentingNewLine]{S2 + Enx \[RightArrowLeftArrow] NC[S2, Enx], \ kf2, \ kr2}, {NC[S2, Enx] \[ShortRightArrow] En + P2, \ k2}, \[IndentingNewLine]{Enx + Inh2 \[RightArrowLeftArrow] NC[Enx, Inh2], kfi2, kri2}, {NC[S2, Enx] + Inh2 \[RightArrowLeftArrow] NC[S2, Enx, Inh2], kfi2, kri2}, \[IndentingNewLine]{S2 + NC[Enx, Inh2] \[RightArrowLeftArrow] NC[S2, Enx, Inh2], kf2, kr2}\[IndentingNewLine]};\)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\)\( (*\ PingPong\ Model\ with\ Three\ Inhibitors\ Non - Competitive\ Inhibition\ *) \)\(\[IndentingNewLine]\) \(\(Enz[\({S1_, S2_} \[RightArrowLeftArrow] {P1_, P2_}\)\&\(En_, Enx_\), PingPong[kf1_, kr1_, k1_, kf2_, kr2_, k2_], NCmI[{Inh1_, kfiInh1_, kriInh1_}, {Inh2_, kfiInh2_, kriInh2_}, {Inh3_, kfiInh3_, kriInh3_}]] \ := \[IndentingNewLine]\[IndentingNewLine]Module[{inhibitorInfo}, \ \[IndentingNewLine]CatalyticRxn = {{S1 + Apply[En, {0, 0, 0}] \[RightArrowLeftArrow] NC2[S1, Apply[En, {0, 0, 0}]], \ kf1, \ kr1}, {NC2[S1, Apply[En, {0, 0, 0}]] \[ShortRightArrow] Apply[Enx, {0, 0, 0}] + P1, k1}, \[IndentingNewLine]{S2 + Apply[Enx, {0, 0, 0}] \[RightArrowLeftArrow] NC2[S2, Apply[Enx, {0, 0, 0}]], \ kf2, \ kr2}, \[IndentingNewLine]{NC2[S2, Apply[Enx, {0, 0, 0}]] \[ShortRightArrow] Apply[En, {0, 0, 0}] + P2, k2}}; \[IndentingNewLine]\[IndentingNewLine]inhibitorInfo = \ {{Inh1, \ kfiInh1, kriInh1}, \ {Inh2, \ kfiInh2, kriInh2}, {Inh3, \ kfiInh3, kriInh3}}; \[IndentingNewLine]For[inhibitor = 1, inhibitor <= 3, \(inhibitor++\), \ \[IndentingNewLine]\[IndentingNewLine]InhibitionRxn[inhibitor] = Flatten[Table[{\[IndentingNewLine]{Apply[En, RotateRight[{0, j, k}, inhibitor - 1]] + inhibitorInfo[\([inhibitor, 1]\)] \[RightArrowLeftArrow] Apply[En, RotateRight[{1, j, k}, inhibitor - 1]], inhibitorInfo[\([inhibitor, 2]\)], inhibitorInfo[\([inhibitor, 3]\)]}, \[IndentingNewLine]{NC2[S1, Apply[En, RotateRight[{0, j, k}, inhibitor - 1]]] + inhibitorInfo[\([inhibitor, 1]\)] \[RightArrowLeftArrow] \[IndentingNewLine]\ \ \ \ NC2[S1, Apply[En, RotateRight[{1, j, k}, inhibitor - 1]]], inhibitorInfo[\([inhibitor, 2]\)], inhibitorInfo[\([inhibitor, 3]\)]}, \[IndentingNewLine]{Apply[Enx, RotateRight[{0, j, k}, inhibitor - 1]] + inhibitorInfo[\([inhibitor, 1]\)] \[RightArrowLeftArrow] \[IndentingNewLine]\ \ \ \ Apply[Enx, RotateRight[{1, j, k}, inhibitor - 1]], inhibitorInfo[\([inhibitor, 2]\)], inhibitorInfo[\([inhibitor, 3]\)]}, \[IndentingNewLine]{NC2[S2, Apply[Enx, RotateRight[{0, j, k}, inhibitor - 1]]] + inhibitorInfo[\([inhibitor, 1]\)] \[RightArrowLeftArrow] NC2[S2, Apply[Enx, RotateRight[{1, j, k}, inhibitor - 1]]], inhibitorInfo[\([inhibitor, 2]\)], inhibitorInfo[\([inhibitor, 3]\)]}\[IndentingNewLine]}, {j, 0, 1}, {k, 0, 1}], 1]]; \n\[IndentingNewLine]Union[CatalyticRxn, Flatten[Map[InhibitionRxn, {1, 2, 3}], 2]]\[IndentingNewLine]];\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(\(Enz[ List[Overscript[RightArrowLeftArrow[Plus[S1_, S2_], Plus[P1_, P2_]], En_, Enx_]], PingPong[kf1_, kr1_, k1_, kf2_, kr2_, k2_], NCmI[{Inh1_, kfiInh1_, kriInh1_}, {Inh2_, kfiInh2_, kriInh2_}, {Inh3_, kfiInh3_, kriInh3_}]] \ := \[IndentingNewLine]\[IndentingNewLine]Module[{inhibitorInfo}, \ \[IndentingNewLine]CatalyticRxn = {{S1 + Apply[En, {0, 0, 0}] \[RightArrowLeftArrow] NC2[S1, Apply[En, {0, 0, 0}]], \ kf1, \ kr1}, {NC2[S1, Apply[En, {0, 0, 0}]] \[ShortRightArrow] Apply[Enx, {0, 0, 0}] + P1, k1}, \[IndentingNewLine]{S2 + Apply[Enx, {0, 0, 0}] \[RightArrowLeftArrow] NC2[S2, Apply[Enx, {0, 0, 0}]], \ kf2, \ kr2}, \[IndentingNewLine]{NC2[S2, Apply[Enx, {0, 0, 0}]] \[ShortRightArrow] Apply[En, {0, 0, 0}] + P2, k2}}; \[IndentingNewLine]\[IndentingNewLine]inhibitorInfo = \ {{Inh1, \ kfiInh1, kriInh1}, \ {Inh2, \ kfiInh2, kriInh2}, {Inh3, \ kfiInh3, kriInh3}}; \[IndentingNewLine]For[inhibitor = 1, inhibitor <= 3, \(inhibitor++\), \ \[IndentingNewLine]\[IndentingNewLine]InhibitionRxn[inhibitor] = Flatten[Table[{\[IndentingNewLine]{Apply[En, RotateRight[{0, j, k}, inhibitor - 1]] + inhibitorInfo[\([inhibitor, 1]\)] \[RightArrowLeftArrow] Apply[En, RotateRight[{1, j, k}, inhibitor - 1]], inhibitorInfo[\([inhibitor, 2]\)], inhibitorInfo[\([inhibitor, 3]\)]}, \[IndentingNewLine]{NC2[S1, Apply[En, RotateRight[{0, j, k}, inhibitor - 1]]] + inhibitorInfo[\([inhibitor, 1]\)] \[RightArrowLeftArrow] \[IndentingNewLine]\ \ \ \ NC2[S1, Apply[En, RotateRight[{1, j, k}, inhibitor - 1]]], inhibitorInfo[\([inhibitor, 2]\)], inhibitorInfo[\([inhibitor, 3]\)]}, \[IndentingNewLine]{Apply[Enx, RotateRight[{0, j, k}, inhibitor - 1]] + inhibitorInfo[\([inhibitor, 1]\)] \[RightArrowLeftArrow] \[IndentingNewLine]\ \ \ \ Apply[Enx, RotateRight[{1, j, k}, inhibitor - 1]], inhibitorInfo[\([inhibitor, 2]\)], inhibitorInfo[\([inhibitor, 3]\)]}, \[IndentingNewLine]{NC2[S2, Apply[Enx, RotateRight[{0, j, k}, inhibitor - 1]]] + inhibitorInfo[\([inhibitor, 1]\)] \[RightArrowLeftArrow] NC2[S2, Apply[Enx, RotateRight[{1, j, k}, inhibitor - 1]]], inhibitorInfo[\([inhibitor, 2]\)], inhibitorInfo[\([inhibitor, 3]\)]}\[IndentingNewLine]}, {j, 0, 1}, {k, 0, 1}], 1]]; \n\[IndentingNewLine]Union[CatalyticRxn, Flatten[Map[InhibitionRxn, {1, 2, 3}], 2]]\[IndentingNewLine]];\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \(Print["\< \>"]; Print["\< kMech is loaded \>"];\)\(\[IndentingNewLine]\) \(\(EndPackage[\ ];\)\(\[IndentingNewLine]\) \)\(\[IndentingNewLine]\) \( (*\ \(! \(! \(\(! \ Remember\ to\ delete\ all\ outputs\ from\ \(\(testing\ !!\)!\)\)\ \[IndentingNewLine] \ How\ to\ save\ as\ a\ Package?\[IndentingNewLine]Click\ right\ bars\ \ of\ cells\)\)\), \ Cell\ -> \ \(Cell\ Properties\ -> \ Initialization\ Cell\), \[IndentingNewLine]\ \ \ \ \ then, \ File\ -> \ \(Save\ As\ Special\ -> \ Package\ Format\)\[IndentingNewLine]*) \)\)\)