/usr/include/BALL/STRUCTURE/residueChecker.h is in libball1.4-dev 1.4.3~beta1-3.
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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | // -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_STRUCTURE_RESIDUECHECKER_H
#define BALL_STRUCTURE_RESIDUECHECKER_H
#ifndef BALL_MATHS_COMMON_H
# include <BALL/MATHS/common.h>
#endif
#ifndef BALL_COMMON_H
# include <BALL/common.h>
#endif
#ifndef BALL_CONCEPT_PROCESSOR_H
# include <BALL/CONCEPT/processor.h>
#endif
#ifndef BALL_DATATYPE_BITVECTOR_H
# include <BALL/DATATYPE/bitVector.h>
#endif
namespace BALL
{
class FragmentDB;
class Residue;
/** Residue Consistency Checker.
This processor checks residues for internal consistency.
It identifies missing or superfluous atoms, suspect bond lengths
and non-integral or extremely large charges on the residue.
Atom positions are checked as well: a warning is printed, if any of the
atom's coordinates is not a number (NaN).
Warnings are emitted to \link LogStream Log \endlink . \par
The individual tests can be enabled/disabled using the \link ResidueChecker::enable enable \endlink
and \link ResidueChecker::disable disable \endlink methods. Please use the enum
\link ResidueChecker::TestTypes TestTypes \endlink to refer to the appropriate tests.
By default all tests are enabled except for OVERLAPPING_ATOMS.
The following tests are currently implemented:
<ul>
<li>
missing atoms in a residue
</li>
<p>
This test checks whether all atoms contained in the fragment database for
this type of residue are present in each of the residues.
</p>
<li>
extra atoms
</li>
<p>
This test checks whether all atoms contained in the current residue are also
present in the template from the fragment database.
</p>
<li>
correct elements
</li>
<p>
Check that all atoms in a residue are of the same element as the corresponding
atoms in the template from the fragment database.
</p>
<li>
suspect bond lengths
</li>
<p>
Check that the bond lengths encountered in each of the residues agree within 15% with
the bond length in the template from the reference database.
</p>
<li>
non-integral net charge
</li>
<p>
Check that the sum of charges of a residue is integral, i.e. the sum of all charges
is an integer (+/- 0.05 elementary charges).
</p>
<li>
large charges
</li>
<p>
Check that the none of the atoms bears a charge with an absolute value above
4.0 elementary charges.
</p>
<li>
large net charge
</li>
<p>
Check that the net charge of the residue is between -2 and +2 elementary charges.
</p>
<li>
NaN atom positions
</li>
<p>
Check whether any atom has NaN (not a number) as any of its corrdinates. This is a frequent source of
error after failing simulations, minimizations, etc.
</p>
<li>
strongly overlapping atoms
</li>
<p>
Check whether any pair of atoms within a residue is closer than 0.5 Angstrom.
</p>
<li> overlapping atoms
</li>
<p>
Check whether any pair of atoms not sharing a bond is further apart then the sum of their vdW radii minus 0.4 Ansgtrom
</p>
<li>
duplicate atom names
</li>
<p>
Check whether two atoms within the residue have the same name.
</p>
<li>
unknown residues
</li>
<p>
If unknown residues are encountered (i.e. residues for which no reference template
exists in the fragment database), an error occurs. If this test is disabled,
the tests requiring a template (missing atoms, extra atoms, suspectr bond lengths, elements) will
not be executed for unknown residues.
</ul>
\ingroup StructureMiscellaneous
*/
class BALL_EXPORT ResidueChecker
: public UnaryProcessor<Residue>
{
public:
BALL_CREATE(ResidueChecker)
/** Enums
*/
//@{
/** Enum to refer to the individual tests.
The values of this enum are used by \link ResidueChecker::enable enable \endlink,
\link ResidueChecker::disable disable \endlink, and \link ResidueChecker::isEnabled isEnabled \endlink.
*/
enum TestType
{
///
MISSING_ATOMS = 0,
///
EXTRA_ATOMS,
///
ELEMENTS,
///
SUSPECT_BOND_LENGTHS,
///
NON_INTEGRAL_NET_CHARGE,
///
LARGE_CHARGES,
///
LARGE_NET_CHARGE,
///
NAN_POSITIONS,
///
OVERLAPPING_ATOMS,
///
STRONGLY_OVERLAPPING_ATOMS,
///
DUPLICATE_ATOM_NAMES,
///
UNKNOWN_RESIDUES,
NUMBER_OF_TESTS
};
//@}
/** Constructors and Destructors
*/
//@{
/** Default constructor
*/
ResidueChecker();
/** Detailed constructor
*/
ResidueChecker(FragmentDB& fragment_db);
/** Copy constructor
*/
ResidueChecker(const ResidueChecker& residue_checker);
/** Destructor
*/
virtual ~ResidueChecker();
//@}
/** Accessors
*/
//@{
/** Enable a specific test
*/
void enable(TestType t, bool enable = true) ;
/** Disable a specific test
*/
void disable(TestType t) ;
/** Enable selection of problematic atoms
*/
void enableSelection() { selection_ = true; }
/** Disable selection of problematic atoms
*/
void disableSelection() { selection_ = false; }
/** Return the status of the selection
*/
bool isSelectionEnabled() { return selection_; }
/** Return true if the last application did not produce any warning.
The getStatus method may be called after applying the ResidueChecker
to a kernel object.
@return bool <b>true</b> if no warnings occured, <b>false</b> otherwise
*/
bool getStatus() const;
/** Check whether a specific test is enabled
*/
bool isEnabled(TestType t) const ;
//@}
/** Processor-related methods
*/
//@{
/**
*/
Processor::Result operator () (Residue& residue);
/**
*/
bool start();
/**
*/
bool finish();
//@}
/**@name Explicit tests
*/
//@{
/**
*/
bool checkAtomPositions(const Residue& res, const String& res_name)
;
/**
*/
bool checkCharge(const Residue& res, const String& res_name)
;
/**
*/
bool checkCompleteness(const Residue& res, const Residue& reference, const String& res_name)
;
/**
*/
bool checkTemplate(const Residue& res, const Residue& reference, const String& res_name)
;
//@}
protected:
// The fragment database
FragmentDB* fragment_db_;
// Bool flag indicating whether any of the tests failed
bool status_;
// A bitvector containing the flags for the tests
BitVector tests_;
// If this flag is set, all atoms/residues having problems will be selected
bool selection_;
};
} // namespace BALL
#endif // BALL_STRUCTURE_RESIDUE_CHECKER
|