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 #include <RDGeneral/export.h>
11 #ifndef __CHEMICALFEATUREFACTORY_H_02122004_1545__
12 #define __CHEMICALFEATUREFACTORY_H_02122004_1545__
13 
14 #include "MolChemicalFeatureDef.h"
15 #include <iostream>
16 #include <boost/shared_ptr.hpp>
17 
18 namespace RDKit {
20 typedef boost::shared_ptr<MolChemicalFeature> FeatSPtr;
21 typedef std::list<FeatSPtr> FeatSPtrList;
22 typedef FeatSPtrList::iterator FeatSPtrList_I;
23 
24 //! The class for finding chemical features in molecules
26  public:
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 beginFeatureDefs() {
32  return d_featDefs.begin();
33  };
34  //! returns an iterator referring to the end of the feature definitions
35  MolChemicalFeatureDef::CollectionType::iterator endFeatureDefs() {
36  return d_featDefs.end();
37  };
38 
39  //! returns a const_iterator referring to the first feature definition
40  MolChemicalFeatureDef::CollectionType::const_iterator beginFeatureDefs()
41  const {
42  return d_featDefs.begin();
43  };
44  //! returns a const_iterator referring to the end of the feature definitions
45  MolChemicalFeatureDef::CollectionType::const_iterator endFeatureDefs() const {
46  return d_featDefs.end();
47  };
48 
49  //! appends a feature definition to the collection of features defs.
51  MolChemicalFeatureDef::CollectionType::value_type featDef) {
52  d_featDefs.push_back(featDef);
53  }
54 
55  //! returns a list of features on the molecule
56  /*!
57  \param mol The molecule of interest
58  \param includeOnly (optional) if this is non-null, only features in this
59  family will be returned
60  \param confId (optional) the conformer id to use
61  */
62  FeatSPtrList getFeaturesForMol(const ROMol &mol, const char *includeOnly = "",
63  int confId = -1) const;
64 
65  private:
67 };
68 
69 //! constructs a MolChemicalFeatureFactory from the data in a stream
70 RDKIT_MOLCHEMICALFEATURES_EXPORT MolChemicalFeatureFactory *buildFeatureFactory(
71  std::istream &inStream);
72 //! constructs a MolChemicalFeatureFactory from the data in a string
73 RDKIT_MOLCHEMICALFEATURES_EXPORT MolChemicalFeatureFactory *buildFeatureFactory(
74  const std::string &featureData);
75 
76 } // end of namespace RDKit
77 
78 #endif
RDKit::MolChemicalFeatureFactory::beginFeatureDefs
MolChemicalFeatureDef::CollectionType::const_iterator beginFeatureDefs() const
returns a const_iterator referring to the first feature definition
Definition: MolChemicalFeatureFactory.h:40
RDKit::FeatSPtr
boost::shared_ptr< MolChemicalFeature > FeatSPtr
Definition: MolChemicalFeatureFactory.h:19
RDKit::buildFeatureFactory
RDKIT_MOLCHEMICALFEATURES_EXPORT MolChemicalFeatureFactory * buildFeatureFactory(std::istream &inStream)
constructs a MolChemicalFeatureFactory from the data in a stream
RDKit::MolChemicalFeatureDef::CollectionType
std::list< boost::shared_ptr< MolChemicalFeatureDef > > CollectionType
Definition: MolChemicalFeatureDef.h:27
RDKit::MolChemicalFeatureFactory
The class for finding chemical features in molecules.
Definition: MolChemicalFeatureFactory.h:25
RDKit::ROMol
Definition: ROMol.h:171
RDKit::FeatSPtrList
std::list< FeatSPtr > FeatSPtrList
Definition: MolChemicalFeatureFactory.h:21
RDKit::MolChemicalFeatureFactory::getNumFeatureDefs
int getNumFeatureDefs() const
returns the number of feature definitions
Definition: MolChemicalFeatureFactory.h:28
RDKit::MolChemicalFeatureFactory::endFeatureDefs
MolChemicalFeatureDef::CollectionType::const_iterator endFeatureDefs() const
returns a const_iterator referring to the end of the feature definitions
Definition: MolChemicalFeatureFactory.h:45
RDKit::MolChemicalFeatureFactory::endFeatureDefs
MolChemicalFeatureDef::CollectionType::iterator endFeatureDefs()
returns an iterator referring to the end of the feature definitions
Definition: MolChemicalFeatureFactory.h:35
RDKit::FeatSPtrList_I
FeatSPtrList::iterator FeatSPtrList_I
Definition: MolChemicalFeatureFactory.h:22
RDKit::MolChemicalFeatureFactory::beginFeatureDefs
MolChemicalFeatureDef::CollectionType::iterator beginFeatureDefs()
returns an iterator referring to the first feature definition
Definition: MolChemicalFeatureFactory.h:31
RDKit
Std stuff.
Definition: Atom.h:30
RDKit::MolChemicalFeature
Definition: MolChemicalFeature.h:26
RDKIT_MOLCHEMICALFEATURES_EXPORT
#define RDKIT_MOLCHEMICALFEATURES_EXPORT
Definition: export.h:385
MolChemicalFeatureDef.h
RDKit::MolChemicalFeatureFactory::addFeatureDef
void addFeatureDef(MolChemicalFeatureDef::CollectionType::value_type featDef)
appends a feature definition to the collection of features defs.
Definition: MolChemicalFeatureFactory.h:50
export.h