Spicoli supports the following storage formats:
|.srf:||Old GRASP format|
|.oesrf:||OpenEye format based upon tagged binary files|
The GRASP format is provided for backwards compatibility with older visualization programs. There were byte ordering issues with the format so OpenEye developed a more flexible format based upon the tagged binary IO available in OESystem.
The OpenEye format allows surfaces to be attached to molecules and then written out to OEBinary (.oeb) files. A visualizer can then read in the molecule and surface without any other means of making the association. Listing 1 demonstrates how to properly attach surfaces to molecules.
Listing 1: Attaching a surface as generic data to be written to OEB
surf = OESurface() OEMakeMolecularSurface(surf, mol) mol.SetData("surface", surf) ofs = oemolostream("foo.oeb") OEWriteMolecule(ofs, mol)
Listing 2 demonstrates how to then read that surface back out of the OEB file.
Listing 2: Retrieving a surface attached as generic data from an OEB file
ifs = oemolistream("foo.oeb") OEReadMolecule(ifs, mol) msrf = mol.GetData("surface")
Versions of Spicoli prior to 1.0.2 required calling OEInitSurfaceHandlers in order to have surfaces attached to molecules be read and written to and from OEB.