Hi All,
I am writing a SBML parser for our simulator in doing that I am struck at this point where I am unable to parse MathML formula in python libsbml.
E.g
<math xmlns="
http://www.w3.org/1998/Math/MathML">
<apply>
<plus/>
<ci> PKC-DAG-AA_p </ci>
<ci> PKC-Ca-memb_p </ci>
<ci> PKC-Ca-AA_p </ci>
<ci> PKC-DAG-memb_p </ci>
<ci> PKC-basal_p </ci>
<ci> PKC-AA_p </ci>
<ci> globalParameter</ci>
<cn> 4 </ci>
</apply>
</math>
I need to get list of species (1st 6 are species) , globalParameter and constant from the MathML, i.e list of children from mathML,
This belongs to assignment rule and we don't have provision to specify global parameter, so I need to replace the global parameter with the constant which is associated with it.
I have install libsbml.5.9.0
I have done
rule = model.getRule(r)
ruleMath = rule.getMath()
num = ruleMath.getNumChildren()
for i in range(0,num):
child = ruleMath.getChild(i)
print child.getName()
But ruleMath.getNumChildren() return 2 and with for loop I just get one species name.
I read a post saying ruleMath.getNumChildren() return 2 should I use any patch for libsbml?
Through this if I can get all the children then I can parse species,global parameter and constant separately as per my requirement
Thank you