rdkit.Chem.ReducedGraphs

Package rdkit :: Package Chem :: Module ReducedGraphs |
[hide private]
[frames] | no frames]

# Source Code for Module rdkit.Chem.ReducedGraphs

     1  # $Id$
     2  #
     3  #  Copyright (c) 2013 Greg Landrum
     4  #
     5  #   @@ All Rights Reserved @@
     6  #  This file is part of the RDKit.
     7  #  The contents are covered by the terms of the BSD license
     8  #  which is included in the file license.txt, found at the root
     9  #  of the RDKit source tree.
    10  #
    11  # Created by Greg Landrum, July 2013
    12
    13  import numpy
    14  from rdkit.Chem.rdReducedGraphs import *
    15
    16 -def TanimotoSimilarity(arr1,arr2):
    17    numer = arr1.dot(arr2)
    18    if numer==0.0:
    19      return 0.0
    20    denom = arr1.dot(arr1)+arr2.dot(arr2)-numer
    21    if denom==0.0:
    22      return 0.0
    23    return numer/denom
    24