Creating an OECIFData Object
In this example, we will use the OECIFData to get, add, delete, and set header data for an input
CIF file. We will use the PDB code 5NEV read using the mmCIF format, but any CIF header can be accessed with these APIs.
First, the molecule is read and the OECIFData object is created. This object holds the header data for easy editing.
To save any changes made to the header back onto the molecule, use the
OESetMMCIFChemCompData function.
Read the data and generate the OECIFData object.
The OECIFData class allows access to all the data in a CIF header, but each CIF header category in a data block
is broken into smaller OECIFCategory objects which can be accessed and modified.
For more information about OECIFData, OECIFCategory, and the CIF file format, see CIF File Format.
Attribute data is accessed by first specifying the CIF category name, and a specific data value in that category can be accessed with the attribute. For the following example, the category is ‘_audit_author.’, and the values correlate with the attribute names.
Editing data items can be done using the Set, Add, and Delete OECIFData functions. When specifying a data value with multiple rows of data (i.e., CIF Loop Data), attribute values on a specific row can be accessed with a base-0 row index:
The OECIFData object can be used to update or synchronize header data with changes to the
molecule. We can simulate this by first modifying a part of the molecule:
Updating requires the user to specify which parts of the header are to be updated. This is done using the
OECIFOptions class. A more detailed explanation about which data items are affected by perception
can be found in the CIF File Format theory. In the following example, we update the header and check
to make sure that our residue changes from above have been applied to the pertinent header locations.
OESetMMCIFChemCompDatafunctionOEUpdateMMCIFDatafunctionOECIFDataclassOECIFCategoryclass