Expand description
Sequence alphabets: detection from residue composition and per-byte symbol classes.
Detection is a port of Easel’s esl_abc_GuessAlphabet() (Eddy 2011; Easel commit
07ca83ba9ef0414dba9ce0a9331d465b5eb58f2b, esl_alphabet.c, BSD licence — see
THIRD-PARTY-NOTICES), applied to the letters of the first input batch. Easel’s rules were
tuned to make no false calls on NCBI nr/nt, Pfam and Rfam; when unsure they return
“unknown”, and DiMA then asks the user for --alphabet rather than guessing.
Symbol classes (case-folded first):
| Class | Protein | DNA / RNA |
|---|---|---|
| residue | ACDEFGHIKLMNPQRSTVWY + U (selenocysteine; Böck et al. 1991) and O (pyrrolysine; Srinivasan et al. 2002) | ACGT / ACGU (T and U folded to the alphabet’s letter) |
| gap | - . _ | same |
| missing | ~ ? | same |
| ambiguity | X B J Z | R Y K M S W B D H V N X I (IUPAC-IUB; Cornish-Bowden 1985) |
| stop | * $ ^ | same (LANL “Codes and Symbols in Sequence Alignments”; Gene Cutter help) |
| frameshift | # | same |
| whitespace | space, TAB, CR, VT, FF (ignored) | same |
Every class except residue and whitespace excludes the k-mers that contain it; anything else is unknown and handled by the validation mode.
Structs§
- Byte
Class Table - Per-byte classification and canonical spelling for one alphabet.
- Letter
Counts - Counts of the letters A–Z, case-insensitive (Easel’s
ct[0..25]). - Resolution
- The alphabet decision for a run.
Constants§
- WHITESPACE
- The white-space bytes of FASTA text (D37): space, TAB, CR, VT and FF (the POSIX
spaceclass without the line feed). They are ignored inside sequence lines, and lines made only of them are skipped before the first record.
Functions§
- guess
- Easel’s
esl_abc_GuessAlphabet(): the alphabet implied by a letter composition, orNonewhen the composition does not determine it. - is_
whitespace truefor aWHITESPACEbyte.- resolve
- Resolves the alphabet from the user’s choice and the probe’s letter counts.