Using pdb2pqr, abps and pymol to visualise protein electrostatics

Visualise surface charges of your protein 3D structure

Erik Breslmayr
4 min readFeb 11, 2021
Surface charges of a protein at two different pH’s. Colour ramp from blue to red, reflects negative to positive charge.
Surface charges (blue…pos, red…neg)

To generate a charge-based surface model of your protein, three different programs are needed: 1) pdb2pqr, which calculates, based on the pH given, the protonation state of amino acids (mainly histidines, aspartic acid, glutamic acid, lysine and arginine) 2) APBS, which calculates electrostatics of the protein and 3) PyMol, which can load the generated matrix file of the surface charges and visualise them by generating a colour ramp.

More infos about pdb2pqr and apbs can be found here.

pdb2pqr and apbs can be used via a web service or by downloading the programs itself. A installation guide how to install them under Linux or MacOsX is provided here. PyMol can be downloaded from its Github repository or from the Schrödinger website. The OpenSource PyMol from Github has to be compiled before it can be used, however does not require a licence compared to the release from Schrödinger.

As mentioned before the pdb2pqr and apbs for calculating the protonation state and subsequent generating the matrix file with the surface charges are easy tools and work quite well. The possibility to set pH and upload ligand data, especially for docking results or cofactor enzymes, are features which help to better understand the protein mechanism and interactions. To calculate surface charges should be one of the standard analysis techniques for protein scientiest. Therefore, this guide should help you to run this tools.

Using the Web Server

  • First you have to upload a .pdb file or to enter the pdb code of you protein.
  • After setting the pH (consider that mainly Histidines, which are often found in the active-site can play an important role. Therefore, use a pH you know from kinetic data to be the optimum or where you know that this pH is the physiological pH of your protein) I suggest to use the PROPKA mode to calculate the protonation states, because PDB2PKA needs a lot of calculation time and is only useful for small structures.
  • The force fiels can be changed in regard of working with one of the simulations software, otherwise I would recommend using PARSE.
  • Output naming can be used as it is set by default (internal naming).
  • The other options can be changed, however default values are good.
  • If you have a ligand or cofactor than you can check the ligand option, which requires to upload a .mol2 file of your ligand.

This .mol2 file has to be exported from your structure. If you upload a file, which you have downloaded from any databank, that will not work, because the xyz coordinates do not fit. pdb2pqr is not considering the ligand from the pdb file, instead it uses it from the .mol2 file. Therefore, I suggest to open your structure with the ligand in Pymol and export the selected ligand as .mol2 file. Beforehand, consider to add hydrogens to your ligand (if not already there), which will make a difference.

pdb2pqr settings with uploaded protein.pdb and ligand.mol2 file exported with pymol from the protein.pdb file
  • After you have run pdb2pqr, you will be automatically redirected to the apbs calculations.
Finished pdb2pqr: ready to download files and to run apbs
  • apbs settings can be changed, however default is good to go.
  • Start abps and download at least the .pqr and .dx.gz files.
Finished apbs: ready to download files and to run visualization
  • You can use the online visualization tool or you open the downloaded files in pymol to render the surface electrostatics.

Using the programs itself

  • If you prefer to download and install the programs itself a guide how to install pdb2pqr and apbs under Linux, MacOsX is provided here.
  • If you have succesfully installed the programs here are the commands you have to enter in a terminal, which will perform the same calculations as the web server.

pdb2pqr --with-ph=7 --ph-calc-method=propka --drop-water --apbs-input --ff=parse --ligand=ligand.mol2 protein.pdb protein.pqr

apbs --output-file=output.log

  • After running these two commands you have the .pqr file and the .pqr.dx file within the directory.

Pymol for Visualization

  • Load the .pqr and the pqr.dx file in pymol and change to surface mode.

The matrix file (.dx.gz) from the web server is compressed and has to be extracted beforehand by any archieve program, such as 7zip for Windows or by the command tar -xvf protein.dx.gz for Linux.

  • To change the surface colors to fit the surface electrostatics you have to create a color ramp based on the .dx file with a defined range and colors.

Typically, a range (or level) between -5 over 0 to +5 is chosen with colors from red over white to blue.

  • The commands to visualize the surface charges are provided here and can be simply copied to the command-line within pymol.

#first change directory with cd path/to/folderand load files

load protein.pqr
load protein.pqr.dx

#or open files by clicking: Files -> Open…

as surface
ramp_new ramp, protein.pqr, [-5, 0, 5], [red, white, blue]
set surface_color, ramp

Standard surface color and ramp color with surface charges

Special Rendering Options

Erik Breslmayr

During my PhD, I worked in the field of bioinformatics (protein modelling/simulation). Now, I want to share my experience with you.