Hi,

I'm trying to assign MMFF94 partial charges to a molecule
programatically with the Open Babel API in C++. I'm using version
2.3.1 of openbabel and running on Ubuntu.

My code snippet (based on the example from the OBChargeModel
documentation) is as follows:

        OBChargeModel* mmffCharges = OBChargeModel::FindType("MMFF94");
        std::vector<double> partialCharges;
        if(mmffCharges) {
                if(mmffCharges->ComputeCharges(mol)) {
                        partialCharges = mmffCharges->GetPartialCharges();
                }
                else {
                        throw std::runtime_error("Failed to calculate partial 
charges");
                }
        }
        else {
                throw std::runtime_error("Failed to find charge model");
        }

When run it throws the "Failed to find charge model". Based on reading
this lists archives I tried prepending:

OBChargeModel obCharges = OBChargeModel("mmff94", true);

to the top of my code, and despite obCharges not being referenced this
has the effect of making the above code throw "Failed to calculate
partial charges" instead, which looks like progress. But I can't get
the call to ComputeCharges to succeed.

Any ideas?

Yours,

Toby Wright

--
InhibOx

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to