openbabel/openbabel — pull request #54 by patrickfuller (2013-12-23 20:14:57+00:00)
Title: Initial commit for EQeq crystal charge equilibration method

This is a first pass at folding EQeq (a speed-optimized crystal-focused charge estimator described [here](http://pubs.acs.org/doi/abs/10.1021/jz3008485)) into openbabel. This currently runs and appears to produce the same results as the original EQeq, but has not yet been rigorously tested.

One note is that the EQeq algorithm requires higher-order ionization energy data and metal ion charges, both of which I couldn't find in `OBElementTable`. Currently, this implementation reads a separate data file for this. It'd be a nice code cleanup to add some more data to `OBElementTable`, but I have not done that here. There are also some parameters that are hardcoded, but, in practice, people don't seem to ever change these. This could be fixed if needed.

Current test script is through Python:

```python
import pybel
import EQeq
import sys

with open(sys.argv[-1]) as in_file:
m = in_file.read()

# Test EQeq's openbabel implementation
mol = pybel.readstring("cif", m)
eqeq = pybel.ob.OBChargeModel_FindType("eqeq")
eqeq.ComputeCharges(mol.OBMol)
charges = [a.partialcharge for a in mol]

# EQeq's standard Python bindings
out = EQeq.run(m, output_type="list")

# Compare (this assumes atoms don't get shuffled in openbabel)
print charges
print out
```