RDCode: FragCatParams.h Source File

# FragCatParams.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_FRAG_CAT_PARAMS_H_
    00007 #define _RD_FRAG_CAT_PARAMS_H_
    00008
    00009 #include <Catalogs/CatalogParams.h>
    00010 #include <string>
    00011 #include <vector>
    00012 #include <boost/shared_ptr.hpp>
    00013
    00014
    00015 namespace RDKit {
    00016   class ROMol;
    00017   typedef std::vector< boost::shared_ptr<ROMol> > MOL_SPTR_VECT;
    00018
    00019   //! container for user parameters used to create a fragment catalog
    00020   class FragCatParams : public RDCatalog::CatalogParams {
    00021     // FIX: this container is still missing all the CASE-type functional groups stuff
    00022   public:
    00023     FragCatParams() {
    00024       d_typeStr = "Fragment Catalog Parameters";
    00025       d_lowerFragLen = 0;
    00026       d_upperFragLen = 0;
    00027       d_tolerance = 1e-8;
    00028       d_funcGroups.clear();
    00029     }
    00030     //! construct from a function-group file
    00031     /*!
    00032       \param lLen       the lower limit on fragment size
    00033       \param uLen       the upper limit on fragment size
    00034       \param fgroupFile the name of the function-group file
    00035       \param tol        (optional) the eigenvalue tolerance to be used
    00036                         when comparing fragments
    00037     */
    00038     FragCatParams(unsigned int lLen, unsigned int uLen, std::string fgroupFile, double tol=1e-08);
    00039     //! copy constructor
    00040     FragCatParams(const FragCatParams &other);
    00041     //! construct from a pickle string (serialized representation)
    00042     FragCatParams(const std::string &pickle);
    00043
    00044     ~FragCatParams();
    00045
    00046     //! returns our lower fragment length
    00047     unsigned int getLowerFragLength() const { return d_lowerFragLen;}
    00048     //! sets our lower fragment length
    00049     void setLowerFragLength(unsigned int lFrLen) {d_lowerFragLen = lFrLen;}
    00050
    00051     //! returns our upper fragment length
    00052     unsigned int getUpperFragLength() const { return d_upperFragLen;}
    00053     //! sets our upper fragment length
    00054     void setUpperFragLength(unsigned int uFrLen) { d_upperFragLen = uFrLen;}
    00055
    00056     //! returns our fragment-comparison tolerance
    00057     double getTolerance() const {return d_tolerance;}
    00058     //! sets our fragment-comparison tolerance
    00059     void setTolerance(double val) { d_tolerance = val;}
    00060
    00061     //! returns our number of functional groups
    00062     unsigned int getNumFuncGroups() const {return d_funcGroups.size();}
    00063
    00064     //! returns our std::vector of functional groups
    00065     const MOL_SPTR_VECT &getFuncGroups() const;
    00066
    00067     //! returns a pointer to a specific functional group
    00068     const ROMol *getFuncGroup(unsigned int fid) const;
    00069
    00070     void toStream(std::ostream &) const;
    00071     std::string Serialize() const;
    00072     void initFromStream(std::istream &ss);
    00073     void initFromString(const std::string &text);
    00074   private:
    00075     unsigned int d_lowerFragLen;
    00076     unsigned int d_upperFragLen;
    00077
    00078     double d_tolerance; //!< tolerance value used when comparing subgraph discriminators
    00079
    00080     MOL_SPTR_VECT d_funcGroups;
    00081   };
    00082 }
    00083
    00084 #endif