...and just for your information, I'd avoid repeated accesses to mol.atoms
as it creates a new list of the molecules atoms every time you call it
(which can be a speed hit). A good idea is to stick it in a variable on
first access and then refer to that variable.
On 9 August 2017 at 10:20, Noel O'
Close, but not quite. You need to delete the C++ atom in the C++ molecule.
Something like...
for atom in mol:
remove.append(atom.OBAtom)
for obatom in remove:
mol.OBMol.DeleteAtom(obatom)
- Noel
On 9 August 2017 at 09:46, David van der Spoel wrote:
> Hi,
>
> I am trying to remove ions
Hi,
I am trying to remove ions from sdf compounds that I downloaded from
pubchem using a python script. The script correctly locates the atoms to
remove but the del command does not seem to have any effect. Am I making
a silly python error?
An example input is here https://pubchem.ncbi.nlm.n
A useful command is dir(pybel), or help(pybel). I think you want
"import openbabel as ob", and ob.OBMol() etc.
On 9 August 2017 at 05:53, Kohsei Tsuji
wrote:
> Dear all,
>
> I am using openbabel 2.4.1 (with python building) on OS X Yosemite 10.10.5
> and python 2.7.10.
> I have successfully insta