Loading...
Searching...
No Matches
buildBondsProcessor.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_STRUCTURE_BUILDBONDSPROCESSOR_H
#define BALL_STRUCTURE_BUILDBONDSPROCESSOR_H
#ifndef BALL_CONCEPT_PROCESSOR_H
#include <BALL/CONCEPT/processor.h>
#endif
#ifndef BALL_KERNEL_ATOMCONTAINER_H
#include <BALL/KERNEL/atomContainer.h>
#endif
#ifndef BALL_DATATYPE_HASHMAP_H
#include <BALL/DATATYPE/hashMap.h>
#endif
#ifndef BALL_KERNEL_BOND_H
#include <BALL/KERNEL/bond.h>
#endif
#ifndef BALL_DATATYPE_OPTIONS_H
#include <BALL/DATATYPE/options.h>
#endif
namespace BALL
{
class BALL_EXPORT BuildBondsProcessor
: public UnaryProcessor<AtomContainer>
{
public:
struct BALL_EXPORT Option
{
static const char* BONDLENGTHS_FILENAME;
static const char* DELETE_EXISTING_BONDS;
static const char* REESTIMATE_BONDORDERS_RINGS;
static const char* DELETE_OVERESTIMATED_BONDS;
};
struct BALL_EXPORT Default
{
static const char* BONDLENGTHS_FILENAME;
static const bool DELETE_EXISTING_BONDS;
static const bool REESTIMATE_BONDORDERS_RINGS;
static const bool DELETE_OVERESTIMATED_BONDS;
};
BALL_CREATE(BuildBondsProcessor);
BuildBondsProcessor();
BuildBondsProcessor(const BuildBondsProcessor& bbp);
BuildBondsProcessor(const String& file_name);
virtual ~BuildBondsProcessor();
virtual bool start();
virtual Processor::Result operator () (AtomContainer& ac);
Size getNumberOfBondsBuilt();
void setBondLengths(const String& file_name);
HashMap<Size, HashMap<Size, HashMap<int, float> > > getBondMap() { return bond_lengths_;};
BuildBondsProcessor& operator = (const BuildBondsProcessor& bbp);
Options options;
void setDefaultOptions();
protected:
Size buildBondsHashGrid3_(AtomContainer& ac);
void estimateBondOrders_(AtomContainer& ac);
void reestimateBondOrdersRings_(AtomContainer& ac);
void deleteOverestimatedBonds_(AtomContainer& ac);
void readBondLengthsFromFile_(const String& file_name = "");
Size num_bonds_;
HashMap<Size, HashMap<Size, HashMap<int, float> > > bond_lengths_;
HashMap<Size, HashMap<Size, float> > max_bond_lengths_;
HashMap<Size, HashMap<Size, float> > min_bond_lengths_;
/*_ returns the best fitting bond order of a bond between atoms of
element e1 and element e2 with a distance of length
*/
Bond::BondOrder getNearestBondOrder_(float length, Size e1, Size e2);
/*_ Returns true if the atom with atomic number an1 and atom with
atomic number an2 can share a bond. If, the parameter length
holds the maximal length of such a bond.
*/
bool getMaxBondLength_(float& length, Size an1, Size an2);
/*_ Returns true if the atom with atomic number an1 and atom with
atomic number an2 can share a bond. If, the parameter length
holds the minimal length of such a bond.
*/
bool getMinBondLength_(float& length, Size an1, Size an2);
float max_length_;
};
} // namespace BALL
#endif // BALL_STRUCTURE_BUILDBONDSPROCESSOR_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
atomContainer.h
bond.h
BALL::AtomContainer
Definition atomContainer.h:32
BALL::Bond::BondOrder
BondOrder
Definition bond.h:97
BALL::BuildBondsProcessor::BuildBondsProcessor
BuildBondsProcessor()
default constructor
BALL::BuildBondsProcessor::getNumberOfBondsBuilt
Size getNumberOfBondsBuilt()
Return the number of bonds built during the last application.
BALL::BuildBondsProcessor::max_bond_lengths_
HashMap< Size, HashMap< Size, float > > max_bond_lengths_
structure were the bond maxima stored in (used in buildBonds_)
Definition buildBondsProcessor.h:184
BALL::BuildBondsProcessor::buildBondsHashGrid3_
Size buildBondsHashGrid3_(AtomContainer &ac)
builds bonds, based on atom distances read from parameter file using a 3D hash grid
BALL::BuildBondsProcessor::num_bonds_
Size num_bonds_
number of bonds, which are created during the processor call
Definition buildBondsProcessor.h:178
BALL::BuildBondsProcessor::start
virtual bool start()
processor method which is called before the operator () call
BALL::BuildBondsProcessor::bond_lengths_
HashMap< Size, HashMap< Size, HashMap< int, float > > > bond_lengths_
structure where bond order distances are stored in
Definition buildBondsProcessor.h:181
BALL::BuildBondsProcessor::setBondLengths
void setBondLengths(const String &file_name)
BALL::BuildBondsProcessor::getMaxBondLength_
bool getMaxBondLength_(float &length, Size an1, Size an2)
BALL::BuildBondsProcessor::max_length_
float max_length_
parameter which holds the longest possible bond
Definition buildBondsProcessor.h:207
BALL::BuildBondsProcessor::getBondMap
HashMap< Size, HashMap< Size, HashMap< int, float > > > getBondMap()
Return the bond length Hashmap.
Definition buildBondsProcessor.h:136
BALL::BuildBondsProcessor::BuildBondsProcessor
BuildBondsProcessor(const BuildBondsProcessor &bbp)
copy construcor
BALL::BuildBondsProcessor::getNearestBondOrder_
Bond::BondOrder getNearestBondOrder_(float length, Size e1, Size e2)
BALL::BuildBondsProcessor::getMinBondLength_
bool getMinBondLength_(float &length, Size an1, Size an2)
BALL::BuildBondsProcessor::reestimateBondOrdersRings_
void reestimateBondOrdersRings_(AtomContainer &ac)
reestimate the bond orders of rings, as aromatic rings are often detected wrong
BALL::BuildBondsProcessor::estimateBondOrders_
void estimateBondOrders_(AtomContainer &ac)
after the bonds are built, the orders are estimated
BALL::BuildBondsProcessor::BALL_CREATE
BALL_CREATE(BuildBondsProcessor)
BALL::BuildBondsProcessor::~BuildBondsProcessor
virtual ~BuildBondsProcessor()
destructor
BALL::BuildBondsProcessor::setDefaultOptions
void setDefaultOptions()
BALL::BuildBondsProcessor::options
Options options
options
Definition buildBondsProcessor.h:151
BALL::BuildBondsProcessor::min_bond_lengths_
HashMap< Size, HashMap< Size, float > > min_bond_lengths_
structure were the bond minima stored in (used in buildBonds_)
Definition buildBondsProcessor.h:187
BALL::BuildBondsProcessor::deleteOverestimatedBonds_
void deleteOverestimatedBonds_(AtomContainer &ac)
deletes bonds, like from multiple bonded hydrogens or halogens
BALL::BuildBondsProcessor::readBondLengthsFromFile_
void readBondLengthsFromFile_(const String &file_name="")
BALL::BuildBondsProcessor::BuildBondsProcessor
BuildBondsProcessor(const String &file_name)
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions).
Definition hashMap.h:74
BALL::Options
Definition options.h:48
BALL::Processor::Result
int Result
Definition processor.h:36
BALL::String
Definition string.h:57
BALL::UnaryProcessor< AtomContainer >::UnaryProcessor
UnaryProcessor()
Definition processor.h:69
hashMap.h
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
options.h
processor.h
BALL::BuildBondsProcessor::Default
Default values for options.
Definition buildBondsProcessor.h:76
BALL::BuildBondsProcessor::Default::BONDLENGTHS_FILENAME
static const char * BONDLENGTHS_FILENAME
default file name for the bond lengths
Definition buildBondsProcessor.h:78
BALL::BuildBondsProcessor::Default::DELETE_OVERESTIMATED_BONDS
static const bool DELETE_OVERESTIMATED_BONDS
this option is off by default
Definition buildBondsProcessor.h:87
BALL::BuildBondsProcessor::Default::REESTIMATE_BONDORDERS_RINGS
static const bool REESTIMATE_BONDORDERS_RINGS
this option is off by default
Definition buildBondsProcessor.h:84
BALL::BuildBondsProcessor::Default::DELETE_EXISTING_BONDS
static const bool DELETE_EXISTING_BONDS
this option is off by default
Definition buildBondsProcessor.h:81
BALL::BuildBondsProcessor::Option
Option names.
Definition buildBondsProcessor.h:45
BALL::BuildBondsProcessor::Option::REESTIMATE_BONDORDERS_RINGS
static const char * REESTIMATE_BONDORDERS_RINGS
Definition buildBondsProcessor.h:64
BALL::BuildBondsProcessor::Option::DELETE_OVERESTIMATED_BONDS
static const char * DELETE_OVERESTIMATED_BONDS
Definition buildBondsProcessor.h:71
BALL::BuildBondsProcessor::Option::BONDLENGTHS_FILENAME
static const char * BONDLENGTHS_FILENAME
Definition buildBondsProcessor.h:49
BALL::BuildBondsProcessor::Option::DELETE_EXISTING_BONDS
static const char * DELETE_EXISTING_BONDS
Definition buildBondsProcessor.h:57