How can i set the R-group compound in java ?

User ee5b66fbc5

12-04-2016 06:08:48

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.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. 

ChemAxon 4a2fc68cd1

12-04-2016 07:47:46

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

User ee5b66fbc5

18-04-2016 13:40:00

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?


 

ChemAxon 58554172c4

18-04-2016 14:16:58

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);