Re: [Open Babel] Segfault when merging molecules through python API

2013-07-08 Thread S.L. Chan
I encountered almost exactly the same problem with running RD Kit using Python. So it looks like it is a swig / python issue. (I did not write earlier because I was not sure about the cause. Actually I have been eagerly waiting for an answer!) So, it looks like one cannot write python functions to

Re: [Open Babel] Segfault when merging molecules through python API

2013-07-08 Thread Noel O'Boyle
I've reproduced this behaviour. As you say it's fairly subtle. In fact I can't tell whether it's a bug at our end or a feature of swig in general. It appears that obmol += newmol replaces the underlying OBMol with a new one. You can see this by printing out the obmol (the address changes) in a non

Re: [Open Babel] SMILES, SMARTS, and PDB

2013-07-08 Thread Wang, LiRong
On 05/07/2013 17:54, Brett T. Hannigan wrote: > I have a database of molecules in pdb files. I'd like to go through > each molecule and see if it has certain substructures, and if they do > identify which atoms are part of that substructure. So it's easy > enough to read the pdb file in, conve

Re: [Open Babel] SMILES, SMARTS, and PDB

2013-07-08 Thread Maciek Wójcikowski
You could also look into ProDy, if you use PDB files. http://www.csb.pitt.edu/prody/reference/atomic/flags.html#term-hetero Pozdrawiam, | Best regards, Maciek Wójcikowski mac...@wojcikowski.pl 2013/7/8 Maciek Wójcikowski > I think you need custom code. For python, you could use pybel. T

Re: [Open Babel] Segmentation fault in inchi conversion

2013-07-08 Thread Noel O'Boyle
I've fixed this. It's a minor change so you could apply it locally if you want. I just moved the call to DeleteHydrogens past the stereo section when reading the InChI: https://github.com/baoilleach/openbabel/commit/428ac8790d3b5307305912b892e9953c793b80dc - Noel On 26 June 2013 14:42, Jon F

Re: [Open Babel] SMILES, SMARTS, and PDB

2013-07-08 Thread Maciek Wójcikowski
I think you need custom code. For python, you could use pybel. There are three lines that do what you want ( http://openbabel.org/docs/dev/UseTheLibrary/Python_PybelAPI.html#pybel.Smarts.findall). You only miss one or two lines to get the atoms by their indices. Although searching pdb files with i