DerivedUnits on KineticLaws are not calculated correctly (invalid units)

6 views
Skip to first unread message

Matthias König

unread,
Mar 1, 2018, 1:01:04 PM3/1/18
to jsbml-development
On the attached model the derivedUnits are not calculated correctly on the KineticLaws (most of the unitDefinitions are invalid).
Below example code with output (most invalid) in JSBML and the correct output with libsbml (python bindings)


package org.cy3sbml.oven;


import org.sbml.jsbml.JSBML;
import org.sbml.jsbml.Model;
import org.sbml.jsbml.Reaction;
import org.sbml.jsbml.SBMLDocument;

import javax.xml.stream.XMLStreamException;
import java.io.IOException;


public class InvalidReactionUnits {

public static void main(String[] args) throws IOException, XMLStreamException {

SBMLDocument doc = JSBML.readSBMLFromFile("./limax_pkpd_39.xml");
Model model = doc.getModel();
for (Reaction reaction: model.getListOfReactions()){
System.out.println(reaction + " " + reaction.getKineticLaw().getDerivedUnits());
}
}
}


reaction [ id="CYP1A2MET" name="CYP1A2_MET (CYP1A2) [metc13 -> apap + co2c13]" compartment="Vli" fast="false" reversible="false"] invalid
reaction [ id="CO2FIX" name="CO2FIX [co2c13 ->]" compartment="Vli" fast="false" reversible="false"] invalid
reaction [ id="APAPD" name="APAP detoxification (apap -> )" compartment="Vli" fast="false" reversible="false"] invalid
reaction [ id="Exhalation_co2c13" name="exhalation C13-CO2" compartment="Vlu" fast="false" reversible="false"] invalid
reaction [ id="Fixation_co2c13" name="fixation C13-CO2" compartment="Vve" fast="false" reversible="false"] invalid
reaction [ id="Release_co2c13" name="release C13-CO2" compartment="Vve" fast="false" reversible="false"] invalid
...

In comparsion in libsbml these are calculated correctly:

import libsbml

doc = libsbml.readSBMLFromFile("limax_pkpd_39.xml")
for r in doc.model.reactions:
ud = r.getKineticLaw().getDerivedUnitDefinition()
print(r, libsbml.UnitDefinition.printUnits(ud))



Reaction CYP1A2MET "CYP1A2_MET (CYP1A2) [metc13 -> apap + co2c13]"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction CO2FIX "CO2FIX [co2c13 ->]"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction APAPD "APAP detoxification (apap -> )"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction Exhalation_co2c13 "exhalation C13-CO2"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction Fixation_co2c13 "fixation C13-CO2"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction Release_co2c13 "release C13-CO2"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction Injection_metc13 "injection C13-methacetin"> second (exponent = -1, multiplier = 3.6e+06, scale = 0), mole (exponent = 1, multiplier = 1, scale = 0)
<Reaction Infusion_metc13 "infusion C13-methacetin"> second (exponent = -1, multiplier = 3.6e+06, scale = 0), mole (exponent = 1, multiplier = 1, scale = 0)
<Reaction Absorption_metc13 "absorption C13-methacetin"> second (exponent = -1, multiplier = 3.6e+06, scale = 0), mole (exponent = 1, multiplier = 1, scale = 0)
<Reaction vre_metc13 "clearance C13-methacetin (kidney)"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction ve_lu_metc13 "inflow lung C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction lu_ar_metc13 "outflow lung C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction ar_re_metc13 "inflow rest C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction re_ve_metc13 "outflow lung C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction ar_bo_metc13 "inflow bone C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction bo_ve_metc13 "outflow bone C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction ar_gu_metc13 "inflow gut C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction gu_li_metc13 "outflow gut C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction ar_he_metc13 "inflow heart C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction he_ve_metc13 "outflow heart C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction ar_ki_metc13 "inflow kidney C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction ki_ve_metc13 "outflow kidney C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction ar_sp_metc13 "inflow spleen C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction sp_li_metc13 "outflow spleen C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction ar_li_metc13 "inflow liver C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction li_ve_metc13 "outflow liver C13-methacetin"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
<Reaction Injection_apap "injection paracetamol"> second (exponent = -1, multiplier = 3.6e+06, scale = 0), mole (exponent = 1, multiplier = 1, scale = 0)
<Reaction Infusion_apap "infusion paracetamol"> second (exponent = -1, multiplier = 3.6e+06, scale = 0), mole (exponent = 1, multiplier = 1, scale = 0)
<Reaction Absorption_apap "absorption paracetamol"> second (exponent = -1, multiplier = 3.6e+06, scale = 0), mole (exponent = 1, multiplier = 1, scale = 0)
<Reaction vre_apap "clearance paracetamol (kidney)"> second (exponent = -1, multiplier = 3600, scale = 0), mole (exponent = 1, multiplier = 1, scale = -3)
...

Best Matthias
limax_pkpd_39.xml

Nicolas Rodriguez

unread,
Mar 2, 2018, 10:58:11 AM3/2/18
to 'Matthias König' via jsbml-development

Hi Matthias,

Thanks for the report, I will have a look at that.

Nico

--
You received this message because you are subscribed to the Google Groups "jsbml-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsbml-developm...@googlegroups.com.
To post to this group, send email to jsbml-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsbml-development/120e746c-d763-46b2-95f9-99e9af08e16f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andreas Dräger

unread,
Mar 3, 2018, 6:51:15 PM3/3/18
to jsbml-de...@googlegroups.com
Thanks Matthias,

For pointing this out!

I tested the model you provided in SBMLsqueezer version 2.1 (available at https://github.com/draeger-lab/SBMLsqueezer/releases/tag/v2.1), which uses JSBML revision 2d8550c. As the screenshot shows for just one of the reactions, the derived unit is here mmol/h. I checked every reaction using this version of SBMLsqueezer. In this revision all units were evaluated as expected.

We need to check how this problem was introduced to the code base.

Cheers
Andreas


With best regards

Dr. Andreas Draeger
Principal Investigator
---
University of Tübingen
Center for Bioinformatics Tübingen (ZBIT)
Applied Bioinformatics Group
Sand 14 · Office #C320 · 72076 Tübingen · Germany
Phone: +49-7071-29-70459 · Fax: +49-7071-29-5152
Web: http://draeger-lab.org · Twitter: @dr_drae
YouTube: https://www.youtube.com/c/systemsbiology

Nicolas Rodriguez

unread,
Mar 5, 2018, 10:31:13 AM3/5/18
to jsbml-de...@googlegroups.com

Hi Matthias,

This should be fixed in master now. I have updated the maven 1.4-SNAPSHOT as well.

The problem was linked to a bad check for assignment cycle.

Thanks,

Nico

Matthias König

unread,
Mar 5, 2018, 4:04:10 PM3/5/18
to jsbml-development
Hi Nico,
thanks for the fix. Works.
Best Matthias
Reply all
Reply to author
Forward
0 new messages