MCPcopy Create free account
hub / github.com/BirolLab/abyss / removeRepeats

Function removeRepeats

MergePaths/MergePaths.cpp:222–255  ·  view source on GitHub ↗

Remove tandem repeats from the set of paths. * @return the removed paths */

Source from the content-addressed store, hash-verified

220 * @return the removed paths
221 */
222static set<ContigID>
223removeRepeats(ContigPathMap& paths)
224{
225 set<ContigID> repeats = findRepeats(paths);
226 if (gDebugPrint) {
227 cout << "Repeats:";
228 if (!repeats.empty()) {
229 for (set<ContigID>::const_iterator it = repeats.begin(); it != repeats.end(); ++it)
230 cout << ' ' << get(g_contigNames, *it);
231 } else
232 cout << " none";
233 cout << '\n';
234 }
235
236 unsigned removed = 0;
237 for (set<ContigID>::const_iterator it = repeats.begin(); it != repeats.end(); ++it)
238 if (paths.count(*it) > 0)
239 removed++;
240 if (removed == paths.size()) {
241 // Every path was identified as a repeat. It's most likely a
242 // cyclic sequence. Don't remove anything.
243 repeats.clear();
244 return repeats;
245 }
246
247 ostringstream ss;
248 for (set<ContigID>::const_iterator it = repeats.begin(); it != repeats.end(); ++it)
249 if (paths.erase(*it) > 0)
250 ss << ' ' << get(g_contigNames, *it);
251
252 if (opt::verbose > 0 && removed > 0)
253 cout << "Removing paths in repeats:" << ss.str() << '\n';
254 return repeats;
255}
256
257static void
258appendToMergeQ(deque<ContigNode>& mergeQ, set<ContigNode>& seen, const ContigPath& path)

Callers 2

assemblePathGraphFunction · 0.70
mainFunction · 0.70

Calls 10

eraseMethod · 0.80
findRepeatsFunction · 0.70
getFunction · 0.70
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
countMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected