Skip to main content

Overview

The residue_names module provides comprehensive constants for working with amino acid and nucleic acid residues in AlphaFold 3. It includes mappings, conversion functions, and standard residue type definitions. Module Path: alphafold3.constants.residue_names

Functions

letters_three_to_one

Returns the single letter name if one exists, otherwise returns the default value. Results are cached for performance.
str
Three-letter residue code (e.g., ‘ARG’, ‘MSE’, ‘ALA’)
str
required
Default value to return if the residue is not found in the mapping
Returns: Single letter code (e.g., ‘R’, ‘M’, ‘A’) or the default value Example:

Mappings

CCD_NAME_TO_ONE_LETTER

Comprehensive mapping from three-letter CCD (Chemical Component Dictionary) codes to single-letter codes. Contains over 1,400 entries including:
  • Standard amino acids (e.g., 'ALA': 'A', 'ARG': 'R')
  • Modified amino acids (e.g., 'MSE': 'M', 'SEP': 'S')
  • Nucleic acids (e.g., 'A': 'A', 'DA': 'A')
  • Non-standard residues and modifications
Example:

Protein Mappings

Maps single-letter amino acid codes to three-letter codes for the 20 standard amino acids.Example:
Inverse mapping of PROTEIN_COMMON_ONE_TO_THREE.Example:
Maps single-letter amino acid codes to integers (0-19) in alphabetical order.
Maps single-letter amino acid codes to integers (0-20), including ‘X’ for unknown.
Maps single-letter amino acid codes to integers (0-21), including ‘X’ and ’-’ (gap).

Nucleic Acid Mappings

Maps single-letter DNA codes to two-letter codes.
Maps RNA single-letter codes (A, G, C, U, N) to integers (0-4).
Maps DNA single-letter codes (A, G, C, T, N) to integers (0-4).

Polymer Type Mappings

Maps polymer residue types to their order indices (29 total: 20 amino acids + 1 unknown + 8 nucleotides).
Maps polymer residue types to their order indices including unknown (30 total).
Maps polymer residue types to their order indices including unknown and gap (31 total).
Maps polymer residue types to their order indices including all unknown types and gap (32 total).

Protein Constants

Standard Amino Acids (Interned Strings)

Special Amino Acids

Protein Type Tuples

The 20 standard protein amino acids (no unknown).
The 20 standard protein amino acids plus UNK (21 total).
Single-letter codes in alphabetical order (standard residue ordering).
Single-letter codes including ‘X’ for unknown.
Single-letter codes including ‘X’ and gap ’-’.

Nucleic Acid Constants

RNA Bases

DNA Bases

Unknown Nucleic Acids

Nucleic Acid Type Tuples

The 4 standard RNA bases.
The 4 standard DNA bases (two-letter codes).
The 4 standard DNA bases (single-letter codes).
All 8 standard nucleic acid types (4 RNA + 4 DNA).
All nucleic acid types plus one unknown type (9 total).
All nucleic acid types plus separate unknowns for RNA and DNA (10 total).
RNA bases plus unknown (5 total).
DNA bases (two-letter) plus unknown (5 total).
DNA bases (single-letter) plus unknown (5 total).

Polymer Type Constants

Polymer Type Tuples

All standard polymer types: 20 amino acids + 8 nucleotides = 28 total.
Polymer types including protein unknown: 21 amino acids + 8 nucleotides = 29 total.
Polymer types with unknowns: 21 amino acids + 9 nucleotides = 30 total.
Polymer types with gap: 20 amino acids + 1 gap + 8 nucleotides = 29 total.
Polymer types with unknown and gap: 21 amino acids + 1 gap + 9 nucleotides = 31 total.
Polymer types with all unknowns and gap: 21 amino acids + 1 gap + 10 nucleotides = 32 total.

Polymer Type Counts


Other Constants

Water Types

Standard water molecule types (H₂O and D₂O).

Unknown Types

All unknown residue types.

Usage Examples

Converting Residue Names

Working with Polymer Types

Integer Encoding