On 2013-11-12 00:55, Fredrik Wallner wrote:
> Hi,
>
> Since pybel doesn’t have a ”bond-concept” at the moment, I suppose
> it needs to be defined first.
Hm. I find I have to get to OBMols and OBAtoms all the time anyway, I
expect bond will be no different. So I'd skip pybel.Bond and just go for
Or, if you import openbabel you can directly do:
for bond in openbabel.OBMolBondIter(obmol):
print bond.GetBeginAtomIdx(), bond.GetEndAtomIdx(), bond.GetBondOrder()
12 nov 2013 kl. 07:55 skrev Fredrik Wallner :
> Hi,
>
> Since pybel doesn’t have a ”bond-concept” at the moment, I suppose it
Hi,
Since pybel doesn’t have a ”bond-concept” at the moment, I suppose it needs to
be defined first. But if you will settle for OBBonds, the following short
generator could work:
def pybelbonditer(pybmol):
for i in range(pybmol.OBMol.NumBonds()):
yield pybmol.OBMol.GetBond(i)
It’s
Hi guys,
one for the next release wishlist: is it possible to expose bonds as an
iterable, similar to atoms?
--
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
signature.asc
Description: OpenPGP digital signature
---