The best place to discuss coding is the avogadro-devel list.
I thought about adding a mechanism to explicitly set partial charges before the 1.0 release. I’m probably going to regret that – although I’ll certainly add it for the next major release (v1.2).
The workaround would be to grab the underlying OBMol and set the partial charges on each atom.
You can set all sorts of arbitrary attributes/properties on primitives in Avogadro. Of course, whether anything recognizes them is another matter.
Hope that helps,
-Geoff
On Nov 17, 2009, at 8:44 AM, Ian Kirker wrote:
Not quite sure if this list or avogadro-devel is the place for this, but
I’ve been trying to make an Extension to let me paste in charges off the
clipboard (using the SetPartialCharge method) and it all seems to work
correctly except for the actual charges turning up in Avogadro.I had a look in the Python terminal, and it seems this call isn’t included
in the Avogadro primitive version of the Atom class, but didn’t raise any
sort of error when I called it from the script. Having a further look
around the classes I couldn’t find a way to properly set partial charges.
I tried setting the attribute on the atom objects directly, which seemed
to have no effect on the atoms in the GUI, although this did work from the
Python terminal. Looking at the molecule object, there seems to be a call
on there which recalculates them, which I imagine I might have to override
somehow.So, does anyone know whether there’s a proper way to set partial charges
from an extension like this?Many thanks,
-Ian(A simpler version of what I’m doing is below - I’ve also tried it using
iterators rather than pop()def pasteCharges(self, glwidget):
charges = list()
mol = glwidget.molecule
atomList = mol.atoms... (some text processing to get the charges) # Pop elements off the lists until one is empty while (len(atomList)!=0) and (len(chargeList)!=0): thisAtom = atomList.pop() thisCharge = chargeList.pop() thisAtom.SetPartialCharge(thisCharge) # One way suggested by the
OB Atom object
thisAtom.partialCharge = thisCharge # Suggested by the Atom object help
from the terminal
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what’s new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
Avogadro-Discuss mailing list
Avogadro-Discuss@lists.sourceforge.net
avogadro-discuss List Signup and Options