[Dock-fans] ligand preparation

Scott Brozell sbrozell at rci.rutgers.edu
Thu Dec 1 10:50:01 PST 2011


On Wed, Nov 30, 2011 at 10:52:07AM -0800, Eric Pettersen wrote:
> > Is there a way to prepare the ligands (if more than 1000s) in a stand-alone
> > program, basically to calculate the charges and write a mol2 file. I have a
> > ligprep format ligands that i would like to convert to mol2 format with
> > proper charges.
> > 
> > I assume antechamber tools included in chimera can do this on a command
> > prompt mode. Any ideas.
> Can you convert your "ligprep format" files to some format that Chimera can read (PDB/Mol2/XYZ)?
> If so, you can use the simple scripting approach described here:
> http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/basicPrimer.html
> to loop through your files, adding charges and writing them out as Mol2 files (with the "addcharge" and "write" commands respectively; check the Chimera documentation for the command arguments you would want to use).
> Antechamber/addcharge will probably fail for a (hopefully small) fraction of your structures.  Assuming you run in "command prompt" (nogui) mode the failures will be noted in the output that Chimera sends to the terminal.  You could look through that to find them (though that output will be voluminous if you have thousands of structures) or you could write some kind of post-processing script that identifies Mol2 files where the charges are all zero (i.e. addcharge failed).
> For the failures where Chimera estimated the wrong formal charge, you could rerun those structures using the graphical version of Chimera and specifying the correct formal charge when prompted by the AddCharge tool, then write the Mol2 files "by hand" with File->Save Mol2.  For the failures where antechamber simply could not handle the ligand structure, you will have to use some other method for getting the charges for that structure.
> If Chimera estimates the wrong formal charge for a structure, feel free to report it as a bug (Help->Report a Bug in Chimera), attaching the structure to the bug report.

Here is a somewhat dated prep script that preps one ligand.
As Eric indicated, check the output for potential problems:
% $HOME/chimera/1.2470/bin/chimera --nogui ligprep.py
% cat ligprep.py
import chimera
from chimera import runCommand
import AddH
import AddCharge
import WriteMol2
import sys, os

print 'STARTING ligand prep'
#open ligand file for reading
lig = chimera.openModels.open('start.sdf')

#delete hydrogen molecules
#runCommand('select H')
#runCommand('delete sel')

mols = chimera.openModels.list()

#ask chimera to recognize ligands

#compute AM1BCC charges
    mol = chimera.openModels.list()[0]
except IndexError:
    print "ERROR:  NO LIGAND !!"

if len(mol.residues) > 1:
    mol = chimera.openModels.list()
    print "charges from DockPrep"
    import DockPrep
    DockPrep.prep(mol, addHFunc=None)
    print "charges from AddCharge"
    charge = AddCharge.estimateFormalCharge(mol.atoms)
    AddCharge.addNonstandardResCharges(mol.residues, charge)

#save as mol2 file
WriteMol2.writeMol2(mol, 'start.mol2')

print 'COMPLETED ligand prep'

More information about the Dock-fans mailing list