compareBase static method

bool compareBase(
  1. NucleotideSequence a,
  2. NucleotideSequence b,
  3. bool fuzzyComp
)

(en) Compares two NucleotideSequence by base only and returns true if they are the same.

(ja) 2つのNucleotideSequenceを塩基のみを基準に比較し、同じであればtrueを返します。

  • a : Sequence 1.
  • b : Sequence 2.
  • fuzzyComp : If true, Can contain m, r, w, s, y, k, v, h, d, b, n. If true, t and u are searched as the same.

Implementation

static bool compareBase(
    NucleotideSequence a, NucleotideSequence b, bool fuzzyComp) {
  if (a.length() != a.length()) return false;
  for (int i = 0; i < a.length(); i++) {
    if (fuzzyComp) {
      if (!a.sequence[i].base.fuzzyComparison(b.sequence[i].base)) {
        return false;
      }
    } else {
      if (a.sequence[i].base != b.sequence[i].base) return false;
    }
  }
  return true;
}