Skip to main content

Module alphabet

Module alphabet 

Source
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):

ClassProteinDNA / RNA
residueACDEFGHIKLMNPQRSTVWY + 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
ambiguityX B J ZR 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
whitespacespace, 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§

ByteClassTable
Per-byte classification and canonical spelling for one alphabet.
LetterCounts
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 space class 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, or None when the composition does not determine it.
is_whitespace
true for a WHITESPACE byte.
resolve
Resolves the alphabet from the user’s choice and the probe’s letter counts.