当前位置: 首页>>代码示例>>C++>>正文


C++ Sequence::getBaseAt方法代码示例

本文整理汇总了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;
}
开发者ID:skimmy,项目名称:lib-bio,代码行数:11,代码来源:NumericKMer.cpp

示例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];
  }
}
开发者ID:Kirill94,项目名称:lib-bio,代码行数:18,代码来源:FullQuality.hpp


注:本文中的Sequence::getBaseAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。