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

Annotation.h

00001 
00002 // Copyright (c) 2003, The Institute for Genomic Research (TUG), Rockville,
00003 // Maryland, U.S.A.  All rights reserved.
00005 #ifndef ANNOTATION_H
00006 #define ANNOTATION_H
00007 
00008 #include <vector>
00009 #include <list>
00010 #include "SeqLoc.h"
00011 #include "GffFeature.h"
00012 #include "AnnotationItem.h"
00013 #include "AnnotationMatrix.h"
00014 #include "AnnotationScore.h"
00015 #include "DnaStr.h"
00016 
00017 class RegionPrediction;
00018 class CustomScore;
00019 
00035 class Annotation {
00036 public:
00037   typedef std::pair<AnnotationScore,int> aipair_t;
00038 #if _RUNTIME_DEBUG >= 1
00039   void scoreExon(int,int) const;
00040 #endif
00041 
00049   Annotation(const string& theSequence, bool forceWholeGeneModel, int cutOff) 
00050   : _theSeq(theSequence), _posSeq(theSequence,dsu::ePos), _negSeq(theSequence,dsu::eNeg),
00051     _forceWholeGeneModel(forceWholeGeneModel), _cutOff(cutOff) {} 
00052   ~Annotation() { }
00053 
00054   //void del() { _matrix.del(); }
00055 
00056   const MatrixItemContents
00057   getBestStart(const CustomScore&) const;
00058   
00069   void insert(const std::vector<RegionPrediction*>&, const CustomScore&);
00070 
00071   
00072   aipair_t 
00073     scoreHelp(int end5, int end3, dsu::Strand_t strnd, int mid, const CustomScore& cs) const;
00074   
00078   bool forceWholeGeneModel() const { return _forceWholeGeneModel; }
00079 
00083   bool empty() const { return _matrix.empty(); }
00084 
00088   const AnnotationMatrix& getMatrix() const { return _matrix; }
00089 
00090 #if 0
00091 
00099   int printOptimalParse(std::ostream&,int,const CustomScore&,const string&) const;
00100 #endif
00101 
00105   void print(std::ostream&,const CustomScore&) const;
00106 
00112   std::list<GffFeature*>*
00113     getGeneList(int&, const CustomScore&) const;
00114 
00115   /*
00116    * score a gene list
00117    */
00118   void 
00119     scoreGeneList(std::list<GffFeature*>& flst, const CustomScore& cs) const;
00120 
00121 protected:
00122  AnnotationMatrix _matrix;
00123  const string& _theSeq;
00124  const DnaStr _posSeq, _negSeq;
00125 
00126 private:
00127  AnnotationScore score(AnnotationItem*, const AnnotationScore&) const;
00128 
00135  bool _forceWholeGeneModel;
00136 
00137  const int _cutOff;
00138 };
00139 
00140 #endif // ANNOTATION_H