FullQuality<C>::FullQuality(const Quality& qual, const Sequence& seq) { this->length = MIN(qual.length(), seq.getSequenceLength()); this->symbolCount = C::length(); this->probVector = initProbMatrix(this->symbolCount, this->length); // get the probabilities vector double* probs = qual.getProbabilities(); // loop through all elements for (size_t pos = 0; pos < this->length; ++pos) { // get the index for the actual symbol size_t symbolIndex = C::getIndex(seq.getBaseAt(pos)); double remind_p = (probs[pos] ) / ((double)(this->symbolCount - 1)); // loop through all symbols for (size_t sym = 0; sym < this->symbolCount; ++sym) { this->probVector[sym][pos] = remind_p; } this->probVector[symbolIndex][pos] = 1.0 - probs[pos]; } }