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

Function readPaths

MergePaths/MergePaths.cpp:799–830  ·  view source on GitHub ↗

Read a set of paths from the specified file. */

Source from the content-addressed store, hash-verified

797
798/** Read a set of paths from the specified file. */
799static ContigPathMap
800readPaths(const Lengths& lengths, const string& filePath)
801{
802 if (opt::verbose > 0)
803 cerr << "Reading `" << filePath << "'..." << endl;
804 ifstream in(filePath.c_str());
805 assert_good(in, filePath);
806
807 unsigned tooSmall = 0;
808 ContigPathMap paths;
809 std::string name;
810 ContigPath path;
811 while (in >> name >> path) {
812 // Ignore seed contigs shorter than the threshold length.
813 ContigID id(get(g_contigNames, name));
814 unsigned len = lengths[id] + opt::k - 1;
815 if (len < opt::seedLen) {
816 tooSmall++;
817 continue;
818 }
819
820 bool inserted = paths.insert(make_pair(id, path)).second;
821 assert(inserted);
822 (void)inserted;
823 }
824 assert(in.eof());
825
826 if (opt::seedLen > 0)
827 cout << "Ignored " << tooSmall << " paths whose seeds are shorter than " << opt::seedLen
828 << " bp.\n";
829 return paths;
830}
831
832/** Store it in out and increment it.
833 * @return true if out != last

Callers 1

mainFunction · 0.70

Calls 5

assert_goodFunction · 0.85
getFunction · 0.70
c_strMethod · 0.45
insertMethod · 0.45
eofMethod · 0.45

Tested by

no test coverage detected