Class RGroupQuery

java.lang.Object
org.openscience.cdk.isomorphism.matchers.QueryChemObject
org.openscience.cdk.isomorphism.matchers.RGroupQuery
All Implemented Interfaces:
Cloneable, ICDKObject, IChemObject, IRGroupQuery

public class RGroupQuery extends QueryChemObject implements IChemObject, IRGroupQuery
Represents information contained in a Symyx RGfile (R-group query file).
It contains a root structure (the scaffold if you like), a map with R-group definitions (each of which can contain multiple substitutes) and a map with attachment points. The attachment points define a connection order for the substitutes, which is relevant when an Rgroup is connected to the scaffold with more than one bond.

This class can also be used to produce all the valid configurations for the combination of its root,definitions and conditions.

This Javadoc does not contain a code sample how to create a new RGroupQuery from scratch, because a sensible RGroupQuery has quite a few attributes to be set including a root plus a bunch of substituents, which are all atom containers. So that would be a lot of sample code here.
The best way to get a feel for the way the RGroup objects are populated is to run the RGroupQueryReaderTest and look at the sample input RGroup query files contained in the CDK and how they translate into RGroupXX objects. The JChempaint application can visualize the input files for you.

Author:
Mark Rijnbeek
Keywords:
Rgroup, R group, R-group
  • Constructor Details

  • Method Details

    • getRgroupQueryAtoms

      public List<IAtom> getRgroupQueryAtoms(Integer rgroupNumber)
      Returns all R# type atoms (pseudo atoms) found in the root structure for a certain provided RGgroup number.

      Parameters:
      rgroupNumber - R# number, 1..32
      Returns:
      list of (pseudo) atoms with the provided rgroupNumber as label
    • getAllRgroupQueryAtoms

      public List<IAtom> getAllRgroupQueryAtoms()
      Returns all R# type atoms (pseudo atoms) found in the root structure.
      Returns:
      list of (pseudo) R# atoms
    • isValidRgroupQueryLabel

      public static boolean isValidRgroupQueryLabel(String Rxx)
      Validates a Pseudo atom's label to be valid RGroup query label (R1..R32).
      Parameters:
      Rxx - R-group label like R1 or R10
      Returns:
      true if R1..R32, otherwise false
    • areSubstituentsDefined

      public boolean areSubstituentsDefined()
      Description copied from interface: IRGroupQuery
      Checks validity of the RGroupQuery. Each distinct R# in the root must have a a corresponding RGroupList definition.
      In file terms: $RGP blocks must be defined for each R-group number.
      Specified by:
      areSubstituentsDefined in interface IRGroupQuery
      Returns:
      true when valid
    • areRootAtomsDefined

      public boolean areRootAtomsDefined()
      Description copied from interface: IRGroupQuery
      Checks validity of RGroupQuery. Each RGroupList definition must have one or more corresponding R# atoms in the root block.
      Specified by:
      areRootAtomsDefined in interface IRGroupQuery
      Returns:
      true when valid
    • getAllConfigurations

      public List<IAtomContainer> getAllConfigurations() throws CDKException
      Description copied from interface: IRGroupQuery
      Produces all combinations of the root structure (scaffold) with the R-groups substituted in valid ways, using each R-group's definitions and conditions.
      Specified by:
      getAllConfigurations in interface IRGroupQuery
      Returns:
      all valid combinations of the root structure (scaffold) with the R-groups substituted.
      Throws:
      CDKException
    • getAtomContainerCount

      public int getAtomContainerCount()
      Description copied from interface: IRGroupQuery
      Return the total number of atom containers (count the root plus all substituents).
      Specified by:
      getAtomContainerCount in interface IRGroupQuery
      Returns:
      count.
    • getSubstituents

      public List<IAtomContainer> getSubstituents()
      Description copied from interface: IRGroupQuery
      Return all the substituent atom containers, in other words the atom containers defined in this RGroupQuery except for the root structure.
      Specified by:
      getSubstituents in interface IRGroupQuery
      Returns:
      list with all substituents
    • setRootStructure

      public void setRootStructure(IAtomContainer rootStructure)
      Description copied from interface: IRGroupQuery
      Setter for the root structure of this R-Group.
      Specified by:
      setRootStructure in interface IRGroupQuery
      Parameters:
      rootStructure - the root structure (or scaffold) container
      See Also:
    • getRootStructure

      public IAtomContainer getRootStructure()
      Description copied from interface: IRGroupQuery
      Getter for the root structure of this R-Group.
      Specified by:
      getRootStructure in interface IRGroupQuery
      Returns:
      the root structure (or scaffold) container
      See Also:
    • setRootAttachmentPoints

      public void setRootAttachmentPoints(Map<IAtom, Map<Integer,IBond>> rootAttachmentPoints)
      Description copied from interface: IRGroupQuery
      Setter for root attachment points = bonds that connect R pseudo-atoms to the scaffold.
      Specified by:
      setRootAttachmentPoints in interface IRGroupQuery
      Parameters:
      rootAttachmentPoints - Map with per R-group pseudo atom another map with an Integer and an IBond, the integer indicating 1st or 2nd attachment.
      See Also:
    • getRootAttachmentPoints

      public Map<IAtom, Map<Integer,IBond>> getRootAttachmentPoints()
      Description copied from interface: IRGroupQuery
      Getter for root attachment points = bonds that connect R pseudo-atoms to the scaffold.
      Specified by:
      getRootAttachmentPoints in interface IRGroupQuery
      Returns:
      Map with per R-group pseudo atom another map with an Integer and an IBond, the integer indicating 1st or 2nd attachment.
      See Also:
    • setRGroupDefinitions

      public void setRGroupDefinitions(Map<Integer, IRGroupList> rGroupDefinitions)
      Description copied from interface: IRGroupQuery
      Setter for the R-group definitions (substituents).
      Specified by:
      setRGroupDefinitions in interface IRGroupQuery
      Parameters:
      rGroupDefinitions - map with an Integer and an RGroupList (substituent list), the Integer being the R-Group number (1..32).
      See Also:
    • getRGroupDefinitions

      public Map<Integer, IRGroupList> getRGroupDefinitions()
      Description copied from interface: IRGroupQuery
      Getter for the R-group definitions (substituents).
      Specified by:
      getRGroupDefinitions in interface IRGroupQuery
      Returns:
      rGroupDefinitions Map with an Integer and an RGroupList (substituent list), the Integer being the R-Group number (1..32).
      See Also: