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 //--------------------------------------------------- writeRecord ------------ 00061 virtual void writeRecord (std::ostream & fix, std::ostream & var) const; 00062 00063 00064 public: 00065 00066 static const NCode_t NCODE; 00068 00069 static const LinkType_t NULL_LINK; 00070 static const LinkType_t OTHER; 00071 static const LinkType_t MATEPAIR; 00072 static const LinkType_t OVERLAP; 00073 static const LinkType_t PHYSICAL; 00074 static const LinkType_t ALIGNMENT; 00075 static const LinkType_t SYNTENY; 00076 00077 static const LinkAdjacency_t NULL_ADJACENCY; 00078 static const LinkAdjacency_t NORMAL; 00079 static const LinkAdjacency_t ANTINORMAL; 00080 static const LinkAdjacency_t INNIE; 00081 static const LinkAdjacency_t OUTIE; 00082 00083 00084 //--------------------------------------------------------- Link_t ----------- 00089 Link_t ( ) 00090 { 00091 nods_m . first = nods_m . second = source_m . first = NULL_ID; 00092 source_m . second = NULL_NCODE; 00093 nodtype_m = NULL_NCODE; 00094 sd_m = size_m = 0; 00095 type_m = NULL_LINK; 00096 } 00097 00098 00099 //--------------------------------------------------------- Link_t ----------- 00102 Link_t (const Link_t & source) 00103 { 00104 *this = source; 00105 } 00106 00107 00108 //--------------------------------------------------------- ~Link_t ---------- 00111 ~Link_t ( ) 00112 { 00113 00114 } 00115 00116 00117 //--------------------------------------------------- clear ------------------ 00118 virtual void clear ( ); 00119 00120 00121 //--------------------------------------------------- flip ------------------- 00131 void flip ( ); 00132 00133 00134 //--------------------------------------------------- getAdjacency ----------- 00146 LinkAdjacency_t getAdjacency ( ) const; 00147 00148 00149 //----------------------------------------------------- getNodes ------------- 00154 std::pair<ID_t, ID_t> getNodes ( ) const 00155 { 00156 return nods_m; 00157 } 00158 00159 00160 //--------------------------------------------------- getNCode --------------- 00161 virtual NCode_t getNCode ( ) const 00162 { 00163 return Link_t::NCODE; 00164 } 00165 00166 00167 //--------------------------------------------------- getSD ------------------ 00172 SD_t getSD ( ) const 00173 { 00174 return sd_m; 00175 } 00176 00177 00178 //--------------------------------------------------- getSize ---------------- 00183 Size_t getSize ( ) const 00184 { 00185 return size_m; 00186 } 00187 00188 00189 //--------------------------------------------------- getSource -------------- 00198 std::pair<ID_t, NCode_t> getSource ( ) const 00199 { 00200 return source_m; 00201 } 00202 00203 00204 //----------------------------------------------------- getNodeType ---------- 00211 NCode_t getNodeType( ) const 00212 { 00213 return nodtype_m; 00214 } 00215 00216 00217 //--------------------------------------------------- getType ---------------- 00224 LinkType_t getType ( ) const 00225 { 00226 return type_m; 00227 } 00228 00229 00230 //--------------------------------------------------- readMessage ------------ 00231 virtual void readMessage (const Message_t & msg); 00232 00233 00234 //--------------------------------------------------- setAdjacency ----------- 00251 void setAdjacency (LinkAdjacency_t adj); 00252 00253 00254 //----------------------------------------------------- setNodes ------------- 00263 void setNodes (std::pair<ID_t, ID_t> nods) 00264 { 00265 nods_m = nods; 00266 } 00267 00268 00269 //----------------------------------------------------- setNodeType ---------- 00277 void setNodeType (NCode_t nodtype) 00278 { 00279 nodtype_m = nodtype; 00280 } 00281 00282 00283 //--------------------------------------------------- setSD ------------------ 00289 void setSD (SD_t sd) 00290 { 00291 sd_m = sd; 00292 } 00293 00294 00295 //--------------------------------------------------- setSize ---------------- 00301 void setSize (Size_t size) 00302 { 00303 size_m = size; 00304 } 00305 00306 00307 //--------------------------------------------------- setSource -------------- 00313 void setSource (std::pair<ID_t, NCode_t> source) 00314 { 00315 source_m = source; 00316 } 00317 00318 00319 //--------------------------------------------------- setType ---------------- 00327 void setType (LinkType_t type); 00328 00329 00330 //--------------------------------------------------- writeMessage ----------- 00331 virtual void writeMessage (Message_t & msg) const; 00332 00333 }; 00334 00335 } // namespace AMOS 00336 00337 #endif // #ifndef __Link_AMOS_HH