shortcut groups in images

User 870ab5b546

12-09-2004 16:27:55

When a structure that contains shortcut groups is made into a JPEG image, the shortcut groups are always expanded. Can we keep them contracted? 'Twould be more desirable to do so. For example:





Code:
<?xml version="1.0"?>


<MDocument>


  <MChemicalStruct>


    <molecule>


      <atomArray


          atomID="a1 a2 a3 a4 a5 a6 a7"


          elementType="C C C C C R R"


          sgroupRef="0 0 0 0 0 sg1 sg2"


          x2="-5.899413333333334 -4.565866666666667 -3.232133333333334 -1.8985866666666666 -0.5648533333333334 0.7686933333333335 -7.233146666666668"


          y2="3.045093333333334 2.275093333333334 3.045093333333334 2.275093333333334 3.045093333333334 2.275093333333334 2.275093333333334"


          />


      <bondArray>


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


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


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


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


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


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


      </bondArray>


      <molecule id="sg1" role="SuperatomSgroup" title="CO2Et">


        <atomArray


            atomID="a8 a9 a10 a11 a12"


            elementType="C C O C O"


            attachmentPoint="1 0 0 0 0"


            x2="0.7686933333333335 -0.5650400000000001 0.7686933333333335 -0.5652266666666669 2.102426666666667"


            y2="2.275093333333334 -0.034906666666666676 0.7350933333333335 -1.574906666666667 3.045093333333334"


            />


        <bondArray>


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


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


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


          <bond atomRefs2="a8 a12" order="2" />


        </bondArray>


      </molecule>


      <molecule id="sg2" role="SuperatomSgroup" title="EtO2C">


        <atomArray


            atomID="a13 a14 a15 a16 a17"


            elementType="C C O C O"


            residueType="UNK UNK UNK UNK UNK"


            residueId="r1 r1 r1 r1 r1"


            residueAtomName="0 0 0 0 0"


            attachmentPoint="1 0 0 0 0"


            x2="-7.233146666666668 -8.566693333333333 -8.566880000000001 -9.900426666666668 -7.233146666666668"


            y2="2.275093333333334 4.585093333333334 3.045093333333334 5.355093333333334 0.7350933333333335"


            />


        <bondArray>


          <bond atomRefs2="a16 a14" order="1" />


          <bond atomRefs2="a14 a15" order="1" />


          <bond atomRefs2="a15 a13" order="1" />


          <bond atomRefs2="a13 a17" order="2" />


        </bondArray>


      </molecule>


    </molecule>


  </MChemicalStruct>


</MDocument>








becomes the JPEG attached.

ChemAxon 7c2d26e5cf

13-09-2004 16:15:51

Image export in Marvin does not expand s-groups.


When you save a molecule with Marvin, each s-groups' status (contracted or expanded displaying) is stored in the molstring. (Image export also preserves groups' status.)


Since the older versions of Marvin always expanded s-groups in the molecule before saving, you may have got a few mol files with expanded structures.


Your attached example also contains expanded s-groups.





There is not any image export option in current Marvin to display all s-groups in contracted format.


Until we solve this problem, I can suggest only one workaround for this problem.


Open in sketcher those mol files which contain expanded s-groups to contract them by selecting the "Edit/Groups/Contract" menu item. Then saves the edited molecules.

ChemAxon 7c2d26e5cf

13-09-2004 18:14:48

You can use Molecule.contractSgroups() to contract s-groups:


http://www.chemaxon.com/marvin/doc/api/chemaxon/struc/Molecule.html#contractSgroups()





You should contract groups before exporting the structure:


Code:



    mol.contractSgroups();


    byte[] data = mol.toBinFormat("jpeg");


User 870ab5b546

13-09-2004 23:21:03

Tamas wrote:
Image export in Marvin does not expand s-groups.


When you save a molecule with Marvin, each s-groups' status (contracted or expanded displaying) is stored in the molstring. (Image export also preserves groups' status.)


Since the older versions of Marvin always expanded s-groups in the molecule before saving, you may have got a few mol files with expanded structures.


Your attached example also contains expanded s-groups.





There is not any image export option in current Marvin to display all s-groups in contracted format.


Until we solve this problem, I can suggest only one workaround for this problem.


Open in sketcher those mol files which contain expanded s-groups to contract them by selecting the "Edit/Groups/Contract" menu item. Then saves the edited molecules.
Tamas,





I compared the code for the structure below with S-groups contracted and expanded, and the S-groups are definitely contracted in the example. However, when I create the image from Marvin under the File menu, the shortcut groups remain contracted. EPOCH must be using some image-creating method that ignores the S-groups, or maybe the S-groups are expanded before creation of the image. I will have our programmer look into it.





-- Bob