Loading...
Searching...
No Matches
FragCatParams.h
Go to the documentation of this file.
//
// Copyright (C) 2003-2006 Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#include <RDGeneral/export.h>
#ifndef _RD_FRAG_CAT_PARAMS_H_
#define _RD_FRAG_CAT_PARAMS_H_
#include <Catalogs/CatalogParams.h>
#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>
namespace RDKit {
class ROMol;
typedef std::vector<boost::shared_ptr<ROMol>> MOL_SPTR_VECT;
//! container for user parameters used to create a fragment catalog
class RDKIT_FRAGCATALOG_EXPORT FragCatParams : public RDCatalog::CatalogParams {
// FIX: this container is still missing all the CASE-type functional groups
// stuff
public:
FragCatParams() {
d_typeStr = "Fragment Catalog Parameters";
d_lowerFragLen = 0;
d_upperFragLen = 0;
d_tolerance = 1e-8;
d_funcGroups.clear();
}
//! construct from a function-group file
/*!
\param lLen the lower limit on fragment size
\param uLen the upper limit on fragment size
\param fgroupFile the name of the function-group file
\param tol (optional) the eigenvalue tolerance to be used
when comparing fragments
*/
FragCatParams(unsigned int lLen, unsigned int uLen,
const std::string &fgroupFile, double tol = 1e-08);
//! copy constructor
FragCatParams(const FragCatParams &other);
//! construct from a pickle string (serialized representation)
FragCatParams(const std::string &pickle);
~FragCatParams() override;
//! returns our lower fragment length
unsigned int getLowerFragLength() const { return d_lowerFragLen; }
//! sets our lower fragment length
void setLowerFragLength(unsigned int lFrLen) { d_lowerFragLen = lFrLen; }
//! returns our upper fragment length
unsigned int getUpperFragLength() const { return d_upperFragLen; }
//! sets our upper fragment length
void setUpperFragLength(unsigned int uFrLen) { d_upperFragLen = uFrLen; }
//! returns our fragment-comparison tolerance
double getTolerance() const { return d_tolerance; }
//! sets our fragment-comparison tolerance
void setTolerance(double val) { d_tolerance = val; }
//! returns our number of functional groups
unsigned int getNumFuncGroups() const {
return static_cast<unsigned int>(d_funcGroups.size());
}
//! returns our std::vector of functional groups
const MOL_SPTR_VECT &getFuncGroups() const;
//! returns a pointer to a specific functional group
const ROMol *getFuncGroup(unsigned int fid) const;
void toStream(std::ostream &) const override;
std::string Serialize() const override;
void initFromStream(std::istream &ss) override;
void initFromString(const std::string &text) override;
private:
unsigned int d_lowerFragLen;
unsigned int d_upperFragLen;
double d_tolerance; //!< tolerance value used when comparing subgraph
// discriminators
MOL_SPTR_VECT d_funcGroups;
};
} // namespace RDKit
#endif
CatalogParams.h
RDCatalog::CatalogParams
abstract base class for the container used to create a catalog
Definition CatalogParams.h:18
RDKit::FragCatParams
container for user parameters used to create a fragment catalog
Definition FragCatParams.h:24
RDKit::FragCatParams::FragCatParams
FragCatParams(const FragCatParams &other)
copy constructor
RDKit::FragCatParams::setLowerFragLength
void setLowerFragLength(unsigned int lFrLen)
sets our lower fragment length
Definition FragCatParams.h:55
RDKit::FragCatParams::initFromStream
void initFromStream(std::istream &ss) override
initializes from a stream pickle
RDKit::FragCatParams::getUpperFragLength
unsigned int getUpperFragLength() const
returns our upper fragment length
Definition FragCatParams.h:58
RDKit::FragCatParams::FragCatParams
FragCatParams()
Definition FragCatParams.h:28
RDKit::FragCatParams::initFromString
void initFromString(const std::string &text) override
initializes from a string pickle
RDKit::FragCatParams::getFuncGroup
const ROMol * getFuncGroup(unsigned int fid) const
returns a pointer to a specific functional group
RDKit::FragCatParams::setUpperFragLength
void setUpperFragLength(unsigned int uFrLen)
sets our upper fragment length
Definition FragCatParams.h:60
RDKit::FragCatParams::getTolerance
double getTolerance() const
returns our fragment-comparison tolerance
Definition FragCatParams.h:63
RDKit::FragCatParams::toStream
void toStream(std::ostream &) const override
serializes (pickles) to a stream
RDKit::FragCatParams::FragCatParams
FragCatParams(unsigned int lLen, unsigned int uLen, const std::string &fgroupFile, double tol=1e-08)
construct from a function-group file
RDKit::FragCatParams::getNumFuncGroups
unsigned int getNumFuncGroups() const
returns our number of functional groups
Definition FragCatParams.h:68
RDKit::FragCatParams::FragCatParams
FragCatParams(const std::string &pickle)
construct from a pickle string (serialized representation)
RDKit::FragCatParams::getFuncGroups
const MOL_SPTR_VECT & getFuncGroups() const
returns our std::vector of functional groups
RDKit::FragCatParams::Serialize
std::string Serialize() const override
returns a string with a serialized (pickled) representation
RDKit::FragCatParams::getLowerFragLength
unsigned int getLowerFragLength() const
returns our lower fragment length
Definition FragCatParams.h:53
RDKit::FragCatParams::setTolerance
void setTolerance(double val)
sets our fragment-comparison tolerance
Definition FragCatParams.h:65
RDKit::FragCatParams::~FragCatParams
~FragCatParams() override
RDKit::ROMol
Definition ROMol.h:199
export.h
RDKIT_FRAGCATALOG_EXPORT
#define RDKIT_FRAGCATALOG_EXPORT
Definition export.h:201
RDKit
Std stuff.
Definition Abbreviations.h:19
RDKit::MOL_SPTR_VECT
std::vector< boost::shared_ptr< ROMol > > MOL_SPTR_VECT
Definition FragCatParams.h:21