It is also to use OEChem to determine whether an atom or bond is in
a ring or cycle of a given size, using the OEAtomIsInRingSize and
OEBondIsInRingSize functions. Both of these functions require that
OEFindRingAtomsAndBonds has previously been called on the molecule.
Both of these functions take the query ring size as an argument, which
should be greater than or equal to three. The definition of ring or
cycle is not based upon the ``smallest set of smallest rings'' (SSSR) , and these return true if there is
a bonded path of `size' unique atoms where each atom is bonded to the
next and the last is bonded to the first.
It is often the case that atoms may be in different sized cycles at
the same time. For example, one way to identify the ring fusion atoms
in indole (the fusion of a five-membered pyrrole ring and a six-membered
benzene ring) is to use OEAtomIsInRing(atm,5) && OEAtomIsInRing(atm,6). Of course, the MyAtomRingBondCount function given in the previous section
would be a more efficient way to solve the same problem.
OEChem also provides an additional pair of functions,
OEAtomIsInAromaticRingSize and OEBondIsInAromaticRingSize , to determine
whether an atom or bond is in an aromatic ring or cycle of a given size.
These behave identically to OEAtomIsInRingSize and OEBondIsInRingSize
except that each ring bond in the path/cycle must be aromatic. In
addition to OEFindRingAtomsAndBonds , these functions also require the
user to have called OEAssignAromaticFlags.