Package org.openscience.cdk.stereo
Class StereoElementFactory
java.lang.Object
org.openscience.cdk.stereo.StereoElementFactory
Create stereo elements for a structure with 2D and 3D coordinates. The
factory does not verify whether atoms can or cannot support stereochemistry -
for this functionality use
Stereocenters
. The factory will not create
stereo elements if there is missing information (wedge/hatch bonds, undefined
coordinates) or the layout indicates unspecified configuration.
Stereocenters specified with inverse down (hatch) bond style are created if
the configuration is unambiguous and the bond does not connect to another
stereocenter.
IAtomContainer container = ...; StereoElementFactory stereo = StereoElementFactory.using2DCoordinates() .interpretProjections(Projection.Haworth); // set the elements replacing any existing elements container.setStereoElements(stereo.createAll()); // adding elements individually is also possible but existing elements are // are not removed for (IStereoElement element : stereo.createAll()) container.addStereoElement(element); // bad, there may already be elements
- Author:
- John May
- See Also:
- Source code:
- main
- Belongs to CDK module:
- standard
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GraphUtil.EdgeToBondMap
A bond map for fast access to bond labels between two atom indices.protected boolean
Verify if created stereochemistry are actually stereo-centres.protected final IAtomContainer
Native CDK structure representation.protected final int[][]
Adjacency list graph representation.protected final ILoggingTool
protected final Set<Projection>
protected boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
StereoElementFactory
(IAtomContainer container, int[][] graph, GraphUtil.EdgeToBondMap bondMap) Internal constructor. -
Method Summary
Modifier and TypeMethodDescriptioncheckSymmetry
(boolean check) Creates all stereo elements found byStereocenters
using the or 2D/3D coordinates to specify the configuration (clockwise/anticlockwise).interpretProjections
(Projection... projections) Indicate that stereochemistry drawn as a certain projection should be interpreted.static StereoElementFactory
using2DCoordinates
(IAtomContainer container) Create a stereo element factory for creating stereo elements using 2D coordinates and depiction labels (up/down, wedge/hatch).static StereoElementFactory
using3DCoordinates
(IAtomContainer container) Create a stereo element factory for creating stereo elements using 3D coordinates and depiction labels (up/down, wedge/hatch).Enables stricter stereochemistry checking, specifically tetrahedral centres may not be created from inverse down wedges (i.e.
-
Field Details
-
container
Native CDK structure representation. -
graph
protected final int[][] graphAdjacency list graph representation. -
bondMap
A bond map for fast access to bond labels between two atom indices. -
projections
-
strict
protected boolean strict -
logger
-
check
protected boolean checkVerify if created stereochemistry are actually stereo-centres.
-
-
Constructor Details
-
StereoElementFactory
protected StereoElementFactory(IAtomContainer container, int[][] graph, GraphUtil.EdgeToBondMap bondMap) Internal constructor.- Parameters:
container
- an atom containergraph
- adjacency list representationbondMap
- lookup bonds by atom index
-
-
Method Details
-
createAll
Creates all stereo elements found byStereocenters
using the or 2D/3D coordinates to specify the configuration (clockwise/anticlockwise). Currently onlyITetrahedralChirality
andIDoubleBondStereochemistry
elements are created..- Returns:
- a list of stereo elements
-
interpretProjections
Indicate that stereochemistry drawn as a certain projection should be interpreted.StereoElementFactory factory = StereoElementFactory.using2DCoordinates(container) .interpretProjections(Projection.Fischer, Projection.Haworth);
- Parameters:
projections
- types of projection- Returns:
- self
- See Also:
-
checkSymmetry
-
withStrictMode
Enables stricter stereochemistry checking, specifically tetrahedral centres may not be created from inverse down wedges (i.e. Daylight style depictions). This also sets that all stereocentres are tested for asymmetry.- Returns:
- stereo element factory.
-
using2DCoordinates
Create a stereo element factory for creating stereo elements using 2D coordinates and depiction labels (up/down, wedge/hatch).- Parameters:
container
- the structure to create the factory for- Returns:
- the factory instance
-
using3DCoordinates
Create a stereo element factory for creating stereo elements using 3D coordinates and depiction labels (up/down, wedge/hatch).- Parameters:
container
- the structure to create the factory for- Returns:
- the factory instance
-