PDB File Parser#
PDB file parser for molecular structure analysis using pdbreader.
This module provides functionality to parse PDB (Protein Data Bank) files and extract atomic coordinates and molecular information using the pdbreader library.
- class hbat.core.pdb_parser.PDBParser[source]#
Bases:
objectParser for PDB format files using pdbreader.
This class handles parsing of PDB (Protein Data Bank) format files and converts them into HBAT’s internal atom and residue representations. Uses the pdbreader library for robust PDB format handling.
- __init__() None[source]#
Initialize PDB parser.
Creates a new parser instance with empty atom and residue lists.
- parse_file(filename: str) bool[source]#
Parse a PDB file.
Reads and parses a PDB format file, extracting all ATOM and HETATM records and converting them to HBAT’s internal representation.
- parse_lines(lines: List[str]) bool[source]#
Parse PDB format lines.
Parses PDB format content provided as a list of strings, useful for processing in-memory PDB data.
- get_atoms_by_residue(res_name: str) List[Atom][source]#
Get all atoms from residues with specific name.
- get_hydrogen_atoms() List[Atom][source]#
Get all hydrogen atoms.
- Returns:
List of all hydrogen and deuterium atoms
- Return type:
List[Atom]
- has_hydrogens() bool[source]#
Check if structure contains hydrogen atoms.
Determines if the structure has a reasonable number of hydrogen atoms compared to heavy atoms, indicating explicit hydrogen modeling.
- Returns:
True if structure appears to contain explicit hydrogens
- Return type:
- get_residue_list() List[Residue][source]#
Get list of all residues.
- Returns:
List of all residues in the structure
- Return type:
List[Residue]
- get_chain_ids() List[str][source]#
Get list of unique chain IDs.
- Returns:
List of unique chain identifiers in the structure
- Return type:
List[str]
- get_statistics() Dict[str, Any][source]#
Get basic statistics about the structure.
Provides counts of atoms, residues, chains, and element composition.
- Returns:
Dictionary containing structure statistics
- Return type:
Dict[str, Any]
- get_bonds() List[Bond][source]#
Get list of all bonds.
- Returns:
List of all bonds in the structure
- Return type:
List[Bond]