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

Function loadKmer

Assembly/LoadAlgorithm.h:12–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10 */
11template <typename Graph>
12size_t loadKmer(Graph& g, FastaReader& in)
13{
14 typedef typename graph_traits<Graph>::vertex_descriptor V;
15
16 assert(opt::rank == -1);
17 size_t count = 0;
18 for (FastaRecord rec; in >> rec;) {
19 assert(rec.seq.size() == V::length());
20 std::istringstream iss(rec.id);
21 float coverage = 1;
22 iss >> coverage;
23 assert(iss);
24 assert(iss.eof());
25 g.add(V(rec.seq), std::max(1, (int)ceilf(coverage)));
26
27 if (++count % 1000000 == 0) {
28 logger(1) << "Read " << count << " k-mer. ";
29 g.printLoad();
30 }
31 g.pumpNetwork();
32 }
33 assert(in.eof());
34 return count;
35}
36
37template <typename Graph>
38bool loadSequence(Graph* seqCollection, Sequence& seq)

Callers 1

loadSequencesFunction · 0.85

Calls 5

sizeMethod · 0.45
eofMethod · 0.45
addMethod · 0.45
printLoadMethod · 0.45
pumpNetworkMethod · 0.45

Tested by

no test coverage detected