Loading...
Searching...
No Matches
HBondProcessor.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_STRUCTURE_HBONDPROCESSOR_H
#define BALL_STRUCTURE_HBONDPROCESSOR_H
#ifndef BALL_CONCEPT_PROCESSOR_H
#include <BALL/CONCEPT/processor.h>
#endif
#ifndef BALL_KERNEL_RESIDUE_H
#include <BALL/KERNEL/residue.h>
#endif
#ifndef BALL_MATHS_VECTOR3_H
#include <BALL/MATHS/vector3.h>
#endif
#ifndef BALL_DATATYPE_OPTIONS_H
#include <BALL/DATATYPE/options.h>
#endif
#include <vector>
#include <map>
namespace BALL
{
class BALL_EXPORT HBondProcessor
: public UnaryProcessor<Composite>
{
public:
class BALL_EXPORT HBond
{
public:
HBond();
HBond(Atom const* acceptor, Atom const* donor, bool donor_is_hydrogen=false)
{acceptor_ = acceptor; donor_ = donor; donor_is_hydrogen_ = donor_is_hydrogen;}
Atom const* getAcceptor() { return acceptor_; }
Atom const* getDonor() { return donor_; }
bool donorIsHydrogen() { return donor_is_hydrogen_; }
float getLength() { return acceptor_->getDistance(*donor_); }
// TODO: getAngle()? This is tricky as the DSSP works with implicit hydrogen positions
protected:
Atom const* acceptor_;
Atom const* donor_;
bool donor_is_hydrogen_;
};
struct BALL_EXPORT Option
{
static const String PREDICTION_METHOD;
static const String ADD_HBONDS;
static const String KABSCH_SANDER_ENERGY_CUTOFF;
};
struct BALL_EXPORT Default
{
static const String PREDICTION_METHOD;
static const bool ADD_HBONDS;
static const float KABSCH_SANDER_ENERGY_CUTOFF;
};
struct BALL_EXPORT PredictionMethod
{
static const String KABSCH_SANDER;
static const String WISHART_ET_AL;
};
// constants for Kabsch Sander
// 5.2 Angstrom is the maximum distance between N and O in a hydrogen bond.
// 4.2 Angstrom is an upper bound for the distance between N and O in the same
// residue. Therefore, if two residues are farther apart than MAX_LENGTH, N and O
// are farther apart than 5.2 Angstroms and there will be no hydrogen bond.
static float MAX_LENGTH;
static float BOND_LENGTH_N_H;
static float BOND_LENGTH_C_O;
// constants for Wishard et al
static float AMIDE_PROTON_OXYGEN_SEPARATION_DISTANCE; // = 3.5;
static float ALPHA_PROTON_OXYGEN_SEPARATION_DISTANCE; // = 2.77208;
struct BALL_EXPORT ResidueData
{
Vector3 pos_C;
Vector3 pos_N;
Vector3 pos_H;
Vector3 pos_O;
Size number;
Residue* res;
bool is_complete;
};
BALL_CREATE(HBondProcessor);
HBondProcessor();
HBondProcessor(Options& new_options);
virtual ~HBondProcessor();
virtual void init();
virtual bool start();
// computes the theoretical position of H
// and stores the residue information in residue_data_
//
virtual Processor::Result operator() (Composite &composite);
// to the chosen method <tt> PredictionMethod</tt>.
virtual bool finish();
const std::vector< HBond>& getHBonds() const {return h_bonds_;}
std::vector< HBond> getHBonds() {return h_bonds_;}
const std::vector< std::vector<Position> >& getBackboneHBondPattern() const;
const std::vector<ResidueData>& getResidueData() const;
Options options;
void setDefaultOptions();
protected:
void preComputeBonds_(ResidueIterator& data);
bool finishKabschSander_();
bool finishWishartEtAl_();
//_ lower point of the grid
Vector3 upper_;
//_ upper point of the grid
Vector3 lower_;
//_ the atom positions and an accending number per residue
std::vector<ResidueData> residue_data_;
//_ the backbone hydrogen bonds for the secondary structure processor
std::vector<std::vector<Position> > backbone_h_bond_pairs_;
/*_ list of __ShiftX__ HBond donors collected by <tt>operator ()</tt>
*/
std::vector<Atom*> donors_;
/*_ list of HBond acceptors collected by <tt>operator ()</tt>
*/
std::vector<Atom*> acceptors_;
std::map< Residue*, Position> residue_ptr_to_position_;
std::vector<HBond> h_bonds_;
}; //class HBondProcessor
} //namesspace BALL
#endif // BALL_STRUCTURE_HBONDPROCESSOR_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::Atom
Definition atom.h:90
BALL::Composite
Definition composite.h:74
BALL::HBondProcessor::HBond::getLength
float getLength()
Return distance between donor and acceptor.
Definition HBondProcessor.h:123
BALL::HBondProcessor::HBond::HBond
HBond(Atom const *acceptor, Atom const *donor, bool donor_is_hydrogen=false)
Definition HBondProcessor.h:114
BALL::HBondProcessor::HBond::getDonor
Atom const * getDonor()
Definition HBondProcessor.h:117
BALL::HBondProcessor::HBond::donorIsHydrogen
bool donorIsHydrogen()
Return flag indicating what HBond definition was used.
Definition HBondProcessor.h:120
BALL::HBondProcessor::HBond::HBond
HBond()
BALL::HBondProcessor::HBond::acceptor_
Atom const * acceptor_
Definition HBondProcessor.h:128
BALL::HBondProcessor::HBond::getAcceptor
Atom const * getAcceptor()
Definition HBondProcessor.h:116
BALL::HBondProcessor::HBond::donor_is_hydrogen_
bool donor_is_hydrogen_
Definition HBondProcessor.h:130
BALL::HBondProcessor::HBond::donor_
Atom const * donor_
Definition HBondProcessor.h:129
BALL::HBondProcessor::BALL_CREATE
BALL_CREATE(HBondProcessor)
BALL::HBondProcessor::finishWishartEtAl_
bool finishWishartEtAl_()
BALL::HBondProcessor::ALPHA_PROTON_OXYGEN_SEPARATION_DISTANCE
static float ALPHA_PROTON_OXYGEN_SEPARATION_DISTANCE
Definition HBondProcessor.h:179
BALL::HBondProcessor::preComputeBonds_
void preComputeBonds_(ResidueIterator &data)
BALL::HBondProcessor::BOND_LENGTH_C_O
static float BOND_LENGTH_C_O
Definition HBondProcessor.h:175
BALL::HBondProcessor::h_bonds_
std::vector< HBond > h_bonds_
store HBond
Definition HBondProcessor.h:309
BALL::HBondProcessor::getBackboneHBondPattern
const std::vector< std::vector< Position > > & getBackboneHBondPattern() const
computes the HBond pattern as needed, e.g. by the SecondaryStructureProcessor
BALL::HBondProcessor::HBondProcessor
HBondProcessor()
Default constructor.
BALL::HBondProcessor::start
virtual bool start()
BALL::HBondProcessor::init
virtual void init()
BALL::HBondProcessor::acceptors_
std::vector< Atom * > acceptors_
Definition HBondProcessor.h:299
BALL::HBondProcessor::AMIDE_PROTON_OXYGEN_SEPARATION_DISTANCE
static float AMIDE_PROTON_OXYGEN_SEPARATION_DISTANCE
Definition HBondProcessor.h:178
BALL::HBondProcessor::backbone_h_bond_pairs_
std::vector< std::vector< Position > > backbone_h_bond_pairs_
Definition HBondProcessor.h:284
BALL::HBondProcessor::HBondProcessor
HBondProcessor(Options &new_options)
Detailed constructor.
BALL::HBondProcessor::upper_
Vector3 upper_
Definition HBondProcessor.h:276
BALL::HBondProcessor::MAX_LENGTH
static float MAX_LENGTH
Definition HBondProcessor.h:173
BALL::HBondProcessor::getHBonds
const std::vector< HBond > & getHBonds() const
Definition HBondProcessor.h:240
BALL::HBondProcessor::residue_data_
std::vector< ResidueData > residue_data_
Definition HBondProcessor.h:281
BALL::HBondProcessor::BOND_LENGTH_N_H
static float BOND_LENGTH_N_H
Definition HBondProcessor.h:174
BALL::HBondProcessor::donors_
std::vector< Atom * > donors_
Definition HBondProcessor.h:295
BALL::HBondProcessor::getResidueData
const std::vector< ResidueData > & getResidueData() const
BALL::HBondProcessor::residue_ptr_to_position_
std::map< Residue *, Position > residue_ptr_to_position_
Definition HBondProcessor.h:301
BALL::HBondProcessor::setDefaultOptions
void setDefaultOptions()
BALL::HBondProcessor::finishKabschSander_
bool finishKabschSander_()
BALL::HBondProcessor::lower_
Vector3 lower_
Definition HBondProcessor.h:278
BALL::HBondProcessor::options
Options options
options
Definition HBondProcessor.h:257
BALL::HBondProcessor::getHBonds
std::vector< HBond > getHBonds()
Definition HBondProcessor.h:243
BALL::HBondProcessor::~HBondProcessor
virtual ~HBondProcessor()
BALL::HBondProcessor::finish
virtual bool finish()
Finish computes all hbonds of the composite according.
BALL::Options
Definition options.h:48
BALL::Processor::Result
int Result
Definition processor.h:36
BALL::Residue
Definition residue.h:38
BALL::String
Definition string.h:57
BALL::UnaryProcessor< Composite >::UnaryProcessor
UnaryProcessor()
Definition processor.h:69
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::ResidueIterator
BidirectionalIterator< Composite, Residue, Composite::CompositeIterator, ResidueIteratorTraits > ResidueIterator
Definition residueIterator.h:62
BALL::Vector3
TVector3< float > Vector3
Definition vector3.h:1084
options.h
processor.h
residue.h
BALL::HBondProcessor::Default
Default values for options.
Definition HBondProcessor.h:155
BALL::HBondProcessor::Default::PREDICTION_METHOD
static const String PREDICTION_METHOD
Definition HBondProcessor.h:156
BALL::HBondProcessor::Default::ADD_HBONDS
static const bool ADD_HBONDS
Definition HBondProcessor.h:157
BALL::HBondProcessor::Default::KABSCH_SANDER_ENERGY_CUTOFF
static const float KABSCH_SANDER_ENERGY_CUTOFF
Definition HBondProcessor.h:158
BALL::HBondProcessor::Option
Option names.
Definition HBondProcessor.h:139
BALL::HBondProcessor::Option::KABSCH_SANDER_ENERGY_CUTOFF
static const String KABSCH_SANDER_ENERGY_CUTOFF
Definition HBondProcessor.h:150
BALL::HBondProcessor::Option::ADD_HBONDS
static const String ADD_HBONDS
Definition HBondProcessor.h:146
BALL::HBondProcessor::Option::PREDICTION_METHOD
static const String PREDICTION_METHOD
Definition HBondProcessor.h:142
BALL::HBondProcessor::PredictionMethod
Default values for options.
Definition HBondProcessor.h:163
BALL::HBondProcessor::PredictionMethod::KABSCH_SANDER
static const String KABSCH_SANDER
Definition HBondProcessor.h:164
BALL::HBondProcessor::PredictionMethod::WISHART_ET_AL
static const String WISHART_ET_AL
Definition HBondProcessor.h:165
BALL::HBondProcessor::ResidueData
Definition HBondProcessor.h:183
BALL::HBondProcessor::ResidueData::pos_H
Vector3 pos_H
Definition HBondProcessor.h:186
BALL::HBondProcessor::ResidueData::is_complete
bool is_complete
sometimes there are defect residues around...
Definition HBondProcessor.h:191
BALL::HBondProcessor::ResidueData::pos_O
Vector3 pos_O
Definition HBondProcessor.h:187
BALL::HBondProcessor::ResidueData::pos_C
Vector3 pos_C
Definition HBondProcessor.h:184
BALL::HBondProcessor::ResidueData::number
Size number
Definition HBondProcessor.h:188
BALL::HBondProcessor::ResidueData::pos_N
Vector3 pos_N
Definition HBondProcessor.h:185
BALL::HBondProcessor::ResidueData::res
Residue * res
Definition HBondProcessor.h:189
vector3.h