Example #1
0
size_t getNumberOfDistinctPositionsWithoutGap(const SymbolList& l1, const SymbolList& l2) {
      if (l1.getAlphabet()->getAlphabetType() != l2.getAlphabet()->getAlphabetType()) throw AlphabetMismatchException("SymbolListTools::getNumberOfDistinctPositions.", l1.getAlphabet(), l2.getAlphabet());
      const Alphabet* alpha = l1.getAlphabet();
      int gapCode = alpha->getGapCharacterCode();
      size_t n = min(l1.size(), l2.size());
      size_t count = 0;
      for (size_t i = 0; i < n; i++) {
          int x = l1[i];
          int y = l2[i];
          if (alpha->isUnresolved(x)) x = gapCode;
          if (alpha->isUnresolved(x)) y = gapCode;
          if (x != gapCode && y != gapCode && x != y) count++;
      }
      return count;
}
Example #2
0
BasicSymbolList::BasicSymbolList(const SymbolList& list):
  alphabet_(list.getAlphabet()), content_(list.getContent()) {}
Example #3
0
EdSymbolList::EdSymbolList(const SymbolList& list):
  alphabet_(list.getAlphabet()), propagateEvents_(true), content_(list.getContent()), listeners_() {}