MolConverter scales incorrectly on non-Marvin MOL string

User fa1369adab

13-06-2006 19:54:12

I have the following MOL string generated by our home-grown software:


Code:



  Lewis   061306154538                                           





 11 10  0     0  0             99 V2000


  182.0000  129.0000    0.0000 N   0  0  0  0  0  0


  232.0000  129.0000    0.0000 N   0  0  0  0  0  0


  132.0000  129.0000    0.0000 C   0  0  0  0  0  0


  283.0000  129.0000    0.0000 C   0  0  0  0  0  0


  232.0000  177.0000    0.0000 O   0  0  0  0  0  0


  132.0000  176.0000    0.0000 H   0  0  0  0  0  0


   85.0000  129.0000    0.0000 H   0  0  0  0  0  0


  132.0000   83.0000    0.0000 H   0  0  0  0  0  0


  283.0000   88.0000    0.0000 H   0  0  0  0  0  0


  325.0000  129.0000    0.0000 H   0  0  0  0  0  0


  283.0000  176.0000    0.0000 H   0  0  0  0  0  0


  1  2  1  0     0


  1  3  1  0     0


  2  4  1  0     0


  2  5  1  0     0


  3  6  1  0     0


  3  7  1  0     0


  3  8  1  0     0


  4  9  1  0     0


  4 10  1  0     0


  4 11  1  0     0


A    3


C


A    4


C


M  END








The result of


Code:



MolImporter.importMol(mol).getImageSize(jpeg:scale100...)





has width 547. I then ask MolConverter() to generate a jpeg with scale 40. The resulting image file has width 319 instead of 219.

ChemAxon 7c2d26e5cf

14-06-2006 08:24:29

I have tested the latest Marvin release with your molecule:


Code:
System.err.println(mol.getImageSize("jpeg:scale100"));


System.err.println(mol.getImageSize("jpeg:scale40"));



I have got the following result:


Code:
w547,h283,scale100.0


w219,h113,scale40.0



It seems to me that image size calculation is correct in the latest release.


Have you tried the latest Marvin?

User fa1369adab

14-06-2006 13:29:26

Tamas,





It could well be that getImageSize() is reporting 219 correctly However, the jpeg that MolConverter is producing when I request scale40 has width 319. (It could be that I have a bug in my code, but I am using similar code for other MOL strings without difficulty.)





Refoyl

User fa1369adab

14-06-2006 13:42:41

Tamas,





It turns out that my input molecule is in MRV, not MOL format:


Code:



<?xml version="1.0" ?>


  <MDocument>


    <MChemicalStruct>


      <molecule molID="m1">


        <atomArray


         atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11"


         elementType="N N C C O H H H H H H"


         mrvAlias="0 0 C C 0 0 0 0 0 0 0"


         x2="8.878049 11.317073


             6.439024 13.804877


             11.317073 6.439024


             4.1463413 6.439024


             13.804877 15.853658


             13.804877"


         y2="4.243902 4.243902


             4.243902 4.243902


             6.5853653 6.536585


             4.243902 2.0


             2.2439022 4.243902


             6.536585"


        />


        <bondArray>


          <bond atomRefs2="a1 a2" order="1" />


          <bond atomRefs2="a1 a3" order="1" />


          <bond atomRefs2="a2 a4" order="1" />


          <bond atomRefs2="a2 a5" order="1" />


          <bond atomRefs2="a3 a6" order="1" />


          <bond atomRefs2="a3 a7" order="1" />


          <bond atomRefs2="a3 a8" order="1" />


          <bond atomRefs2="a4 a9" order="1" />


          <bond atomRefs2="a4 a10" order="1" />


          <bond atomRefs2="a4 a11" order="1" />


        </bondArray>


      </molecule>


    </MChemicalStruct>


  </MDocument>








I am using jchem3.1.6. I see the same behavior when I invoke the command-line version of molconvert: I get a figure scaled to width 319.


Code:



molconvert jpeg:mono,H_off,wireframe,#ffffff,scale40 -o /tmp/foo.jpeg /tmp/foo.mrv








Refoyl

User fa1369adab

14-06-2006 14:23:43

Tamas,





Sorry. It turns out to be my mistake. As we convert from MOL to MRV, we change the scaling. I was measuring the size of the MOL but converting the MRV to a JPEG, hence the discrepancy.





Refoyl