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

Function readPaths

MergePaths/MergeContigs.cpp:321–359  ·  view source on GitHub ↗

Read contig paths from the specified file. * @param ids [out] the string ID of the paths */

Source from the content-addressed store, hash-verified

319 * @param ids [out] the string ID of the paths
320 */
321static ContigPaths
322readPaths(const string& inPath, vector<string>* ids = NULL)
323{
324 if (ids != NULL)
325 assert(ids->empty());
326 ifstream fin(inPath.c_str());
327 if (opt::verbose > 0)
328 cerr << "Reading `" << inPath << "'..." << endl;
329 if (inPath != "-")
330 assert_good(fin, inPath);
331 istream& in = inPath == "-" ? cin : fin;
332
333 unsigned count = 0;
334 ContigPaths paths;
335 string id;
336 ContigPath path;
337 while (in >> id >> path) {
338 paths.push_back(path);
339 if (ids != NULL)
340 ids->push_back(id);
341
342 ++count;
343 if (opt::verbose > 1 && count % 1000000 == 0)
344 cerr << "Read " << count
345 << " paths. "
346 "Using "
347 << toSI(getMemoryUsage()) << "B of memory.\n";
348 }
349 if (opt::verbose > 0)
350 cerr << "Read " << count
351 << " paths. "
352 "Using "
353 << toSI(getMemoryUsage()) << "B of memory.\n";
354 if (!opt::db.empty())
355 addToDb(db, "Init_paths", count);
356 opt::pathCount = count;
357 assert(in.eof());
358 return paths;
359}
360
361/** Finds all contigs used in each path in paths, and
362 * marks them as seen in the vector seen. */

Callers 1

mainFunction · 0.70

Calls 8

assert_goodFunction · 0.85
toSIFunction · 0.85
getMemoryUsageFunction · 0.85
addToDbFunction · 0.85
emptyMethod · 0.45
c_strMethod · 0.45
push_backMethod · 0.45
eofMethod · 0.45

Tested by

no test coverage detected