BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
BALL::DNAMutator Class Reference

#include <BALL/STRUCTURE/DNAMutator.h>

Inheritance diagram for BALL::DNAMutator:
BALL::Mutator

Public Types

enum  MatchingMode { MINIMUM_ANGLE, MATCH_TORSION }
 
- Public Types inherited from BALL::Mutator
enum  MutatorOptions { NONE = 0, OPTIMIZE = 1 }
 

Public Member Functions

 DNAMutator (EnergyMinimizer *mini=NULL, ForceField *ff=NULL, FragmentDB *frag=NULL)
 
 ~DNAMutator ()
 
virtual void setup ()
 
void setMinimizer (EnergyMinimizer *mini)
 
void setForceField (ForceField *ff)
 
void setMaxOptimizationSteps (Size steps)
 
void setUsedProperty (Property p)
 
bool optimize ()
 
void setStrands (Chain *s1, Chain *s2)
 
void setFirstStrand (Chain *s1)
 
void setSecondStrand (Chain *s2)
 
void setNucleotideMapping (const NucleotideMapping &bij)
 
void addMutation (Index i, const String &new_frag_name)
 
void clearMutations ()
 
void setMatchingMode (MatchingMode mmode)
 
- Public Member Functions inherited from BALL::Mutator
 Mutator (FragmentDB *db=0)
 
virtual ~Mutator ()
 
void setFragmentDB (FragmentDB *db)
 
void mutate (MutatorOptions opts=NONE)
 

Protected Member Functions

virtual void mutate_impl_ (MutatorOptions opt)
 

Private Types

typedef std::map< Residue
*, String
Mutations
 
typedef Mutations::iterator MutIterator
 

Private Member Functions

void mutateSingleBase_ (Residue *res, const String &basename) const
 
void freeFF_ ()
 
void mark_ (AtomContainer *atoms) const
 
void unmark_ (AtomContainer *atoms) const
 
bool optimize_ (Fragment *frag)
 
AtomgetAttachmentAtom (AtomContainer *res) const
 
AtommarkBaseAtoms_ (AtomContainer *res) const
 
void alignBases_ (AtomContainer *from, const Vector3 &from_connection, const Vector3 &to_connection, Atom *from_at) const
 
AtomgetTorsionDefiningAtom_ (Atom *atom) const
 
const AtomgetTorsionDefiningAtom_ (const Atom *atom) const
 
void rotateBasesMatchTorsion_ (AtomContainer *from, const Atom *to_connection_at, Atom *from_at, const Atom *to_at) const
 
void rotateBasesMinAngle_ (AtomContainer *from, const Vector3 &to_connection, Atom *from_at, const Atom *to_at) const
 
void rotateSameBases_ (AtomContainer *from, AtomContainer *to) const
 
Vector3 getNormalVector_ (const Atom *at) const
 
AtomgetConnectionAtom_ (Atom *at) const
 
String canonizeName_ (const String &frag_name) const
 
bool isPurine_ (const Atom &baseNitrogen) const
 
bool isPyrimidine_ (const Atom &baseNitrogen) const
 
String getComplement_ (const String &s) const
 

Private Attributes

bool keep_ff_
 
ForceFieldff_
 
EnergyMinimizerminimizer_
 
Size num_steps_
 
Property prop_
 
Chainfirst_strand_
 
Chainsecond_strand_
 
NucleotideMapping mapping_
 
MatchingMode matching_mode_
 
std::map< Residue *, Stringmutations_
 
std::deque< Atom * > to_optimize_
 

Static Private Attributes

static const char * bases_ []
 
static const Size default_num_steps_
 

Additional Inherited Members

- Protected Attributes inherited from BALL::Mutator
FragmentDBdb_
 

Detailed Description

Definition at line 30 of file DNAMutator.h.

Member Typedef Documentation

typedef std::map<Residue*, String> BALL::DNAMutator::Mutations
private

Definition at line 173 of file DNAMutator.h.

typedef Mutations::iterator BALL::DNAMutator::MutIterator
private

Definition at line 174 of file DNAMutator.h.

Member Enumeration Documentation

This controls how a purine and pyrimidine base are matched onto each other

Enumerator
MINIMUM_ANGLE 

Use a minimum angle criterion and try out which conformation fits best.

MATCH_TORSION 

Set the torsion angle of the sugar-base connection in the new base to the torsion angle found in the second base

Definition at line 36 of file DNAMutator.h.

Constructor & Destructor Documentation

BALL::DNAMutator::DNAMutator ( EnergyMinimizer mini = NULL,
ForceField ff = NULL,
FragmentDB frag = NULL 
)

Constructs a DNAMutator

Parameters
fragA FragmentDB instance that shall be used to obtain structure of the new bases. If nothing or NULL is passed a default FragmentDB is used. The FragmentDB is initialized as needed causing a short delay when mutating the first base. If you do not want this either pass a valid FragmentDB instance or call DNAMutator::setup() prior to using. You can set a new FragmentDB using DNAMutator::setFragmentDB()
miniThe minimizer that shall be used for optimization of the mutated base. If nothing or NULL is passed optimization is disabled. You can pass a new minimizer anytime using DNAMutator::setMinimizer().
ffThe forcefield that should be used in conjunction with the minimizer You can set a new forcefield anytime using DNAMutator::setForceField().
See Also
DNAMutator::setup(), DNAMutator::setFragmentDB(), DNAMutator::setMinimizer() DNAMutator::setForceField()
BALL::DNAMutator::~DNAMutator ( )

The destructor of the DNAMutator; Deletes the FragmentDB instance iff it has been auto generated

Member Function Documentation

void BALL::DNAMutator::addMutation ( Index  i,
const String new_frag_name 
)
virtual

Implements Mutator::addMutation.

See Also
Mutator::addMutation
Exceptions
Exception::NotInitializedThis exception is thrown when the first DNA strand has not been set.
Exception::IndexOverflowIf the specified index is larger than the number of bases in the first strand, an exception is raised.

Implements BALL::Mutator.

void BALL::DNAMutator::alignBases_ ( AtomContainer from,
const Vector3 from_connection,
const Vector3 to_connection,
Atom from_at 
) const
private
String BALL::DNAMutator::canonizeName_ ( const String frag_name) const
private
void BALL::DNAMutator::clearMutations ( )
virtual

Clears the already specified mutations.

Implements BALL::Mutator.

void BALL::DNAMutator::freeFF_ ( )
private
Atom* BALL::DNAMutator::getAttachmentAtom ( AtomContainer res) const
private

This function returns a pointer to the nitrogen atom that attaches a base to the sugar backbone

String BALL::DNAMutator::getComplement_ ( const String s) const
private
Atom* BALL::DNAMutator::getConnectionAtom_ ( Atom at) const
private
Vector3 BALL::DNAMutator::getNormalVector_ ( const Atom at) const
private
Atom* BALL::DNAMutator::getTorsionDefiningAtom_ ( Atom atom) const
private
const Atom* BALL::DNAMutator::getTorsionDefiningAtom_ ( const Atom atom) const
private
bool BALL::DNAMutator::isPurine_ ( const Atom baseNitrogen) const
private

The methods below decide whether a base is a Purine or a Pyrimidine. In an ideal distant future this should be stored in the fragment and thus be not necessary.

bool BALL::DNAMutator::isPyrimidine_ ( const Atom baseNitrogen) const
private
void BALL::DNAMutator::mark_ ( AtomContainer atoms) const
private
Atom* BALL::DNAMutator::markBaseAtoms_ ( AtomContainer res) const
private

Selects the atoms in a base. If succesfull it returns the pointer to the attachment nitrogen.

virtual void BALL::DNAMutator::mutate_impl_ ( MutatorOptions  opt)
protectedvirtual

Implements BALL::Mutator.

void BALL::DNAMutator::mutateSingleBase_ ( Residue res,
const String basename 
) const
private
bool BALL::DNAMutator::optimize ( )
virtual

This function optimizes the new bases. Inherited from Mutator. Calling it before mutate will have no effect.

Returns
true if the optimization was successful false otherwise.

Implements BALL::Mutator.

bool BALL::DNAMutator::optimize_ ( Fragment frag)
private

Reoptimize the given fragment using the minimizer stored in minimizer_.

Returns
false on error.
void BALL::DNAMutator::rotateBasesMatchTorsion_ ( AtomContainer from,
const Atom to_connection_at,
Atom from_at,
const Atom to_at 
) const
private
void BALL::DNAMutator::rotateBasesMinAngle_ ( AtomContainer from,
const Vector3 to_connection,
Atom from_at,
const Atom to_at 
) const
private
void BALL::DNAMutator::rotateSameBases_ ( AtomContainer from,
AtomContainer to 
) const
private
void BALL::DNAMutator::setFirstStrand ( Chain s1)

Sets the first strand. If the second strand is already specified, this will lead to the computation of a NucleotideMapping using NucleotideMapping::assignNaively

See Also
NucleotideMapping::assignNaively
void BALL::DNAMutator::setForceField ( ForceField ff)

Set a new ForceField instance that is used in conjunction with the minimizer to refine the structure. Even if no minimizer has been passed this force field will be used to calculate the most favourable rotation of the base using a simple heuristic. If you do not want this behaviour pass NULL.

void BALL::DNAMutator::setMatchingMode ( MatchingMode  mmode)

Sets the matching heuristic used for aligning a pyrimidine to a purine base. Default is MATCH_TORSION.

void BALL::DNAMutator::setMaxOptimizationSteps ( Size  steps)

Controlls maximum number of steps to be used when refining the generated structure via a minimizer.

void BALL::DNAMutator::setMinimizer ( EnergyMinimizer mini)

Set the current minimizer to mini. Passing NULL will disable minimization.

void BALL::DNAMutator::setNucleotideMapping ( const NucleotideMapping bij)

Assign a custom NucleotideMapping.

void BALL::DNAMutator::setSecondStrand ( Chain s2)

Sets the second strand. If the first strand is already specified, this will lead to the computation of a NucleotideMapping using NucleotideMapping::assignNaively

See Also
NucleotideMapping::assignNaively
void BALL::DNAMutator::setStrands ( Chain s1,
Chain s2 
)

Sets the first and the second strand. This will lead to the computation of a NucleotideMapping using NucleotideMapping::assignNaively

See Also
NucleotideMapping::assignNaively
virtual void BALL::DNAMutator::setup ( )
virtual

Calling this method explicitly circumvents lazy loading of the FragmentDB. This method has no effect if mutate has already been called or if valid instances of the FragmentDB has been passed via the constructor.

Warning
If you called setup() and then set the FragmentDB to NULL via setFragmentDB() you will need to call setup() again in order to prevent lazy loading.

Reimplemented from BALL::Mutator.

void BALL::DNAMutator::setUsedProperty ( Property  p)

The DNAMutator internally uses the unnamed property mechanism of the Atoms. This defaults to property Atom::NUMBER_OF_PROPERTIES. If you already use this property in your code you can set another property by passing it to this function.

void BALL::DNAMutator::unmark_ ( AtomContainer atoms) const
private

Member Data Documentation

const char* BALL::DNAMutator::bases_[]
staticprivate

Definition at line 238 of file DNAMutator.h.

const Size BALL::DNAMutator::default_num_steps_
staticprivate

Definition at line 239 of file DNAMutator.h.

ForceField* BALL::DNAMutator::ff_
private

Definition at line 178 of file DNAMutator.h.

Chain* BALL::DNAMutator::first_strand_
private

Definition at line 184 of file DNAMutator.h.

bool BALL::DNAMutator::keep_ff_
private

Definition at line 176 of file DNAMutator.h.

NucleotideMapping BALL::DNAMutator::mapping_
private

Definition at line 187 of file DNAMutator.h.

MatchingMode BALL::DNAMutator::matching_mode_
private

Definition at line 188 of file DNAMutator.h.

EnergyMinimizer* BALL::DNAMutator::minimizer_
private

Definition at line 179 of file DNAMutator.h.

std::map<Residue*, String> BALL::DNAMutator::mutations_
private

Definition at line 243 of file DNAMutator.h.

Size BALL::DNAMutator::num_steps_
private

Definition at line 181 of file DNAMutator.h.

Property BALL::DNAMutator::prop_
private

Definition at line 182 of file DNAMutator.h.

Chain* BALL::DNAMutator::second_strand_
private

Definition at line 185 of file DNAMutator.h.

std::deque<Atom*> BALL::DNAMutator::to_optimize_
private

Definition at line 244 of file DNAMutator.h.