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

Method run

Parallel/NetworkSequenceCollection.cpp:68–284  ·  view source on GitHub ↗

Run the assembly state machine. */

Source from the content-addressed store, hash-verified

66
67/** Run the assembly state machine. */
68void NetworkSequenceCollection::run()
69{
70 /** The number of contigs and k-mer assembled. */
71 pair<size_t, size_t> numAssembled;
72
73 ofstream bubbleFile;
74
75 SetState(NAS_LOADING);
76 while (m_state != NAS_DONE) {
77 switch (m_state) {
78 case NAS_LOADING:
79 m_data.setColourSpace(
80 m_comm.receiveBroadcast());
81 loadSequences();
82 EndState();
83 SetState(NAS_WAITING);
84 m_comm.sendCheckPointMessage();
85 break;
86 case NAS_LOAD_COMPLETE:
87 {
88 m_comm.barrier();
89 pumpNetwork();
90 logger(0) << "Loaded " << m_data.size()
91 << " k-mer.\n";
92 assert(!m_data.empty());
93 m_data.setDeletedKey();
94 m_data.shrink();
95 m_comm.reduce(m_data.size());
96
97 Histogram myh
98 = AssemblyAlgorithms::coverageHistogram(m_data);
99 Histogram h(m_comm.reduce(myh.toVector()));
100 AssemblyAlgorithms::setCoverageParameters(h);
101
102 /*
103 * If we have loaded the k-mer hash table from disk, then
104 * the adjacency data for each k-mer has already been computed
105 * in the hash table.
106 *
107 * `applyKmerCoverageThreshold` would not work correctly
108 * in this case because it removes k-mer records from
109 * the hash table without attempting to update the adjacency
110 * info of neighbouring k-mers.
111 */
112 if (!m_data.isAdjacencyLoaded() && opt::kc > 0) {
113 m_comm.barrier();
114 size_t removed = AssemblyAlgorithms::applyKmerCoverageThreshold(m_data, opt::kc);
115 logger(1) << "Removed " << removed
116 << " low multiplicity k-mers" << std::endl;
117 m_comm.reduce(removed);
118 m_comm.reduce(m_data.size());
119 }
120
121 EndState();
122 SetState(NAS_WAITING);
123 break;
124 }
125 case NAS_GEN_ADJ:

Callers 1

mainFunction · 0.80

Calls 15

loadSequencesFunction · 0.85
coverageHistogramFunction · 0.85
setCoverageParametersFunction · 0.85
generateAdjacencyFunction · 0.85
erodeEndsFunction · 0.85
getNumErodedFunction · 0.85
removeMarkedFunction · 0.85
openBubbleFileFunction · 0.85
markAmbiguousFunction · 0.85
splitAmbiguousFunction · 0.85
SeqFlagEnum · 0.85

Tested by

no test coverage detected