// Simple sweep through the MultiAlignment columns, looking for columns to merge and removing null // columns // // Loop over all columns. If we do not merge, advance to the next column, otherwise, stay here and // merge to the now different next column (mergeCompatible removes the column that gets merged into // the current column). // // Note that _firstColumn is never removed. The second column could be merged into the first, // and the second one then removed. void abAbacus::mergeColumns(bool highQuality) { assert(_firstColumn != NULL); abColumn *column = _firstColumn; bool somethingMerged = false; assert(column->prev() == NULL); #if 0 fprintf(stderr, "mergeColumns()--\n"); display(stderr); #endif // If we merge, update the base call, and stay here to try another merge of the now different // next column. Otherwise, we didn't merge anything, so advance to the next column. while (column->next()) { if (column->mergeWithNext(this, highQuality) == true) somethingMerged = true; else column = column->next(); } // If any merges were performed, refresh. This updates the column list. if (somethingMerged) refreshColumns(); }
void abAbacus::recallBases(bool highQuality) { //fprintf(stderr, "abAbacus::recallBases()-- highQuality=%d\n", highQuality); // Given that _firstColumn is a valid column, walk to the start of the column list. // We could use _columns[] instead. while (_firstColumn->_prevColumn != NULL) _firstColumn = _firstColumn->_prevColumn; // Number the columns, so we can make sure the _columns array has enough space. Probably not // needed to be done first, but avoids having the resize call in the next loop. for (abColumn *column = _firstColumn; column; column = column->next()) column->baseCall(highQuality); // After calling bases, we need to refresh to copy the bases from each column into // _cnsBases and _cnsQuals. refreshColumns(); }