/usr/include/BALL/STRUCTURE/hybridisationProcessor.h is in libball1.4-dev 1.4.3~beta1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | // -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_STRUCTURE_HYBRIDISATIONPROCESSOR_H
#define BALL_STRUCTURE_HYBRIDISATIONPROCESSOR_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
#ifndef BALL_DATATYPE_STRINGHASHMAP_H
#include <BALL/DATATYPE/stringHashMap.h>
#endif
#include <map>
namespace BALL
{
/** Hybridisation processor
\ingroup StructureMiscellaneous
*/
class BALL_EXPORT HybridisationProcessor
: public UnaryProcessor<AtomContainer>
{
public:
/** @name Constant Definitions
*/
//@{
/// Option names
struct BALL_EXPORT Option
{
/** Name to the file where the atom types and corresponding
* hybridisation states are stored in.
*/
static const char* ATOM_TYPE_SMARTS_FILENAME;
/** Name to the file where the atom types, corresponding
* hybridisation states, and bond angles are stored in (force field based method).
*/
static const char* ATOM_TYPE_FF_FILENAME;
/** If true, the existing bonds are deleted before
* bonds detection begins. If the atoms are in
* non-bond distance no bonds will be build! Note
* that the processor cannot rebuild inter-atomcontainer
* bonds, that will cause problem using it with proteins.
*/
/** Technique to compute the hybridisation states.
*/
static const String METHOD;
};
/// Default values for options
struct BALL_EXPORT Default
{
/// default file name for the atom type smarts
static const char* ATOM_TYPE_SMARTS_FILENAME;
/** default file name for the atom types, hybridisation states, and
* bond angles (force field based)
*/
static const char* ATOM_TYPE_FF_FILENAME;
/// this option is set to
/// HybridisationProcessor::Method::SMART_MATCHING
/// by default
static const String METHOD;
};
struct BALL_EXPORT Method
{
static const String SMART_MATCHING;
static const String STRUCTURE_BASED;
static const String FF_BASED;
};
//@}
/** @name Constructors and Destructors
*/
//@{
BALL_CREATE(HybridisationProcessor);
/// default constructor
HybridisationProcessor();
/// copy construcor
HybridisationProcessor(const HybridisationProcessor& hp);
/// Constructor with parameter filename for the smarts based algorithm
/// and parameter filename for the force field based method
HybridisationProcessor(const String& smarts_file_name, const String& ff_file_name) throw(Exception::FileNotFound);
/// destructor
virtual ~HybridisationProcessor();
//@}
/** @name Processor-related methods
*/
//@{
/// processor method which is called before the operator () call
virtual bool start();
/// operator () for the processor
virtual Processor::Result operator () (AtomContainer& ac);
//@}
/** @name Accessors
*/
//@{
/// Return the number of hybridisation states set during the last application.
Size getNumberOfHybridisationStatesSet();
/// sets the parameters file
void setAtomTypeSmarts(const String& file_name) throw(Exception::FileNotFound);
/// Return the atom_types--hybridisation Hashmap
vector< std::pair<String, Size> > getHybridisationMap() { return atom_type_smarts_;};
//@}
/** @name Assignment
*/
//@{
/// assignment operator
HybridisationProcessor& operator = (const HybridisationProcessor& hp);
//@}
/** @name Public Attributes
*/
//@{
/// options
Options options;
/** reset the options to default values
*/
void setDefaultOptions();
//@}
protected:
/** Struct for atom types and hybridization states
*/
struct Elements_
{
/// The type
String type;
/// Hybridization state
unsigned char hyb;
};
/** The atom names for each bond angle
*/
struct AtomNames_
{
/// First atom
String a1;
/// Second atom
String a2;
/// Third atom
String a3;
};
/// method to read the paramter file
bool readAtomTypeSmartsFromFile_(const String& file_name = "") throw(Exception::FileNotFound);
/// number of bonds, which are created during the processor call
Size num_hybridisation_states_;
/// structure where atom type smarts and the corresponding hybridisation states are stored in
vector< std::pair<String, Size> > atom_type_smarts_;
/** Contains the bond angles and their atom types. The bond angles
* are stored in 'rad'.
*/
StringHashMap<StringHashMap<StringHashMap<std::multimap<float, AtomNames_> > > > bond_angles_;
bool readAndInitBondAnglesFromFile_(const String& file_name = "") throw(Exception::FileNotFound);
/** Maps the atom types onto their elements
*/
StringHashMap<Elements_> elements_;
/// the Processors state
bool valid_;
/// computes the averaged bond angle for the given Atom
double AverageBondAngle_(Atom* a);
};
} // namespace BALL
#endif // BALL_STRUCTURE_HYBRIDISATIONPROCESSOR_H
|