Class SquarePlanar

  • All Implemented Interfaces:
    Cloneable, ICDKObject, IStereoElement<IAtom,​IAtom>

    public final class SquarePlanar
    extends Object
    Describes square planar configuration. The configuration around a square planar is described by 3 possible values (1:U, 2:4, or 3:Z) based on the ordering of the planar carries around the focus:
    
     Configurations:
    
         a                a                a
         |                |                |
      d--f--b = U      c--f--d = 4      b--f--c = Z
         |                |                |
         c                b                d
    
        SP1              SP2              SP3
     
    cis-platin can be represented as any of the following:
     [NH3][Pt@SP1]([NH3])(Cl)Cl
     [NH3][Pt@SP3]([NH3])(Cl)Cl
     [NH3][Pt@SP2](Cl)([NH3])Cl
     [NH3][Pt@SP1](Cl)(Cl)[NH3]
     
    trans-platin can be represented as any of the following:
     [NH3][Pt@SP2]([NH3])(Cl)Cl
     [NH3][Pt@SP1](Cl)([NH3])Cl
     [NH3][Pt@SP1](Cl)([NH3])Cl
     [NH3][Pt@SP3](Cl)(Cl)[NH3]
     
    The normalize function (normalize()) create a new
    IStereoElement
    where the carriers have been reorder such that the configuration is in a U shape (order=1).
    See Also:
    Square Planar Centers, OpenSMILES, TrigonalBipyramidal, Octahedral
    • Constructor Detail

      • SquarePlanar

        public SquarePlanar​(IAtom focus,
                            IAtom[] carriers,
                            int order)
        Create a square-planar configuration around a provided focus atom. The carriers are flat in the plane and their arrangement is either, U-shape, 4-shape, or Z-shape.
        Parameters:
        focus - the focus
        carriers - the carriers
        order - the configuration order, 1-3
    • Method Detail

      • normalize

        public SquarePlanar normalize()
        Normalize the configuration to the lowest configuration order (1) - U-shaped.
        Returns:
        the normalized configuration
      • numCarriers

        protected static int numCarriers​(int cfg)
      • getFocus

        public F getFocus()
        The focus atom or bond at the 'centre' of the stereo-configuration.
        Specified by:
        getFocus in interface IStereoElement<F extends IChemObject,​C extends IChemObject>
        Returns:
        the focus
      • getConfig

        public int getConfig()
        Access the configuration order and class of the stereochemistry.
        Specified by:
        getConfig in interface IStereoElement<F extends IChemObject,​C extends IChemObject>
        Returns:
        the configuration
      • setConfigOrder

        public void setConfigOrder​(int cfg)
        Set the configuration order of the stereochemistry.
        Specified by:
        setConfigOrder in interface IStereoElement<F extends IChemObject,​C extends IChemObject>
        Parameters:
        cfg - the new configuration
      • setGroupInfo

        public void setGroupInfo​(int grp)
        Set the stereo group information - see class doc.
        Specified by:
        setGroupInfo in interface IStereoElement<F extends IChemObject,​C extends IChemObject>
        Parameters:
        grp - the group info
      • contains

        public boolean contains​(IAtom atom)
        Does the stereo element contain the provided atom.
        Specified by:
        contains in interface IStereoElement<F extends IChemObject,​C extends IChemObject>
        Parameters:
        atom - an atom to test membership
        Returns:
        whether the atom is present
      • map

        public IStereoElement<F,​C> map​(Map<IAtom,​IAtom> atoms,
                                             Map<IBond,​IBond> bonds)
        Map the atoms/bonds in this instance to a new stereo element using the provided atom/bond mapping. This allows the stereo element to be transferred between a cloned or aligned (i.e. isomorphic) chemical graph. If no mapping is found for a given atom or bond it is left intact. However the provided atom and bonds maps must not be null.
        Specified by:
        map in interface IStereoElement<F extends IChemObject,​C extends IChemObject>
        Parameters:
        atoms - used to convert the original atoms to their mapped counterparts
        bonds - used to convert the original bonds to their mapped counterparts
        Returns:
        a new stereo element in the same configuration but with atoms/bonds replaced with their mapped equivalence.
      • mapStrict

        public final IStereoElement<F,​C> mapStrict​(Map<IChemObject,​IChemObject> chemobjs)
        Description copied from interface: IStereoElement
        Update the stereo using the remapping of atoms/bonds in this instance to a new stereo element using the provided atom/bond mapping. This allows the stereo element to be transferred between a cloned or aligned (i.e. isomorphic) chemical graph. If no mapping is found for a given atom or bond a new element is NOT created.
        Specified by:
        mapStrict in interface IStereoElement<F extends IChemObject,​C extends IChemObject>
        Parameters:
        chemobjs - chem object mapping
        Returns:
        a new stereo element in the same configuration but with atoms/bonds replaced with their mapped equivalence.
      • invapply

        protected static <T> T[] invapply​(T[] src,
                                          int[] perm)