Main Page | Class Hierarchy | Class List | File List | Class Members

CustomScore.h

00001 
00002 // Copyright (c) 2003, The Institute for Genomic Research (TIGR), Rockville,
00003 // Maryland, U.S.A.  All rights reserved.
00005 #ifndef CUSTOMSCORE_H
00006 #define CUSTOMSCORE_H
00007 
00008 #include "AnnotationScore.h"
00009 #include "DataDescrip.h"
00010 #include "dsu.h"
00011 #include "EvScores.h"
00012 #include "FeatVec.h"
00013 #include <pair.h>
00014 
00015 class RegionPrediction;
00016 
00028 class CustomScore {
00029  public:
00030   typedef vector<EvScores> LabelScore;
00031   friend class InputData; // initializes the feature maps
00032   virtual ~CustomScore() { 
00033     for(unsigned i = 0; i < _ddVec.size(); ++i) {
00034       delete _ddVec[i];
00035     }
00036   }
00037 
00038   vector<FeatVec*> calcVec(const RegionPrediction*, dsu::Strand_t) const;
00039   virtual double getProb(const AnnotationItem&, EvScores::Bnd_t, dsu::Strand_t) const = 0;
00040 
00041   const vector<DataDescrip*>& getFeatMaps() const { return _ddVec; }
00042   vector<DataDescrip*>& getFeatMaps() { return _ddVec; }
00043   virtual LabelScore score(const RegionPrediction&, const string&) const = 0;
00044   virtual void score(vector<RegionPrediction*>&, const string&) const = 0;
00050   virtual bool parseOnly() const { return false; }
00051 
00052  protected:
00053 
00054   CustomScore(unsigned size = (unsigned)EvScores::eNumBnd) : _ddVec(size) { 
00055     for(unsigned i = 0; i < _ddVec.size(); ++i) {
00056       _ddVec[i] = new DataDescrip;
00057     }
00058   } 
00059  protected:
00060   vector<DataDescrip*> _ddVec;
00061 
00062 };
00063 
00064 #endif //CUSTOMSCORE_H