RDKit
Open-source cheminformatics and machine learning.
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 {
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
25  public:
26 
27  //! returns the number of feature definitions
28  int getNumFeatureDefs() const {return d_featDefs.size();};
29 
30  //! returns an iterator referring to the first feature definition
31  MolChemicalFeatureDef::CollectionType::iterator
32  beginFeatureDefs() { return d_featDefs.begin(); };
33  //! returns an iterator referring to the end of the feature definitions
34  MolChemicalFeatureDef::CollectionType::iterator
35  endFeatureDefs() { return d_featDefs.end(); };
36 
37  //! returns a const_iterator referring to the first feature definition
38  MolChemicalFeatureDef::CollectionType::const_iterator
39  beginFeatureDefs() const { return d_featDefs.begin(); };
40  //! returns a const_iterator referring to the end of the feature definitions
41  MolChemicalFeatureDef::CollectionType::const_iterator
42  endFeatureDefs() const { return d_featDefs.end(); };
43 
44  //! appends a feature definition to the collection of features defs.
45  void addFeatureDef(MolChemicalFeatureDef::CollectionType::value_type featDef){
46  d_featDefs.push_back(featDef);
47  }
48 
49  //! returns a list of features on the molecule
50  /*!
51  \param mol The molecule of interest
52  \param includeOnly (optional) if this is non-null, only features in this
53  family will be returned
54  */
55  FeatSPtrList getFeaturesForMol(const ROMol &mol,const char *includeOnly="") const;
56 
57  private:
59  };
60 
61  //! constructs a MolChemicalFeatureFactory from the data in a stream
62  MolChemicalFeatureFactory *buildFeatureFactory(std::istream &inStream);
63  //! constructs a MolChemicalFeatureFactory from the data in a string
64  MolChemicalFeatureFactory *buildFeatureFactory(const std::string &featureData);
65 
66 }// end of namespace RDKit
67 
68 #endif
FeatSPtrList getFeaturesForMol(const ROMol &mol, const char *includeOnly="") const
returns a list of features on the molecule
MolChemicalFeatureDef::CollectionType::iterator beginFeatureDefs()
returns an iterator referring to the first feature definition
The class for finding chemical features in molecules.
MolChemicalFeatureDef::CollectionType::iterator endFeatureDefs()
returns an iterator referring to the end of the feature definitions
FeatSPtrList::iterator FeatSPtrList_I
std::list< boost::shared_ptr< MolChemicalFeatureDef > > CollectionType
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:105
MolChemicalFeatureDef::CollectionType::const_iterator beginFeatureDefs() const
returns a const_iterator referring to the first feature definition
void addFeatureDef(MolChemicalFeatureDef::CollectionType::value_type featDef)
appends a feature definition to the collection of features defs.
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
MolChemicalFeatureFactory * buildFeatureFactory(std::istream &inStream)
constructs a MolChemicalFeatureFactory from the data in a stream
std::list< FeatSPtr > FeatSPtrList
int getNumFeatureDefs() const
returns the number of feature definitions
MolChemicalFeatureDef::CollectionType::const_iterator endFeatureDefs() const
returns a const_iterator referring to the end of the feature definitions
boost::shared_ptr< MolChemicalFeature > FeatSPtr