RDCode: RDDepictor.h Source File

# RDDepictor.h

Go to the documentation of this file.

    00001 //
    00002 //  Copyright (C) 2003-2008 Greg Landrum and Rational Discovery LLC
    00003 //
    00004 //   @@ All Rights Reserved  @@
    00005 //
    00006
    00007 #ifndef _RDDEPICTOR_H_
    00008 #define _RDDEPICTOR_H_
    00009
    00010 #include <RDGeneral/types.h>
    00011 #include <list>
    00012 #include <GraphMol/ROMol.h>
    00013 #include "EmbeddedFrag.h"
    00014
    00015 namespace RDKit {
    00016   class ROMol;
    00017 }
    00018
    00019 namespace RDDepict {
    00020
    00021   //! \brief Generate 2D coordinates (a depiction) for a molecule
    00022   /*!
    00023
    00024     \param mol the molecule were are interested in
    00025
    00026     \param coordMap a map of int to Point2D, between atom IDs and
    00027     their locations.  This is the container the user needs to fill if
    00028     he/she wants to specify coordinates for a portion of the molecule,
    00029     defaults to 0
    00030
    00031     \param canonOrient canonicalize the orientation so that the long
    00032     axes align with the x-axis etc.
    00033
    00034     \param clearConfs clear all existing conformations on the molecule
    00035     before adding the 2D coordinates instead of simply adding to the
    00036     list
    00037
    00038     \return ID of the conformation added to the molecule cotaining the
    00039     2D coordinates
    00040
    00041   */
    00042   unsigned int compute2DCoords(RDKit::ROMol &mol,
    00043                                const RDGeom::INT_POINT2D_MAP *coordMap=0,
    00044                                bool canonOrient=false,
    00045                                bool clearConfs=true,
    00046                                unsigned int nFlipsPerSample=0,
    00047                                unsigned int nSamples=0,
    00048                                int sampleSeed=0,
    00049                                bool permuteDeg4Nodes=false);
    00050
    00051   //! \brief Compute the 2D coordinates such the interatom distances
    00052   //   mimic those in a distance matrix
    00053   /*!
    00054
    00055     This function generates 2D coordinates such that the inter-atom
    00056     distances mimic those specified via dmat. This is done by randomly
    00057     sampling(flipping) the rotatable bonds in the molecule and
    00058     evaluating a cost function which contains two components. The
    00059     first component is the sum of inverse of the squared inter-atom
    00060     distances, this helps in spreading the atoms far from each
    00061     other. The second component is the sum of squares of the
    00062     difference in distance between those in dmat and the generated
    00063     structure.  The user can adjust the relative importance of the two
    00064     components via a adjustable paramter (see below)
    00065
    00066     ARGUMENTS:
    00067
    00068     \param mol - molecule to generate coordinates for
    00069
    00070     \param dmat - the distance matrix we want to mimic, this is a
    00071     symmetric N by N matrix where N is the number of atoms in mol. All
    00072     negative entries in dmat are ignored.
    00073
    00074     \param canonOrient - canonicalize the orientation after the 2D
    00075     embedding is done
    00076
    00077     \param clearConfs - clear any previously existing conformations on
    00078     mol before adding a conformation
    00079
    00080     \param weightDistMat - A value between 0.0 and 1.0, this
    00081     determines the importance of mimicing the the inter atoms
    00082     distances in dmat. (1.0 - weightDistMat) is the weight associated
    00083     to spreading out the structure (density) in the cost function
    00084
    00085     \param nFlipsPerSample - the number of rotatable bonds that are
    00086     flipped at random for each sample
    00087
    00088     \param nSample - the number of samples
    00089
    00090     \param sampleSeed - seed for the random sampling process
    00091
    00092     \return ID of the conformation added to the molecule cotaining the
    00093     2D coordinates
    00094
    00095
    00096   */
    00097   unsigned int compute2DCoordsMimicDistMat(RDKit::ROMol &mol,
    00098                                            const DOUBLE_SMART_PTR *dmat=0,
    00099                                            bool canonOrient=true,
    00100                                            bool clearConfs=true,
    00101                                            double weightDistMat=0.5,
    00102                                            unsigned int nFlipsPerSample=3,
    00103                                            unsigned int nSamples=100,
    00104                                            int sampleSeed=25,
    00105                                            bool permuteDeg4Nodes=true);
    00106 };
    00107
    00108 #endif