pestifer.charmmff.ligand_paramgen package¶
On-the-fly CGenFF parameterization for ligands not covered by the standard CHARMM topologies.
- The pipeline:
- pestifer Residue (HETATM)
-> protonate at target pH (RDKit + Dimorphite-DL) -> write mol2 (Open Babel, format conversion only) -> shell out to the
cgenffbinary -> parse the .str output -> remap CGenFF-invented heavy-atom names back to the PDB names -> inject into the psfgen session as an extra topology stream
This subpackage builds that pipeline piece by piece.
- exception pestifer.charmmff.ligand_paramgen.LigandProtonationError[source]¶
Bases:
RuntimeErrorRaised when a ligand cannot be protonated for CGenFF parameterization.
- exception pestifer.charmmff.ligand_paramgen.RCSBLookupError[source]¶
Bases:
RuntimeErrorRaised when an RCSB SMILES lookup fails.
- pestifer.charmmff.ligand_paramgen.fetch_ligand_smiles(comp_id: str, *, timeout: float = 10.0) str[source]¶
Fetch the best-available SMILES for a PDB chemical component.
- Parameters:
comp_id – PDB chemical-component ID (e.g.
"ATP","NAG"). Case-insensitive; whitespace stripped.timeout – HTTP request timeout in seconds.
- Returns:
SMILES string. Preference order: OpenEye canonical (stereo) > CACTVS canonical (stereo) > OpenEye non-canonical > CACTVS non-canonical > any remaining
SMILES_CANONICAL> any remainingSMILES.- Return type:
- Raises:
RCSBLookupError – If the component ID is not found, the network call fails, or the response carries no SMILES descriptor.
- pestifer.charmmff.ligand_paramgen.protonate_ligand(residue: Residue, smiles: str, ph: float = 7.4) Chem.Mol[source]¶
Protonate a ligand residue at the given pH using Dimorphite-DL.
The input
residuesupplies heavy-atom coordinates and PDB atom names; thesmilessupplies bond orders and formal charges. Heavy-atom order in the returned Mol matches the input residue’s heavy-atom order, and each heavy atom carries its PDB name as the RDKit property_pdb_name. Hydrogens are placed in 3D at the protonation state appropriate forph.- Parameters:
residue – A pestifer
Residuefor the ligand. Hydrogens inresidue.atomsare ignored; only heavy atoms are used.smiles – SMILES describing the ligand’s heavy-atom skeleton and bond orders. Heavy-atom count must match the number of heavy atoms in
residue.ph – pH at which to protonate (default 7.4).
ph_minandph_maxpassed to Dimorphite-DL are both set to this value.