本文整理汇总了C++中Sequence::getBaseAt方法的典型用法代码示例。如果您正苦于以下问题:C++ Sequence::getBaseAt方法的具体用法?C++ Sequence::getBaseAt怎么用?C++ Sequence::getBaseAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sequence
的用法示例。
在下文中一共展示了Sequence::getBaseAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sequenceToInt
uint64_t NumericKMer::sequenceToInt(const Sequence& s) {
uint64_t kmer = 0;
for (size_t i = 0; i < k; ++i) {
kmer <<= 2;
char c = s.getBaseAt(i);
// TODO: It may be worth to add a (fast) check for 'c'
uint64_t base = DNAAlphabet2Bits::charToInt(c);
kmer |= (base & 0x03);
}
return kmer;
}
示例2: MIN
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];
}
}