RDCode: MolTransforms.h Source File

- Main Page
- Namespaces
- Classes
- Files
- Directories

# MolTransforms.h

Go to the documentation of this file.

    00001 //
    00002 //   Copyright (C) 2003-2006 Rational Discovery LLC
    00003 //
    00004 //   @@ All Rights Reserved  @@
    00005 //
    00006 #ifndef _RD_MOLTRANSFORMS_H_
    00007 #define _RD_MOLTRANSFORMS_H_
    00008
    00009 #include <Geometry/point.h>
    00010 #include <Numerics/SymmMatrix.h>
    00011
    00012 namespace RDKit{
    00013   class ROMol;
    00014   class Atom;
    00015   class Conformer;
    00016 }
    00017
    00018 namespace RDGeom {
    00019   class Transform3D;
    00020 }
    00021
    00022 namespace MolTransforms{
    00023   void transformMolsAtoms(RDKit::ROMol *mol,RDGeom::Transform3D &tform);
    00024   void transformAtom(RDKit::Atom *atom,RDGeom::Transform3D &tform);
    00025
    00026   //! Compute the centroid of a conformer
    00027   /*!
    00028     This is simple the average of the heavy atom locations in the conformer,
    00029     not attention is paid to hydrogens or the differences in atomic radii
    00030
    00031     \param conf     Conformer of interest
    00032     \param ignoreHs If true, ignore hydrogen atoms
    00033   */
    00034   RDGeom::Point3D computeCentroid(const RDKit::Conformer &conf, bool ignoreHs=true);
    00035
    00036   //! Compute the covariance matrix for a conformer
    00037   /*!
    00038     \param conf       Conformer of interest
    00039     \param center     Center to be used for covariance matrix calculation
    00040     \param normalize  If true, normalize the covariance matrix by the number of atoms
    00041     \param ignoreHs   If true, ignore hydrogen atoms
    00042   */
    00043   RDNumeric::DoubleSymmMatrix *computeCovarianceMatrix(const RDKit::Conformer &conf,
    00044                                                        const RDGeom::Point3D &center,
    00045                                                        bool normalize=false,
    00046                                                        bool ignoreHs=true);
    00047
    00048
    00049   //! Compute the transformation require to orient the conformation
    00050   //! along the principal axes about the center; i.e. center is made to coincide with the
    00051   //! origin, the largest princiapl axis with the x-axis, the next largest with the y-axis
    00052   //! and the smallest with the z-axis
    00053   /*!
    00054     If center is not specified the the centroid of the conformer will be used
    00055     \param conf                Conformer of interest
    00056     \param center              Center to be used for canonicalization, defaults to the centroid of the
    00057                                conformation
    00058     \param normalizeCovar      Normalize the covariance matrix with the number of atoms
    00059     \param ignoreHs            Optinally ignore hydrogens
    00060   */
    00061   RDGeom::Transform3D *computeCanonicalTransform(const RDKit::Conformer &conf,
    00062                                                  const RDGeom::Point3D *center=0,
    00063                                                  bool normalizeCovar=false,
    00064                                                  bool ignoreHs=true);
    00065
    00066   //! Transform the conformation using the specified transformation
    00067   void transformConformer(RDKit::Conformer &conf, const RDGeom::Transform3D &trans);
    00068
    00069   //! Canonicalize the orientation of a conformer so that its principal axes
    00070   //! around the specified center point coincide with the x, y, z axes
    00071   /*!
    00072     \param conf           The conformer of interest
    00073     \param center         Optional center point about which the principal axes are computed
    00074                           if not specified the centroid of the conformer will be used
    00075     \param normalizeCovar Optionally normalize the covariance matrix by the number of atoms
    00076     \param ignoreHs       If true, ignore hydrogen atoms
    00077
    00078   */
    00079   void canonicalizeConformer(RDKit::Conformer &conf, const RDGeom::Point3D *center=0,
    00080                              bool normalizeCovar=false, bool ignoreHs=true);
    00081
    00082   //! Canonicalize all the conformations in a molecule
    00083   /*!
    00084     \param mol            the molecule of interest
    00085     \param normalizeCovar Optionally normalize the covariance matrix by the number of atoms
    00086     \param ignoreHs       If true, ignore hydrogens
    00087   */
    00088   void canonicalizeMol(RDKit::ROMol &mol, bool normalizeCovar=false, bool ignoreHs=true);
    00089
    00090 }
    00091 #endif