# PDBQT file format explained

> A PDBQT file is a PDB-like text file that adds a partial charge, an AutoDock atom type and a torsion tree to every molecule AutoDock Vina docks. Read one line by line, see which parts change a Vina score, and convert PDB and SDF files without losing chemistry.

## What is a PDBQT file?

A PDBQT file is a plain-text structure file that AutoDock and AutoDock Vina read as input. It is a PDB file with two extra fields on every atom, a partial charge (Q) and an AutoDock atom type (T), plus keywords that say which bonds can rotate. Vina keeps the format for compatibility with the AutoDock tools, and its FAQ is blunt that PDBQT is not a standard structure format.

The number a docking run prints depends on who wrote that file. We prepared the imatinib ligand from the c-Abl kinase structure 1IEP five ways and scored each one against the same receptor, in the same pose, with Vina 1.2.7. The scores ran from −12.015 to −13.055 kcal/mol. That spread of 1.04 kcal/mol would be a 5.8-fold difference in Kd if the score were a true ΔG, and nothing changed except the PDBQT.

Two things in the file explain nearly all of it: which hydrogens were kept and typed as donors, and how many rotatable bonds the torsion tree declares. The partial charges, which look important, did not move the score at all. The sections below read a file line by line, then return to the five preparations.

## Anatomy of a PDBQT file

Here is the start of the PDBQT that Meeko, the preparation package the Vina tutorial uses, wrote for imatinib from the tutorial's SDF. The first block is the root, the next is the first rotatable branch, and the last line is the torsion count. Lines are cut to 70 characters and the middle of the file is left out.
```text
REMARK SMILES Cc1ccc(NC(=O)c2ccc(CN3CC[NH+](C)CC3)cc2)cc1Nc1nccc(-c2cccnc2)n1
REMARK SMILES IDX 6 1 7 2 8 3 5 5 24 6 2 7 23 8 3 9 4 10 1 11 25 12 26 14
REMARK H PARENT 6 4 25 13 17 40
ROOT
ATOM      1  N   UNL     1      16.600  51.810  14.798  1.00  0.00    -0.322 N
ATOM      2  C   UNL     1      15.629  51.747  15.784  1.00  0.00     0.255 C
ATOM      3  O   UNL     1      14.789  52.612  15.983  1.00  0.00    -0.269 OA
ATOM      4  H   UNL     1      17.359  51.117  14.866  1.00  0.00     0.170 HD
ENDROOT
BRANCH   1   5
ATOM      5  C   UNL     1      16.678  52.727  13.688  1.00  0.00     0.043 A
ATOM      6  C   UNL     1      15.822  54.641  12.322  1.00  0.00     0.046 A
...
ENDBRANCH   1   5
...
TORSDOF 7
```
<caption><strong>Table 1. The keywords in a ligand PDBQT file.</strong> Line formats follow the AutoDock 4.2.6 user guide; the Meeko REMARK lines are what its version 0.7.1 wrote for this ligand.</caption>
  <thead>
    <tr>
      <th scope="col">Line</th>
      <th scope="col">What it holds</th>
      <th scope="col">In the imatinib file</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>`REMARK`</td>
      <td>Free text. Meeko writes the ligand's SMILES and an atom map here</td>
      <td>Three REMARK lines before the first atom</td>
    </tr>
    <tr>
      <td>`ROOT` and `ENDROOT`</td>
      <td>The rigid core that does not move relative to itself</td>
      <td>Four atoms: the amide N, C, O and its hydrogen</td>
    </tr>
    <tr>
      <td>`ATOM`</td>
      <td>Serial number, name, coordinates, charge and AutoDock atom type</td>
      <td>40 atoms: 37 heavy atoms and 3 polar hydrogens</td>
    </tr>
    <tr>
      <td>`BRANCH` and `ENDBRANCH`</td>
      <td>A group of atoms that rotates about one bond, named by the two atoms of the bond</td>
      <td>7 branches, some nested inside others</td>
    </tr>
    <tr>
      <td>`TORSDOF`</td>
      <td>The number of torsional degrees of freedom</td>
      <td>7</td>
    </tr>
  </tbody>

### Atom lines: coordinates, charge and type

An atom line follows the PDB layout up to the temperature factor. Then the format replaces columns 67 to 76 with the partial charge and puts the AutoDock atom type, one or two letters, in columns 78 and 79. Everything else, from the serial number to the chain and residue fields, is the same as in a [PDB file](/guides/open-pdb-file).

There are no bond records. The AutoDock tools neither recognize nor write `CONECT` lines, so a PDBQT file never says which atoms are bonded, and it cannot say whether a bond is single or double. The torsion tree implies connectivity only for the rotatable bonds. Any program that wants the chemistry back has to guess it or carry it somewhere else.

### AutoDock atom types

The atom type encodes what an atom can do in the scoring function, not its element or hybridization. Carbon is split into aliphatic and aromatic, nitrogen and oxygen into hydrogen-bond acceptors and non-acceptors, and hydrogen into donors and non-donors.

  <caption><strong>Table 2. Common AutoDock atom types.</strong> Meanings follow the comments in the default atomic parameter file printed in the AutoDock 4.2.6 user guide, which also lists halogens, phosphorus and several metal ions.</caption>
  <thead>
    <tr>
      <th scope="col">Type</th>
      <th scope="col">Meaning</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>`C`</td>
      <td>Aliphatic carbon</td>
    </tr>
    <tr>
      <td>`A`</td>
      <td>Aromatic carbon</td>
    </tr>
    <tr>
      <td>`N`</td>
      <td>Nitrogen that does not accept hydrogen bonds</td>
    </tr>
    <tr>
      <td>`NA`</td>
      <td>Nitrogen that accepts one hydrogen bond, with a direction</td>
    </tr>
    <tr>
      <td>`NS`</td>
      <td>Nitrogen acceptor with a spherical (undirected) hydrogen bond</td>
    </tr>
    <tr>
      <td>`OA`</td>
      <td>Oxygen that accepts two hydrogen bonds</td>
    </tr>
    <tr>
      <td>`OS`</td>
      <td>Oxygen acceptor with a spherical hydrogen bond</td>
    </tr>
    <tr>
      <td>`SA`</td>
      <td>Sulfur that accepts hydrogen bonds</td>
    </tr>
    <tr>
      <td>`S`</td>
      <td>Sulfur that does not accept hydrogen bonds</td>
    </tr>
    <tr>
      <td>`HD`</td>
      <td>Hydrogen that donates a hydrogen bond</td>
    </tr>
    <tr>
      <td>`H`</td>
      <td>Hydrogen that does not donate</td>
    </tr>
  </tbody>

In the imatinib file, Meeko's types are 21 `A`, 8 `C`, 3 `N`, 4 `NA`, 1 `OA` and 3 `HD`. The four `NA` atoms are the two pyrimidine nitrogens, the pyridine nitrogen and the benzyl nitrogen of the piperazine. The protonated piperazine nitrogen is plain `N`, but it carries one of the three `HD` hydrogens.

### Hydrogens

PDBQT keeps polar hydrogens and removes the nonpolar ones, merging their charges into the carbons they were bonded to. The 69-atom SDF for imatinib, with 32 hydrogens, becomes a 40-atom file. Of its 32 hydrogens, 3 sit on nitrogen and survive; the other 29 are merged away.

Vina scores only heavy atoms, which its FAQ calls a united-atom approach, but it reads the hydrogens that remain to decide which heavy atoms can donate or accept hydrogen bonds. A missing polar hydrogen is therefore not a cosmetic gap. It changes how Vina types the atom it was attached to.

### The torsion tree

Flexibility is written as a tree. The root is the central rigid portion, and each `BRANCH` line names the bond a group rotates about: the first number is the atom in the parent group, the second is the first atom of the moving group. Branches nest, and nested rotations are applied from the leaves back to the root.

Because the tree is built from atom order, the `ATOM` records have to be written in branch order, which is why a PDBQT file rarely lists atoms in the order of the molecule that produced it. `TORSDOF` holds the number of rotatable bonds. In AutoDock 4.2 it counts every rotatable bond, including hydroxyl and other groups where only hydrogens move, and excludes bonds in rings.

The format has limits. AutoDock 4 is compiled for at most 32 rotatable bonds, and its guide says the program is effective for roughly 10. Vina's manual says it sets no artificial limit on the number of torsions, but it divides its score by a term that grows with the torsion count, a point the [Vina score guide](/guides/vina-score) works through.

### Receptor and flexible residue files

A receptor file is the same format without the tree. Meeko's PDBQT for the 1IEP receptor has 2,702 atoms, of which 473 are polar hydrogens, and no `ROOT` or `BRANCH` lines at all, because the receptor is rigid.

When side chains are flexible, AutoDock and Vina use a second file in which each flexible residue sits between `BEGIN_RES` and `END_RES`, with its alpha carbon as the root. The atoms in that file must be left out of the rigid receptor file.

### Output files from Vina

Vina writes every pose into one multi-model PDBQT, each pose between `MODEL` and `ENDMDL`. In the file we generated, each model begins with a `REMARK VINA RESULT` line holding the affinity in kcal/mol and two RMSD bounds, then lines for the intermolecular and intramolecular energy. The RMSD values are measured against the best pose using movable heavy atoms only.

Poses docked from a Meeko file keep its `REMARK SMILES` header. That header is how a pose can be turned back into an SDF with its bond orders and charges.

## One ligand, five PDBQT files

The ligand was imatinib, the Vina tutorial's own example, and the receptor was the tutorial's hydrogen-added c-Abl structure from 1IEP.

We made five ligand files with Meeko 0.7.1 and Open Babel 3.2.1: Meeko from the tutorial SDF, Meeko from the same SDF with `--flexible_amides`, Open Babel from the same SDF, and Open Babel from the crystal ligand's PDB records (chain A, 37 heavy atoms) with and without the `-h` option that keeps hydrogens.

We scored each file in place with the Vina 1.2.7 Python bindings, with no optimization and no docking, in a 20 Å box centered at 15.190, 53.903, 16.917.

The receptor was prepared two ways, once by Meeko and once by Open Babel with the rigid option. All five ligands scored identically against both receptors to the third decimal, so the table below is about the ligand file alone. (Meeko 0.7.1 stopped on one out-of-order hydrogen line in the tutorial receptor, Ser 438. We moved that line next to its residue.)

  <caption><strong>Table 3. The same imatinib pose, scored from five PDBQT files.</strong> Vina 1.2.7 rescoring of the crystal pose against the 1IEP receptor, no optimization. N_rot is the rotatable-bond count implied by dividing the intermolecular energy by the score; it is our calculation, not a value read from the files.</caption>
  <thead>
    <tr>
      <th scope="col">How the ligand PDBQT was made</th>
      <th scope="col">N_rot implied</th>
      <th scope="col">Intermolecular energy</th>
      <th scope="col">Vina score</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Meeko, from the SDF</td>
      <td>7</td>
      <td>−17.634</td>
      <td>−12.513</td>
    </tr>
    <tr>
      <td>Meeko, from the SDF, flexible amides on</td>
      <td>8</td>
      <td>−17.634</td>
      <td>−12.015</td>
    </tr>
    <tr>
      <td>Open Babel, from the SDF</td>
      <td>6</td>
      <td>−17.634</td>
      <td>−13.055</td>
    </tr>
    <tr>
      <td>Open Babel, from the crystal PDB records</td>
      <td>6</td>
      <td>−16.364</td>
      <td>−12.115</td>
    </tr>
    <tr>
      <td>Open Babel, from the crystal PDB records, hydrogens kept</td>
      <td>6</td>
      <td>−16.786</td>
      <td>−12.427</td>
    </tr>
  </tbody>

The three files made from the SDF share one intermolecular energy, −17.634 kcal/mol, so Vina saw the same atoms in the same places. They differ in the divisor. Dividing −17.634 by 1 + 0.0585 × N_rot gives −12.511 for seven rotatable bonds, −13.052 for six and −12.012 for eight, each within 0.003 of the reported score.

The Meeko and Open Babel files disagree by one rotatable bond. Meeko keeps amide bonds rigid by default, and its help text warns against making them flexible; turning them on adds one torsion and moves the score by 0.498 kcal/mol, about a 2.3-fold change in Kd on the same reading. None of these is the wrong file. They are different torsion models, and a score only means something against files made the same way.

The two PDB-derived rows lose something else. Starting from the crystal ligand's PDB records, Open Babel had no hydrogens to work with, so the file has no donor hydrogens and the intermolecular energy drops by 1.270. Adding hydrogens with `-h` recovers about a third of that.

That file has two polar hydrogens where Meeko kept three. Meeko's third polar hydrogen sits on the protonated piperazine nitrogen, a +1 charge that the SDF carried and the crystal PDB records do not.

### What Vina ignored, and what it did not

To separate the pieces, we edited the Meeko file three ways and rescored. Setting every partial charge to zero changed nothing, and the score stayed −12.513. Renaming every aromatic `A` carbon to aliphatic `C` also changed nothing in this ligand. Renaming the three `HD` hydrogens to plain `H`, the type for a hydrogen that cannot donate, moved the score to −11.246, a loss of 1.267 kcal/mol.

That matches the Vina FAQ, which says Vina ignores user-supplied partial charges and handles electrostatics through its hydrophobic and hydrogen-bonding terms. The charges still matter if you score with the AutoDock4 force field, so they are worth getting right, but they are not why two Vina PDBQT files disagree.

### The pose survived every preparation

Rescoring held the pose fixed. We also redocked four of the ligand files with Vina 1.2.7, exhaustiveness 32 and seed 42, in the same box. Every top pose landed within 0.44 Å of the crystal ligand (0.36 Å for Meeko, 0.25 Å with flexible amides, 0.36 Å for Open Babel from the SDF and 0.44 Å from the PDB records), measured on heavy atoms with atoms of the same element matched to minimize the distance.

Top scores were −13.251, −12.809, −13.871 and −13.583. So the preparation route barely changed where Vina put the ligand and changed what it said the pose was worth. That is the same lesson as a [passed redocking test](/guides/redocking-docking-validation): getting the pose right and getting the number right are separate questions.

### Getting the chemistry back

The last test is the way home. Meeko's `mk_export.py` rebuilt the top Meeko pose as an SDF whose SMILES matched the input exactly, including the +1 on the piperazine nitrogen. The Vina documentation explains why: Meeko stores the SMILES in the header, while other tools try to guess bond orders from PDBQT, which it calls impossible for some molecules.

Open Babel's PDBQT to SDF conversion of the two poses prepared from the protonated SDF produced files that RDKit refused to read, because the piperazine nitrogen had four bonds and no charge. The pose prepared from the PDB records read fine, but as the neutral amine, which is not the molecule we started with.

## Making a PDBQT file

Prepare the ligand from a 3D SDF whose hydrogens and charge state are the ones you intend to dock, because a PDBQT file freezes both. The Vina tutorial uses Meeko for this, with `mk_prepare_ligand.py -i ligand.sdf -o ligand.pdbqt`. The [SDF to PDBQT converter](/app/sdf-to-pdbqt) runs that preparation online, and [SMILES to PDBQT](/app/smiles-to-pdbqt) builds a 3D conformer first. Read the [SDF file guide](/guides/sdf-file) for what to check in the input.

The receptor goes through Meeko too, after you remove waters and ligands you do not want and make sure hydrogens are present:
```bash
mk_prepare_receptor.py -i receptor.pdb -o receptor -p -v \
  --box_size 20 20 20 --box_center 15.190 53.903 16.917
```
The command writes the receptor PDBQT with polar hydrogens and charges, plus the box as a text file Vina can read. The hosted [AutoDock Vina](/app/autodock-vina) tool does both steps, including a [PDB2PQR](/app/pdb2pqr) repair of missing atoms when needed. For the whole workflow, see the [Vina tutorial](/guides/autodock-vina-tutorial).

### PDB to PDBQT

For a receptor, PDB to PDBQT is the normal route, and it works when the structure has hydrogens, one chosen alternate location per atom and nothing you do not want to dock to. A [mmCIF file](/guides/cif-file) from the PDB needs the same care.

For a ligand, it is the route to avoid. The Vina documentation strongly advises against preparing small molecules from PDB files, since PDB carries no bond connections. Our crystal-ligand rows in Table 3 show the cost: the hydrogens and the charge were gone before PDBQT began.

Open Babel can write the file with `obabel ligand.pdb -O ligand.pdbqt`, and options such as `-xr` for rigid output and `-xh` to preserve hydrogens, but it only converts what the input contains.

Charges are a smaller trap. Our Open Babel files carried zero in every charge column by default, and asking for `--partialcharge gasteiger` filled them in. For Vina scoring the difference did not show up above, so check the charge column only if you plan to run AutoDock4 scoring.

### Converting to and from PDBQT

  <caption><strong>Table 4. What each PDBQT conversion keeps and what to do about it.</strong> Based on the experiments above and the Vina and AutoDock documentation.</caption>
  <thead>
    <tr>
      <th scope="col">Conversion</th>
      <th scope="col">What happens</th>
      <th scope="col">What to do</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>SDF or MOL2 to PDBQT</td>
      <td>Keeps coordinates and chemistry, adds types, charges and a torsion tree. Merges nonpolar hydrogens</td>
      <td>Start from a 3D file in the intended protonation state, then use a ligand preparation tool</td>
    </tr>
    <tr>
      <td>SMILES to PDBQT</td>
      <td>Builds a new 3D conformer first, so the starting geometry is not experimental</td>
      <td>Treat the pose as a starting point and dock rather than rescore</td>
    </tr>
    <tr>
      <td>PDB to PDBQT, ligand</td>
      <td>Bond orders, charge and often hydrogens are guessed or missing</td>
      <td>Rebuild the ligand from an SDF or SMILES and use the PDB only for coordinates</td>
    </tr>
    <tr>
      <td>PDB to PDBQT, receptor</td>
      <td>Works if hydrogens, alternate locations and waters are handled first</td>
      <td>Repair and protonate before conversion, then check the polar hydrogens</td>
    </tr>
    <tr>
      <td>PDBQT to SDF</td>
      <td>Exact if Meeko wrote the SMILES header, a guess for other files</td>
      <td>Keep the Vina output file and export with Meeko, or use the [PDBQT to SDF converter](/app/pdbqt-to-sdf)</td>
    </tr>
    <tr>
      <td>PDBQT to PDB</td>
      <td>Coordinates survive, charge and atom type are dropped, and poses stay as separate models</td>
      <td>Fine for viewing in the [PDB viewer](/app/pdb-viewer); not a source for chemistry</td>
    </tr>
  </tbody>

When you compare ligands, prepare them all the same way. Mixing a Meeko file with an Open Babel file puts a rotatable-bond difference of one or more into the comparison before docking begins, and the [docking score is not a binding affinity](/guides/docking-score-binding-energy-affinity) to begin with.

## PDBQT tools on ProteinIQ

Prepare the ligand first, dock second and convert the poses back last. [Dimorphite-DL](/app/dimorphite-dl) comes before all of them when the charge state is in doubt.

  <caption><strong>Table 5. PDBQT and docking tools on ProteinIQ.</strong></caption>
  <thead>
    <tr>
      <th scope="col">Task</th>
      <th scope="col">Tool</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Choose the charge states a ligand takes near physiological pH</td>
      <td>[Dimorphite-DL](/app/dimorphite-dl)</td>
    </tr>
    <tr>
      <td>Make a ligand PDBQT from an SDF</td>
      <td>[SDF to PDBQT](/app/sdf-to-pdbqt)</td>
    </tr>
    <tr>
      <td>Make a ligand PDBQT from a SMILES string</td>
      <td>[SMILES to PDBQT](/app/smiles-to-pdbqt)</td>
    </tr>
    <tr>
      <td>Repair a receptor and add hydrogens before docking</td>
      <td>[PDB2PQR](/app/pdb2pqr)</td>
    </tr>
    <tr>
      <td>Dock and score, with receptor and ligand preparation included</td>
      <td>[AutoDock Vina](/app/autodock-vina)</td>
    </tr>
    <tr>
      <td>Turn Vina poses back into chemistry</td>
      <td>[PDBQT to SDF](/app/pdbqt-to-sdf)</td>
    </tr>
    <tr>
      <td>Convert other format pairs, add hydrogens or set a pH</td>
      <td>[Open Babel](/app/open-babel)</td>
    </tr>
    <tr>
      <td>Look at a PDBQT structure in the browser</td>
      <td>[PDB viewer](/app/pdb-viewer)</td>
    </tr>
  </tbody>

More on choosing a docking program is in the [molecular docking](/use-cases/molecular-docking) use case, and the other small-molecule formats are compared in the [chemical file formats](/guides/chemical-file-formats) guide.

## Frequently asked questions

### What is a PDBQT file?

A PDBQT file is a plain-text structure file used by AutoDock and AutoDock Vina. It is a PDB file with a partial charge and an AutoDock atom type on every atom, plus `ROOT`, `BRANCH` and `TORSDOF` lines that describe which bonds rotate.

### What does PDBQT stand for?

It is PDB plus Q for partial charge and T for atom type. Those two fields are what the format adds to a standard PDB file.

### How do I convert PDB to PDBQT?

For a receptor, add hydrogens, choose one alternate location per atom, remove waters and ligands you do not want, then run Meeko's `mk_prepare_receptor.py`. For a ligand, avoid starting from PDB, because it has no bond information; rebuild the ligand from an SDF or SMILES and prepare that instead.

### How do I convert SDF to PDBQT?

Use a ligand preparation tool rather than a plain format converter, because PDBQT needs atom types, charges and a torsion tree. The Vina tutorial uses `mk_prepare_ligand.py -i ligand.sdf -o ligand.pdbqt`. Start from a 3D SDF with the protonation state you intend to dock.

### Does AutoDock Vina use the partial charges in a PDBQT file?

No. The Vina FAQ says it ignores user-supplied partial charges and treats electrostatics through its hydrophobic and hydrogen-bonding terms. In our imatinib test, setting every charge to zero left the score at −12.513 kcal/mol. AutoDock4 scoring does use them.

### Can a PDBQT file hold more than one molecule?

An input file describes one ligand. Vina's output file holds several poses of it, one per model, and Vina can split them with its `vina_split` tool.
