This repository contains Python and PyMOL-based tools for investigating how the choice of coordinate origin affects the calculated dipole moment of charged proteins.
The scripts enable:
- Automated partial charge profiling across pH values.
- Dipole moment calculation from atomic partial charges.
- Comparison of dipole vectors across coordinate origins.
- Consistent, reproducible workflows using PQR structures.
| Script | Description |
|---|---|
titration_charge_profiler.py |
Scans multiple PDBs across a pH range (0–14), computes formal charge profiles, finds a representative charge state, and saves .pqr and titration plots. |
calculate_absolute_dipole.py |
PyMOL plugin to compute and visualize dipole moments using charge-weighted atomic positions. |
dipole_origin_dependence.py |
Analyzes how dipole magnitude changes when the structure is shifted to a new origin; outputs CSV comparisons and session files. |
calculate_charge_at_pH7.py |
Calculates and summarizes partial charges at pH 7 for all .pdb files in the current folder. |
centroid.py |
Utility script for calculating geometric centroids (required by dipole_origin_dependence.py). |
cgo_arrow.py |
Custom CGO arrow drawing function for PyMOL (required by calculate_absolute_dipole.py). |
Make sure pdb2pqr is installed and accessible via python -m pdb2pqr ....
python titration_charge_profiler.py *.pdb --step 0.5 --csv output.csv- Computes charge vs. pH curves (0–14) for each PDB file.
- Finds a common or best-match formal charge.
- Saves
.pqrfiles and titration plots (.png).
# In PyMOL
load your_file.pqr
calculate_dipole_absolute your_object- Computes the dipole vector based on partial charges.
- Draws a colored CGO arrow (if
cgo_arrow.pyis available). - Saves dipole information to a
.txtfile.
python dipole_origin_dependence.py- Loads all
.pqrfiles. - Calculates dipoles twice: once from original centroid, once from a shifted origin.
- Outputs
dipole_summary.csvand session files (.pse).
python calculate_charge_at_pH7.py- Converts all
.pdbfiles to.pqrusing pH 7.0. - Computes and records the total partial charge.
- Outputs
charges_at_pH7.csv.
If you use this code in your research, please cite: Islam K. Matar and Chérif F. Matta, "Origin-Dependence of Dipole Moments of Charged Proteins: Theoretical Foundations and Implications, Revisited" Journal of Computational Chemistry 46 (2025): e70207. https://doi.org/10.1002/jcc.70207
This repository is licensed under the GNU General Public License v3.0.
See LICENSE for details.