Detect
This module provides functionality to detect protonation sites in molecules using substructure matching with comprehensive error handling and validation.
ProtonationSiteDetectionError
¶
Bases: Exception
Raised when protonation site detection encounters an error.
ProtonationSiteDetector(validate_sites=True, max_sites_per_molecule=50)
¶
Robust detector for finding protonation sites in molecules.
Uses substructure matching to identify potential protonation sites based on known pKa patterns. Handles atom protection to prevent overlapping matches.
Initialize the detector with explicit configuration.
PARAMETER | DESCRIPTION |
---|---|
validate_sites
|
Whether to validate detected sites (explicit, not default)
TYPE:
|
max_sites_per_molecule
|
Maximum sites to detect per molecule (bounded)
TYPE:
|
max_sites_per_molecule = max_sites_per_molecule
¶
pka_data = PKaData()
¶
validate_sites = validate_sites
¶
find_sites(mol_record)
¶
Find protonation sites in a molecule. This is the main entry point.
PARAMETER | DESCRIPTION |
---|---|
mol_record
|
MoleculeRecord to analyze
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[MoleculeRecord, list[ProtonationSite]]
|
Tuple of (updated_mol_record, list_of_protonation_sites) |
RAISES | DESCRIPTION |
---|---|
ProtonationSiteDetectionError
|
If detection fails critically |
get_stats()
¶
reset_stats()
¶
Reset all detection statistics to zero.