RDCode: RDDepictor.h Source File

- Main Page
- Namespaces
- Classes
- Files
- Directories

# 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 This the function the user gets to compute coodinates
    00022   /*!
    00023     \param mol          the molecule were are interested in
    00024     \param coordMap     a map of int to Point2D, between atom IDs and their locations.
    00025       This is the container the user need to fill if he/she wants to
    00026       specify coordinates for a portion of the molecule, defualts to 0
    00027     \param canonOrient  canonicalize the orientation so that the the long axes
    00028       align with the x-axis etc.
    00029     \param clearConfs   clear all existing conformations on the molecule them adding the
    00030       2D coordinates or simple add to the list
    00031
    00032
    00033     \return ID of the conformation added to the molecule cotaining the 2D coordinates
    00034   */
    00035   unsigned int compute2DCoords(RDKit::ROMol &mol, const RDGeom::INT_POINT2D_MAP *coordMap=0,
    00036                                bool canonOrient=false, bool clearConfs=true,
    00037                                unsigned int nFlipsPerSample=0, unsigned int nSamples=0,
    00038                                int sampleSeed=0, bool permuteDeg4Nodes=false);
    00039
    00040   //! \brief Compute the 2D coordinates such the interatom distances mimic those in ditance matrix
    00041   /*!
    00042     This function generates 2D coordinates such that the inter atom distance mimic those specified via
    00043     dmat. This is done by randomly sampling(flipping) the rotatable bonds in the molecule and evaluating
    00044     a cost function which contains two components. The first component is the sum of inverse of the squared
    00045     inter-atom distances, this helps in spreading the atoms far from each other. The second component is
    00046     the sum of squares of the difference in distance between those in dmat and the generated structure.
    00047     The user can adjust the relative importance of the two components via a adjustable paramter (see below)
    00048
    00049     ARGUMENTS:
    00050     \param mol - molecule involved in the frgament
    00051     \param dmat - the distance matrix we want to mimic, this is symmteric N by N matrix when N is the number
    00052                   of atoms in mol. All ngative entries in dmat are ignored.
    00053     \param canonOrient - canonicalze the orientation after the 2D embedding is done
    00054     \param clearConfs - clear any previously existing conformations on mol before adding a conformation
    00055     \param weightDistMat - A value between 0.0 and 1.0, this determines the importance of mimicing the
    00056                            the inter atoms distances in dmat. (1.0 - weightDistMat) is the weight associated
    00057                            to spreading out the structure (density) in the cost function
    00058     \param nFlipsPerSample - the number of rotatable bonds that are flips at random for each sample
    00059     \param nSample - the number of samples
    00060     \param sampleSeed - seed for the random sampling process
    00061   */
    00062   unsigned int compute2DCoordsMimicDistMat(RDKit::ROMol &mol, const DOUBLE_SMART_PTR *dmat=0,
    00063                                            bool canonOrient=true, bool clearConfs=true, double weightDistMat=0.5,
    00064                                            unsigned int nFlipsPerSample=3, unsigned int nSamples=100,
    00065                                            int sampleSeed=25, bool permuteDeg4Nodes=true);
    00066   namespace DepictorLocal {
    00067     void embedFusedSystems(const RDKit::ROMol &mol, const RDKit::VECT_INT_VECT &arings,
    00068                            std::list<EmbeddedFrag> &efrags);
    00069     void embedCisTransSystems(const RDKit::ROMol &mol,
    00070                               std::list<EmbeddedFrag> &efrags);
    00071     RDKit::INT_LIST getNonEmbeddedAtoms(const RDKit::ROMol &mol, const std::list<EmbeddedFrag> &efrags);
    00072   };
    00073 };
    00074
    00075 #endif