Increase the torsion limit in Autodock4 to 64.

Although I got the message from forum that two many torsions were not accurate for docking. But I had no choice, the professor asked me to include more residues.

The method is following. I got help from

1. download the source from

2. tar xvzf autodocksuite-4.2.6-src.tar.gz

3. cd src/autodock # the unzipped folder

4. vi constants.h, change the following lines

#define NLIGTOR      64       /* Max. num. of torsions in each ligand */

#define MAX_TORS     64       /* Maximum number of torsions in Small Molecule. */

#define TOR_ARG_LIST &sInit.tor[0], &sInit.tor[1], &sInit.tor[2], &sInit.tor[3], &sInit.tor[4], &sInit.tor[5], &sInit.tor[6], &sInit.tor[7], &sInit.tor[8], &sInit.tor[9], &sInit.tor[10], &sInit.tor[11], &sInit.tor[12], &sInit.tor[13], &sInit.tor[14], &sInit.tor[15], &sInit.tor[16], &sInit.tor[17], &sInit.tor[18], &sInit.tor[19], &sInit.tor[20], &sInit.tor[21], &sInit.tor[22], &sInit.tor[23], &sInit.tor[24], &sInit.tor[25], &sInit.tor[26], &sInit.tor[27], &sInit.tor[28], &sInit.tor[29], &sInit.tor[30], &sInit.tor[31], &sInit.tor[32], &sInit.tor[33], &sInit.tor[34], &sInit.tor[35], &sInit.tor[36], &sInit.tor[37], &sInit.tor[38], &sInit.tor[39], &sInit.tor[40], &sInit.tor[41], &sInit.tor[42], &sInit.tor[43], &sInit.tor[44], &sInit.tor[45], &sInit.tor[46], &sInit.tor[47], &sInit.tor[48], &sInit.tor[49], &sInit.tor[50], &sInit.tor[51], &sInit.tor[52], &sInit.tor[53], &sInit.tor[54], &sInit.tor[55], &sInit.tor[56], &sInit.tor[57], &sInit.tor[58], &sInit.tor[59], &sInit.tor[60], &sInit.tor[61], &sInit.tor[62], &sInit.tor[63]

After editing the file,use :wq! to save it, because it’s read-only, please add “!”

5. vi autocomm.h, change the following lines

const unsigned int MAX_LINES=512;    /* Number of lines in parameter file              */

const /* not unsigned */ int LINE_LEN=512;    /* Line length in characters                      */

Use :wq! to save it.

6. mkdir a new folder, I used “self”. cd self

7. run the following command to compile it.



make check

8. Check the Testruns folder, to see if the test is passed.

9. cp autodock4 ~/bin

10. run ~/bin/autodock4 -v, you can see the program information, in which the edited torsions can be seen as Maximum number of torsions in ligand and flexres (MAX_TORS): 64


Add hydrogen atoms on protein and water for Autodock.

I was asked to do docking with explicit water. I am confused whether I should add water manually or just use the crystal water. By searching for a while, it seemed the docking with water only use the water inside the crystal structure. So I just do that for the job now.

Autodock can not add hydrogen atoms on the lonely oxygen atoms in x-ray crystal structure. I tried some other programs, VMD, Schrodinger, HAAD server, WHAT IF. And finally, I found USCF chimera has a module to add hydrogen atoms very well. Although I am not sure whether the hydrogen atoms are optimized or not, at least they did not orient to one direction.

Autodock seems have trouble to deal with the structure got from chimera. I used VMD to extract water and add hydrogen atoms by chimera and save to PDB. Then I used VMD to extract protein and glycan of the protein crystal PDB file and save to another PDB file.

cat water.pdb protein.pdb > total.pdb

I use Autodock to open total.pdb, then add the polar hydrogen atoms. When I choose it for Grid process. The protein and water all be treated as the receptor for the following docking.

Maybe I can choose water as flexible residue for better docking result.


This afternoon, I got reply from Stephanie Nicole Lewis from Virginia Polytechnic Institute and State University. She is a great mentor and expert in Molecular Docking field. The docking with explicit water just use the crystal water. But in some condition, only water in specific region like docking pocket or caveat are meaningful. And she also use Chimera to add hydrogen atoms.

I read some papers and files from Google about FlexX. It’s a famous docking software, commercial, a part of LeadIT from BioSolveIt. This docking program have better solution for crystal water. It has three method to deal with water. One, add hydrogen atoms on the oxygen, and the orientation of hydrogen atoms should allow to form more hydrogen bonds like Chimera does. Two, do not add hydrogen atoms but treat it as a oxygen of water with uncertain orientations. This is better for ligands to form hydrogen bonds with the oxygen atoms of water. Three, the oxygen still does not have hydrogen atoms, and could bond with ligand or receptor in any direction. They can also be replaced by ligands if the water is an obstacle for the docking process. So the third way may be the best one. I may learn the software some day when I have time.