00001
00002
00003
00004
00005
00006
00007
00008 #ifndef DNAMUTATOR_H
00009 #define DNAMUTATOR_H
00010
00011 #include <BALL/COMMON/exception.h>
00012 #include <BALL/MATHS/vector3.h>
00013
00014 namespace BALL
00015 {
00016 class FragmentDB;
00017 class EnergyMinimizer;
00018 class ForceField;
00019 class Fragment;
00020 class AtomContainer;
00021 class Atom;
00022
00023 class BALL_EXPORT DNAMutator
00024 {
00025 public:
00029 enum Base { ADENINE = 0, THYMINE = 1, GUANINE = 2, CYTOSINE = 3, URACILE = 4 };
00030
00051 DNAMutator(EnergyMinimizer* mini = NULL, ForceField* ff = NULL, FragmentDB* frag = NULL);
00052
00057 ~DNAMutator();
00058
00067 void setup();
00068
00081 void mutate(Fragment* res, Base base) throw(Exception::InvalidOption);
00082
00083
00084
00085
00086
00087 void setMinimizer(EnergyMinimizer* mini);
00088
00089
00090
00091
00092
00093
00094 void setFragmentDB(FragmentDB* frag);
00095
00096
00097
00098
00099
00100
00101
00102 void setForceField(ForceField* ff);
00103
00104
00105
00106
00107
00108 void setMaxOptimizationSteps(Size steps);
00109
00110
00111
00112
00113
00114
00115 void setUsedProperty(Property p);
00116
00117 private:
00118 bool keep_db_;
00119 bool keep_ff_;
00120
00121 FragmentDB* db_;
00122 ForceField* ff_;
00123 EnergyMinimizer* minimizer_;
00124
00125 Size num_steps_;
00126 Property prop_;
00127
00128 void freeDB_();
00129 void freeFF_();
00130
00131 void mark_(AtomContainer* atoms);
00132 void unmark_(AtomContainer* atoms);
00133
00134 void tryFlip_(Fragment* res, const Vector3& connect_atom, const Vector3& axis) const;
00135
00141 bool optimize_(Fragment* frag);
00142
00147 Atom* getAttachmentAtom(AtomContainer* res);
00148
00153 Atom* markBaseAtoms(AtomContainer* res);
00154
00155 void rotateBases(AtomContainer* from, const Atom* from_at, const Atom* to_at,
00156 const Vector3& from_connection, const Vector3& to_connection);
00157 void rotateSameBases(AtomContainer* from, AtomContainer* to);
00158
00159 const Atom* getSecondNitro(const std::vector<const Atom*>& ring_atoms, const Atom* base);
00160
00161 Vector3 getNormalVector(const Atom* at);
00162 Atom* getConnectionAtom(Atom* at);
00163 Vector3 getOrthogonalVector(const Vector3& n, const Atom* base, const Atom* at);
00164
00170 bool isPurine(const Atom& baseNitrogen) const;
00171 bool isPyrimidine(const Atom& baseNitrogen) const;
00172
00173 static const char* bases_[];
00174 static const Size default_num_steps_;
00175 };
00176 }
00177
00178 #endif
00179