sys-bio / roadrunner

libRoadRunner: A high-performance SBML simulator
http://libroadrunner.org/
Other
39 stars 25 forks source link

Add function to return the model as a string that was derived from the SBML #363

Open hsauro opened 7 years ago

hsauro commented 7 years ago

I new method should be added to C API, C++ API and Python bindings that returns the model in the form of a string that was derived from the SBML. The following is an example output from Jarnac:


Rubisco = Rbco_vm*RuBP_ch/(RuBP_ch+Rbco_km*(1+PGA_ch/Rbco_KiPGA+FBP_ch/Rbco_KiFBP+SBP_ch/Rbco_KiSBP+Pi_ch/Rbco_KiPi+NADPH_ch/Rbco_KiNADPH))
PhosphoglycerateKinase = EQMult*(PGA_ch*ATP_ch-(BPGA_ch*ADP_ch/q2))
G3P_dehydrogenase = EQMult*(BPGA_ch*NADPH_ch*Proton_ch-NADP_ch*GAP_ch*Pi_ch/q3)
TPI = EQMult*(GAP_ch-DHAP_ch/q4)
Aldolase = EQMult*(DHAP_ch*GAP_ch-FBP_ch/q5)
FBPase = FBPase_ch_vm*FBP_ch/(FBP_ch+FBPase_ch_km*(1+F6P_ch/FBPase_ch_KiF6P+Pi_ch/FBPase_ch_KiPi))
PGI_ch = EQMult*(F6P_ch-G6P_ch/q14)
PGM_ch = EQMult*(G6P_ch-G1P_ch/q15)
St_synthase = Vstsyn_ch*G1P_ch*ATP_ch/((G1P_ch+stsyn_ch_km1)*(1+ADP_ch/stsyn_ch_Ki)*(ATP_ch+stsyn_ch_km2)+stsyn_ch_km2*Pi_ch/(stsyn_ch_ka1*PGA_ch)+(stsyn_ch_ka2*F6P_ch)+(stsyn_ch_ka3*FBP_ch))
StPase = StPase_Vm*Pi_ch/(Pi_ch+StPase_km*(1+G1P_ch/StPase_kiG1P))
transketolase = EQMult*(F6P_ch*GAP_ch-E4P_ch*X5P_ch/q7)
Aldolase2 = EQMult*(E4P_ch*DHAP_ch-SBP_ch/q8)
seduheptuloseBPase = SBPase_ch_vm*SBP_ch/(SBP_ch+SBPase_ch_km*(1+Pi_ch/SBPase_ch_KiPi))
transketolase2 = EQMult*(GAP_ch*S7P_ch-X5P_ch*R5P_ch/q10)
R5Pisomerase = EQMult*(R5P_ch-Ru5P_ch/q11)
X5Pisomerase = EQMult*(X5P_ch-Ru5P_ch/q12)
Ru5Pkinase = Ru5Pk_ch_vm*Ru5P_ch*ATP_ch/((Ru5P_ch+Ru5Pk_ch_km1*(1+PGA_ch/Ru5Pk_ch_KiPGA+RuBP_ch/Ru5Pk_ch_KiRuBP+Pi_ch/Ru5Pk_ch_KiPi))*(ATP_ch*(1+ADP_ch/Ru5Pk_ch_KiADP1)+Ru5Pk_ch_km2*(1+ADP_ch/Ru5Pk_ch_KiADP2)))
TP_Pi_apPGA = PGA_xpMult*TP_Piap_vm*PGA_ch/(TP_Piap_kPGA_ch*(1+(1+TP_Piap_kPi_cyt/Pi_cyt)*(Pi_ch/TP_Piap_kPi_ch+PGA_ch/TP_Piap_kPGA_ch+DHAP_ch/TP_Piap_kDHAP_ch+GAP_ch/TP_Piap_kGAP_ch)))
TP_Pi_apGAP = TP_Piap_vm*GAP_ch/(TP_Piap_kGAP_ch*(1+(1+TP_Piap_kPi_cyt/Pi_cyt)*(Pi_ch/TP_Piap_kPi_ch+PGA_ch/TP_Piap_kPGA_ch+DHAP_ch/TP_Piap_kDHAP_ch+GAP_ch/TP_Piap_kGAP_ch)))
TP_Pi_apDHAP = TP_Piap_vm*DHAP_ch/(TP_Piap_kDHAP_ch*(1+(1+TP_Piap_kPi_cyt/Pi_cyt)*(Pi_ch/TP_Piap_kPi_ch+PGA_ch/TP_Piap_kPGA_ch+DHAP_ch/TP_Piap_kDHAP_ch+GAP_ch/TP_Piap_kGAP_ch)))
Light_react = LR_vm*ADP_ch*Pi_ch/((ADP_ch+LR_kmADP)*(Pi_ch+LR_kmPi))
dRuBP_ch/dt = - Rubisco + Ru5Pkinase
dPGA_ch/dt = + 2 Rubisco - PhosphoglycerateKinase - TP_Pi_apPGA
dATP_ch/dt = - PhosphoglycerateKinase - St_synthase - Ru5Pkinase + Light_react
dBPGA_ch/dt = + PhosphoglycerateKinase - G3P_dehydrogenase
dGAP_ch/dt = + G3P_dehydrogenase - TPI - Aldolase - transketolase - transketolase2 - TP_Pi_apGAP
dPi_ch/dt = + G3P_dehydrogenase + FBPase + 2 St_synthase - StPase + seduheptuloseBPase + TP_Pi_apPGA + TP_Pi_apGAP + TP_Pi_apDHAP - Light_react
dDHAP_ch/dt = + TPI - Aldolase - Aldolase2 - TP_Pi_apDHAP
dFBP_ch/dt = + Aldolase - FBPase
dF6P_ch/dt = + FBPase - PGI_ch - transketolase
dG6P_ch/dt = + PGI_ch - PGM_ch
dG1P_ch/dt = + PGM_ch - St_synthase + StPase
dE4P_ch/dt = + transketolase - Aldolase2
dX5P_ch/dt = + transketolase + transketolase2 - X5Pisomerase
dSBP_ch/dt = + Aldolase2 - seduheptuloseBPase
dS7P_ch/dt = + seduheptuloseBPase - transketolase2
dR5P_ch/dt = + transketolase2 - R5Pisomerase
dADP_ch/dt = + PhosphoglycerateKinase + St_synthase + Ru5Pkinase - Light_react
dRu5P_ch/dt = + R5Pisomerase + X5Pisomerase - Ru5Pkinase
0u812 commented 7 years ago

Needs to be in C/C++ API

luciansmith commented 4 years ago

It's possible to get the Antimony string from Tellurium directly; will that work for this?

luciansmith commented 2 years ago

Given that there is r.getCurrentSBML() and r.getCurrentAntimony() when using Tellurium, I'm closing this. But feel free to re-open if we need a C/C++ solution and not a Python solution.

hsauro commented 2 years ago

The issue is whether a user can get the actual ODE model rather than the SBML or antimony. Currently a user does this using

te.getODEsFromModel(r)

v_J0 = k0S1 v_J1 = k1S1S0 v_J2 = k2S0

dS0/dt = v_J1 - v_J2 dS1/dt = v_J0 - v_J1

The question is should this functionality be built into roadrunner?

luciansmith commented 2 years ago

Ah, got it. So, just the list of actual dx/dt's in their final forms. Would you want assignment rules, too? Events?

I suppose in a sense you're asking for the CellML version of the model ;-)

I would think that if we want this functionality anywhere, we'd build it into roadrunner itself, since that's where the equations live.

hsauro commented 2 years ago

Yes correct, rules, events and all

I thought too it should be built into roadrunner.