Package org.openscience.cdk.stereo
Class StereoElementFactory
- java.lang.Object
-
- org.openscience.cdk.stereo.StereoElementFactory
-
public abstract class StereoElementFactory extends Object
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 useStereocenters
. 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:
Stereocenters
- Source code:
- main
- Belongs to CDK module:
- standard
-
-
Field Summary
Fields Modifier and Type Field Description protected GraphUtil.EdgeToBondMap
bondMap
A bond map for fast access to bond labels between two atom indices.protected boolean
check
Verify if created stereochemistry are actually stereo-centres.protected IAtomContainer
container
Native CDK structure representation.protected int[][]
graph
Adjacency list graph representation.protected ILoggingTool
logger
protected Set<Projection>
projections
protected boolean
strict
-
Constructor Summary
Constructors Modifier Constructor Description protected
StereoElementFactory(IAtomContainer container, int[][] graph, GraphUtil.EdgeToBondMap bondMap)
Internal constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StereoElementFactory
checkSymmetry(boolean check)
List<IStereoElement>
createAll()
Creates all stereo elements found byStereocenters
using the or 2D/3D coordinates to specify the configuration (clockwise/anticlockwise).StereoElementFactory
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).StereoElementFactory
withStrictMode()
Enables stricter stereochemistry checking, specifically tetrahedral centres may not be created from inverse down wedges (i.e.
-
-
-
Field Detail
-
container
protected final IAtomContainer container
Native CDK structure representation.
-
graph
protected final int[][] graph
Adjacency list graph representation.
-
bondMap
protected final GraphUtil.EdgeToBondMap bondMap
A bond map for fast access to bond labels between two atom indices.
-
projections
protected final Set<Projection> projections
-
strict
protected boolean strict
-
logger
protected final ILoggingTool logger
-
check
protected boolean check
Verify if created stereochemistry are actually stereo-centres.
-
-
Constructor Detail
-
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 Detail
-
createAll
public List<IStereoElement> 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
public StereoElementFactory interpretProjections(Projection... projections)
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:
Projection
-
checkSymmetry
public StereoElementFactory checkSymmetry(boolean check)
-
withStrictMode
public StereoElementFactory 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
public static StereoElementFactory using2DCoordinates(IAtomContainer container)
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
public static StereoElementFactory using3DCoordinates(IAtomContainer container)
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
-
-