Loading...
Searching...
No Matches
GAFFTypeProcessor.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_MOLMEC_AMBER_GAFFTYPEPROCESSOR_H
#define BALL_MOLMEC_AMBER_GAFFTYPEPROCESSOR_H
#ifndef BALL_CONCEPT_COMPOSITE_H
# include <BALL/CONCEPT/composite.h>
#endif
#ifndef BALL_CONCEPT_PROCESSOR_H
# include <BALL/CONCEPT/processor.h>
#endif
#ifndef BALL_MOLMEC_AMBER_GAFFCESPARSER_H
# include <BALL/MOLMEC/AMBER/GAFFCESParser.h>
#endif
#ifndef BALL_DATATYPE_OPTIONS_H
# include <BALL/DATATYPE/options.h>
#endif
#ifndef BALL_COMMON_EXCEPTION_H
# include <BALL/COMMON/exception.h>
#endif
#ifndef BALL_KERNEL_MOLECULE_H
# include <BALL/KERNEL/molecule.h>
#endif
#include <vector>
#include <map>
namespace BALL
{
class BALL_EXPORT GAFFTypeProcessor : public UnaryProcessor<Composite>
{
public:
struct TypeDefinition
{
String atom_type;
int atomic_number;
int connectivity;
String attached_hydrogens;
String electron_withdrawal_atoms;
String atomic_property;
String chemical_environment;
};
struct BALL_EXPORT Option
{
static const String ATOMTYPE_FILENAME;
static const String GAFF_ATOMTYPE_POSTPROCESSING;
};
struct BALL_EXPORT Default
{
static const String ATOMTYPE_FILENAME;
static const bool GAFF_ATOMTYPE_POSTPROCESSING;
};
enum BALL_EXPORT BOND_TYPES
{
sb,
SB,
db,
DB,
TB,
DL,
AB
};
GAFFTypeProcessor();
GAFFTypeProcessor(const Options& new_options);
virtual ~GAFFTypeProcessor();
virtual Processor::Result operator() (Composite &composite);
std::set<String> getTypeNames() const;
Options options;
protected:
// helper functions used in identifying the correct atom type
std::vector<TypeDefinition> getCarbonTypes_() { return atom_types_[6]; }
std::vector<TypeDefinition> getHydrogenTypes_() { return atom_types_[1]; }
std::vector<TypeDefinition> getNitrogenTypes_() { return atom_types_[7]; }
std::vector<TypeDefinition> getOxygenTypes_() { return atom_types_[8]; }
std::vector<TypeDefinition> getSulfurTypes_() { return atom_types_[16]; }
void parseAtomtypeTableFile_();
void precomputeBondProperties_(Molecule* molecule);
void precomputeAtomProperties_(Molecule* molecule);
void annotateBondTypes_();
void annotateRingSizes_();
void annotateAliphaticAndAromaticRingAtoms_();
void annotatePlanarRingAtoms_();
bool planarAtom_(const Atom& atom);
bool assignAtomtype_(Atom& atom);
void postProcessAtomTypes_(Molecule* molecule);
//for every CESstring in atomtable store the "predicate tree"
//built by GAFFCESParser
StringHashMap<GAFFCESParser*> ces_parsers_;
// stores the vectors of atom types indexed by atomic number for fast retrieval
std::map<Position, std::vector<TypeDefinition> > atom_types_;
// smallest set of smallest rings used for atomic environment strings
std::vector<std::vector<Atom*> > sssr_;
Molecule* current_molecule_;
};
}
#endif
exception.h
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
GAFFCESParser.h
SB
SB
Definition GAFFTypeProcessor.h:73
sb
sb
Definition GAFFTypeProcessor.h:72
db
db
Definition GAFFTypeProcessor.h:74
DB
DB
Definition GAFFTypeProcessor.h:75
TB
TB
Definition GAFFTypeProcessor.h:76
DL
DL
Definition GAFFTypeProcessor.h:77
BALL::Atom
Definition atom.h:90
BALL::Composite
Definition composite.h:74
BALL::GAFFTypeProcessor::GAFFTypeProcessor
GAFFTypeProcessor(const Options &new_options)
BALL::GAFFTypeProcessor::sssr_
std::vector< std::vector< Atom * > > sssr_
Definition GAFFTypeProcessor.h:140
BALL::GAFFTypeProcessor::ces_parsers_
StringHashMap< GAFFCESParser * > ces_parsers_
Definition GAFFTypeProcessor.h:134
BALL::GAFFTypeProcessor::getCarbonTypes_
std::vector< TypeDefinition > getCarbonTypes_()
Definition GAFFTypeProcessor.h:92
BALL::GAFFTypeProcessor::current_molecule_
Molecule * current_molecule_
Definition GAFFTypeProcessor.h:143
BALL::GAFFTypeProcessor::~GAFFTypeProcessor
virtual ~GAFFTypeProcessor()
BALL::GAFFTypeProcessor::precomputeAtomProperties_
void precomputeAtomProperties_(Molecule *molecule)
BALL::GAFFTypeProcessor::getSulfurTypes_
std::vector< TypeDefinition > getSulfurTypes_()
Definition GAFFTypeProcessor.h:96
BALL::GAFFTypeProcessor::annotateBondTypes_
void annotateBondTypes_()
Helper for precomputeBondProperties.
BALL::GAFFTypeProcessor::planarAtom_
bool planarAtom_(const Atom &atom)
BALL::GAFFTypeProcessor::annotateRingSizes_
void annotateRingSizes_()
Helper for precomputeAtomProperties.
BALL::GAFFTypeProcessor::getOxygenTypes_
std::vector< TypeDefinition > getOxygenTypes_()
Definition GAFFTypeProcessor.h:95
BALL::GAFFTypeProcessor::getHydrogenTypes_
std::vector< TypeDefinition > getHydrogenTypes_()
Definition GAFFTypeProcessor.h:93
BALL::GAFFTypeProcessor::getNitrogenTypes_
std::vector< TypeDefinition > getNitrogenTypes_()
Definition GAFFTypeProcessor.h:94
BALL::GAFFTypeProcessor::precomputeBondProperties_
void precomputeBondProperties_(Molecule *molecule)
compute aromaticity, ring memberships, GAFF bond typization, ...
BALL::GAFFTypeProcessor::annotateAliphaticAndAromaticRingAtoms_
void annotateAliphaticAndAromaticRingAtoms_()
BALL::GAFFTypeProcessor::GAFFTypeProcessor
GAFFTypeProcessor()
BALL::GAFFTypeProcessor::annotatePlanarRingAtoms_
void annotatePlanarRingAtoms_()
BALL::GAFFTypeProcessor::options
Options options
Definition GAFFTypeProcessor.h:88
BALL::GAFFTypeProcessor::postProcessAtomTypes_
void postProcessAtomTypes_(Molecule *molecule)
BALL::GAFFTypeProcessor::atom_types_
std::map< Position, std::vector< TypeDefinition > > atom_types_
Definition GAFFTypeProcessor.h:137
BALL::GAFFTypeProcessor::getTypeNames
std::set< String > getTypeNames() const
BALL::GAFFTypeProcessor::assignAtomtype_
bool assignAtomtype_(Atom &atom)
BALL::GAFFTypeProcessor::parseAtomtypeTableFile_
void parseAtomtypeTableFile_()
BALL::Molecule
Definition molecule.h:31
BALL::Options
Definition options.h:48
BALL::Processor::Result
int Result
Definition processor.h:36
BALL::StringHashMap
Definition stringHashMap.h:42
BALL::String
Definition string.h:57
BALL::UnaryProcessor< Composite >::UnaryProcessor
UnaryProcessor()
Definition processor.h:69
composite.h
molecule.h
BALL
Definition constants.h:13
options.h
processor.h
BALL::GAFFTypeProcessor::Default
Definition GAFFTypeProcessor.h:62
BALL::GAFFTypeProcessor::Default::ATOMTYPE_FILENAME
static const String ATOMTYPE_FILENAME
path to the file containing the atom type definitions
Definition GAFFTypeProcessor.h:64
BALL::GAFFTypeProcessor::Default::GAFF_ATOMTYPE_POSTPROCESSING
static const bool GAFF_ATOMTYPE_POSTPROCESSING
switch cleanup of GAFF types (cc=>cd, ...) on or off
Definition GAFFTypeProcessor.h:67
BALL::GAFFTypeProcessor::Option
Definition GAFFTypeProcessor.h:53
BALL::GAFFTypeProcessor::Option::ATOMTYPE_FILENAME
static const String ATOMTYPE_FILENAME
path to the file containing the atom type definitions
Definition GAFFTypeProcessor.h:55
BALL::GAFFTypeProcessor::Option::GAFF_ATOMTYPE_POSTPROCESSING
static const String GAFF_ATOMTYPE_POSTPROCESSING
switch cleanup of GAFF types (cc=>cd, ...) on or off
Definition GAFFTypeProcessor.h:58
BALL::GAFFTypeProcessor::TypeDefinition
Nested class definitions.
Definition GAFFTypeProcessor.h:42
BALL::GAFFTypeProcessor::TypeDefinition::atomic_property
String atomic_property
Definition GAFFTypeProcessor.h:48
BALL::GAFFTypeProcessor::TypeDefinition::attached_hydrogens
String attached_hydrogens
Definition GAFFTypeProcessor.h:46
BALL::GAFFTypeProcessor::TypeDefinition::electron_withdrawal_atoms
String electron_withdrawal_atoms
Definition GAFFTypeProcessor.h:47
BALL::GAFFTypeProcessor::TypeDefinition::connectivity
int connectivity
Definition GAFFTypeProcessor.h:45
BALL::GAFFTypeProcessor::TypeDefinition::atom_type
String atom_type
Definition GAFFTypeProcessor.h:43
BALL::GAFFTypeProcessor::TypeDefinition::chemical_environment
String chemical_environment
Definition GAFFTypeProcessor.h:49
BALL::GAFFTypeProcessor::TypeDefinition::atomic_number
int atomic_number
Definition GAFFTypeProcessor.h:44