Dear all,

I need to find how many bonds of a certain type are in a molecule. For example, 
for DOUBLE bonds, I would do:

bond_number = 0
for bond in mol.GetBonds():
    if bond.GetType() == Chem.BondType.DOUBLE:
        bond_number += 1

However, searching for faster manners to do this, I found "rdqueries". For 
example, to find how many atoms of Carbon there are in a molecule, you could do:

q = rdqueries.AtomNumEqualsQueryAtom(6)
carbon_number = len(mol.GetAtomsMatchingQuery(q))

I'm wondering if some of you know the equivalent in "rdqueries" to find the 
number of bonds that match a type.

Many thanks in advance. Best,

José-Emilio Sánchez
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to