BALL
1.4.1
|
00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 00005 #ifndef BALL_STRUCTURE_RESIDUECHECKER_H 00006 #define BALL_STRUCTURE_RESIDUECHECKER_H 00007 00008 #ifndef BALL_MATHS_COMMON_H 00009 # include <BALL/MATHS/common.h> 00010 #endif 00011 00012 #ifndef BALL_COMMON_H 00013 # include <BALL/common.h> 00014 #endif 00015 00016 #ifndef BALL_CONCEPT_PROCESSOR_H 00017 # include <BALL/CONCEPT/processor.h> 00018 #endif 00019 00020 #ifndef BALL_DATATYPE_BITVECTOR_H 00021 # include <BALL/DATATYPE/bitVector.h> 00022 #endif 00023 00024 namespace BALL 00025 { 00026 class FragmentDB; 00027 class Residue; 00028 00126 class BALL_EXPORT ResidueChecker 00127 : public UnaryProcessor<Residue> 00128 { 00129 public: 00130 00131 BALL_CREATE(ResidueChecker) 00132 00133 00136 00137 00141 enum TestType 00142 { 00144 MISSING_ATOMS = 0, 00146 EXTRA_ATOMS, 00148 ELEMENTS, 00150 SUSPECT_BOND_LENGTHS, 00152 NON_INTEGRAL_NET_CHARGE, 00154 LARGE_CHARGES, 00156 LARGE_NET_CHARGE, 00158 NAN_POSITIONS, 00160 OVERLAPPING_ATOMS, 00162 STRONGLY_OVERLAPPING_ATOMS, 00164 DUPLICATE_ATOM_NAMES, 00166 UNKNOWN_RESIDUES, 00167 00168 NUMBER_OF_TESTS 00169 }; 00171 00175 00178 ResidueChecker(); 00179 00182 ResidueChecker(FragmentDB& fragment_db); 00183 00186 ResidueChecker(const ResidueChecker& residue_checker); 00187 00190 virtual ~ResidueChecker(); 00192 00196 00199 void enable(TestType t) ; 00200 00203 void disable(TestType t) ; 00204 00207 void enableSelection() { selection_ = true; } 00208 00211 void disableSelection() { selection_ = false; } 00212 00215 bool isSelectionEnabled() { return selection_; } 00216 00222 bool getStatus() const; 00223 00224 00225 00228 bool isEnabled(TestType t) const ; 00230 00234 00237 Processor::Result operator () (Residue& residue); 00238 00241 bool start(); 00242 00245 bool finish(); 00246 00248 00254 bool checkAtomPositions(const Residue& res, const String& res_name) 00255 ; 00256 00259 bool checkCharge(const Residue& res, const String& res_name) 00260 ; 00261 00264 bool checkCompleteness(const Residue& res, const Residue& reference, const String& res_name) 00265 ; 00266 00269 bool checkTemplate(const Residue& res, const Residue& reference, const String& res_name) 00270 ; 00271 00273 00274 protected: 00275 00276 // The fragment database 00277 FragmentDB* fragment_db_; 00278 00279 // Bool flag indicating whether any of the tests failed 00280 bool status_; 00281 00282 // A bitvector containing the flags for the tests 00283 BitVector tests_; 00284 00285 // If this flag is set, all atoms/residues having problems will be selected 00286 bool selection_; 00287 }; 00288 00289 } // namespace BALL 00290 00291 #endif // BALL_STRUCTURE_RESIDUE_CHECKER