Atom Utilities#
Atom Utilities
This module contains utility functions for working with PDB atoms and elements.
- hbat.utilities.atom_utils.get_element_from_pdb_atom(atom_name: str) str[source]#
Map PDB atom name to chemical element using regex patterns.
This function uses regular expressions to identify the element type from PDB atom naming conventions, handling complex cases like: - Greek letter remoteness indicators (CA, CB, CG, CD, CE, CZ, CH) - Numbered variants (C1’, H2’’, OP1, etc.) - Ion charges (CA2+, MG2+, etc.) - IUPAC hydrogen naming conventions
- Parameters:
atom_name (str) – PDB atom name (e.g., ‘CA’, ‘OP1’, ‘H2’’, ‘CA2+’)
- Returns:
Chemical element symbol (e.g., ‘C’, ‘O’, ‘H’, ‘CA’)
- Return type:
Examples
>>> get_element_from_pdb_atom('CA') 'C' >>> get_element_from_pdb_atom('OP1') 'O' >>> get_element_from_pdb_atom('CA2+') 'CA' >>> get_element_from_pdb_atom('H2'') 'H'