"""
Example 3: Extract shape query from a shape query file, and convert to
searchable molecule
"""
from openeye.oechem import oeifstream, OEThrow, OEMol
from openeye.oeshape import OEShapeQuery, OEReadShapeQuery

ifs = oeifstream()
filename = "<your_shape_query_filename>.sq"

if not ifs.open(filename):
    OEThrow.Fatal(f"Unable to open file {filename}")

sq = OEShapeQuery()
OEReadShapeQuery(ifs, sq)
ifs.close()

mol = OEMol()
sq.GetCompositeMolecule(mol)
