Analysis Parameters#
Contains analysis parameters, default values, and validation ranges for molecular interaction analysis.
Module Overview#
Analysis parameters for HBAT molecular interaction analysis.
This module contains the AnalysisParameters class that defines all configurable parameters for hydrogen bond, halogen bond, and π interaction analysis.
- class hbat.constants.parameters.ParametersDefault[source]#
Bases:
object
Default values for molecular interaction analysis parameters.
- HB_DISTANCE_CUTOFF = 2.5#
- HB_ANGLE_CUTOFF = 120.0#
- HB_DA_DISTANCE = 3.5#
- WHB_DISTANCE_CUTOFF = 3.6#
- WHB_ANGLE_CUTOFF = 150.0#
- WHB_DA_DISTANCE = 3.5#
- XB_DISTANCE_CUTOFF = 3.9#
- XB_ANGLE_CUTOFF = 150.0#
- PI_DISTANCE_CUTOFF = 3.5#
- PI_ANGLE_CUTOFF = 110.0#
- PI_CCL_DISTANCE_CUTOFF = 3.5#
- PI_CCL_ANGLE_CUTOFF = 145#
- PI_CBR_DISTANCE_CUTOFF = 3.5#
- PI_CBR_ANGLE_CUTOFF = 155#
- PI_CI_DISTANCE_CUTOFF = 3.6#
- PI_CI_ANGLE_CUTOFF = 165.0#
- PI_CH_DISTANCE_CUTOFF = 3.5#
- PI_CH_ANGLE_CUTOFF = 110.0#
- PI_NH_DISTANCE_CUTOFF = 3.2#
- PI_NH_ANGLE_CUTOFF = 115.0#
- PI_OH_DISTANCE_CUTOFF = 3.0#
- PI_OH_ANGLE_CUTOFF = 115.0#
- PI_SH_DISTANCE_CUTOFF = 3.8#
- PI_SH_ANGLE_CUTOFF = 105.0#
- COVALENT_CUTOFF_FACTOR = 0.85#
- ANALYSIS_MODE = 'complete'#
- MAX_BOND_DISTANCE = 2.5#
- MIN_BOND_DISTANCE = 0.5#
- FIX_PDB_ENABLED = True#
- FIX_PDB_METHOD = 'pdbfixer'#
- FIX_PDB_ADD_HYDROGENS = True#
- FIX_PDB_ADD_HEAVY_ATOMS = False#
- FIX_PDB_REPLACE_NONSTANDARD = False#
- FIX_PDB_REMOVE_HETEROGENS = False#
- FIX_PDB_KEEP_WATER = True#
- class hbat.constants.parameters.AnalysisParameters(hb_distance_cutoff: float = 2.5, hb_angle_cutoff: float = 120.0, hb_donor_acceptor_cutoff: float = 3.5, whb_distance_cutoff: float = 3.6, whb_angle_cutoff: float = 150.0, whb_donor_acceptor_cutoff: float = 3.5, xb_distance_cutoff: float = 3.9, xb_angle_cutoff: float = 150.0, pi_distance_cutoff: float = 3.5, pi_angle_cutoff: float = 110.0, pi_ccl_distance_cutoff: float = 3.5, pi_ccl_angle_cutoff: float = 145, pi_cbr_distance_cutoff: float = 3.5, pi_cbr_angle_cutoff: float = 155, pi_ci_distance_cutoff: float = 3.6, pi_ci_angle_cutoff: float = 165.0, pi_ch_distance_cutoff: float = 3.5, pi_ch_angle_cutoff: float = 110.0, pi_nh_distance_cutoff: float = 3.2, pi_nh_angle_cutoff: float = 115.0, pi_oh_distance_cutoff: float = 3.0, pi_oh_angle_cutoff: float = 115.0, pi_sh_distance_cutoff: float = 3.8, pi_sh_angle_cutoff: float = 105.0, covalent_cutoff_factor: float = 0.85, analysis_mode: str = 'complete', fix_pdb_enabled: bool = True, fix_pdb_method: str = 'pdbfixer', fix_pdb_add_hydrogens: bool = True, fix_pdb_add_heavy_atoms: bool = False, fix_pdb_replace_nonstandard: bool = False, fix_pdb_remove_heterogens: bool = False, fix_pdb_keep_water: bool = True, **kwargs)[source]#
Bases:
object
Parameters for comprehensive molecular interaction analysis.
This class contains all configurable parameters for detecting and analyzing molecular interactions in protein structures. Supports multiple interaction types with subtype-specific parameters.
Hydrogen Bonds (Classical): - Strong N-H···O, O-H···O, N-H···N interactions - Default: 2.5Å H···A distance, 120° D-H···A angle
Weak Hydrogen Bonds (C-H···O): - Carbon-hydrogen donor interactions with oxygen acceptors - Default: 3.6Å H···A distance, 150° D-H···A angle - Important in protein-ligand binding and aromatic interactions
Halogen Bonds: - C-X···A interactions where X is Cl, Br, I - Default: 3.9Å X···A distance, 150° C-X···A angle (updated default)
π Interactions (Multiple Subtypes): - Hydrogen-π: C-H···π, N-H···π, O-H···π, S-H···π - Halogen-π: C-Cl···π, C-Br···π, C-I···π - Each subtype has optimized distance/angle cutoffs
- Parameters:
hb_distance_cutoff (float) – Maximum H…A distance for hydrogen bonds (Å)
hb_angle_cutoff (float) – Minimum D-H…A angle for hydrogen bonds (degrees)
hb_donor_acceptor_cutoff (float) – Maximum D…A distance for hydrogen bonds (Å)
whb_distance_cutoff (float) – Maximum H…A distance for weak hydrogen bonds (Å)
whb_angle_cutoff (float) – Minimum D-H…A angle for weak hydrogen bonds (degrees)
whb_donor_acceptor_cutoff (float) – Maximum D…A distance for weak hydrogen bonds (Å)
xb_distance_cutoff (float) – Maximum X…A distance for halogen bonds (Å)
xb_angle_cutoff (float) – Minimum C-X…A angle for halogen bonds (degrees, default: 150°)
pi_distance_cutoff (float) – Maximum H…π distance for π interactions (Å, legacy)
pi_angle_cutoff (float) – Minimum D-H…π angle for π interactions (degrees, legacy)
pi_ccl_distance_cutoff (float) – Maximum C-Cl…π distance for halogen-π interactions (Å)
pi_ccl_angle_cutoff (float) – Minimum C-Cl…π angle for halogen-π interactions (degrees)
pi_cbr_distance_cutoff (float) – Maximum C-Br…π distance for halogen-π interactions (Å)
pi_cbr_angle_cutoff (float) – Minimum C-Br…π angle for halogen-π interactions (degrees)
pi_ci_distance_cutoff (float) – Maximum C-I…π distance for halogen-π interactions (Å)
pi_ci_angle_cutoff (float) – Minimum C-I…π angle for halogen-π interactions (degrees)
pi_ch_distance_cutoff (float) – Maximum C-H…π distance for hydrogen-π interactions (Å)
pi_ch_angle_cutoff (float) – Minimum C-H…π angle for hydrogen-π interactions (degrees)
pi_nh_distance_cutoff (float) – Maximum N-H…π distance for hydrogen-π interactions (Å)
pi_nh_angle_cutoff (float) – Minimum N-H…π angle for hydrogen-π interactions (degrees)
pi_oh_distance_cutoff (float) – Maximum O-H…π distance for hydrogen-π interactions (Å)
pi_oh_angle_cutoff (float) – Minimum O-H…π angle for hydrogen-π interactions (degrees)
pi_sh_distance_cutoff (float) – Maximum S-H…π distance for hydrogen-π interactions (Å)
pi_sh_angle_cutoff (float) – Minimum S-H…π angle for hydrogen-π interactions (degrees)
covalent_cutoff_factor (float) – Factor for covalent bond detection
analysis_mode (str) – Analysis mode (‘local’ or ‘global’)
fix_pdb_enabled (bool) – Enable PDB structure fixing
fix_pdb_method (str) – PDB fixing method (‘openbabel’ or ‘pdbfixer’)
fix_pdb_add_hydrogens (bool) – Add missing hydrogen atoms (both methods)
fix_pdb_add_heavy_atoms (bool) – Add missing heavy atoms (PDBFixer only)
fix_pdb_replace_nonstandard (bool) – Replace nonstandard residues (PDBFixer only)
fix_pdb_remove_heterogens (bool) – Remove heterogens (PDBFixer only)
fix_pdb_keep_water (bool) – Keep water when removing heterogens (PDBFixer only)
- __init__(hb_distance_cutoff: float = 2.5, hb_angle_cutoff: float = 120.0, hb_donor_acceptor_cutoff: float = 3.5, whb_distance_cutoff: float = 3.6, whb_angle_cutoff: float = 150.0, whb_donor_acceptor_cutoff: float = 3.5, xb_distance_cutoff: float = 3.9, xb_angle_cutoff: float = 150.0, pi_distance_cutoff: float = 3.5, pi_angle_cutoff: float = 110.0, pi_ccl_distance_cutoff: float = 3.5, pi_ccl_angle_cutoff: float = 145, pi_cbr_distance_cutoff: float = 3.5, pi_cbr_angle_cutoff: float = 155, pi_ci_distance_cutoff: float = 3.6, pi_ci_angle_cutoff: float = 165.0, pi_ch_distance_cutoff: float = 3.5, pi_ch_angle_cutoff: float = 110.0, pi_nh_distance_cutoff: float = 3.2, pi_nh_angle_cutoff: float = 115.0, pi_oh_distance_cutoff: float = 3.0, pi_oh_angle_cutoff: float = 115.0, pi_sh_distance_cutoff: float = 3.8, pi_sh_angle_cutoff: float = 105.0, covalent_cutoff_factor: float = 0.85, analysis_mode: str = 'complete', fix_pdb_enabled: bool = True, fix_pdb_method: str = 'pdbfixer', fix_pdb_add_hydrogens: bool = True, fix_pdb_add_heavy_atoms: bool = False, fix_pdb_replace_nonstandard: bool = False, fix_pdb_remove_heterogens: bool = False, fix_pdb_keep_water: bool = True, **kwargs)[source]#
Initialize analysis parameters.
- Parameters:
hb_distance_cutoff (float) – Maximum H…A distance for hydrogen bonds (Å)
hb_angle_cutoff (float) – Minimum D-H…A angle for hydrogen bonds (degrees)
hb_donor_acceptor_cutoff (float) – Maximum D…A distance for hydrogen bonds (Å)
whb_distance_cutoff (float) – Maximum H…A distance for weak hydrogen bonds (Å)
whb_angle_cutoff (float) – Minimum D-H…A angle for weak hydrogen bonds (degrees)
whb_donor_acceptor_cutoff (float) – Maximum D…A distance for weak hydrogen bonds (Å)
xb_distance_cutoff (float) – Maximum X…A distance for halogen bonds (Å)
xb_angle_cutoff (float) – Minimum C-X…A angle for halogen bonds (degrees)
pi_distance_cutoff (float) – Maximum H…π distance for π interactions (Å)
pi_angle_cutoff (float) – Minimum D-H…π angle for π interactions (degrees)
covalent_cutoff_factor (float) – Factor for covalent bond detection
analysis_mode (str) – Analysis mode (‘local’ or ‘global’)
fix_pdb_enabled (bool) – Enable PDB structure fixing
fix_pdb_method (str) – PDB fixing method (‘openbabel’ or ‘pdbfixer’)
fix_pdb_add_hydrogens (bool) – Add missing hydrogen atoms (both methods)
fix_pdb_add_heavy_atoms (bool) – Add missing heavy atoms (PDBFixer only)
fix_pdb_replace_nonstandard (bool) – Replace nonstandard residues (PDBFixer only)
fix_pdb_remove_heterogens (bool) – Remove heterogens (PDBFixer only)
fix_pdb_keep_water (bool) – Keep water when removing heterogens (PDBFixer only)
kwargs (dict) – Additional parameters (for future extensibility)
- __repr__() str [source]#
Return string representation of the parameters object.
- Returns:
String representation showing all parameters
- Return type:
- __eq__(other) bool [source]#
Compare two AnalysisParameters objects for equality.
- Parameters:
other (AnalysisParameters) – Other AnalysisParameters object to compare
- Returns:
True if all parameters are equal
- Return type:
- __hash__() int [source]#
Return hash of the parameters object for use in sets/dicts.
- Returns:
Hash value based on all parameters
- Return type:
- to_dict() dict [source]#
Convert parameters to dictionary format.
- Returns:
Dictionary representation of all parameters
- Return type:
- classmethod from_dict(data: dict) AnalysisParameters [source]#
Create AnalysisParameters object from dictionary.
- Parameters:
data (dict) – Dictionary containing parameter values
- Returns:
New AnalysisParameters object
- Return type:
- class hbat.constants.parameters.ParameterRanges[source]#
Bases:
object
Valid ranges for analysis parameters.
- MIN_DISTANCE = 0.5#
- MAX_DISTANCE = 6#
- MIN_ANGLE = 0.0#
- MAX_ANGLE = 180.0#
- MIN_COVALENT_FACTOR = 0.0#
- MAX_COVALENT_FACTOR = 1.0#
- class hbat.constants.parameters.PDBFixingModes[source]#
Bases:
object
Available PDB structure fixing modes.
- OPENBABEL = 'openbabel'#
- PDBFIXER = 'pdbfixer'#
- ALL_METHODS = ['openbabel', 'pdbfixer']#
- ADD_HYDROGENS = 'add_hydrogens'#
- ADD_HEAVY_ATOMS = 'add_heavy_atoms'#
- REPLACE_NONSTANDARD = 'replace_nonstandard'#
- REMOVE_HETEROGENS = 'remove_heterogens'#
- OPENBABEL_OPERATIONS = ['add_hydrogens']#
- PDBFIXER_OPERATIONS = ['add_hydrogens', 'add_heavy_atoms', 'replace_nonstandard', 'remove_heterogens']#