Chemical Data Processing Library C++ API - Version 1.4.0
Chem/UtilityFunctions.hpp
Go to the documentation of this file.
1 /*
2  * UtilityFunctions.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_CHEM_UTILITYFUNCTIONS_HPP
30 #define CDPL_CHEM_UTILITYFUNCTIONS_HPP
31 
32 #include <cstddef>
33 #include <string>
34 
35 #include "CDPL/Chem/APIPrefix.hpp"
36 #include "CDPL/Chem/Molecule.hpp"
38 #include "CDPL/Util/BitSet.hpp"
39 #include "CDPL/Math/Vector.hpp"
40 
41 
42 namespace CDPL
43 {
44 
45  namespace Chem
46  {
47 
54  CDPL_CHEM_API Molecule::SharedPointer parseSMARTS(const std::string& smarts, bool init_qry = true);
55 
63  CDPL_CHEM_API bool parseSMARTS(const std::string& smarts, Molecule& mol, bool init_qry = true);
64 
65 
72 
79  CDPL_CHEM_API bool parseSMILES(const std::string& smiles, Molecule& mol);
80 
81 
89  CDPL_CHEM_API void extendBoundingBox(Math::Vector3D& min, Math::Vector3D& max, const Math::Vector3D& coords, bool reset = false);
90 
98  CDPL_CHEM_API bool insideBoundingBox(const Math::Vector3D& min, const Math::Vector3D& max, const Math::Vector3D& coords);
99 
100 
108  CDPL_CHEM_API bool isAromatic(const Fragment& ring, const MolecularGraph& molgraph, const Util::BitSet& arom_bond_mask);
109 
116  CDPL_CHEM_API bool isNotAromatic(const Fragment& ring, const MolecularGraph& molgraph);
117 
118 
125  CDPL_CHEM_API bool containsFragmentWithBond(const FragmentList& frag_list, const Bond& bond);
126 
133  CDPL_CHEM_API bool containsFragmentWithMinSize(const FragmentList& frag_list, std::size_t min_size);
134 
135 
143  CDPL_CHEM_API bool atomTypesMatch(unsigned int qry_type, unsigned int tgt_type);
144 
145 
151  CDPL_CHEM_API unsigned int sybylToAtomType(unsigned int sybyl_type);
152 
158  CDPL_CHEM_API const std::string& getSybylAtomTypeString(unsigned int sybyl_type);
159 
165  CDPL_CHEM_API const std::string& getSybylBondTypeString(unsigned int sybyl_type);
166  } // namespace Chem
167 } // namespace CDPL
168 
169 #endif // CDPL_CHEM_UTILITYFUNCTIONS_HPP
Declaration of type CDPL::Util::BitSet.
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of class CDPL::Chem::FragmentList.
Definition of class CDPL::Chem::Molecule.
Definition of vector data types.
Abstract base class representing a chemical bond between two Chem::Atom instances.
Definition: Bond.hpp:54
Data type for the storage of Chem::Fragment objects.
Definition: FragmentList.hpp:49
Concrete Chem::MolecularGraph implementation that stores references to a selectable subset of atoms a...
Definition: Fragment.hpp:57
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
Abstract base class representing a mutable molecular graph that owns its atoms and bonds.
Definition: Molecule.hpp:53
std::shared_ptr< Molecule > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Molecule instances.
Definition: Molecule.hpp:59
CDPL_CHEM_API bool containsFragmentWithBond(const FragmentList &frag_list, const Bond &bond)
Tells whether any fragment in frag_list contains the bond bond.
CDPL_CHEM_API bool containsFragmentWithMinSize(const FragmentList &frag_list, std::size_t min_size)
Tells whether frag_list contains at least one fragment with at least min_size atoms.
CDPL_CHEM_API bool insideBoundingBox(const AtomContainer &cntnr, const Math::Vector3D &min, const Math::Vector3D &max, const Atom3DCoordinatesFunction &coords_func)
Tells whether every atom of cntnr lies inside the axis-aligned bounding box defined by min and max.
CDPL_CHEM_API const std::string & getSybylAtomTypeString(unsigned int sybyl_type)
Returns the canonical textual representation of the Sybyl atom type sybyl_type.
CDPL_CHEM_API bool isAromatic(const Fragment &ring, const MolecularGraph &molgraph, const Util::BitSet &arom_bond_mask)
Tells whether ring fulfills the Hückel (4n+2)π-electron criterion within molgraph.
CDPL_CHEM_API bool atomTypesMatch(unsigned int qry_type, unsigned int tgt_type)
Tells whether the target atom type tgt_type matches the query atom type qry_type (taking generic atom...
CDPL_CHEM_API unsigned int sybylToAtomType(unsigned int sybyl_type)
Translates a Sybyl atom-type identifier to the corresponding generic Chem::AtomType value.
CDPL_CHEM_API void extendBoundingBox(Math::Vector3D &min, Math::Vector3D &max, const Math::Vector3D &coords, bool reset=false)
Extends the axis-aligned bounding box defined by min and max so that it contains the point coords.
CDPL_CHEM_API Molecule::SharedPointer parseSMILES(const std::string &smiles)
Parses the SMILES string smiles into a freshly allocated Chem::Molecule.
CDPL_CHEM_API bool isNotAromatic(const Fragment &ring, const MolecularGraph &molgraph)
Tells whether ring is guaranteed not to be aromatic (based on quick geometric/topological criteria).
CDPL_CHEM_API Molecule::SharedPointer parseSMARTS(const std::string &smarts, bool init_qry=true)
Parses the SMARTS string smarts into a freshly allocated query Chem::Molecule.
CDPL_CHEM_API const std::string & getSybylBondTypeString(unsigned int sybyl_type)
Returns the canonical textual representation of the Sybyl bond type sybyl_type.
CVector< double, 3 > Vector3D
Bounded 3 element vector holding floating point values of type double.
Definition: Vector.hpp:2937
boost::dynamic_bitset BitSet
Dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.