Chemical Data Processing Library C++ API - Version 1.4.0
MolProp/MolecularGraphFunctions.hpp
Go to the documentation of this file.
1 /*
2  * MolecularGraphFunctions.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_MOLPROP_MOLECULARGRAPHFUNCTIONS_HPP
30 #define CDPL_MOLPROP_MOLECULARGRAPHFUNCTIONS_HPP
31 
32 #include <string>
33 #include <cstddef>
34 
40 
41 
42 namespace CDPL
43 {
44 
45  namespace Chem
46  {
47 
48  class MolecularGraph;
49  }
50 
51  namespace MolProp
52  {
53 
60 
67 
73  CDPL_MOLPROP_API void generateMassCompositionString(const Chem::MolecularGraph& molgraph, std::string& comp);
74 
81  CDPL_MOLPROP_API void generateMolecularFormula(const Chem::MolecularGraph& molgraph, std::string& formula, const std::string& sep = std::string());
82 
89  CDPL_MOLPROP_API void generateElementHistogram(const Chem::MolecularGraph& molgraph, ElementHistogram& hist, bool append = false);
90 
91 
98 
99 
105  CDPL_MOLPROP_API std::size_t getAtomCount(const Chem::MolecularGraph& molgraph);
106 
115  CDPL_MOLPROP_API std::size_t getAtomCount(const Chem::MolecularGraph& molgraph, unsigned int type, bool strict = true);
116 
123 
132 
141 
148 
155 
162 
163 
169  CDPL_MOLPROP_API std::size_t getBondCount(const Chem::MolecularGraph& molgraph);
170 
178  CDPL_MOLPROP_API std::size_t getBondCount(const Chem::MolecularGraph& molgraph, std::size_t order, bool inc_aro = true);
179 
186 
193 
202  CDPL_MOLPROP_API std::size_t getRotatableBondCount(const Chem::MolecularGraph& molgraph, bool h_rotors = false, bool ring_bonds = false, bool amide_bonds = false);
203 
210 
211 
219 
227 
235 
236 
252 
253 
260 
268  CDPL_MOLPROP_API void calcPEOEProperties(Chem::MolecularGraph& molgraph, bool overwrite, std::size_t num_iter = 20,
269  double damping = 0.48);
270 
277 
285  CDPL_MOLPROP_API void calcAtomHydrophobicities(Chem::MolecularGraph& molgraph, bool overwrite, bool from_logp = false);
286 
293 
300 
308 
316 
323 
331 
339 
348  } // namespace MolProp
349 } // namespace CDPL
350 
351 #endif // CDPL_MOLPROP_MOLECULARGRAPHFUNCTIONS_HPP
Definition of constants in namespace CDPL::Chem::AtomPropertyFlag.
Definition of the type CDPL::MolProp::ElementHistogram.
Definition of class CDPL::Chem::FragmentList.
Definition of the type CDPL::MolProp::MassComposition.
Definition of the preprocessor macro CDPL_MOLPROP_API.
#define CDPL_MOLPROP_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
std::shared_ptr< FragmentList > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentList instances.
Definition: FragmentList.hpp:55
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
Data type for the storage of element histograms of chemical compounds.
Definition: ElementHistogram.hpp:50
Data type for the storage of mass percent compositions of chemical compounds.
Definition: MassComposition.hpp:51
constexpr unsigned int DEFAULT
Represents the default set of atom properties.
Definition: Chem/AtomPropertyFlag.hpp:53
CDPL_MOLPROP_API void calcMassComposition(const Chem::MolecularGraph &molgraph, MassComposition &comp)
Calculates the per-element mass composition of the molecular graph molgraph.
CDPL_MOLPROP_API double calcMass(const Chem::MolecularGraph &molgraph)
Calculates the total molecular mass of the molecular graph molgraph (sum of atom standard atomic weig...
CDPL_MOLPROP_API double calcMeanPolarizability(const Chem::MolecularGraph &molgraph)
Calculates the mean atomic polarizability of the molecular graph molgraph.
CDPL_MOLPROP_API void calcMHMOProperties(Chem::MolecularGraph &molgraph, bool overwrite)
Calculates MHMO π-charges and π-bond orders for the molecular graph molgraph and stores them as atom/...
CDPL_MOLPROP_API void generateMolecularFormula(const Chem::MolecularGraph &molgraph, std::string &formula, const std::string &sep=std::string())
Generates the molecular formula of the molecular graph the molecular graph molgraph.
CDPL_MOLPROP_API double calcXLogP(const Chem::MolecularGraph &molgraph)
Calculates the value of the molecular graph molgraph using MolProp::XLogPCalculator.
CDPL_MOLPROP_API std::size_t getChainAtomCount(const Chem::Atom &atom, const Chem::MolecularGraph &molgraph)
Returns the number of chain (non-ring) neighbors of the atom atom in the molecular graph molgraph (in...
CDPL_MOLPROP_API std::size_t getImplicitHydrogenCount(const Chem::MolecularGraph &molgraph)
Returns the total number of implicit hydrogens in the molecular graph molgraph.
CDPL_MOLPROP_API void generateElementHistogram(const Chem::MolecularGraph &molgraph, ElementHistogram &hist, bool append=false)
Generates the element histogram of the molecular graph molgraph.
CDPL_MOLPROP_API std::size_t getHydrogenBondCount(const Chem::MolecularGraph &molgraph)
Returns the number of bonds in the molecular graph molgraph that involve at least one hydrogen atom.
CDPL_MOLPROP_API void clearFunctionalGroups(Chem::MolecularGraph &molgraph)
Clears the value of the MolProp::MolecularGraphProperty::FUNCTIONAL_GROUPS property of the molecular ...
CDPL_MOLPROP_API std::size_t getChainBondCount(const Chem::Atom &atom, const Chem::MolecularGraph &molgraph)
Returns the number of chain (non-ring) bonds incident to the atom atom in the molecular graph molgrap...
CDPL_MOLPROP_API void calcAtomHydrophobicities(Chem::MolecularGraph &molgraph, bool overwrite, bool from_logp=false)
Calculates per-atom hydrophobicities for the molecular graph molgraph and stores them as atom propert...
CDPL_MOLPROP_API void calcPEOEProperties(Chem::MolecularGraph &molgraph, bool overwrite, std::size_t num_iter=20, double damping=0.48)
Calculates PEOE σ-charges and electronegativities for the atoms of the molecular graph molgraph and s...
CDPL_MOLPROP_API std::size_t getOrdinaryHydrogenCount(const Chem::Atom &atom, const Chem::MolecularGraph &molgraph, unsigned int flags=Chem::AtomPropertyFlag::DEFAULT)
Returns the number of ordinary hydrogen neighbors of the atom atom in the molecular graph molgraph.
CDPL_MOLPROP_API std::size_t getComponentCount(const Chem::MolecularGraph &molgraph)
Returns the number of connected components in the molecular graph molgraph.
CDPL_MOLPROP_API std::size_t getExplicitOrdinaryHydrogenCount(const Chem::MolecularGraph &molgraph, unsigned int flags=Chem::AtomPropertyFlag::DEFAULT)
Returns the number of explicit ordinary hydrogens in the molecular graph molgraph.
CDPL_MOLPROP_API void perceiveHBondDonorAtomTypes(Chem::MolecularGraph &molgraph, bool overwrite)
Perceives the H-bond donor types of the atoms in the molecular graph molgraph and stores them as atom...
CDPL_MOLPROP_API void generateMassCompositionString(const Chem::MolecularGraph &molgraph, std::string &comp)
Generates a string representation of the per-element mass composition of the molecular graph molgraph...
CDPL_MOLPROP_API std::size_t calcCyclomaticNumber(const Chem::MolecularGraph &molgraph)
Calculates the cyclomatic number of the molecular graph molgraph (number of independent cycles).
CDPL_MOLPROP_API void perceiveHBondAcceptorAtomTypes(Chem::MolecularGraph &molgraph, bool overwrite)
Perceives the H-bond acceptor types of the atoms in the molecular graph molgraph and stores them as a...
CDPL_MOLPROP_API const Chem::FragmentList::SharedPointer & getFunctionalGroups(const Chem::MolecularGraph &molgraph)
Returns the value of the MolProp::MolecularGraphProperty::FUNCTIONAL_GROUPS property of the molecular...
CDPL_MOLPROP_API std::size_t getAtomCount(const Chem::Atom &atom, const Chem::MolecularGraph &molgraph, unsigned int type, bool strict=true)
Returns the number of neighbors of the atom atom in the molecular graph molgraph (including implicit ...
CDPL_MOLPROP_API std::size_t getBondCount(const Chem::Atom &atom, const Chem::MolecularGraph &molgraph)
Returns the total number of bonds incident to the atom atom in the molecular graph molgraph (includin...
CDPL_MOLPROP_API std::size_t getRotatableBondCount(const Chem::Atom &atom, const Chem::MolecularGraph &molgraph, bool h_rotors=false, bool ring_bonds=false, bool amide_bonds=false)
Returns the number of rotatable bonds incident to the atom atom in the molecular graph molgraph.
CDPL_MOLPROP_API double calcTPSA(const Chem::MolecularGraph &molgraph)
Calculates the topological polar surface area (TPSA) of the molecular graph molgraph using MolProp::T...
CDPL_MOLPROP_API std::size_t getHBondAcceptorAtomCount(const Chem::MolecularGraph &molgraph)
Returns the number of H-bond acceptor atoms in the molecular graph molgraph.
CDPL_MOLPROP_API bool hasFunctionalGroups(const Chem::MolecularGraph &molgraph)
Tells whether the MolProp::MolecularGraphProperty::FUNCTIONAL_GROUPS property of the molecular graph ...
CDPL_MOLPROP_API double calcLogS(const Chem::MolecularGraph &molgraph)
Calculates the (aqueous solubility) of the molecular graph molgraph using MolProp::LogSCalculator.
CDPL_MOLPROP_API std::size_t getRuleOfFiveScore(const Chem::MolecularGraph &molgraph)
Returns the Lipinski rule-of-five score of the molecular graph molgraph, defined as the number of sat...
CDPL_MOLPROP_API void setFunctionalGroups(Chem::MolecularGraph &molgraph, const Chem::FragmentList::SharedPointer &fg_list)
Sets the value of the MolProp::MolecularGraphProperty::FUNCTIONAL_GROUPS property of the molecular gr...
CDPL_MOLPROP_API Chem::FragmentList::SharedPointer perceiveFunctionalGroups(const Chem::MolecularGraph &molgraph)
Perceives the functional groups of the molecular graph molgraph using MolProp::FunctionalGroupList.
CDPL_MOLPROP_API std::size_t getHBondDonorAtomCount(const Chem::MolecularGraph &molgraph)
Returns the number of H-bond donor atoms in the molecular graph molgraph.
The namespace of the Chemical Data Processing Library.