R-group structures

Introduction

An R-group structure describes a set of derivatives in one structure (substitution variation). It is useful to define Markush-structures.

Definitions

Implementation

The core representation of R-group structures is the chemaxon.struc.RgMolecule class.

Build an R-group

Create R-atoms and a root molecule

The core of the root molecule (i.e. the molecule without the R-atoms) can be built in a same way as any other MoleculeGraph object. To create an R-atom, use the MolAtom.RGROUP constant in the constructor of the MolAtom. Using the MolAtom.setRgroup(int), an ID can be set for the R-atom.
   MolAtom r1 = new MolAtom(MolAtom.RGROUP);
   r1.setRgroup(1);
 
Note, that R-atoms are MolAtom objects, hence they should be added to the root molecule.

Create R-group

An RgMolecule object can be constructed with an empty constructor. Specify its root molecule using the RgMolecule.setRoot(MoleculeGraph) method.
   RgMolecule rgMol = new RgMolecule();
   rgMol.setRoot(root);
 

Create R-group definition

R-group definitions are Molecule objects. To define an R-group attachment point to one of its atoms use the MolAtom.addRgroupAttachmentPoint(int, int). With the first integer the order of the attachment point is set, the second one defines the bond type. R-group definition should be added to the corresponding R-group using the Rgmolecule.addRgroup(int, Molecule). The integer parameter shows to which R-atom the definition corresponds to.
   Molecule rg = MolImporter.importMol("O");
   rg.getAtom(0).addRgroupAttachmentPoint(1, 1);
   rgMol.addRgroup(1, rg);
 
You may find a full example here.

Access the root molecule and the R-group definition

	//get the root structure and enumerate the atoms, find R-Atoms.
        Molecule root = rgmol.getRoot();
        for (int i = root.getAtomCount() - 1; i >= 0; --i){
            MolAtom atom = root.getAtom(i);
            if (atom.getAtno() == MolAtom.RGROUP){
               ....
            }
        }
     
        //enumerate the R-group definitions and its fragments
        int nr = rgmol.getRgroupCount();
        for(int i = 0; i < nr; ++i) {
            int nrm = rgmol.getRgroupMemberCount(i);
            for(int j = 0; j < nrm; ++j) {
        //    	.... do something with rgmol.getRgroupMember(i, j)  
            }
        }

 

 

 

 

Molecule Graph

Table of contents

S-groups

Previous chapter

 

Next chapter