def PrintTanimoto(molA, molB, minb, maxb):
    fpA = oegraphsim.OEFingerPrint()
    fpB = oegraphsim.OEFingerPrint()
    numbits = 2048
    atype = oegraphsim.OEFPAtomType_DefaultPathAtom
    btype = oegraphsim.OEFPBondType_DefaultPathBond
    oegraphsim.OEMakePathFP(fpA, molA, numbits, minb, maxb, atype, btype)
    oegraphsim.OEMakePathFP(fpB, molB, numbits, minb, maxb, atype, btype)
    print("Tanimoto(A,B) = %.3f" % oegraphsim.OETanimoto(fpA, fpB))
def PrintTanimoto(molA, molB, atype, btype):
    fpA = oegraphsim.OEFingerPrint()
    fpB = oegraphsim.OEFingerPrint()
    numbits = 2048
    minb = 0
    maxb = 5
    oegraphsim.OEMakePathFP(fpA, molA, numbits, minb, maxb, atype, btype)
    oegraphsim.OEMakePathFP(fpB, molB, numbits, minb, maxb, atype, btype)
    print("Tanimoto(A,B) = %.3f" % oegraphsim.OETanimoto(fpA, fpB))
Example #3
0
# Customer is hereby permitted to use, copy, and modify the Sample Code,
# subject to these terms. OpenEye claims no rights to Customer's
# modifications. Modification of Sample Code is at Customer's sole and
# exclusive risk. Sample Code may require Customer to have a then
# current license or subscription to the applicable OpenEye offering.
# THE SAMPLE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED.  OPENEYE DISCLAIMS ALL WARRANTIES, INCLUDING, BUT
# NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE AND NONINFRINGEMENT. In no event shall OpenEye be
# liable for any damages or liability in connection with the Sample Code
# or its use.

from openeye import oechem
from openeye import oegraphsim

mol = oechem.OEGraphMol()
oechem.OESmilesToMol(mol, "c1ccccc1")

# @ <SNIPPET-MAKE-FP>
fpA = oegraphsim.OEFingerPrint()
oegraphsim.OEMakePathFP(fpA, mol)

fpB = oegraphsim.OEFingerPrint()
oegraphsim.OEMakeFP(fpB, mol, fpA.GetFPTypeBase())
# @ </SNIPPET-MAKE-FP>

if oegraphsim.OEIsSameFPType(fpA, fpB):
    print("same fingerprint types")
else:
    print("different fingerprint types")
Example #4
0
# THE SAMPLE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED.  OPENEYE DISCLAIMS ALL WARRANTIES, INCLUDING, BUT
# NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE AND NONINFRINGEMENT. In no event shall OpenEye be
# liable for any damages or liability in connection with the Sample Code
# or its use.

from openeye import oechem
from openeye import oegraphsim

mol = oechem.OEGraphMol()
oechem.OESmilesToMol(mol, "c1ccccc1")

# @ <SNIPPET-MAKE-PATH-1>
fp = oegraphsim.OEFingerPrint()
oegraphsim.OEMakePathFP(fp, mol)
# @ </SNIPPET-MAKE-PATH-1>

print(fp.GetFPTypeBase().GetFPTypeString())

# @ <SNIPPET-MAKE-PATH-2>
oegraphsim.OEMakeFP(fp, mol, oegraphsim.OEFPType_Path)
# @ </SNIPPET-MAKE-PATH-2>

print(fp.GetFPTypeBase().GetFPTypeString())

# @ <SNIPPET-MAKE-PATH-3>
numbits = 1024
minbonds = 0
maxbonds = 5
oegraphsim.OEMakePathFP(fp, mol, numbits, minbonds, maxbonds,