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

Function readPaths

PathOverlap/PathOverlap.cpp:221–251  ·  view source on GitHub ↗

Read contig paths from the specified file. * @param g the contig adjacency graph * @param inPath the file of contig paths * @param[out] pathIDs the path IDs * @return the paths */

Source from the content-addressed store, hash-verified

219 * @return the paths
220 */
221static Paths
222readPaths(Graph& g, const string& inPath, vector<string>& pathIDs)
223{
224 typedef graph_traits<Graph>::vertex_descriptor V;
225
226 assert(pathIDs.empty());
227 ifstream fin(inPath.c_str());
228 if (opt::verbose > 0)
229 cerr << "Reading `" << inPath << "'..." << endl;
230 if (inPath != "-")
231 assert_good(fin, inPath);
232 istream& in = inPath == "-" ? cin : fin;
233
234 assert_good(in, inPath);
235 Paths paths;
236 string id;
237 ContigPath path;
238 while (in >> id >> path) {
239 if (path.empty()) {
240 // Remove this contig from the graph.
241 V u = find_vertex(id, false, g);
242 clear_vertex(u, g);
243 remove_vertex(u, g);
244 } else {
245 pathIDs.push_back(id);
246 paths.push_back(path);
247 }
248 }
249 assert(in.eof());
250 return paths;
251}
252
253typedef multimap<ContigNode, Vertex> SeedMap;
254

Callers 1

mainFunction · 0.70

Calls 8

assert_goodFunction · 0.85
find_vertexFunction · 0.50
clear_vertexFunction · 0.50
remove_vertexFunction · 0.50
emptyMethod · 0.45
c_strMethod · 0.45
push_backMethod · 0.45
eofMethod · 0.45

Tested by

no test coverage detected