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
-
-
Field Summary
-
Fields inherited from interface org.openscience.cdk.interfaces.IChemObject
ALIPHATIC, AROMATIC, CONJUGATED, HYDROGEN_BOND_ACCEPTOR, HYDROGEN_BOND_DONOR, IN_RING, MAPPED, NOT_IN_RING, PLACED, REACTIVE_CENTER, SINGLE_OR_DOUBLE, TYPEABLE, VISITED
-
-
Constructor Summary
Constructors Constructor Description RGroupQuery(IChemObjectBuilder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareRootAtomsDefined()Checks validity of RGroupQuery.booleanareSubstituentsDefined()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.intgetAtomContainerCount()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.IAtomContainergetRootStructure()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 booleanisValidRgroupQueryLabel(String Rxx)Validates a Pseudo atom's label to be valid RGroup query label (R1..R32).voidsetRGroupDefinitions(Map<Integer,IRGroupList> rGroupDefinitions)Setter for the R-group definitions (substituents).voidsetRootAttachmentPoints(Map<IAtom,Map<Integer,IBond>> rootAttachmentPoints)Setter for root attachment points = bonds that connect R pseudo-atoms to the scaffold.voidsetRootStructure(IAtomContainer rootStructure)Setter for the root structure of this R-Group.-
Methods inherited from class org.openscience.cdk.isomorphism.matchers.QueryChemObject
addListener, addProperties, clear, clone, flags, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, is, matches, notifyChanged, notifyChanged, removeListener, removeProperty, set, 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, clear, clone, flags, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, is, notifyChanged, notifyChanged, removeListener, removeProperty, set, 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:IRGroupQueryChecks validity of the RGroupQuery. Each distinct R# in the root must have a a correspondingRGroupListdefinition.
In file terms: $RGP blocks must be defined for each R-group number.- Specified by:
areSubstituentsDefinedin interfaceIRGroupQuery- Returns:
- true when valid
-
areRootAtomsDefined
public boolean areRootAtomsDefined()
Description copied from interface:IRGroupQueryChecks validity of RGroupQuery. EachRGroupListdefinition must have one or more corresponding R# atoms in the root block.- Specified by:
areRootAtomsDefinedin interfaceIRGroupQuery- Returns:
- true when valid
-
getAllConfigurations
public List<IAtomContainer> getAllConfigurations() throws CDKException
Description copied from interface:IRGroupQueryProduces 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:
getAllConfigurationsin 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:IRGroupQueryReturn the total number of atom containers (count the root plus all substituents).- Specified by:
getAtomContainerCountin interfaceIRGroupQuery- Returns:
- count.
-
getSubstituents
public List<IAtomContainer> getSubstituents()
Description copied from interface:IRGroupQueryReturn all the substituent atom containers, in other words the atom containers defined in this RGroupQuery except for the root structure.- Specified by:
getSubstituentsin interfaceIRGroupQuery- Returns:
- list with all substituents
-
setRootStructure
public void setRootStructure(IAtomContainer rootStructure)
Description copied from interface:IRGroupQuerySetter for the root structure of this R-Group.- Specified by:
setRootStructurein interfaceIRGroupQuery- Parameters:
rootStructure- the root structure (or scaffold) container- See Also:
IRGroupQuery.getRootStructure()
-
getRootStructure
public IAtomContainer getRootStructure()
Description copied from interface:IRGroupQueryGetter for the root structure of this R-Group.- Specified by:
getRootStructurein 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:IRGroupQuerySetter for root attachment points = bonds that connect R pseudo-atoms to the scaffold.- Specified by:
setRootAttachmentPointsin 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:IRGroupQueryGetter for root attachment points = bonds that connect R pseudo-atoms to the scaffold.- Specified by:
getRootAttachmentPointsin 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:IRGroupQuerySetter for the R-group definitions (substituents).- Specified by:
setRGroupDefinitionsin 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:IRGroupQueryGetter for the R-group definitions (substituents).- Specified by:
getRGroupDefinitionsin 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>)
-
-