Hi,
> You cannot iterate over something that you are changing. (This is a
> general rule in C++, and maybe in life)
Ok, right.
> Instead you need too loops: in the first you create a list of OBAtoms
> you want to delete;
Create a list? :) I'll need to google and find an exemple to copy
paste... hope to find some code easy to understand.
> in the second, you iterate over this list and delete them.
Ok.
Currently, I bypassed the problem by checking if the molecule has an
atom with only one neighbor. As long the answer is yes, I delete some
atom with the snippet of code I just sended, with:
isAnAtomWithOneNeighbor = checkIfIsOnlyOneNeighbor(mol)
while (isAnAtomWithOneNeighbor):
mol = delete(mol)
isAnAtomWithOneNeighbor = checkIfIsOnlyOneNeighbor(mol)
I'll try do a list of atom(s) to delete.
> BTW, try googling "pybel murcko" - Florian Nigsch has written an
> implementation.
Sure, I already did it, but Florian Nigsch generate all cyclic
fragments, and not the Murcko framework.
With CDK, there is also fragmenter2.java from Rajarshi Guha, but it
generates all possible fragments - cyclic or not.
Thanks for your answer!
Pascal
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
OpenBabel-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss