5.1.4 Title

The ``Title'' property is a string used to represent the name of the molecule. The default value is an empty string. This field may be used to store registry number or other identifier, instead of a common name. The string is typically trimmed of white space by most file format readers.

#!/usr/bin/env python
# ch5-1.py
from openeye.oechem import *

mol = OEGraphMol()
OEParseSmiles(mol, "c1ccccc1")

mol.SetTitle("benzene")
mol.SetEnergy(-20.3)

print "Title: ", mol.GetTitle()
print "Energy:", mol.GetEnergy()

Much more data can be stored in generic data containers associated with the molecules. The most common is SD file tagged data. In Python, we have added several convenience methods for dealing with SD file tagged data since it is so common.