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 //--------------------------------------------------- writeRecord ------------ 00060 virtual void writeRecord (std::ostream & fix, std::ostream & var) const; 00061 00062 00063 public: 00064 00065 static const NCode_t NCODE; 00067 00068 static const OverlapAdjacency_t NULL_ADJACENCY; 00069 static const OverlapAdjacency_t NORMAL; 00070 static const OverlapAdjacency_t ANTINORMAL; 00071 static const OverlapAdjacency_t INNIE; 00072 static const OverlapAdjacency_t OUTIE; 00073 00074 00075 //--------------------------------------------------- Overlap_t -------------- 00080 Overlap_t ( ) 00081 { 00082 score_m = 0; 00083 aHang_m = bHang_m = 0; 00084 reads_m . first = reads_m . second = NULL_ID; 00085 } 00086 00087 00088 //--------------------------------------------------- Overlap_t -------------- 00091 Overlap_t (const Overlap_t & source) 00092 { 00093 *this = source; 00094 } 00095 00096 00097 //--------------------------------------------------- ~Overlap_t ------------- 00100 ~Overlap_t ( ) 00101 { 00102 00103 } 00104 00105 00106 //--------------------------------------------------- clear ------------------ 00107 virtual void clear ( ) 00108 { 00109 Universal_t::clear( ); 00110 score_m = 0; 00111 aHang_m = bHang_m = 0; 00112 reads_m . first = reads_m . second = NULL_ID; 00113 } 00114 00115 00116 //--------------------------------------------------- flip ------------------- 00127 void flip ( ); 00128 00129 00130 //--------------------------------------------------- getAdjacency ----------- 00140 OverlapAdjacency_t getAdjacency ( ) const; 00141 00142 00143 //--------------------------------------------------- getAhang --------------- 00150 Size_t getAhang ( ) const 00151 { 00152 return aHang_m; 00153 } 00154 00155 00156 //--------------------------------------------------- getBhang --------------- 00163 Size_t getBhang ( ) const 00164 { 00165 return bHang_m; 00166 } 00167 00168 00169 //--------------------------------------------------- getNCode --------------- 00170 virtual NCode_t getNCode ( ) const 00171 { 00172 return Overlap_t::NCODE; 00173 } 00174 00175 00176 //--------------------------------------------------- getReads --------------- 00181 std::pair<ID_t, ID_t> getReads ( ) const 00182 { 00183 return reads_m; 00184 } 00185 00186 00187 //--------------------------------------------------- getScore --------------- 00192 uint32_t getScore ( ) const 00193 { 00194 return score_m; 00195 } 00196 00197 00198 //--------------------------------------------------- isFlagC ---------------- 00203 bool isFlagC ( ) const 00204 { 00205 return flags_m . nibble & FLAGC_BIT; 00206 } 00207 00208 00209 //--------------------------------------------------- readMessage ------------ 00210 virtual void readMessage (const Message_t & msg); 00211 00212 00213 //--------------------------------------------------- setAdjacency ----------- 00228 void setAdjacency (OverlapAdjacency_t adj); 00229 00230 00231 //--------------------------------------------------- setAhang --------------- 00239 void setAhang (Size_t aHang) 00240 { 00241 aHang_m = aHang; 00242 } 00243 00244 00245 //--------------------------------------------------- setBhang --------------- 00253 void setBhang (Size_t bHang) 00254 { 00255 bHang_m = bHang; 00256 } 00257 00258 00259 //--------------------------------------------------- setFlagC --------------- 00265 void setFlagC (bool flag) 00266 { 00267 if ( flag ) 00268 flags_m . nibble |= FLAGC_BIT; 00269 else 00270 flags_m . nibble &= ~FLAGC_BIT; 00271 } 00272 00273 00274 //--------------------------------------------------- setReads --------------- 00279 void setReads (std::pair<ID_t, ID_t> reads) 00280 { 00281 reads_m = reads; 00282 } 00283 00284 00285 //--------------------------------------------------- setScore --------------- 00291 void setScore (uint32_t score) 00292 { 00293 score_m = score; 00294 } 00295 00296 00297 //--------------------------------------------------- writeMessage ----------- 00298 virtual void writeMessage (Message_t & msg) const; 00299 00300 }; 00301 00302 } // namespace AMOS 00303 00304 #endif // #ifndef __Overlap_AMOS_HH