BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
BALL::AddHydrogenProcessor Class Reference

#include <BALL/STRUCTURE/addHydrogenProcessor.h>

Inheritance diagram for BALL::AddHydrogenProcessor:
BALL::UnaryProcessor< Composite > BALL::UnaryFunctor< Composite, Processor::Result >

Public Member Functions

 AddHydrogenProcessor ()
 Default constructor. More...
 
virtual ~AddHydrogenProcessor ()
 Destructor. More...
 
virtual bool start ()
 
virtual Processor::Result operator() (Composite &composite)
 
Size getConnectivity (const Atom &atom) const
 
void setRings (const vector< vector< Atom * > > &rings)
 
Size getNumberOfAddedHydrogens () const
 
- Public Member Functions inherited from BALL::UnaryProcessor< Composite >
 UnaryProcessor ()
 
 UnaryProcessor (const UnaryProcessor &)
 
virtual ~UnaryProcessor ()
 
virtual bool finish ()
 

Protected Member Functions

Processor::Result placePeptideBondH_ (Residue *res)
 
Size countBondOrders (const Atom &atom) const
 
void addHydrogen_ (Atom &atom, Vector3 position)
 
bool isRingAtom_ (const Atom &atom) const
 
vector< Atom * > getPartners_ (Atom &atom) const
 
Vector3 getNormal_ (const Vector3 &v) const
 
bool normalize_ (Vector3 &v) const
 
bool hasMultipleBond_ (const Atom &atom) const
 
float getBondLength_ (Position element) const
 

Additional Inherited Members

- Public Types inherited from BALL::UnaryFunctor< Composite, Processor::Result >
typedef Processor::Result result_type
 
typedef Composite argument_type
 
typedef Compositeargument_reference
 
typedef const Compositeconst_argument_reference
 
typedef Compositeargument_pointer
 
typedef const Compositeconst_argument_pointer
 

Detailed Description

Saturate atoms with hydrogen atoms.

This processor only works for main group elements. The formal charge of the atoms are taken into account. The placement of the hydrogen atoms only depends on the direct neighbour atoms.

No additional optimization of the atom placement is performed. The optimal bond lengths are calculated by a modified Schomaker-Stevenson rule (adapted from the MMFF94 Force Field.). For hydrogen atoms located in a peptide bond the atom is placed taking the planarity of the bond into account. In this case bond length is taken from the rules used by DSSP (Kabsch-Sander) as implemented by the HydrogenBondProcessor.

Usage:
RingPerceptionProcessor rpp;
vector<vector<Atom*> > rings;
rpp.calculateSSSR(rings, system);
rings = rpp.getAllSmallRings();
ap.setRings(rings);
system.apply(ap);

Keep in mind that the hydrogen positions obtained by using this method are usually not optimal. For better better Atom placment when adding hydrogens to Proteins and DNA you should use the ReconstructFragmentProcessor. Nevertheless in both cases it is recommended to optimize the obtained hydrogen atom positions using a force field (e.g. BALL::AmberFF, BALL::CharmmFF, BALL::MMFF94)

Definition at line 58 of file addHydrogenProcessor.h.

Constructor & Destructor Documentation

BALL::AddHydrogenProcessor::AddHydrogenProcessor ( )

Default constructor.

virtual BALL::AddHydrogenProcessor::~AddHydrogenProcessor ( )
virtual

Destructor.

Member Function Documentation

void BALL::AddHydrogenProcessor::addHydrogen_ ( Atom atom,
Vector3  position 
)
protected

Adds a single hydrogen an atom.

Parameters
atomThe Atom to which a hydrogen should be added
positionThe position of the newly added hydrogen
Size BALL::AddHydrogenProcessor::countBondOrders ( const Atom atom) const
protected

Sums up the bond orders of all bonds the atom participates in.

Parameters
atomThe Atom for which the bond orders should be determined
Returns
The bond orders of the Atom.
float BALL::AddHydrogenProcessor::getBondLength_ ( Position  element) const
protected

Get the ideal bond length for the given element with hydrogen atoms. This uses the Schomaker-Stevenson rule.

Parameters
elementThe Element for which to compute the distance
Returns
The preferred distance of a hydrogen atom from the input Element
Size BALL::AddHydrogenProcessor::getConnectivity ( const Atom atom) const

Computes the number of connections of a provided Atom the computation is solely based on the formal charge of the molecule as obtained from its group in the PTE. Hence only one connectivity is computed for every element.

Parameters
atomThe Atom for which the connectivity shoudl be computed
Returns
The number of connections the atom most likely will form. 0 if no connectivity could be computed.
Vector3 BALL::AddHydrogenProcessor::getNormal_ ( const Vector3 v) const
protected

Computes a vector orthogonal to the input. It uses the x-axis as reference. If the input is colinear to the x-axis, the y-axis is used.

Parameters
vA vector for which an orthogonal vector shoudl be computed
Returns
A vector of unit length orthogonal to the input
Size BALL::AddHydrogenProcessor::getNumberOfAddedHydrogens ( ) const
inline

Returns the number of added hydrogen atoms. This value will accumulate over multiple calls of operator()

Returns
The number of added hydrogens

Definition at line 118 of file addHydrogenProcessor.h.

vector<Atom*> BALL::AddHydrogenProcessor::getPartners_ ( Atom atom) const
protected

Returns a list of atoms bound to the specified Atom

Parameters
atomthe atom for which the binding partners should be determined
Returns
A std::vector containing all Atoms that have a bond to the specified Atom
bool BALL::AddHydrogenProcessor::hasMultipleBond_ ( const Atom atom) const
protected

Determines whether an Atom has a bond that is not a single bond.

Parameters
atomThe Atom that should be checked for non-single bonds.
Returns
true if the atom has a a non-single bond, false otherwise
bool BALL::AddHydrogenProcessor::isRingAtom_ ( const Atom atom) const
protected

Returns whether the atom is in the internal list of ring atoms

See also
AddHydrogenProcessor::setRings
Parameters
atomThe Atom that should be checked
Returns
true if the Atom is in the ring Atom set false otherwise
bool BALL::AddHydrogenProcessor::normalize_ ( Vector3 v) const
protected

Normalizes a vector.

Parameters
vThe vector that should be normalized. Normalization is performed in-place.
Returns
true if the vector is non-zero false otherwise.
virtual Processor::Result BALL::AddHydrogenProcessor::operator() ( Composite composite)
virtual

Adds hydrogen atoms to the specified composite. If composite is a Residue it uses the peptide bond rule to place hydrogens. Otherwise the placement heuristic based on the modified Schomaker-Stevenson rule is used.

See also
UnaryProcessor::operator()
Parameters
compositeThe composite that should be saturated with hydrogens
Returns
Processor::CONTINUE is returned in all cases.

Reimplemented from BALL::UnaryProcessor< Composite >.

Processor::Result BALL::AddHydrogenProcessor::placePeptideBondH_ ( Residue res)
protected

Place peptide bond H-atoms according to Kabsch-Sander

Parameters
resA pointer to a Residue for which a peptide bond hydrogen should be placed
Returns
Processor::CONTINUE in all cases.
void BALL::AddHydrogenProcessor::setRings ( const vector< vector< Atom * > > &  rings)

Sets the internal list of ring atoms. This is necessary computing a better estimate of the hydrogen position.

Parameters
ringsA set of rings. A suitable input for this method can be computed by using RingPerceptionProcessor::calculateSSSR
virtual bool BALL::AddHydrogenProcessor::start ( )
virtual

Initialize the processor. Resets the number of added hydrogens.

See also
UnaryProcessor::start()
Returns
true in all cases

Reimplemented from BALL::UnaryProcessor< Composite >.