我真的很陌生,xml
我正在尝试sbml
使用.xml2
R
演示文件sbml
取自sbml
主页。
我对如何使用xpath
.
例如,我试过
test <- read_xml("./scratch.xml")
xml_children(test)[1]
xml_attr(xml_children(test)[1], "name")
工作并给我"EnzymaticReaction"
作为答案。但是,我不想按索引访问节点,而是按名称访问节点 - 所以我尝试了
xml_find_one(test, ".//model")
这给了我错误
Error: No matches
谁能帮我看看我在打电话时做错了xpath
什么?该sbml
文件也粘贴在下面。
谢谢!
<?xml version="1.0" encoding="UTF-8"?>
<sbml level="2" version="3" xmlns="http://www.sbml.org/sbml/level2/version3">
<model name="EnzymaticReaction">
<listOfUnitDefinitions>
<unitDefinition id="per_second">
<listOfUnits>
<unit kind="second" exponent="-1"/>
</listOfUnits>
</unitDefinition>
<unitDefinition id="litre_per_mole_per_second">
<listOfUnits>
<unit kind="mole" exponent="-1"/>
<unit kind="litre" exponent="1"/>
<unit kind="second" exponent="-1"/>
</listOfUnits>
</unitDefinition>
</listOfUnitDefinitions>
<listOfCompartments>
<compartment id="cytosol" size="1e-14"/>
</listOfCompartments>
<listOfSpecies>
<species compartment="cytosol" id="ES" initialAmount="0" name="ES"/>
<species compartment="cytosol" id="P" initialAmount="0" name="P"/>
<species compartment="cytosol" id="S" initialAmount="1e-20" name="S"/>
<species compartment="cytosol" id="E" initialAmount="5e-21" name="E"/>
</listOfSpecies>
<listOfReactions>
<reaction id="veq">
<listOfReactants>
<speciesReference species="E"/>
<speciesReference species="S"/>
</listOfReactants>
<listOfProducts>
<speciesReference species="ES"/>
</listOfProducts>
<kineticLaw>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<times/>
<ci>cytosol</ci>
<apply>
<minus/>
<apply>
<times/>
<ci>kon</ci>
<ci>E</ci>
<ci>S</ci>
</apply>
<apply>
<times/>
<ci>koff</ci>
<ci>ES</ci>
</apply>
</apply>
</apply>
</math>
<listOfParameters>
<parameter id="kon" value="1000000" units="litre_per_mole_per_second"/>
<parameter id="koff" value="0.2" units="per_second"/>
</listOfParameters>
</kineticLaw>
</reaction>
<reaction id="vcat" reversible="false">
<listOfReactants>
<speciesReference species="ES"/>
</listOfReactants>
<listOfProducts>
<speciesReference species="E"/>
<speciesReference species="P"/>
</listOfProducts>
<kineticLaw>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<times/>
<ci>cytosol</ci>
<ci>kcat</ci>
<ci>ES</ci>
</apply>
</math>
<listOfParameters>
<parameter id="kcat" value="0.1" units="per_second"/>
</listOfParameters>
</kineticLaw>
</reaction>
</listOfReactions>
</model>
</sbml>