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.
Attached to Molecules¶
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; OEMakeMolecularSurface(surf, mol); mol.SetData<OESurface>("surface", surf); oemolostream ofs("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
oemolistream ifs("foo.oeb"); OEReadMolecule(ifs, mol); OESurface msrf = mol.GetData<OESurface>("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.