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
How can i set the R-group compound in java ?
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
Hanwoong

Joined: 17 Dec 2015
Posts: 5

View user's profile

Back to top
Link to postPosted: Tue Apr 12, 2016 7:08 amPost subject: How can i set the R-group compound in java ? Reply with quote

Markush Enumeration plugin API : 

Sequential enumeration:

 // Create plugin
 MarkushEnumerationPlugin plugin = new MarkushEnumerationPlugin();
 
 // Set target molecule
 plugin.setMolecule(mol);
 
 // Run the calculation
 plugin.run();
 
 // 1. Get results one by one
 Molecule m = plugin.getNextStructure();
 while (m != null) {
     System.out.println(m.toFormat("smiles"));
     // ...
     // Getting next enumerated molecule
     m = plugin.getNextStructure();
 }
 
 // OR
 // 2. Get results in an array
 long size = plugin.getStructureCount();
 if (size != -1 && size <= Integer.MAX_VALUE) {
     Molecule[] enumerated = plugin.getStructures();
     for (int i = 0; i < enumerated.length; i++) {
         System.out.println(enumerated[i].toFormat("smiles"));
         // ...
     }
 }
================================ 

I want to create new molecules from scaffold molecule in java code. 

but there is no information for how can i set the R-group compounds. 

Péter
ChemAxon personnel
Joined: 15 Mar 2010
Posts: 94

View user's profile

Back to top
Link to postPosted: Tue Apr 12, 2016 8:47 amPost subject: Reply with quote

Hi,

You should build a so-called Markush structure or R-group molecule before you use the enumeration plugin. An RgMolecule is composed of a scaffold structure (see setRoot() method) and R-group definitions (see addRgroup() method). Both methods take Molecule objects as parameter, which can be imported from various formats (SDF/MOL, MRV, smiles, etc.) or can be built from scratch using the API of the class.

Example:

RgMolecule rgmol = new RgMolecule();
Molecule scaffold = ...
rgmol.setRoot(scaffold);
Molecule r1a = ...
Molecule r1b = ...
Molecule r1c = ...
rgmol.addRgroup(1, r1a);
rgmol.addRgroup(1, r1b);
rgmol.addRgroup(1, r1c);
Molecule r2a = ...
Molecule r2b = ...
rgmol.addRgroup(2, r2a);
rgmol.addRgroup(2, r2b);

This example builds an RgMolecule with a scaffold (which should contain R1 and R2 atoms) and adds 3 definition member molecules to R1 group and two members to R2.

I hope this helps.

Péter Kovács

Hanwoong

Joined: 17 Dec 2015
Posts: 5

View user's profile

Back to top
Link to postPosted: Mon Apr 18, 2016 2:40 pmPost subject: Thank you for your kind answer Reply with quote

Thank you for your kind answer.

The answer is very helpful to me. 

but, I still don't know that how can I apply the R-group molecule code to enumeration plugin code.

Could you please explain the method using enumeration code?

 

Arpad
ChemAxon personnel
Joined: 25 Mar 2013
Posts: 97

View user's profile

Back to top
Link to postPosted: Mon Apr 18, 2016 3:16 pmPost subject: Reply with quote

You can build a Markush structure using the "Build R-group" code example from here

https://www.chemaxon.com/marvin-archive/6.1.3/marvin/help/developer/core/appendix.html

and you can insert the created rgMol in the corresponding part of the enumeration example, to generate the compounds represented by your Markush structure.

// Create plugin
 MarkushEnumerationPlugin plugin = new MarkushEnumerationPlugin();
 
 // Set target molecule
 plugin.setMolecule(rgMol);
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