Skip to content

module adabmDCA.alphabet

Alphabet definitions shared by lightweight and tensor-based APIs.

Global Variables

  • TOKENS_PROTEIN
  • TOKENS_RNA
  • TOKENS_DNA

function get_tokens

get_tokens(alphabet: str) → str

Return the ordered token string of an alphabet.

Args:

  • alphabet: "protein", "rna", "dna" or a custom token string, which is returned unchanged.

Returns: The tokens, gap first for the built-in alphabets ("-ACDEFGHIKLMNPQRSTVWY", "-ACGU" or "-ACGT").

Raises:

  • TypeError: If alphabet is not a string.

function detect_alphabet

detect_alphabet(sequences) → str

Select the smallest compatible standard alphabet (DNA wins ties).

All symbols must fit a standard alphabet; custom tokens are never inferred. Gap-only or empty input cannot identify an alphabet.


This file was automatically generated via lazydocs.