This script adds NME and ACE groups to protein terminal residues. The pdb file may contain one or more than one chains. In case of multiple chains, the scripts adds NME and ACE to each chains. Note that chains are detected from the chain labels like 'A', 'B' etc using MDAnalysis mda.segments function. Also make sure that terminal residues have backbone C, O and CA atoms. Also note that the output removes TER in multi chain systems, so before running tleap add TER between chains. It can be done with a quick bash command that adds TER between lines where one line has NME and the next one has ACE, e.g something like
awk '/NME/{nme=NR} /ACE/ && nme && NR > nme {print "TER"; nme=0} {print}' capped.pdb > capped_TER.pdb
- Python3 (I tested with 3.11.7), should also work for other python3 versions
- MDAnalysis (I tested with 2.7.0), should also work for other versions
- Numpy (I tested with 1.26.4), but should also work with other versions
Before running the command make sure that the input protein has all the waters and other stuff removed. Also remove all the Hydrogens, tleap can add it automatically later. You can remove the hydrogen by using the following quick command, considering your protein is named protein.pdb:
python -c 'import MDAnalysis as mda; u=mda.Universe ("protein.pdb"); u.select_atoms("protein and not name H* 1H* 2H* 3H*").write ("input.pdb")'
Now to add ACE and NME to the hydrogen-removed-pdb, run following command:
python add_caps.py -i input.pdb -o output.pdb
The script reads the hydrogen-less pdb file using MDAnalysis.
- If the first residue has an
OXT, we remove it and place anNatom of NME. The carbon atom of NME is added at a distance of 1.36 Å along theC-Nvector. WhereCis the protein backbone carbon atom. - If there is no
OXT, theNatom is connected to the backboneCalong the vector connecting the backboneCposition and the mid-point ofCAandOatoms of the backbone.
- The first carbon of ACE is connected to the backbone
Nand along the vector connecting backboneCAandNatoms. - To add the other carbon and oxygen of ACE, we imagine the backbone
N, the other carbon and oxygen to be the vertices of an equilateral triangle with the previously added carbon as the centroid of the triangle. The coordinates of other two vertices given one vertex ($x_a, y_a, z_a$ ) and centroid ($x_g, y_g, z_g$ ) of an equilateratl triangle is obtained as:
First vertex:
Second vertex:
Where (np.random, it really does not matter. The coordinates generated above may be a over 2 Å apart. So finally we rescale the bonds such that they are around 1.4 Å.
MDAnalysis universe are created for above ACE and NME.
- The names of
ACEatoms are C, CH3, O. While the NME atoms are named N, C. Note that in earlier ambertools the NME are named N, CH3, so one can replace C with CH3 for such cases if later on tleap complains about atom names not being found. - The ACE, protein and NME universes are merged with MDAnalysis
mda.Mergefunction and the final pdb is written
If you use this in published work, please cite the following reference:
Protein–Protein Interaction Stabilizers from MD Simulation-Derived Pharmacophores, Mohd Ibrahim and Martin Zacharias, J. Chem. Inf. Model. 2026