Overlap_AMOS.hh

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 #ifndef __Overlap_AMOS_HH
00011 #define __Overlap_AMOS_HH 1
00012 
00013 #include "Universal_AMOS.hh"
00014 
00015 
00016 
00017 
00018 namespace AMOS {
00019 
00020 typedef char OverlapAdjacency_t;
00021 
00022 //================================================ Overlap_t ===================
00032 //==============================================================================
00033 class Overlap_t : public Universal_t
00034 {
00035 
00036 private:
00037 
00038   Size_t aHang_m;          
00039   Size_t bHang_m;          
00040   std::pair<ID_t, ID_t> reads_m;   
00041   uint32_t score_m;        
00042 
00043 
00044 protected:
00045 
00046   static const uint8_t NORMAL_BITS     = 0x1;
00047   static const uint8_t ANTINORMAL_BITS = 0x2;
00048   static const uint8_t INNIE_BITS      = 0x3;
00049   static const uint8_t OUTIE_BITS      = 0x0;
00050   static const uint8_t ADJACENCY_BITS  = 0x3;  
00051   static const uint8_t ADJACENCY_BIT   = 0x4;  
00052   static const uint8_t FLAGC_BIT       = 0x8;  
00053 
00054 
00055   //--------------------------------------------------- readRecord -------------
00056   virtual void readRecord (std::istream & fix, std::istream & var);
00057 
00058 
00059   //--------------------------------------------------- readRecordFix ----------
00060   virtual void readRecordFix (std::istream & fix);
00061 
00062   //--------------------------------------------------- writeRecord ------------
00063   virtual void writeRecord (std::ostream & fix, std::ostream & var) const;
00064 
00065 
00066 public:
00067 
00068   static const NCode_t NCODE;
00070 
00071   static const OverlapAdjacency_t NULL_ADJACENCY = 0;
00072   static const OverlapAdjacency_t NORMAL         = 'N';  
00073   static const OverlapAdjacency_t ANTINORMAL     = 'A';  
00074   static const OverlapAdjacency_t INNIE          = 'I';  
00075   static const OverlapAdjacency_t OUTIE          = 'O';  
00076 
00077 
00078   //--------------------------------------------------- Overlap_t --------------
00083   Overlap_t ( )
00084   {
00085     score_m = 0;
00086     aHang_m = bHang_m = 0;
00087     reads_m . first = reads_m . second = NULL_ID;
00088   }
00089 
00090 
00091   //--------------------------------------------------- Overlap_t --------------
00094   Overlap_t (const Overlap_t & source)
00095   {
00096     *this = source;
00097   }
00098 
00099 
00100   //--------------------------------------------------- ~Overlap_t -------------
00103   ~Overlap_t ( )
00104   {
00105 
00106   }
00107 
00108 
00109   //--------------------------------------------------- clear ------------------
00110   virtual void clear ( )
00111   {
00112     Universal_t::clear( );
00113     score_m = 0;
00114     aHang_m = bHang_m = 0;
00115     reads_m . first = reads_m . second = NULL_ID;
00116   }
00117 
00118 
00119   //--------------------------------------------------- flip -------------------
00130   void flip ( );
00131 
00132 
00133   //--------------------------------------------------- getAdjacency -----------
00143   OverlapAdjacency_t getAdjacency ( ) const;
00144 
00145 
00146   //--------------------------------------------------- getAhang ---------------
00153   Size_t getAhang ( ) const
00154   {
00155     return aHang_m;
00156   }
00157 
00158 
00159   //--------------------------------------------------- getBhang ---------------
00166   Size_t getBhang ( ) const
00167   {
00168     return bHang_m;
00169   }
00170 
00171 
00172   //--------------------------------------------------- getNCode ---------------
00173   virtual NCode_t getNCode ( ) const
00174   {
00175     return Overlap_t::NCODE;
00176   }
00177 
00178 
00179   //--------------------------------------------------- getReads ---------------
00184   std::pair<ID_t, ID_t> getReads ( ) const
00185   {
00186     return reads_m;
00187   }
00188 
00189 
00190   //--------------------------------------------------- getScore ---------------
00195   uint32_t getScore ( ) const
00196   {
00197     return score_m;
00198   }
00199 
00200 
00201   //--------------------------------------------------- isFlagC ----------------
00206   bool isFlagC ( ) const
00207   {
00208     return flags_m . nibble & FLAGC_BIT;
00209   }
00210 
00211 
00212   //--------------------------------------------------- readMessage ------------
00213   virtual void readMessage (const Message_t & msg);
00214 
00215 
00216   //--------------------------------------------------- setAdjacency -----------
00231   void setAdjacency (OverlapAdjacency_t adj);
00232 
00233 
00234   //--------------------------------------------------- setAhang ---------------
00242   void setAhang (Size_t aHang)
00243   {
00244     aHang_m = aHang;
00245   }
00246 
00247 
00248   //--------------------------------------------------- setBhang ---------------
00256   void setBhang (Size_t bHang)
00257   {
00258     bHang_m = bHang;
00259   }
00260 
00261 
00262   //--------------------------------------------------- setFlagC ---------------
00268   void setFlagC (bool flag)
00269   {
00270     if ( flag )
00271       flags_m . nibble |= FLAGC_BIT;
00272     else
00273       flags_m . nibble &= ~FLAGC_BIT;
00274   }
00275 
00276 
00277   //--------------------------------------------------- setReads ---------------
00282   void setReads (std::pair<ID_t, ID_t> reads)
00283   {
00284     reads_m = reads;
00285   }
00286 
00287 
00288   //--------------------------------------------------- setScore ---------------
00294   void setScore (uint32_t score)
00295   {
00296     score_m = score;
00297   }
00298 
00299 
00300   //--------------------------------------------------- writeMessage -----------
00301   virtual void writeMessage (Message_t & msg) const;
00302 
00303 };
00304 
00305 } // namespace AMOS
00306 
00307 #endif // #ifndef __Overlap_AMOS_HH

Generated on Mon Feb 22 17:36:27 2010 for libAMOS by  doxygen 1.4.7