SpeciesReferenceGlyph: curve information missed in layout ex
mephenor opened this issue · comments
I encountered a problem while writing a curve of a SpeciesReferenceGlyph in a sbml document with layout extension.
It is possible to write bounding boxes of ReactionGlyphs or SpeciesReferenceGlyphs, but when writing a curve of a speciesReferenceGlyph, the output is only the opening and closing layout:curve-tag (see below).
Code for generating the reactionGlyph:
ReactionGlyph rg = new ReactionGlyph("react_r1", model.getLevel(), model.getVersion());
SpeciesReferenceGlyph srg1 = rg.createSpeciesReferenceGlyph("srg_r1_s1", speciesGlyph1.getId());
SpeciesReferenceGlyph srg2 = rg.createSpeciesReferenceGlyph("srg_r1_s2", speciesGlyph2.getId());
srg1.setRole(SpeciesReferenceRole.SUBSTRATE);
srg2.setRole(SpeciesReferenceRole.PRODUCT);
BoundingBox bbRg = rg.createBoundingBox(10.0, 10.0, 0.0);
bbRg.setPosition(new Point(100.0, 0.0, 0.0));
CurveSegment cs1 = new CurveSegment();
cs1.setStart(new Point(35.0, 10.0, 0.0));
cs1.setEnd(new Point(100.0, 10.0, 0.0));
Curve c = new Curve();
ListOf<CurveSegment> csList = new ListOf<CurveSegment>();
csList.add(cs1);
c.setListOfCurveSegments(csList);
srg1.setCurve(c);
CurveSegment cs2 = new CurveSegment();
cs2.createStart(110.0, 10.0, 0.0);
cs2.createEnd(235.0, 10.0, 0.0);
Curve c2 = new Curve();
ListOf<CurveSegment> csList2 = new ListOf<CurveSegment>();
csList2.add(cs2);
c2.setListOfCurveSegments(csList2);
srg2.setCurve(c2);
BoundingBox bbSrg2 = srg2.createBoundingBox();
bbSrg2.setPosition(new Point(110.0, 10.0, 0.0));
bbSrg2.setDimensions(new Dimensions(200.0, 10.0, 0, model.getLevel(), model.getVersion()));
layout.addReactionGlyph(rg);
reactionGlyph-output in the written SBML file:
<layout:reactionGlyph layout:id="react_r1">
<layout:boundingBox>
<layout:position layout:x="100" layout:y="0" layout:z="0"/>
<layout:dimensions layout:width="10" layout:height="10" layout:depth="0"/>
</layout:boundingBox>
<layout:listOfSpeciesReferenceGlyphs>
<layout:speciesReferenceGlyph layout:id="srg_r1_s1" layout:role="substrate" layout:speciesGlyph="spec_s1">
<layout:curve>
.... MISSING INFORMATION ....
</layout:curve>
</layout:speciesReferenceGlyph>
<layout:speciesReferenceGlyph layout:id="srg_r1_s2" layout:role="product" layout:speciesGlyph="spec_s2">
<layout:boundingBox>
<layout:position layout:x="110" layout:y="10" layout:z="0"/>
<layout:dimensions layout:width="200" layout:height="10" layout:depth="0"/>
</layout:boundingBox>
<layout:curve>
.... MISSING INFORMATION ....
</layout:curve>
</layout:speciesReferenceGlyph>
</layout:listOfSpeciesReferenceGlyphs>
</layout:reactionGlyph>
Reported by: stscherneck
- assigned_to: nobody --> niko-rodrigue
- status: open --> open-accepted
Original comment by: niko-rodrigue
I can reproduce it and I will have a loot at it.
Original comment by: niko-rodrigue
- milestone: --> jsbml 1.0
- status: open-accepted --> closed-fixed
Original comment by: niko-rodrigue
Ok, it should be fixed now. The problem was that the listOfCurveSegments had not the layout namespace set properly. While testing that I also fixed an other bug to be able to read properly the curve element under a speciesReferenceGlyph. So it should be hopefully all fine now.
Original comment by: niko-rodrigue