RDKit: MolChemicalFeatureFactory.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

MolChemicalFeatureFactory.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 Rational Discovery LLC
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 #ifndef __CHEMICALFEATUREFACTORY_H_02122004_1545__
11 #define __CHEMICALFEATUREFACTORY_H_02122004_1545__
12
13 #include "MolChemicalFeatureDef.h"
14 #include <iostream>
15 #include <boost/shared_ptr.hpp>
16
17 namespace RDKit {
18 class MolChemicalFeature;
19 typedef boost::shared_ptr<MolChemicalFeature> FeatSPtr;
20 typedef std::list<FeatSPtr> FeatSPtrList;
21 typedef FeatSPtrList::iterator FeatSPtrList_I;
22
23 //! The class for finding chemical features in molecules
24 class MolChemicalFeatureFactory {
25 public:
26 //! returns the number of feature definitions
27 int getNumFeatureDefs() const { return d_featDefs.size(); };
28
29 //! returns an iterator referring to the first feature definition
30 MolChemicalFeatureDef::CollectionType::iterator beginFeatureDefs() {
31 return d_featDefs.begin();
32 };
33 //! returns an iterator referring to the end of the feature definitions
34 MolChemicalFeatureDef::CollectionType::iterator endFeatureDefs() {
35 return d_featDefs.end();
36 };
37
38 //! returns a const_iterator referring to the first feature definition
39 MolChemicalFeatureDef::CollectionType::const_iterator beginFeatureDefs()
40 const {
41 return d_featDefs.begin();
42 };
43 //! returns a const_iterator referring to the end of the feature definitions
44 MolChemicalFeatureDef::CollectionType::const_iterator endFeatureDefs() const {
45 return d_featDefs.end();
46 };
47
48 //! appends a feature definition to the collection of features defs.
49 void addFeatureDef(
50 MolChemicalFeatureDef::CollectionType::value_type featDef) {
51 d_featDefs.push_back(featDef);
52 }
53
54 //! returns a list of features on the molecule
55 /*!
56 \param mol The molecule of interest
57 \param includeOnly (optional) if this is non-null, only features in this
58 family will be returned
59 */
60 FeatSPtrList getFeaturesForMol(const ROMol &mol,
61 const char *includeOnly = "") const;
62
63 private:
64 MolChemicalFeatureDef::CollectionType d_featDefs;
65 };
66
67 //! constructs a MolChemicalFeatureFactory from the data in a stream
68 MolChemicalFeatureFactory *buildFeatureFactory(std::istream &inStream);
69 //! constructs a MolChemicalFeatureFactory from the data in a string
70 MolChemicalFeatureFactory *buildFeatureFactory(const std::string &featureData);
71
72 } // end of namespace RDKit
73
74 #endif
RDKit::MolChemicalFeatureFactory::getFeaturesForMol
FeatSPtrList getFeaturesForMol(const ROMol &mol, const char *includeOnly="") const
returns a list of features on the molecule
RDKit::MolChemicalFeatureFactory::beginFeatureDefs
MolChemicalFeatureDef::CollectionType::iterator beginFeatureDefs()
returns an iterator referring to the first feature definition
Definition: MolChemicalFeatureFactory.h:30
RDKit::MolChemicalFeatureFactory
The class for finding chemical features in molecules.
Definition: MolChemicalFeatureFactory.h:24
RDKit::MolChemicalFeatureFactory::endFeatureDefs
MolChemicalFeatureDef::CollectionType::iterator endFeatureDefs()
returns an iterator referring to the end of the feature definitions
Definition: MolChemicalFeatureFactory.h:34
RDKit::FeatSPtrList_I
FeatSPtrList::iterator FeatSPtrList_I
Definition: MolChemicalFeatureFactory.h:21
RDKit::ROMol
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:103
MolChemicalFeatureDef.h
RDKit::MolChemicalFeatureFactory::beginFeatureDefs
MolChemicalFeatureDef::CollectionType::const_iterator beginFeatureDefs() const
returns a const_iterator referring to the first feature definition
Definition: MolChemicalFeatureFactory.h:39
RDKit::MolChemicalFeatureFactory::addFeatureDef
void addFeatureDef(MolChemicalFeatureDef::CollectionType::value_type featDef)
appends a feature definition to the collection of features defs.
Definition: MolChemicalFeatureFactory.h:49
RDKit::MolChemicalFeatureDef::CollectionType
std::list< boost::shared_ptr< MolChemicalFeatureDef > > CollectionType
Definition: MolChemicalFeatureDef.h:26
RDKit
Std stuff.
Definition: Atom.h:29
RDKit::buildFeatureFactory
MolChemicalFeatureFactory * buildFeatureFactory(std::istream &inStream)
constructs a MolChemicalFeatureFactory from the data in a stream
RDKit::MolChemicalFeature
Definition: MolChemicalFeature.h:25
RDKit::MolChemicalFeatureFactory::getNumFeatureDefs
int getNumFeatureDefs() const
returns the number of feature definitions
Definition: MolChemicalFeatureFactory.h:27
RDKit::MolChemicalFeatureFactory::endFeatureDefs
MolChemicalFeatureDef::CollectionType::const_iterator endFeatureDefs() const
returns a const_iterator referring to the end of the feature definitions
Definition: MolChemicalFeatureFactory.h:44
RDKit::FeatSPtrList
std::list< FeatSPtr > FeatSPtrList
Definition: MolChemicalFeatureFactory.h:20
RDKit::FeatSPtr
boost::shared_ptr< MolChemicalFeature > FeatSPtr
Definition: MolChemicalFeatureFactory.h:18