new MDocument.exportToFormat() bug

User 870ab5b546

15-05-2009 14:12:59

The code:


            MolImporter importer = new MolImporter();
debugPrint("respMRV:\n" + respMRV);
importedMolecule = importer.importMol(respMRV);
useMDoc = importedMolecule.getDocument();
debugPrint("MechData: before cloning, useMDoc:\n"
+ useMDoc.exportToFormat("mrv"));

The log output:


Entering MechData constructor ...
respMRV:
<?xml version="1.0" ?>
<MDocument>
<MPolyline id="o1" headLength="0.8" headWidth="0.5">
<MRectanglePoint pos="5" rectRef="o3" />
<MRectanglePoint pos="7" rectRef="o2" />
</MPolyline>
<MRectangle id="o2">
<MPoint x="0.1443749964237213" y="3.994374990463257" />
<MPoint x="6.785624980926514" y="3.994374990463257" />
<MPoint x="6.785624980926514" y="-1.9249999523162842" />
<MPoint x="0.1443749964237213" y="-1.9249999523162842" />
</MRectangle>
<MRectangle id="o3">
<MPoint x="-8.854999542236328" y="3.9462499618530273" />
<MPoint x="-1.8287500143051147" y="3.9462499618530273" />
<MPoint x="-1.8287500143051147" y="-2.5506250858306885" />
<MPoint x="-8.854999542236328" y="-2.5506250858306885" />
</MRectangle>
<MEFlow id="o4" arcAngle="-254.995522631729" headSkip="0.25"
headLength="0.6" headWidth="0.5" tailSkip="0.15">
<MAtomSetPoint atomRefs="m1.a2 m1.a5" />
<MAtomSetPoint atomRefs="m1.a2" />
</MEFlow>
<MChemicalStruct>
<molecule molID="m1">
<atomArray
atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9"
elementType="C N C C H N C C C"
formalCharge="0 1 0 0 0 0 0 0 0"
x2="-6.400625228881836 -5.0669461070538 -3.7332669852257645 -5.0669461070538 -3.579420334568635 3.031874895095825 1.69819577326779 4.365554016923861 3.0318748950958248"
y2="-0.5293750166893005 0.24062498331069937 -0.5293750166893005 1.7806249833106995 0.6392063127685813 1.106874942779541 0.33687494277954044 0.33687494277954144 2.646874942779541"
/>
<bondArray>
<bond atomRefs2="a1 a2" order="1" />
<bond atomRefs2="a2 a3" order="1" />
<bond atomRefs2="a2 a4" order="1" />
<bond atomRefs2="a2 a5" order="1" />
<bond atomRefs2="a6 a7" order="1" />
<bond atomRefs2="a6 a8" order="1" />
<bond atomRefs2="a6 a9" order="1" />
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>

MechData: before cloning, useMDoc:
<?xml version="1.0" ?>
<cml>
<MDocument>
<MPolyline id="o1">
<MRectanglePoint pos="5" rectRef="o3" />
<MRectanglePoint pos="7" rectRef="o2" />
</MPolyline>
<MRectangle id="o2">
<MPoint x="0.1443749964237213" y="3.994374990463257" />
<MPoint x="6.785624980926514" y="3.994374990463257" />
<MPoint x="6.785624980926514" y="-1.9249999523162842" />
<MPoint x="0.1443749964237213" y="-1.9249999523162842" />
</MRectangle>
<MRectangle id="o3">
<MPoint x="-8.854999542236328" y="3.9462499618530273" />
<MPoint x="-1.8287500143051147" y="3.9462499618530273" />
<MPoint x="-1.8287500143051147" y="-2.5506250858306885" />
<MPoint x="-8.854999542236328" y="-2.5506250858306885" />
</MRectangle>
<MEFlow id="o4">
<MAtomSetPoint atomRefs="m1.a2 m1.a5" />
<MAtomSetPoint atomRefs="m1.a2" />
</MEFlow>
<MChemicalStruct>
<molecule molID="m1">
<atomArray
atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9"
elementType="C N C C H N C C C"
formalCharge="0 1 0 0 0 0 0 0 0"
x2="-6.400625228881836 -5.0669461070538 -3.7332669852257645 -5.0669461070538 -3.579420334568635 3.031874895095825 1.69819577326779 4.365554016923861 3.0318748950958248"
y2="-0.5293750166893005 0.24062498331069937 -0.5293750166893005 1.7806249833106995 0.6392063127685813 1.106874942779541 0.33687494277954044 0.33687494277954144 2.646874942779541"
/>
<bondArray>
<bond atomRefs2="a1 a2" order="1" />
<bond atomRefs2="a2 a3" order="1" />
<bond atomRefs2="a2 a4" order="1" />
<bond atomRefs2="a2 a5" order="1" />
<bond atomRefs2="a6 a7" order="1" />
<bond atomRefs2="a6 a8" order="1" />
<bond atomRefs2="a6 a9" order="1" />
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>

Note the loss of the arrow's head in the MPolyline (object 1) in the second MRV code.  JChem 5.2.1.


I'm pretty sure this is a bug in exportToFormat(), not importMol() or getDocument().


Please fix ASAP, as we throw errors left and right when we find lines where we expect arrows.

User ef5e605ae6

21-05-2009 12:54:30

It seems to be a new bug, I try to track it down.

User ef5e605ae6

21-05-2009 15:57:57

Fixed. The bugfix will appear in Marvin 5.2.3.

User 870ab5b546

28-07-2009 15:52:37

Confirmed that the bug is fixed.  Köszönöm!