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 #include <utility>
00015
00016
00017
00018
00019 namespace AMOS {
00020
00021 typedef char OverlapAdjacency_t;
00022
00023
00029
00030 class Overlap_t : public Universal_t
00031 {
00032
00033 public:
00034
00035 static const OverlapAdjacency_t NULL_ADJACENCY = 0;
00036 static const OverlapAdjacency_t NORMAL = 'N';
00037 static const OverlapAdjacency_t ANTINORMAL = 'A';
00038 static const OverlapAdjacency_t INNIE = 'I';
00039 static const OverlapAdjacency_t OUTIE = 'O';
00040
00041
00042 private:
00043
00044 Size_t aHang_m;
00045 Size_t bHang_m;
00046 std::pair<ID_t, ID_t> reads_m;
00047
00048
00049 protected:
00050
00051 static const uint8_t FIRST_BIT = 0x1;
00052 static const uint8_t SECOND_BIT = 0x2;
00053
00054
00055
00056 virtual void readRecord (std::istream & fix,
00057 std::istream & var);
00058
00059
00060
00061 virtual Size_t sizeVar ( ) const;
00062
00063
00064
00065 virtual void writeRecord (std::ostream & fix,
00066 std::ostream & var) const;
00067
00068
00069 public:
00070
00071
00079
00080 {
00081 return Bank_k::OVERLAP;
00082 }
00083
00084
00085
00090
00091 {
00092 aHang_m = bHang_m = 0;
00093 reads_m . first = reads_m . second = NULL_ID;
00094 }
00095
00096
00097
00100
00101 {
00102 *this = source;
00103 }
00104
00105
00106
00109
00110 {
00111
00112 }
00113
00114
00115
00116 virtual void clear ( )
00117 {
00118 Universal_t::clear( );
00119 aHang_m = bHang_m = 0;
00120 reads_m . first = reads_m . second = NULL_ID;
00121 }
00122
00123
00124
00135
00136 {
00137 OverlapAdjacency_t oa = getAdjacency( );
00138 if ( oa == NORMAL ) setAdjacency (ANTINORMAL);
00139 else if ( oa == ANTINORMAL ) setAdjacency (NORMAL);
00140
00141 Size_t tHang = aHang_m; aHang_m = bHang_m; bHang_m = tHang;
00142
00143 reads_m = make_pair (reads_m . second, reads_m . first);
00144 }
00145
00146
00147
00157
00158
00159
00160
00167
00168 {
00169 return aHang_m;
00170 }
00171
00172
00173
00180
00181 {
00182 return bHang_m;
00183 }
00184
00185
00186
00187 virtual NCode_t getNCode ( ) const
00188 {
00189 return Overlap_t::NCode( );
00190 }
00191
00192
00193
00198
00199 {
00200 return reads_m;
00201 }
00202
00203
00204
00205 virtual void readMessage (const Message_t & msg);
00206
00207
00208
00223
00224
00225
00226
00234
00235 {
00236 aHang_m = aHang;
00237 }
00238
00239
00240
00248
00249 {
00250 bHang_m = bHang;
00251 }
00252
00253
00254
00259
00260 {
00261 reads_m = reads;
00262 }
00263
00264
00265
00266 virtual void writeMessage (Message_t & msg) const;
00267
00268 };
00269
00270 }
00271
00272 #endif // #ifndef __Overlap_AMOS_HH