Miscellaneous

Here all examples are presented, which does not fit in another category.

Point group symmetry calculation

Here is an example for the brute force symmetry analyzer identifying primitive rotations, planes and inversion centres.

Example 9-30. Calculate point group symmetries

if (symmetry.readCoordinates(mol) < 0)
{
  System.err.println("Error reading in atomic coordinates");
  System.exit(1);
}

// start symmetry estimation
try
{
  symmetry.findSymmetryElements(true);
}
catch (SymmetryException e)
{
  e.printStackTrace();
  System.exit(1);
}

if (symmetry.getBadOptimization())
  System.out.println("Refinement of some symmetry elements was"+
                     " terminated before convergence was reached.\n" +
                     "Some symmetry elements may remain unidentified.\n");

symmetry.reportSymmetryElementsVerbose();
System.out.println("Molecule has the following symmetry elements:\n"+ symmetry.getSymmetryCode());
PointGroup pointGroup = symmetry.identifyPointGroup();
if (pointGroup != null)
{
  System.out.println("It seems to be the "+ pointGroup.getGroupName()+ " point group");
}
else
{
  System.out.println("These symmetry elements match more than one group I know of.");
}

Hash code calculation

Sloppy Hashcode which uses only topological informations without E/Z isomerism and S/R chirality. This hascode is really helpfull to identify duplicate topological molecule entries.

Example 9-31. Calculate a molecule hashcode

int hashcode =AbstractDatabase.getHashcode(mol)

Reading JCAMP-DX spectras

Parse JCAMP-DX data.

Example 9-32. Load JCAMP-DX spectras

JCAMPParser jcamp=null;
try
{
  jcamp=JCAMPParser(jcampString);
}
catch(IOException ioex)
{
  ioex.printStackTrace();
}
catch(JCAMPException jex)
{
  jex.printStackTrace();
}

Create fragmented molecules

Fragemted molecules can be generated by splitting contiguous fragments or using SMARTS splice definitions.

Example 9-33. Fragment molecules if they are disconnected (non-contiguous)

ContiguousFragments fragmenter=new ContiguousFragments();
JOEMolVector fragments=fragmenter.getFragmentation(mol);

Combinatorial synthesis for generating virtual combinatorial libraries

The standard procedure to generate molecules is using s scaffold and R-groups. New coordinates will be generated if the scaffold contains already 2D or 3D coordinates.

Example 9-34. Generate molecules using R-Groups

MolGenerationHelper generator=new MolGenerationHelper();
JOEMol newMolecule=createNewMolecule(baseMolecule,connections,rGroups);