Dear all, I’m happy to announce that the torsion fingerprint deviation (TFD) developed in Rarey’s group (J. Chem. Inf. Model., 52, 1499, 2012) are now available in the Python part of the RDKit. Thanks a lot to Gregori and Ilenia (+ Christin Schäfer) for their help at the UGM Hackathon to resolve the last disagreements with the paper!
Here are some small examples on the usage, a more detailed documentation can be found in the Cookbook. There are three wrapper functions for convenience: TFD between two sets of conformers of a molecule: >>> from rdkit.Chem import TorsionFingerprints >>> tfd = TorsionFingerprints.GetTFDBetweenConformers(mol, confIds1=[0, 2], >>> confIds2=[1, 3]) The result is a list of - in this case 4 - TFD values. TFD between two instances of the same molecule with different conformers. If no confIds are specified, the first one of each molecule is taken. >>> tfd = TorsionFingerprints.GetTFDBetweenMolecules(mol1, mol2) The result is a list containing in this case a single TFD value. For clustering or diversity picking purposes, there is also a convenience function to get the matrix of TFD values. >>> tfdmat = TorsionFingerprints.GetTFDMatrix(mol) The different steps of the TFD calculation can also be accessed independently: 1) A list of the torsions (one for non-ring bonds, one for ring bonds) is generated. For each torsion, the indices of the four atoms are stored. This has to be done only once for a molecule. 2) The weights for the torsions are calculated. By default, the bonds in the centre of the molecule receives the highest weight and the other weights are decreased based on the distance from the central bond. If another part of the molecule should have the highest weight, the user can also specify two atom indices that represent the most important bond. Again, this step has to be done only once for a molecule. 3) The torsion angles are calculated for each conformer of interest given the torsion lists. 4) The TFD value between two conformers is calculated given the torsion angles and weights. >>> tors_list, ring_tors_list = TorsionFingerprints.CalculateTorsionLists(mol) >>> weights = TorsionFingerprints.CalculateTorsionWeights(mol) >>> torsions1 = TorsionFingerprints.CalculateTorsionAngles(mol, tors_list, >>> ring_tors_list, confId=0) >>> torsions2 = TorsionFingerprints.CalculateTorsionAngles(mol, tors_list, >>> ring_tors_list, confId=1) >>> tfd = TorsionFingerprints.CalculateTFD(torsions1, torsions2, >>> weights=weights) Let me know if you encounter any problems. Best, Sereina ------------------------------------------------------------------------------ _______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss