If the molecule is not 0 dimensional, then the parity information of the stereo center is calculated from the spatial arrangement of the ligands. In case of 3 dimensions only the atomic coordinates are used. In case of 2 dimensions beside the atomic coordinates the out of plane information stored in the bond flags – known as wedges – are used.
The parity information in 2 dimensions can be modified by setting wedge to the chiral center. PARITY_EITHER can be achieved for a chiral center with wiggly bond or equally, with removing all wedge from the center. There are two methods to define parity in 2 dimensions: a single atom can be modified using the setParity(int i, int p)
method, while parities of all atoms in the molecule can be modified by the setParity(int[] p)
method of MoleculeGraph
class.
The only possibility to change parity information of a 3 dimensional molecule is to change the atomic coordinates. However, it is not recommended to translate one atom as it may lead to unexpected bond length or collision of atoms. To overcome this problem one can convert the 3 dimensional molecule to 0 dimensional, change the parity information and finally clean the result to 3 dimensions. Please note that all parity values should be set to 0, CIS or TRANS, it is not possible to set PARITY_EITHER in case of 3D molecules. Example
molecule.setDim(0);
molecule.setParity(1, StereoConstants.PARITY_EVEN);
Cleaner.clean(molecule, 3, null);
In case of 2 dimensions the parity information is calculated from the coordinates and from the wedges connected to the stereocenter. In case of 3 dimensions only the coordinates are used, any wedge information is neglected. To calculate the parity of an atom in 2 or 3 dimensions the getParity(int i)
method of the MoleculeGraph
class can be used.
Example using getParity() method
int p = molecule.getParity(1);