Return all contigs that are tandem repeats, identified as those * contigs that appear more than once in a single path. */
| 200 | * contigs that appear more than once in a single path. |
| 201 | */ |
| 202 | static set<ContigID> |
| 203 | findRepeats(const ContigPathMap& paths) |
| 204 | { |
| 205 | set<ContigID> repeats; |
| 206 | for (ContigPathMap::const_iterator pathIt = paths.begin(); pathIt != paths.end(); ++pathIt) { |
| 207 | const ContigPath& path = pathIt->second; |
| 208 | map<ContigID, unsigned> count; |
| 209 | for (ContigPath::const_iterator it = path.begin(); it != path.end(); ++it) |
| 210 | if (!it->ambiguous()) |
| 211 | count[it->contigIndex()]++; |
| 212 | for (map<ContigID, unsigned>::const_iterator it = count.begin(); it != count.end(); ++it) |
| 213 | if (it->second > 1) |
| 214 | repeats.insert(it->first); |
| 215 | } |
| 216 | return repeats; |
| 217 | } |
| 218 | |
| 219 | /** Remove tandem repeats from the set of paths. |
| 220 | * @return the removed paths |
no test coverage detected