Chapter 1. JOELib basics

Table of Contents
Atoms
Bonds
Molecule

Atoms

Atoms in joelib.molecule.JOEAtom are represented as nodes of a graph. The atom properties can be changed with standard set and get methods.

Internally atoms have special atom types, which were defined as SMARTS [smarts] patterns in the joelib/data/plain/atomtype.txt-file. These types can be used to develop descriptors or to export molecules easily to other file formats (e.g. force field or ab inito programs). For the last task there is the joelib.data.JOETypeTable helper class available, which uses the default converting types defined in joelib/data/plain/types.txt.

For getting all atoms of a molecule you can use an iterator or a simple index access.

Example 1-1. Using an iterator for acessing atoms

JOEAtom atom;
AtomIterator ait = molecule.atomIterator();
while(ait.hasNext())
{
  atom = ait.nextAtom();
}

Example 1-2. Using the atom index for acessing atoms

JOEAtom atom;
for(int index=1;index<=molecule.numAtoms();index++)
{
  atom = molecule.getAtom(index);
}