OESetCrystalSymmetry¶
bool OESetCrystalSymmetry(OEChem::OEMolBase &mol,
const OECrystalSymmetryParams ¶ms,
bool force=false)
Sets the crystal symmetry stored in a OECrystalSymmetryParams object for a given molecule.
The above functions return false
if the space group number
(returned by OECrystalSymmetryParams.GetSpaceGroup
)
is not found or the symmetry cannot be set on the molecule because the
constraints on the spacegroup are violated.
If force
is set to true, then parameters that violate the constraints of
the given spacegroup will be applied. (This is sometimes necessary based on
slight rounding errors for deposited CRYST1 cards).
Note
Use this overloaded function in the supported wrapped languages: Python, Java and C#.
Example:
for pdb in ifs.GetOEGraphMols():
p = oechem.OECrystalSymmetryParams(124.978, 124.978, 69.000, 90.0, 90.0, 120.0, 154, 4)
if oechem.OESetCrystalSymmetry(pdb, p):
print("a= %f b= %f c= %f" % (p.GetA(), p.GetB(), p.GetC()), end=" ")
print("alpha= %f beta= %f gamma= %f" % (p.GetAlpha(), p.GetBeta(), p.GetGamma()), end=" ")
print("spacegroup= %d z-value= %d" % (p.GetSpaceGroup(), p.GetZValue()))
bool OESetCrystalSymmetry(OEChem::OEMolBase &mol,
float a, float b, float c,
float alpha, float beta, float gamma,
unsigned int sgnumber, bool force=false)
Sets the crystal symmetry for a given molecule.
The above functions return false
if the indicated space group number is
not found or the symmetry cannot be set on the molecule because the
constraints on the spacegroup are violated, such as a=b for tetragonal
spacegroups.
If force
is set to true, then parameters that violate the constraints of
the given spacegroup will be applied. (This is sometimes necessary based on
slight rounding errors for deposited CRYST1 cards).
See also
OEGetCrystalSymmetry
function