[Chimera-users] formal charge or net charge
Eric Pettersen
pett at cgl.ucsf.edu
Tue Dec 25 18:42:34 PST 2007
Hi Snoze,
For bulk calculations of charge, you are going to have to use a
Python script. In particular you will need to use the
estimateFormalCharge method from the AddCharge module. Here's an
example script that works if the only molecule open in Chimera is the
one you want to estimate the charge for:
----
from chimera import openModels, Molecule
from AddCharge import estimateFormalCharge
mol = openModels.list(modelTypes=[Molecule])[0]
print estimateFormalCharge(mol.atoms)
----
You would run such a script (if you called the script charge.py) with:
chimera --nogui --nostatus molecule.pdb charge.py
The charge would be printed on standard output. I would recommend you
use at least Chimera 1.2470, and the latest daily build if possible if
that works for you.
You might want to avoid the overhead of starting Chimera for each
molecule by opening them all in one instance of Chimera, in which case
the script would be something like:
----
from chimera import openModels, Molecule
from AddCharge import estimateFormalCharge
for mol in openModels.list(modelTypes=[Molecule]):
print mol.name, estimateFormalCharge(mol.atoms)
----
The charge estimation in Chimera works reasonably well, most usually
failing when the molecular geometry is poor --causing atom types to be
mistyped (e.g. a deprotonated alcohol mistaken for a carbonyl due to
the bond length being very short). Therefore you might want to sanity
check the charge estimation by adding up the atomic numbers of the
atoms and ensuring that when you add the estimated charge you get an
even number. Something like:
fc = estimateFormalCharge(mol.atoms)
atomicSum = 0
for a in mol.atoms:
atomicSum += a.element.number
if (atomicSum + fc) % 2 == 0:
print mol.name, fc
else:
print "BAD CHARGE ESTIMATE:", mol.name, fc
--Eric
Eric Pettersen
UCSF Computer Graphics Lab
On Dec 22, 2007, at 12:16 PM, snoze pa wrote:
> Dear Chimera Users,
>
> Is it possible to calculate the net charge or formal charge of
> unknown residues using chimera. I have a large set of molecules for
> which i am trying to calculate the net charge on each molecule.
>
> Thanks in advance
> s
>
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users
More information about the Chimera-users
mailing list