RDKit: MolChemicalFeature.h Source File

| RDKit Open-source cheminformatics and machine learning.

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

MolChemicalFeature.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 __MOLCHEMICALFEATURE_H_11012005_1404__
11 #define __MOLCHEMICALFEATURE_H_11012005_1404__
12
13 #include <string>
14 #include <vector>
15 #include <map>
16 #include <Geometry/point.h>
17 #include <ChemicalFeatures/ChemicalFeature.h>
18
19 namespace RDKit {
20 class ROMol;
21 class Atom;
22 class MolChemicalFeatureFactory;
23 class MolChemicalFeatureDef;
24
25 class MolChemicalFeature : public ChemicalFeatures::ChemicalFeature {
26 friend class MolChemicalFeatureFactory;
27
28 public:
29 typedef std::vector<const Atom *> AtomPtrContainer;
30 typedef AtomPtrContainer::const_iterator AtomPtrContainer_CI;
31
32 //! Constructor
33 MolChemicalFeature(const ROMol *mol, const MolChemicalFeatureFactory *factory,
34 const MolChemicalFeatureDef *fdef, int id = -1)
35 : dp_mol(mol),
36 dp_factory(factory),
37 dp_def(fdef),
38 d_id(id),
39 d_activeConf(-1){};
40
41 ~MolChemicalFeature() {}
42
43 //! \brief return the name of the feature's family
44 const std::string &getFamily() const;
45 //! \brief return the name of the feature's type
46 const std::string &getType() const;
47 //! \brief return the position of the feature (obtained from
48 //! from the associated conformation
49 RDGeom::Point3D getPos() const;
50
51 //! \brief return the position of the feature (obtained from
52 //! from the requested conformation from the associated molecule)
53 RDGeom::Point3D getPos(int confId) const;
54 //! \brief return a pointer to our feature factory
55 const MolChemicalFeatureFactory *getFactory() const { return dp_factory; };
56 //! \brief return a pointer to our associated molecule
57 const ROMol *getMol() const { return dp_mol; };
58 //! \brief return a pointer to our feature definition
59 const MolChemicalFeatureDef *getFeatDef() const { return dp_def; };
60
61 //! \brief returns the active conformer (in the associated molecule)
62 int getId() const { return d_id; };
63
64 //! \brief returns the number of atoms defining the feature
65 inline unsigned int getNumAtoms() const { return d_atoms.size(); }
66
67 //! \brief sets the active conformer (in the associated molecule)
68 void setActiveConformer(int confId);
69
70 //! \brief returns the active conformer (in the associated molecule)
71 int getActiveConformer() const { return d_activeConf; };
72
73 //! \brief clears out the internal position cache
74 void clearCache() { d_locs.clear(); };
75
76 //! \brief returns our atom container of
77 const AtomPtrContainer &getAtoms() const { return d_atoms; }
78 AtomPtrContainer::const_iterator beginAtoms() const {
79 return d_atoms.begin();
80 };
81 AtomPtrContainer::const_iterator endAtoms() const { return d_atoms.end(); };
82
83 private:
84 typedef std::map<int, RDGeom::Point3D> PointCacheType;
85
86 const ROMol *dp_mol;
87 const MolChemicalFeatureFactory *dp_factory;
88 const MolChemicalFeatureDef *dp_def;
89 int d_id;
90 int d_activeConf;
91 AtomPtrContainer d_atoms;
92 mutable PointCacheType d_locs;
93 };
94 }
95
96 #endif
RDKit::MolChemicalFeature::getFamily
const std::string & getFamily() const
return the name of the feature's family
RDKit::MolChemicalFeature::getFactory
const MolChemicalFeatureFactory * getFactory() const
return a pointer to our feature factory
Definition: MolChemicalFeature.h:55
RDKit::MolChemicalFeature::getActiveConformer
int getActiveConformer() const
returns the active conformer (in the associated molecule)
Definition: MolChemicalFeature.h:71
RDKit::MolChemicalFeatureFactory
The class for finding chemical features in molecules.
Definition: MolChemicalFeatureFactory.h:24
RDKit::MolChemicalFeature::AtomPtrContainer
std::vector< const Atom * > AtomPtrContainer
Definition: MolChemicalFeature.h:29
point.h
RDKit::MolChemicalFeature::MolChemicalFeature
MolChemicalFeature(const ROMol *mol, const MolChemicalFeatureFactory *factory, const MolChemicalFeatureDef *fdef, int id=-1)
Constructor.
Definition: MolChemicalFeature.h:33
RDKit::MolChemicalFeature::getId
int getId() const
returns the active conformer (in the associated molecule)
Definition: MolChemicalFeature.h:62
RDKit::MolChemicalFeature::~MolChemicalFeature
~MolChemicalFeature()
Definition: MolChemicalFeature.h:41
RDKit::MolChemicalFeature::getFeatDef
const MolChemicalFeatureDef * getFeatDef() const
return a pointer to our feature definition
Definition: MolChemicalFeature.h:59
RDKit::MolChemicalFeature::getPos
RDGeom::Point3D getPos() const
return the position of the feature (obtained from from the associated conformation ...
RDKit::ROMol
ROMol is a molecule class that is intended to have a fixed topology.
Definition: ROMol.h:102
ChemicalFeature.h
RDKit::MolChemicalFeature::getAtoms
const AtomPtrContainer & getAtoms() const
returns our atom container of
Definition: MolChemicalFeature.h:77
ChemicalFeatures::ChemicalFeature
abstract base class for chemical feature
Definition: ChemicalFeature.h:18
RDKit
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
RDGeom::Point3D
Definition: point.h:45
RDKit::MolChemicalFeature::AtomPtrContainer_CI
AtomPtrContainer::const_iterator AtomPtrContainer_CI
Definition: MolChemicalFeature.h:30
RDKit::MolChemicalFeature
Definition: MolChemicalFeature.h:25
RDKit::MolChemicalFeature::endAtoms
AtomPtrContainer::const_iterator endAtoms() const
Definition: MolChemicalFeature.h:81
RDKit::MolChemicalFeature::setActiveConformer
void setActiveConformer(int confId)
sets the active conformer (in the associated molecule)
RDKit::MolChemicalFeature::clearCache
void clearCache()
clears out the internal position cache
Definition: MolChemicalFeature.h:74
RDKit::MolChemicalFeatureDef
Definition: MolChemicalFeatureDef.h:24
RDKit::MolChemicalFeature::getType
const std::string & getType() const
return the name of the feature's type
RDKit::MolChemicalFeature::getMol
const ROMol * getMol() const
return a pointer to our associated molecule
Definition: MolChemicalFeature.h:57
RDKit::MolChemicalFeature::beginAtoms
AtomPtrContainer::const_iterator beginAtoms() const
Definition: MolChemicalFeature.h:78
RDKit::MolChemicalFeature::getNumAtoms
unsigned int getNumAtoms() const
returns the number of atoms defining the feature
Definition: MolChemicalFeature.h:65