Esempio n. 1
0
#
# TERMS FOR USE OF SAMPLE CODE The software below ("Sample Code") is
# provided to current licensees or subscribers of OpenEye products or
# SaaS offerings (each a "Customer").
# 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

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

# @ <SNIPPET>
screen = oechem.OESubSearchScreen()
oechem.OEMakeSubSearchTargetScreen(screen, mol,
                                   oechem.OESubSearchScreenType_MDL)
stype = screen.GetScreenType()
print(stype.GetScreenTypeString())
print(stype.GetVersionString())
print(stype.GetName())
# @ </SNIPPET>
Esempio n. 2
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

# @ <SNIPPET>
mol = oechem.OEGraphMol()
oechem.OESmilesToMol(mol, "c1ccccc1")

screenA = oechem.OESubSearchScreen()
oechem.OEMakeSubSearchTargetScreen(screenA, mol,
                                   oechem.OESubSearchScreenType_Molecule)

screenB = oechem.OESubSearchScreen()
oechem.OEMakeSubSearchTargetScreen(screenB, mol, screenA.GetScreenType())

# @ </SNIPPET>
if (oechem.OESameSubSearchScreenTypes(screenA, screenB)):
    print("same screen types")
else:
    print("different screen types")
Esempio n. 3
0
$$$$
'''

ifs = oechem.oemolistream()
ifs.SetFormat(oechem.OEFormat_MDL)
ifs.openstring(mdlquery)

# @ <SNIPPET>
qmol = oechem.OEQMol()
queryopts = oechem.OEMDLQueryOpts_Default | oechem.OEMDLQueryOpts_SuppressExplicitH
oechem.OEReadMDLQueryFile(ifs, qmol, queryopts)

qscreen = oechem.OESubSearchScreen()
if not oechem.OEMakeSubSearchQueryScreen(qscreen, qmol,
                                         oechem.OESubSearchScreenType_MDL):
    print("query MDL screen cannot be generated")

tmol = oechem.OEGraphMol()
oechem.OESmilesToMol(tmol, "c1c[nH]cc1")

tscreen = oechem.OESubSearchScreen()
if not oechem.OEMakeSubSearchTargetScreen(tscreen, tmol,
                                          oechem.OESubSearchScreenType_MDL):
    print("target MDL screen cannot be generated")
# @ </SNIPPET>

if oechem.OEScreen(qscreen, tscreen):
    print("screen match")
else:
    print("no match")
# 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
# @ <SNIPPET>
qmol = oechem.OEQMol()
oechem.OEParseSmarts(qmol, "c1cc[o,n,s]c1")
qscreen = oechem.OESubSearchScreen()
oechem.OEMakeSubSearchQueryScreen(qscreen, qmol,
                                  oechem.OESubSearchScreenType_SMARTS)

tmol = oechem.OEGraphMol()
oechem.OEParseSmiles(tmol, "c1ccoc1")
tscreen = oechem.OESubSearchScreen()
oechem.OEMakeSubSearchTargetScreen(tscreen, tmol,
                                   oechem.OESubSearchScreenType_SMARTS)

ss = oechem.OESubSearch(qmol)

if oechem.OEScreen(qscreen, tscreen):
    if ss.SingleMatch(tmol):
        print("match")
    else:
        print("false positive match")
else:
    print("no match")
# @ </SNIPPET>