Re: [Rdkit-discuss] How many bonds of a Type in a molecule

2020-12-09 Thread Jan Halborg Jensen
mol.GetSubstructMatches(Chem.MolFromSmarts(‘[*]=[*]’)) Should find all double bonds between non-aromatic atoms. If you want to include those Chem.Kekulize(mol) first. On 8 Dec 2020, at 15.01, José Emilio Sánchez Aparicio mailto:joseemilio.sanc...@uab.cat>> wrote: Dear all, I need to find how

Re: [Rdkit-discuss] How many bonds of a Type in a molecule

2020-12-08 Thread Francois Berenger
On 08/12/2020 23:01, José Emilio Sánchez Aparicio wrote: 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

[Rdkit-discuss] How many bonds of a Type in a molecule

2020-12-08 Thread José Emilio Sánchez Aparicio
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