Hi Shaozhen,
The function for creating reaction fingerprints is
rdChemReactions.CreateDifferenceFingerprintForReaction()
Here's a quick demo of using it on your reactions:
In [44]: rxn1 = rdChemReactions.ReactionFromSmarts('CCCO>>CCC=O')
In [45]: rxn2 = rdChemReactions.ReactionFromSmarts('CC(O)C>>CC(=O)C')
In [46]: fp1 = rdChemReactions.CreateDifferenceFingerprintForReaction(rxn1)
In [47]: fp2 = rdChemReactions.CreateDifferenceFingerprintForReaction(rxn2)
In [48]: DataStructs.TanimotoSimilarity(fp1,fp2)
Out[48]: 0.0
The similarity here is zero because as far as the reaction fingerprint is
concerned the parts which change within the reactions have nothing in
common with each other.
An example where there is some similarity in what changes:
In [49]: rxn3 = rdChemReactions.ReactionFromSmarts('NCCO>>NCC=O')
In [50]: fp3 = rdChemReactions.CreateDifferenceFingerprintForReaction(rxn3)
In [51]: DataStructs.TanimotoSimilarity(fp1,fp3)
Out[51]: 0.42857142857142855
The reaction fingerprinting algorithm is described in this paper:
https://pubs.acs.org/doi/abs/10.1021/ci5006614
Best,
-greg
On Wed, Jun 10, 2020 at 6:13 AM 丁邵珍 <164...@qq...> wrote:
> Hi, I want to calculate Tanimoto similarity score of two reactions
> ('CCCO>>CCC=O', 'CC(O)C>>CC(=O)C'), I found all methods of Tanimoto
> similarity score calculation are for compounds. Could you please tell me
> how to calculate the Tanimoto similarity score of reactions? I am looking
> forward to your reply.
>
> Yours,
> shaozhen
> _______________________________________________
> Rdkit-discuss mailing list
> Rdk...@li...
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
|