no return characters in MRV

User 870ab5b546

19-03-2013 15:24:40

Hello,


Using JChem/Marvin 5.11.5.  The Javascript code:


            var molstruct = String(applet.getMol('mrv'));
alert('got molstruct from applet:\n' + molstruct);

The alert message:


got molstruct from applet:
<?xml version="1.0"?><cml version="ChemAxon file format v5.10.0, generated by v5.11.5">
<MDocument><MChemicalStruct><molecule molID="m1"><atomArray atomID="a1 a2 a3 a4 a5" elementType="C C C C C" x2="-3.3687500953674316 -4.614616424384458 -4.138754006997239 -2.5987461837376244 -2.1228837663504034" y2="1.743117244048722 0.8379006455367208 -0.6266467943831723 -0.6266467943831723 0.8379006455367208"></atomArray><bondArray><bond atomRefs2="a1 a2" order="1"></bond><bond atomRefs2="a1 a5" order="1"></bond><bond atomRefs2="a2 a3" order="1"></bond><bond atomRefs2="a3 a4" order="1"></bond><bond atomRefs2="a4 a5" order="1"></bond></bondArray></molecule></MChemicalStruct></MDocument>
</cml>

Note the lack of return characters in the obtained MRV.  It's not a huge deal, but it makes it a lot harder to read.  If I go to Edit -> Source in the applet, the MRV has return characters, and it's a lot easier to read:


<?xml version="1.0"?>
<cml version="ChemAxon file format v5.10.0, generated by v5.11.5">
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5" elementType="C C C C C" x2="-3.3687500953674316 -4.614616424384458 -4.138754006997239 -2.5987461837376244 -2.1228837663504034" y2="1.743117244048722 0.8379006455367208 -0.6266467943831723 -0.6266467943831723 0.8379006455367208"/>
<bondArray>
<bond atomRefs2="a1 a2" order="1"/>
<bond atomRefs2="a1 a5" order="1"/>
<bond atomRefs2="a2 a3" order="1"/>
<bond atomRefs2="a3 a4" order="1"/>
<bond atomRefs2="a4 a5" order="1"/>
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>

The method MolExporter.exportToFormat(MDocument, String) also omits the return characters.  The omission of return characters is a fairly recent development in Marvin.  If you could change these methods back so that they again put the return characters in, it would make debugging much easier.


-- Bob

ChemAxon 2c555f5717

20-03-2013 10:05:12

Dear Bob!


   If you add the  "P" export option to mrv format, you will get a pretty rpinted mrv.


Regards:
Balázs


 


like this:


 


var molstruct = String(applet.getMol('mrv:P'));
alert('got molstruct from applet:\n' + molstruct);

 


You can find more export options here.

User 870ab5b546

20-03-2013 18:40:44

Thanks!  I had been using a molecule property to store the selection information, but the S option is much more useful.

ChemAxon 2c555f5717

21-03-2013 06:25:51

It is good to see someone uses that feature. :)

User 870ab5b546

21-03-2013 22:56:58

When was the S option introduced?  Since Marvin 5.4, or before?

ChemAxon 2c555f5717

25-03-2013 10:15:39

 


It was introduced at the 11th of January in 2012. (Marvin 5.8)