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
- Source code:
- main
- Belongs to CDK module:
- isomorphism
- Keywords:
- Rgroup, R group, R-group
-
-
Constructor Summary
Constructors Constructor Description RGroupQuery(IChemObjectBuilder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areRootAtomsDefined()
Checks validity of RGroupQuery.boolean
areSubstituentsDefined()
Checks validity of the RGroupQuery.List<IAtomContainer>
getAllConfigurations()
Produces all combinations of the root structure (scaffold) with the R-groups substituted in valid ways, using each R-group's definitions and conditions.List<IAtom>
getAllRgroupQueryAtoms()
Returns all R# type atoms (pseudo atoms) found in the root structure.int
getAtomContainerCount()
Return the total number of atom containers (count the root plus all substituents).Map<Integer,IRGroupList>
getRGroupDefinitions()
Getter for the R-group definitions (substituents).List<IAtom>
getRgroupQueryAtoms(Integer rgroupNumber)
Returns all R# type atoms (pseudo atoms) found in the root structure for a certain provided RGgroup number.Map<IAtom,Map<Integer,IBond>>
getRootAttachmentPoints()
Getter for root attachment points = bonds that connect R pseudo-atoms to the scaffold.IAtomContainer
getRootStructure()
Getter for the root structure of this R-Group.List<IAtomContainer>
getSubstituents()
Return all the substituent atom containers, in other words the atom containers defined in this RGroupQuery except for the root structure.static boolean
isValidRgroupQueryLabel(String Rxx)
Validates a Pseudo atom's label to be valid RGroup query label (R1..R32).void
setRGroupDefinitions(Map<Integer,IRGroupList> rGroupDefinitions)
Setter for the R-group definitions (substituents).void
setRootAttachmentPoints(Map<IAtom,Map<Integer,IBond>> rootAttachmentPoints)
Setter for root attachment points = bonds that connect R pseudo-atoms to the scaffold.void
setRootStructure(IAtomContainer rootStructure)
Setter for the root structure of this R-Group.-
Methods inherited from class org.openscience.cdk.isomorphism.matchers.QueryChemObject
addListener, addProperties, clone, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, matches, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilder
-
Methods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, addProperties, clone, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, toString
-
-
-
-
Constructor Detail
-
RGroupQuery
public RGroupQuery(IChemObjectBuilder builder)
-
-
Method Detail
-
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 correspondingRGroupList
definition.
In file terms: $RGP blocks must be defined for each R-group number.- Specified by:
areSubstituentsDefined
in interfaceIRGroupQuery
- Returns:
- true when valid
-
areRootAtomsDefined
public boolean areRootAtomsDefined()
Description copied from interface:IRGroupQuery
Checks validity of RGroupQuery. EachRGroupList
definition must have one or more corresponding R# atoms in the root block.- Specified by:
areRootAtomsDefined
in interfaceIRGroupQuery
- 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 interfaceIRGroupQuery
- 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 interfaceIRGroupQuery
- 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 interfaceIRGroupQuery
- 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 interfaceIRGroupQuery
- Parameters:
rootStructure
- the root structure (or scaffold) container- See Also:
IRGroupQuery.getRootStructure()
-
getRootStructure
public IAtomContainer getRootStructure()
Description copied from interface:IRGroupQuery
Getter for the root structure of this R-Group.- Specified by:
getRootStructure
in interfaceIRGroupQuery
- Returns:
- the root structure (or scaffold) container
- See Also:
IRGroupQuery.setRootStructure(org.openscience.cdk.interfaces.IAtomContainer)
-
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 interfaceIRGroupQuery
- 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:
IRGroupQuery.getRootAttachmentPoints()
-
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 interfaceIRGroupQuery
- 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:
IRGroupQuery.setRootAttachmentPoints(Map)
-
setRGroupDefinitions
public void setRGroupDefinitions(Map<Integer,IRGroupList> rGroupDefinitions)
Description copied from interface:IRGroupQuery
Setter for the R-group definitions (substituents).- Specified by:
setRGroupDefinitions
in interfaceIRGroupQuery
- Parameters:
rGroupDefinitions
- map with an Integer and an RGroupList (substituent list), the Integer being the R-Group number (1..32).- See Also:
IRGroupQuery.getRGroupDefinitions()
-
getRGroupDefinitions
public Map<Integer,IRGroupList> getRGroupDefinitions()
Description copied from interface:IRGroupQuery
Getter for the R-group definitions (substituents).- Specified by:
getRGroupDefinitions
in interfaceIRGroupQuery
- Returns:
- rGroupDefinitions Map with an Integer and an RGroupList (substituent list), the Integer being the R-Group number (1..32).
- See Also:
IRGroupQuery.setRGroupDefinitions(java.util.Map<java.lang.Integer, org.openscience.cdk.isomorphism.matchers.IRGroupList>)
-
-