RDCode: AtomPairs.h Source File

- Main Page
- Namespaces
- Classes
- Files
- Directories

# AtomPairs.h

Go to the documentation of this file.

    00001 //
    00002 //  Copyright (C) 2007 Greg Landrum
    00003 //
    00004 //   @@ All Rights Reserved  @@
    00005 //
    00006
    00007 /*! \file AtomPairs.h
    00008
    00009   \brief Use MolDescriptors.h in client code.
    00010
    00011 */
    00012 #ifndef __RD_ATOMPAIRS_H__
    00013 #define __RD_ATOMPAIRS_H__
    00014
    00015 #include <DataStructs/SparseIntVect.h>
    00016 namespace RDKit {
    00017   class Atom;
    00018
    00019   namespace Descriptors {
    00020     namespace AtomPairs {
    00021       const std::string atomPairsVersion="1.0.0";
    00022       const unsigned int numTypeBits=4;
    00023       const unsigned int atomNumberTypes[1<<numTypeBits]={5,6,7,8,9,14,15,16,17,33,34,35,51,52,43};
    00024       const unsigned int numPiBits=2;
    00025       const unsigned int maxNumPi=(1<<numPiBits)-1;
    00026       const unsigned int numBranchBits=3;
    00027       const unsigned int maxNumBranches=(1<<numBranchBits)-1;
    00028       const unsigned int codeSize=numTypeBits+numPiBits+numBranchBits;
    00029       const unsigned int numPathBits=5;
    00030       const unsigned int maxPathLen=(1<<numPathBits)-1;
    00031       const unsigned int numAtomPairFingerprintBits=numPathBits+2*codeSize;
    00032
    00033       //! returns a numeric code for the atom (the atom's hash in the
    00034       //! atom-pair scheme)
    00035       /*!
    00036         \param atom            the atom to be considered
    00037         \param branchSubtract  (optional) a constant to subtract from
    00038                                the number of neighbors when the hash
    00039                                is calculated (used in the topological
    00040                                torsions code)
    00041       */
    00042       unsigned int getAtomCode(const Atom *atom,unsigned int branchSubtract=0);
    00043
    00044       //! returns an atom pair hash based on two atom hashes and the
    00045       //! distance between the atoms.
    00046       /*!
    00047         \param codeI  the hash for the first atom
    00048         \param codeJ  the hash for the second atom
    00049         \param dist   the distance (number of bonds) between the two
    00050                       atoms
    00051        */
    00052       unsigned int getAtomPairCode(unsigned int codeI,unsigned int codeJ,
    00053                                    unsigned int dist);
    00054
    00055       //! returns the atom-pair fingerprint for a molecule
    00056       /*!
    00057         The algorithm used is described here:
    00058         R.E. Carhart, D.H. Smith, R. Venkataraghavan; "Atom Pairs as
    00059           Molecular Features in Structure-Activity Studies: Definition
    00060           and Applications" JCICS 25, 64-73 (1985).
    00061
    00062
    00063         \param mol:   the molecule to be fingerprinted
    00064         \return a pointer to the fingerprint. The client is
    00065                 responsible for calling delete on this.
    00066
    00067        */
    00068       SparseIntVect<int> *getAtomPairFingerprint(const ROMol &mol);
    00069
    00070       //! returns an topological torsion hash based on the atom hashes
    00071       //! passed in
    00072       /*!
    00073         \param atomCodes  the vector of atom hashes
    00074        */
    00075       unsigned long long int getTopologicalTorsionCode(const std::vector<unsigned int> &atomCodes);
    00076
    00077       //! returns the topological-torsion fingerprint for a molecule
    00078       /*!
    00079         The algorithm used is described here:
    00080         R. Nilakantan, N. Bauman, J. S. Dixon, R. Venkataraghavan;
    00081         "Topological Torsion: A New Molecular Descriptor for SAR Applications.
    00082         Comparison with Other Descriptors" JCICS 27, 82-85 (1987).
    00083
    00084         \param mol:         the molecule to be fingerprinted
    00085         \param targetSize:  the number of atoms to include in the torsions
    00086
    00087         \return a pointer to the fingerprint. The client is
    00088                 responsible for calling delete on this.
    00089
    00090        */
    00091       SparseIntVect<long long int> *getTopologicalTorsionFingerprint(const ROMol &mol,
    00092                                                                      unsigned int targetSize=4);
    00093     }
    00094   } // end of namespace Descriptors
    00095 }
    00096
    00097 #endif