Technical Support Forum Index
Technical Support Forum
Access ChemAxon scientists and developers here. For registration and login issues contact website support.

Support Ticket System is replacing forum

This forum was converted into a searchable archive. You cannot add posts here any more. For support please use our new Ticket System.

Create your first ticket
RgMolecule converting to Images with MarvinBeans
To watch this topic for replies  Register (enables digests) or give email address:
This topic is locked: you cannot edit posts or make replies.
Display posts from previous:   
    View previous topic :: View next topic    
Author Message
Helge

Joined: 07 Jan 2008
Posts: 29

View user's profile

Back to top
Link to postPosted: Fri Sep 05, 2008 3:06 pmPost subject: RgMolecule converting to Images with MarvinBeans Reply with quote

Dear all,

I've successfully imported a molecule with R-Group into a RgMolecule object using MarvinBeans (we're using MarvinBeans 5.0.7).

Now, I want to convert this Molecule into an image including all R-Groups. This image should look like the display of the Molecule in MarvinSketch, i.e. especially I want the String "R1" marking the groups appear in it.

But If I use toBinFormat() I only get the main molecule without R-Groups. If I import it into a Molecule object, I get the R-Groups but no maker named "R1".

Can you help me with that?

Thanks in advance!

Helge



 Filename: example_Rgroup.mol    Filesize: 2.14 KB    Downloaded: 343 Time(s)
 Description:  
Judit
ChemAxon personnel
Joined: 04 Nov 2004
Posts: 612

View user's profile

Back to top
Link to postPosted: Mon Sep 08, 2008 11:35 amPost subject: Reply with quote

Hello Helge,

you are right, in 5.0.7 the simple image conversion doesn't seem to include the R-group definitions, though it works nicely with 5.1.x
( using mol.toBinFormat("jpeg:w200,h200"); ).

A quick 5.0.7 solution can be:

Code:
            // getting the actual scale factor of the canvas
            double currentScale = sketchPane.getScale();
            // getting the image of the canvas with
            // the current scale factor
            Image canvasImage = sketchPane.getImage(currentScale);


I hope you can use this or it's possible for you to upgrade.
Kind regards,
Judit
Helge

Joined: 07 Jan 2008
Posts: 29

View user's profile

Back to top
Link to postPosted: Tue Sep 09, 2008 6:05 amPost subject: Reply with quote

Hi Judit,

thanks for your response.

I've replaced 5.0.7 with the actual version 5.1.1 and everything works fine! Thank you very much!

Helge
Helge

Joined: 07 Jan 2008
Posts: 29

View user's profile

Back to top
Link to postPosted: Wed Sep 10, 2008 6:02 amPost subject: Reply with quote

Hi Judit,

the exchange of MarvinBeans 5.0.7 with 5.1.1 solves the problem with Rgroups but arises another problem.

If you load the reaction defined in 0rea.mol (or 0rea.mrv) in MarvinSketch, everything looks fine. But when I render it in MarvinBeans 5.1.1. (after loading it as an RgMolecule) the arrow is missing. The same rendering code with MarvinBeans 5.0.7. works fine. Marvin Beans is always fed with the Molfile V3 format.

Do you have any idea? Or a workaround?

Helge



 Filename: 0rea.mol    Filesize: 1.08 KB    Downloaded: 362 Time(s)
 Description:  

 Filename: 0rea.mrv    Filesize: 2.32 KB    Downloaded: 368 Time(s)
 Description:  
Judit
ChemAxon personnel
Joined: 04 Nov 2004
Posts: 612

View user's profile

Back to top
Link to postPosted: Thu Sep 11, 2008 11:43 amPost subject: Reply with quote

Hi Helge,

thank you for the code example you've sent in e-mail, it helped us to reproduce the problem.

We will fix it by 5.1.2, but until then here is a quick&dirty workaround:

Code:
      if (molecule.getDocument() == null) {
          new MDocument(molecule);
      }
      if(molecule.getRoot() instanceof RxnMolecule) {
          RxnMolecule root = (RxnMolecule)molecule.getRoot();
          MRArrow arrow = (MRArrow) root.getReactionArrow(true);
          arrow.setType(RxnMolecule.REGULAR_SINGLE);
      }


Please add this code after the molecule importing part and before the conditional cleaning of the molecule.

Should you have any more problems, please contact us.

Kind regards,
Judit
Helge

Joined: 07 Jan 2008
Posts: 29

View user's profile

Back to top
Link to postPosted: Thu Sep 11, 2008 12:40 pmPost subject: Reply with quote

Hi Judit,

this code snippet seems to solve our problems, thank you very much!

Best regards

Helge
This topic is locked: you cannot edit posts or make replies.
Page 1 of 1


To watch this topic for replies   Register (enables digests) or give email address  
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum