Skip to main content

guess

Function guess 

Source
pub fn guess(ct: &LetterCounts) -> Option<Alphabet>
Expand description

Easel’s esl_abc_GuessAlphabet(): the alphabet implied by a letter composition, or None when the composition does not determine it.

Rules, in order (n = total letters):

  1. n ≤ 10 → unknown (too little evidence);
  2. n > 2000 and all N → DNA (genome assemblies led by N runs);
  3. any of EFIJLOPQZ → protein;
  4. ≥ 98% ACGTN and all of A, C, G, T seen → DNA;
  5. ≥ 98% ACGUN and all of A, C, G, U seen → RNA;
  6. ≥ 98% amino-acid letters (or N, T, X), more DHKMRSVWY than ACG, and at least 15 different letters seen → protein (as written in Easel this cannot fire: when rule 3 does not apply, at most 14 of these letters can occur; kept for fidelity);
  7. otherwise unknown.