An overlap of two sequences. */
| 210 | |
| 211 | /** An overlap of two sequences. */ |
| 212 | struct Overlap : public DistanceEst { |
| 213 | unsigned overlap; |
| 214 | bool mask; |
| 215 | |
| 216 | Overlap() : overlap(UINT_MAX), mask(false) { } |
| 217 | Overlap(int) { assert(false); } |
| 218 | Overlap(const DistanceEst& est, unsigned overlap, bool mask) |
| 219 | : DistanceEst(est), overlap(overlap), mask(mask) { } |
| 220 | |
| 221 | bool operator==(const Overlap& o) const |
| 222 | { |
| 223 | return overlap == o.overlap; |
| 224 | } |
| 225 | |
| 226 | operator Distance() const |
| 227 | { |
| 228 | assert(overlap > 0); |
| 229 | return -overlap; |
| 230 | } |
| 231 | |
| 232 | friend ostream& operator<<(ostream& out, const Overlap& o) |
| 233 | { |
| 234 | return out << "d=" |
| 235 | << (o.overlap > 0 ? -(int)o.overlap : o.distance); |
| 236 | } |
| 237 | }; |
| 238 | |
| 239 | /** Create a contig representing the gap between contigs u and v. */ |
| 240 | static FastaRecord createGapContig(const Graph& g, |