15.5 Writing a Sybyl mol2 file using OEWriteMol2File

To demonstrate how all of these atom and bond typing routines are used together, the following example shows how to write a Sybyl mol2 file using low-level I/O.

void MyWriteMol2Molecule(oemolostream &ofs, OEMolBase &mol)
{
  OEFindRingAtomsAndBonds(mol);
  OEAssignAromaticFlags(mol,OEAroModelTripos);
  OETriposAtomTypeNames(mol);
  OETriposBondTypeNames(mol);
  OETriposAtomNames(mol);
  OEWriteMol2File(ofs,mol,false);
}