Molecular Interaction Analyzer#

High-performance molecular interaction analyzer for HBAT.

This module provides the main analyzer using NumPy for vectorized calculations of molecular interactions in protein structures.

class hbat.core.np_analyzer.NPMolecularInteractionAnalyzer(parameters: AnalysisParameters | None = None)[source]#

Bases: object

Analyzer for molecular interactions.

This analyzer uses vectorized NumPy operations for efficient analysis of molecular interactions in protein structures. Supports comprehensive detection of:

  • Hydrogen bonds: Classical N-H···O, O-H···O, N-H···N interactions

  • Weak hydrogen bonds: C-H···O interactions (important in protein-ligand binding)

  • Halogen bonds: C-X···A interactions where X is Cl, Br, I (default angle: 150°)

  • π interactions: Multiple subtypes including:

    • Hydrogen-π: C-H···π, N-H···π, O-H···π, S-H···π

    • Halogen-π: C-Cl···π, C-Br···π, C-I···π

  • Cooperativity chains: Networks of linked interactions

Parameters:

parameters (Optional[AnalysisParameters]) – Analysis parameters with subtype-specific cutoffs

__init__(parameters: AnalysisParameters | None = None)[source]#

Initialize analyzer with parameters.

analyze_file(pdb_file: str) bool[source]#

Analyze a PDB file for molecular interactions.

Performs comprehensive analysis of hydrogen bonds, weak hydrogen bonds (C-H···O), halogen bonds, π interactions (including subtypes: C-H···π, N-H···π, O-H···π, S-H···π, C-Cl···π, C-Br···π, C-I···π), and cooperativity chains in the provided PDB structure. Optionally applies PDB fixing to add missing atoms if enabled in parameters.

Parameters:

pdb_file (str) – Path to PDB file to analyze

Returns:

True if analysis completed successfully, False if parsing failed

Return type:

bool

Raises:

Exception – If PDB fixing fails when enabled

get_summary() Dict[str, Any][source]#

Get comprehensive analysis summary with statistics, PDB fixing info, and timing.

Returns a dictionary containing interaction counts, averages, bond type distributions, PDB fixing information (if applied), and analysis timing.

Returns:

Dictionary containing comprehensive analysis summary

Return type:

Dict[str, Any]