Re: [Open Babel] Best approach for removing a molecule from a complex

2012-05-16 Thread inviso
Oops, meant to reply to the list. That indeed was the problem. Building a list of atoms to remove and then removing then in a separate loop worked like a charm. Thanks, Greg On Wed, May 16, 2012 at 7:16 AM, Noel O'Boyle wrote: > >> Any thoughts on why pybel.formula is not updating when I use

Re: [Open Babel] Best approach for removing a molecule from a complex

2012-05-16 Thread Noel O'Boyle
> Any thoughts on why pybel.formula is not updating when I use the > underlying OBMol.DeleteAtom? > This is a FAQ. Don't delete atoms from whether a loop using an Open Babel iterator as it invalidates the iterator. Instead, just create a list of OBAtoms, and in a separate loop delete each OBAtom i

Re: [Open Babel] Best approach for removing a molecule from a complex

2012-05-15 Thread inviso
Comments inline below. On Mon, May 14, 2012 at 11:46 PM, My Th wrote: > You could try to align the molecules and then get the coordinates which > are close enough. Or if the bond perception works correctly and there > are only those Cl bonded to Rh which have to go away, then you could > iterate

Re: [Open Babel] Best approach for removing a molecule from a complex

2012-05-15 Thread inviso
Noel, Thanks for the input. Regarding the floating point problems, that's what I assumed, but I didn't know what to use for a safe delta. Is this a decent approach otherwise? The alternate method sounds great. I'll do a little research and see if that will work for us. Thanks for the pointer.

Re: [Open Babel] Best approach for removing a molecule from a complex

2012-05-15 Thread Noel O'Boyle
The coordinates should not change on copying the molecule (I just tested this). However, I'm guessing that you are comparing two floating point numbers using "if x==y". If you search around the web, you will see that you should this doesn't work for a variety of reasons. Instead, you should compar

Re: [Open Babel] Best approach for removing a molecule from a complex

2012-05-14 Thread My Th
Sv, 2012-05-13 20:49 -0700, inviso rakstīja: > As a disclaimer, I'm an amazingly poor excuse for a chemist. In this > case, I'm simply a programming resource in a research project so > please forgive any amateur mistakes or abuses of terminology. The > project is being done in Python using pybel.

[Open Babel] Best approach for removing a molecule from a complex

2012-05-13 Thread inviso
As a disclaimer, I'm an amazingly poor excuse for a chemist. In this case, I'm simply a programming resource in a research project so please forgive any amateur mistakes or abuses of terminology. The project is being done in Python using pybel. As part of our process, we will be doing a scf calc