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
OESurface surf = new OESurface(); OESpicoli.OEMakeMolecularSurface(surf, mol); OESpicoli.OESetSurface(mol, "surface", surf); oemolostream ofs = new oemolostream("foo.oeb"); OEChem.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
oemolistream ifs = new oemolistream("foo.oeb"); OEChem.OEReadMolecule(ifs, mol); OESurface msrf = OESpicoli.OEGetSurface(mol, "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.