Return the length of the specified path in k-mer. */
| 287 | |
| 288 | /** Return the length of the specified path in k-mer. */ |
| 289 | static unsigned calculatePathLength(const Graph& g, |
| 290 | const ContigNode& origin, |
| 291 | const ContigPath& path, size_t prefix = 0, size_t suffix = 0) |
| 292 | { |
| 293 | if (prefix + suffix == path.size()) |
| 294 | return 0; |
| 295 | assert(prefix + suffix < path.size()); |
| 296 | int length = addProp(g, path.begin() + prefix, |
| 297 | path.end() - suffix).length; |
| 298 | |
| 299 | // Account for the overlap on the left. |
| 300 | vertex_descriptor u = prefix == 0 ? origin : path[prefix - 1]; |
| 301 | length += getDistance(g, u, path[prefix]); |
| 302 | assert(length > 0); |
| 303 | return length; |
| 304 | } |
| 305 | |
| 306 | /** Compare the lengths of two paths. */ |
| 307 | struct ComparePathLength |
no test coverage detected