dockResult.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: dockResult.h,v 1.2.16.2 2007/08/07 16:16:15 bertsch Exp $
00005 //
00006 
00007 #ifndef BALL_STRUCTURE_DOCKING_DOCKRESULT_H
00008 #define BALL_STRUCTURE_DOCKING_DOCKRESULT_H
00009 
00010 #ifndef BALL_DATATYPE_OPTIONS_H
00011 # include <BALL/DATATYPE/options.h>
00012 #endif
00013 
00014 #ifndef BALL_STRUCTURE_DOCKING_CONFORMATIONSET_H
00015 # include <BALL/STRUCTURE/DOCKING/conformationSet.h>
00016 #endif
00017 
00018 namespace BALL
00019 {
00029     class BALL_EXPORT DockResult
00030     {
00031       public:
00032           
00036           
00039         DockResult()
00040           ;
00041           
00044         DockResult(const String& docking_algorithm, ConformationSet* conformation_set,
00045                     const Options& docking_options)
00046           ;
00047         
00050         DockResult(const DockResult& dock_res)
00051           ;
00052           
00055         virtual ~DockResult()
00056           ;
00057           
00059         
00063         
00066         const DockResult& operator =(const DockResult& dock_res)
00067           ;
00068           
00070         
00074         
00077         void setConformationSet(ConformationSet* conformation_set)
00078           ;
00079         
00082         const String& getDockingAlgorithm() const
00083           ;
00084           
00087         const Options& getDockingOptions() const
00088           ;
00089         
00092         const ConformationSet* getConformationSet() const
00093           ;
00094         
00097         ConformationSet* getConformationSet()
00098           ;
00099         
00100         /*  Sets scoring flag by which all scores are sorted displayed
00101             a negative index corresponds to sorting by snapshot index
00102          */
00103          void sortBy(Index scoring_index)
00104           throw(Exception::IndexOverflow);
00105           
00106         /*  Get the number of the scoring by which all scores are sorted displayed
00107          */
00108         Index isSortedBy() const
00109           ;
00110         
00114         float operator()(Position i, Position j)
00115           throw(Exception::IndexOverflow);
00116         
00119         const vector<ConformationSet::Conformation> getScores(Position i) const
00120           throw(Exception::IndexOverflow);
00121           
00124         const String& getScoringName(Position i) const
00125           throw(Exception::IndexOverflow);
00126           
00129         const Options& getScoringOptions(Position i) const
00130           throw(Exception::IndexOverflow);
00131           
00134         Size numberOfScorings() const
00135           ;
00136           
00142         void addScoring(const String& name, const Options& options, vector<ConformationSet::Conformation> scores)
00143           ;
00144           
00147         void deleteScoring(Position i)
00148           throw(Exception::IndexOverflow);
00149         
00151           
00155           
00162         bool writeDockResult(const String& filename)
00163           ;
00164         
00170         bool writeDockResult(std::ostream& file) const
00171           ;
00172           
00179         bool readDockResult(const String& filename)
00180           ;
00181           
00187         bool readDockResult(std::istream& file)
00188           ;
00189         
00193         friend std::ostream& operator <<(std::ostream& out, const DockResult& dock_res)
00194           ;
00195         
00199         friend std::istream& operator >>(std::istream& in, DockResult& dock_res)
00200           ;
00201         
00203         
00204       protected:
00205         
00212         class Scoring_
00213         {
00214           public:
00215           
00218             Scoring_() ;
00219             
00222             Scoring_(const Scoring_& scoring)
00223               ;
00224             
00227             Scoring_(const String& name, const Options& options, const vector<float>& scores, const vector<Index>& snapshot_order) ;
00228             
00231             ~Scoring_() ;
00232             
00235             const Scoring_& operator =(const Scoring_& scoring)
00236               ;
00237             
00240             String name_;
00243             Options options_;
00247             vector<float> scores_;
00251             vector<Index> snapshot_order_;
00252         };
00253         
00260         class Compare_
00261         {
00262           public:
00263 
00266             Compare_() ;
00267 
00270             ~Compare_() ;
00271 
00274             //bool operator() (const std::pair<Index, float>& a, const std::pair<Index, float>& b) const
00275             bool operator() (const ConformationSet::Conformation& a, const ConformationSet::Conformation& b) const
00276               ;
00277         };
00278         
00281         String docking_algorithm_;
00284         Options docking_options_;
00287         ConformationSet* conformation_set_;
00291         vector<Scoring_> scorings_;
00296         Index sorted_by_;
00297     };
00298     
00299     std::ostream& operator <<(std::ostream& out, const DockResult& dock_res)
00300       ;
00301       
00302     std::istream& operator >>(std::istream& in, DockResult& dock_res)
00303       ;
00304 }
00305 #endif