pyef.geometry¶
Module Contents¶
Classes¶
Create PDB visualizations of electrostatic properties. |
- class Geometry(filexyz)¶
- getGeomInfo()¶
Input: filepathtoxyz: string of xyz filename Output: dataframe with atomic symbols and coordinates
- getGeomInfovDW()¶
Input: filepathtoxyz: string of xyz filename Output: dataframe with atomic symbols and coordinates
- getCentroidDistance(ref_xyz)¶
- getSubstrateFramePosition(idx_substrate)¶
- getBondedAtoms(atomidx)¶
Input: filepathtoxyz: string of xyz filename atomidx: integer of atom index Output: list of integers of bonded atom indices
- weak_Hbond_check(donors_weak, hydrogens, acceptors_weak, CH_bond_cutoff, HA_bond_cutoff, weak_angle_cutoff)¶
- hbond_check(donors_strong, hydrogens, acceptors_strong, hconv_cutoff, hcoor_cutoff, strong_angle_cutoff)¶
- createpdbfromcoords(charges, atoms, output_filename)¶
Input: xyz_coords: list of tuples of coordinates charges: list of charges atoms: list of atomic symbols output_filename: string of output filename
Output: .pdb file with partial charges
- getCloseHcontacts(res_atoms)¶
- countCloseContacts(res_atoms, factor)¶
- class Visualize(filexyz='None')¶
Create PDB visualizations of electrostatic properties.
This class generates PDB files with electrostatic properties (ESP, E-field, energies) stored in the B-factor column for visualization in molecular viewers like PyMOL, VMD, or Chimera.
PDB File Naming Convention Quick Reference¶
ESP: esp_{charge_type}_{structure}_atom{idx}.pdb E-field: ef_{charge_type}_{structure}_bond{i}-{j}.pdb
ef_{charge_type}_{structure}_combined.pdb
- Estab: estab_{charge_type}_{structure}_atomwise.pdb
estab_{charge_type}_{structure}_tensor_sub{N}_env{M}.pdb
Where: - {charge_type}: Hirshfeld_I, CHELPG, Becke, etc. - {structure}: Job directory name or XYZ filename - {idx}, {i}, {j}: Atom indices (0-based) - {N}, {M}: Multipole orders (1=monopole, 2=+dipole, 3=+quadrupole)
See makePDB() docstring for complete details and visualization examples.
- makePDBpercentEfield()¶
- makePDBcontributionEfield()¶
- makePDBcontributionESP()¶
- compareESP()¶
- pdb_esp()¶
- makePDB(output_filename, b_col, pdbName)¶
Generate PDB files with data in B-factor column for visualization.
Creates a PDB file from XYZ coordinates with custom values (e.g., charges, electric fields, energies) stored in the B-factor column for visualization in programs like PyMOL, VMD, or Chimera.
- Parameters:
output_filename (str) – Path to input file containing atom data (typically charges or multipoles)
b_col (array-like) – Values to store in B-factor column (0-indexed, length = number of atoms) Examples: partial charges, E-field magnitudes, energy contributions
pdbName (str) – Output PDB filename
Conventions (Output PDB Naming) –
------------------------------ –
names (PyEF automatically generates PDB files with descriptive) –
Potential) (**ESP (Electrostatic) –
Format (-) –
Example (-) –
B-factor (-) –
bond) (**Electric Field (per) –
Format –
Example –
B-factor –
(combined (**Electric Field) –
bonds) (all) –
Format –
Example –
B-factor –
(atomwise) (**Electrostatic Stabilization) –
Format –
Example –
B-factor –
formalism) (**Electrostatic Stabilization (tensor) –
Format –
Example –
B-factor –
Notes
All atom indices in filenames use 0-based indexing
Structure name is derived from the job directory or XYZ filename
Charge type indicates the partitioning scheme (Hirshfeld_I, CHELPG, etc.)
B-factor values can be positive or negative depending on the property
In PyMOL:
` load esp_Hirshfeld_I_complex_atom25.pdb spectrum b, blue_white_red, minimum=-10, maximum=10 `In VMD:
` mol new esp_Hirshfeld_I_complex_atom25.pdb mol modcolor 0 0 Beta `
- diff_pdbs(initial_pdb, change_pdb, new_pdb_name, new_to_old_map='None')¶