RDCode: MorganFingerprints.h Source File

# MorganFingerprints.h

Go to the documentation of this file.

    00001 //
    00002 //
    00003 //  Copyright (c) 2009, Novartis Institutes for BioMedical Research Inc.
    00004 //  All rights reserved.
    00005 //
    00006 // Redistribution and use in source and binary forms, with or without
    00007 // modification, are permitted provided that the following conditions are
    00008 // met:
    00009 //
    00010 //     * Redistributions of source code must retain the above copyright
    00011 //       notice, this list of conditions and the following disclaimer.
    00012 //     * Redistributions in binary form must reproduce the above
    00013 //       copyright notice, this list of conditions and the following
    00014 //       disclaimer in the documentation and/or other materials provided
    00015 //       with the distribution.
    00016 //     * Neither the name of Novartis Institutes for BioMedical Research Inc.
    00017 //       nor the names of its contributors may be used to endorse or promote
    00018 //       products derived from this software without specific prior written permission.
    00019 //
    00020 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    00021 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    00022 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    00023 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    00024 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    00025 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    00026 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    00027 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    00028 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    00029 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    00030 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    00031 //
    00032 //  Created by Greg Landrum, July 2008
    00033 //
    00034 //
    00035
    00036 /*! \file MorganFingerprints.h
    00037
    00038 */
    00039 #ifndef __RD_MORGANFPS_H__
    00040 #define __RD_MORGANFPS_H__
    00041
    00042 #include <vector>
    00043 #include <DataStructs/SparseIntVect.h>
    00044 #include <boost/cstdint.hpp>
    00045
    00046 namespace RDKit {
    00047   class ROMol;
    00048   namespace MorganFingerprints {
    00049     const std::string morganFingerprintVersion="0.1.0";
    00050
    00051     //! returns the Morgan fingerprint for a molecule
    00052     /*!
    00053       These fingerprints are similar to the well-known ECFP or
    00054       FCFP fingerprints, depending on which invariants are used.
    00055
    00056       The algorithm used is described in the paper
    00057       D. Rogers, R.D. Brown, M. Hahn J. Biomol. Screen. 10:682-6 (2005)
    00058       and in more detail in an unpublished technical report:
    00059       http://www.ics.uci.edu/~welling/teaching/ICS274Bspring06/David%20Rogers%20-%20ECFP%20Manuscript.doc
    00060
    00061       \param mol:    the molecule to be fingerprinted
    00062       \param radius: the number of iterations to grow the fingerprint
    00063       \param invariants : optional pointer to a set of atom invariants to
    00064             be used. By default ECFP-type invariants are used
    00065             (calculated by getConnectivityInvariants())
    00066       \param fromAtoms : if this is provided, only the atoms in the vector will be
    00067                          used as centers in the fingerprint
    00068
    00069       \return a pointer to the fingerprint. The client is
    00070       responsible for calling delete on this.
    00071
    00072     */
    00073     SparseIntVect<boost::uint32_t> *
    00074       getFingerprint(const ROMol &mol,
    00075                      unsigned int radius,
    00076                      std::vector<boost::uint32_t> *invariants=0,
    00077                      const std::vector<boost::uint32_t> *fromAtoms=0);
    00078
    00079
    00080     //! returns the connectivity invariants for a molecule
    00081     /*!
    00082
    00083       \param mol:    the molecule to be considered
    00084       \param invariants : used to return the results
    00085       \param includeRingMembership : if set, whether or not the atom is in
    00086                  a ring will be used in the invariant list.
    00087     */
    00088     void getConnectivityInvariants(const ROMol &mol,
    00089                                    std::vector<boost::uint32_t> &invars,
    00090                                    bool includeRingMembership=false);
    00091
    00092   } // end of namespace MorganFingerprints
    00093 }
    00094
    00095 #endif