00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 #ifndef __Link_AMOS_HH 00011 #define __Link_AMOS_HH 1 00012 00013 #include "Universal_AMOS.hh" 00014 #include <utility> 00015 00016 00017 00018 00019 namespace AMOS { 00020 00021 typedef char LinkType_t; 00022 typedef char LinkAdjacency_t; 00023 00024 //====================================================== Link_t ================ 00032 //============================================================================== 00033 class Link_t : public Universal_t 00034 { 00035 00036 private: 00037 00038 std::pair<ID_t, ID_t> nods_m; 00039 std::pair<ID_t, NCode_t> source_m; 00040 NCode_t nodtype_m; 00041 SD_t sd_m; 00042 Size_t size_m; 00043 LinkType_t type_m; 00044 00045 00046 protected: 00047 00048 static const uint8_t ADJACENCY_BIT = 0x4; 00049 static const uint8_t ADJACENCY_BITS = 0x3; 00050 static const uint8_t NORMAL_BITS = 0x1; 00051 static const uint8_t ANTINORMAL_BITS = 0x2; 00052 static const uint8_t INNIE_BITS = 0x3; 00053 static const uint8_t OUTIE_BITS = 0x0; 00054 00055 00056 //--------------------------------------------------- readRecord ------------- 00057 virtual void readRecord (std::istream & fix, std::istream & var); 00058 00059 00060 //--------------------------------------------------- readRecordFix ---------- 00061 virtual void readRecordFix (std::istream & fix); 00062 00063 00064 //--------------------------------------------------- writeRecord ------------ 00065 virtual void writeRecord (std::ostream & fix, std::ostream & var) const; 00066 00067 00068 public: 00069 00070 static const NCode_t NCODE; 00072 00073 static const LinkType_t NULL_LINK = 0; 00074 static const LinkType_t OTHER = 'X'; 00075 static const LinkType_t MATEPAIR = 'M'; 00076 static const LinkType_t OVERLAP = 'O'; 00077 static const LinkType_t PHYSICAL = 'P'; 00078 static const LinkType_t ALIGNMENT = 'A'; 00079 static const LinkType_t SYNTENY = 'S'; 00080 00081 static const LinkAdjacency_t NULL_ADJACENCY = 0; 00082 static const LinkAdjacency_t NORMAL = 'N'; 00083 static const LinkAdjacency_t ANTINORMAL = 'A'; 00084 static const LinkAdjacency_t INNIE = 'I'; 00085 static const LinkAdjacency_t OUTIE = 'O'; 00086 00087 00088 //--------------------------------------------------------- Link_t ----------- 00093 Link_t ( ) 00094 { 00095 nods_m . first = nods_m . second = source_m . first = NULL_ID; 00096 source_m . second = NULL_NCODE; 00097 nodtype_m = NULL_NCODE; 00098 sd_m = size_m = 0; 00099 type_m = NULL_LINK; 00100 } 00101 00102 00103 //--------------------------------------------------------- Link_t ----------- 00106 Link_t (const Link_t & source) 00107 { 00108 *this = source; 00109 } 00110 00111 00112 //--------------------------------------------------------- ~Link_t ---------- 00115 ~Link_t ( ) 00116 { 00117 00118 } 00119 00120 00121 //--------------------------------------------------- clear ------------------ 00122 virtual void clear ( ); 00123 00124 00125 //--------------------------------------------------- flip ------------------- 00135 void flip ( ); 00136 00137 00138 //--------------------------------------------------- getAdjacency ----------- 00150 LinkAdjacency_t getAdjacency ( ) const; 00151 00152 00153 //----------------------------------------------------- getNodes ------------- 00158 std::pair<ID_t, ID_t> getNodes ( ) const 00159 { 00160 return nods_m; 00161 } 00162 00163 00164 //--------------------------------------------------- getNCode --------------- 00165 virtual NCode_t getNCode ( ) const 00166 { 00167 return Link_t::NCODE; 00168 } 00169 00170 00171 //--------------------------------------------------- getSD ------------------ 00176 SD_t getSD ( ) const 00177 { 00178 return sd_m; 00179 } 00180 00181 00182 //--------------------------------------------------- getSize ---------------- 00187 Size_t getSize ( ) const 00188 { 00189 return size_m; 00190 } 00191 00192 00193 //--------------------------------------------------- getSource -------------- 00202 std::pair<ID_t, NCode_t> getSource ( ) const 00203 { 00204 return source_m; 00205 } 00206 00207 00208 //----------------------------------------------------- getNodeType ---------- 00215 NCode_t getNodeType( ) const 00216 { 00217 return nodtype_m; 00218 } 00219 00220 00221 //--------------------------------------------------- getType ---------------- 00228 LinkType_t getType ( ) const 00229 { 00230 return type_m; 00231 } 00232 00233 00234 //--------------------------------------------------- readMessage ------------ 00235 virtual void readMessage (const Message_t & msg); 00236 00237 00238 //--------------------------------------------------- setAdjacency ----------- 00255 void setAdjacency (LinkAdjacency_t adj); 00256 00257 00258 //----------------------------------------------------- setNodes ------------- 00267 void setNodes (std::pair<ID_t, ID_t> nods) 00268 { 00269 nods_m = nods; 00270 } 00271 00272 00273 //----------------------------------------------------- setNodeType ---------- 00281 void setNodeType (NCode_t nodtype) 00282 { 00283 nodtype_m = nodtype; 00284 } 00285 00286 00287 //--------------------------------------------------- setSD ------------------ 00293 void setSD (SD_t sd) 00294 { 00295 sd_m = sd; 00296 } 00297 00298 00299 //--------------------------------------------------- setSize ---------------- 00305 void setSize (Size_t size) 00306 { 00307 size_m = size; 00308 } 00309 00310 00311 //--------------------------------------------------- setSource -------------- 00317 void setSource (std::pair<ID_t, NCode_t> source) 00318 { 00319 source_m = source; 00320 } 00321 00322 00323 //--------------------------------------------------- setType ---------------- 00331 void setType (LinkType_t type); 00332 00333 00334 //--------------------------------------------------- writeMessage ----------- 00335 virtual void writeMessage (Message_t & msg) const; 00336 00337 }; 00338 00339 } // namespace AMOS 00340 00341 #endif // #ifndef __Link_AMOS_HH
1.4.7