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

Function readPaths

MergePaths/PathConsensus.cpp:220–258  ·  view source on GitHub ↗

Read contig paths from the specified file. * @param[in] inPath the filename of the contig paths * @param[out] ids the string ID of the paths * @param[out] isAmb whether the path contains a gap */

Source from the content-addressed store, hash-verified

218 * @param[out] isAmb whether the path contains a gap
219 */
220static ContigPaths readPaths(const string& inPath,
221 vector<string>& ids, vector<bool>& isAmb)
222{
223 assert(ids.empty());
224 assert(isAmb.empty());
225 assert(g_ambpath_contig.empty());
226 ifstream fin(inPath.c_str());
227 if (opt::verbose > 0)
228 cerr << "Reading `" << inPath << "'..." << endl;
229 if (inPath != "-")
230 assert_good(fin, inPath);
231 istream& in = inPath == "-" ? cin : fin;
232
233 ContigPaths paths;
234 string id;
235 Path path;
236 while (in >> id >> path) {
237 paths.push_back(path);
238 ids.push_back(id);
239 isAmb.push_back(false);
240
241 if (path.size() <= 2)
242 continue;
243 for (Path::iterator it = path.begin() + 2;
244 it != path.end(); ++it) {
245 ContigPath::value_type t = it[-2], u = it[-1], v = it[0];
246 if (u.ambiguous()) {
247 assert(!t.ambiguous());
248 assert(!v.ambiguous());
249 g_ambpath_contig.insert(AmbPath2Contig::value_type(
250 AmbPathConstraint(t, v, u.length()),
251 ContigPath()));
252 isAmb.back() = true;
253 }
254 }
255 }
256 assert(in.eof());
257 return paths;
258}
259
260/** Mark every contig in path as seen. */
261static void markSeen(vector<bool>& seen, const ContigPath& path,

Callers 1

mainFunction · 0.70

Calls 13

assert_goodFunction · 0.85
AmbPathConstraintClass · 0.85
ambiguousMethod · 0.80
emptyMethod · 0.45
c_strMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
lengthMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected