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

Function selectBase

Consensus/Consensus.cpp:271–291  ·  view source on GitHub ↗

Returns the most likely base found by the pile up count. */

Source from the content-addressed store, hash-verified

269
270/** Returns the most likely base found by the pile up count. */
271static char selectBase(const BaseCount& count, unsigned& sumBest,
272 unsigned& sumSecond)
273{
274 int bestBase = -1;
275 unsigned bestCount = 0;
276 unsigned secondCount = 0;
277 for (int x = 0; x < 4; x++) {
278 if (count.count[x] > bestCount) {
279 bestBase = x;
280 secondCount = bestCount;
281 bestCount = count.count[x];
282 }
283 }
284
285 sumBest += bestCount;
286 sumSecond += secondCount;
287
288 if (bestBase == -1)
289 return 'N';
290 return codeToBase(bestBase);
291}
292
293/** Convert all 'N' bases to nt's based on local information. */
294static void fixUnknown(Sequence& ntSeq, const Sequence& csSeq )

Callers 1

consensusFunction · 0.85

Calls 1

codeToBaseFunction · 0.85

Tested by

no test coverage detected