rotamerLibrary.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: rotamerLibrary.h,v 1.31.20.7 2007/08/07 13:02:41 toussaint Exp $
00005 //
00006 
00007 #ifndef BALL_STRUCTURE_ROTAMERLIBRARY_H
00008 #define BALL_STRUCTURE_ROTAMERLIBRARY_H
00009 
00010 #ifndef BALL_STRUCTURE_FRAGMENT_DB_H
00011 # include <BALL/STRUCTURE/fragmentDB.h>
00012 #endif
00013 
00014 #ifndef BALL_STRUCTURE_RESIDUEROTAMERSET_H
00015  #include <BALL/STRUCTURE/residueRotamerSet.h>
00016 #endif
00017 
00018 #ifndef BALL_DATATYPE_HASHMAP_H
00019   #include <BALL/DATATYPE/hasMap.h>
00020 #endif
00021 
00022 //#include <map>
00023 
00024 namespace BALL
00025 {
00026   class FragmentDB;
00027   class String;
00028 
00035   class BALL_EXPORT RotamerLibrary
00036   {
00037     public:
00038 
00039     BALL_CREATE(RotamerLibrary)
00040 
00041     
00044 
00046     static const String DEFAULT_LIBRARY;
00047 
00049     static const String DEFAULT_FRAGMENT_DB;
00051 
00059     RotamerLibrary() ;
00060 
00062     RotamerLibrary(const String& filename, const FragmentDB& fragment_db) ;
00063 
00065     RotamerLibrary(const FragmentDB& fragment_db) ;
00066 
00068     RotamerLibrary(const RotamerLibrary& library) ;
00069 
00071     virtual ~RotamerLibrary();
00073 
00077 
00078     RotamerLibrary& operator = (const RotamerLibrary& rhs);
00080       
00081 
00085 
00086     ResidueRotamerSet* getRotamerSet(const String& name);
00087 
00089     ResidueRotamerSet* getRotamerSet(const String& name, float phi, float psi);
00090 
00092     ResidueRotamerSet* getRotamerSet(const Residue& residue);
00093 
00095     Size getNumberOfRotamers() const;
00096 
00098     Size getNumberOfRotamers(const String& name) const;
00099 
00101     Size getNumberOfRotamerSets() const;
00102 
00104     void addRotamer(const String& name, const Rotamer& rotamer, Size number_of_torsions, Index phi, Index psi);
00105 
00107     void addRotamer(const String& name, const Rotamer& rotamer, Size number_of_torsions);
00108 
00110     bool isBackboneDependent() const;
00111 
00113     void setBackboneDependent(bool dependent);
00114 
00116     bool hasRotamers(const String& name) const;
00117 
00119     bool validate();
00120 
00122     void sort();
00123 
00127     void clear();
00129 
00130     protected:
00131 
00135 
00136     HashMap<Index, HashMap<Index, HashMap<String, ResidueRotamerSet> > > bb_dep_sets_;
00137   
00139     HashMap<String, ResidueRotamerSet> bb_indep_sets_;
00140 
00142     Index getNearestBackboneTorsion_(double angle) const;
00143 
00145     Size step_width_;
00146 
00148     FragmentDB fragment_db_;
00149 
00151     bool backbone_dependent_;
00153   };
00154 
00155 } // namespace BALL
00156 
00157 #endif // BALL_STRUCTURE_ROTAMERLIBRARY_H