.. _section_oechem_releasenotes_192:

********************************************************************************
Version 1.9.2
********************************************************************************

OEChem 1.9.2
================================================================================

New features
--------------------------------------------------------------------------------

* OEChem now supports the creation of InChI. OEChem produces the same
  InChI as the InChI library provided application for 99.77% of MDDR
  in the SDF format. The differences fall into two categories:

  - Corrupted molecules where the tools have to make arbitrary
    decisions about how to correctly interpret the data.
  - Bond stereo being perceived by the InChI application where bond
    stereo does not actually exist. OEChem does not assign bond stereo
    and generates what appears to be a more "correct" InChI for these cases. 

  The inclusion of InChI support added the following: 

  - :oe:func:`OEChem::OECreateInChI`
  - :oe:func:`OEChem::OECreateInChIKey`
  - :oe:const:`OEChem::OEFormat::INCHI`
  - :oe:const:`OEChem::OEFormat::INCHIKEY`
  - :oe:constns:`OEChem::OEOFlavor::INCHI`
  - :oe:constns:`OEChem::OEOFlavor::INCHIKEY`
  - :ref:`OEInChIOptions <OEChem_OEInChIOptions>`

  In addition, :ref:`oemolostream <OEChem_oemolostream>` will automatically write
  InChI when using the ``.inchi`` file extension. 

* :oe:func:`OEChem::OEPrepareSearch` added that perceives atom and
  bond properties of a molecule that are necessary to successfully execute a
  given substructure search. It is now highly recommended to run this
  function on a molecule before passing the molecule to any of
  OEChem's graph matching algorithms.

.. oe:language:: java

   * Several Java API points that pass primitive arrays of doubles or
     floats were optimized with good results.  The following API
     points that take these primitive array types were optimized:
     ``NewConf``, ``SetCoords``, and ``GetCoords``. 

     .. list-table::  **The following figures should be indicative of the performance increase in the 2013.June release:**

        * - .. image:: ../../oechemtk/releasenotes/images/javagraph1.png
          - .. image:: ../../oechemtk/releasenotes/images/javagraph2.png

* Changed the default input and output molecule file formats for
  molstreams and molthreads from :oe:const:`OEChem::OEFormat::SMI` to
  :oe:const:`OEChem::OEFormat::ISM`.

* :oe:func:`OEChem::OEWriteMDLFile` writes MDL enhanced stereo
  groups.

* :oe:func:`OEChem::OEWriteMDLFile` will now automatically write a molecule
  in the V3000 file format if it has more than 999 atoms or if it has any
  MDL enhanced stereo group regardless of the given file format
  flavor.

* :oe:func:`OEChem::OESetMCSExhaustiveSearchTruncationLimit` and
  :oe:func:`OEChem::OEGetMCSExhaustiveSearchTruncationLimit` functions
  added that control how thoroughly the search is performed by the
  :oe:const:`exhaustive<OEChem::OEMCSType::Exhaustive>` MCS search. 
 

* Added the following standard SYBYL atom types:
  :oe:const:`OEChem::OETriposType::Cu`
  :oe:const:`OEChem::OETriposType::Cooh`,
  :oe:const:`OEChem::OETriposType::Croh`,
  :oe:const:`OEChem::OETriposType::Crth`,
  :oe:const:`OEChem::OETriposType::Fe`,
  :oe:const:`OEChem::OETriposType::Mg`,
  :oe:const:`OEChem::OETriposType::Mn`,
  :oe:const:`OEChem::OETriposType::Mo`,
  :oe:const:`OEChem::OETriposType::Se`,
  :oe:const:`OEChem::OETriposType::Sn`, and
  :oe:const:`OEChem::OETriposType::Zn`.
  Atoms for which no SYBYL atom type exists are still internally handled with the 
  :oe:const:`OEChem::OETriposType::Du` type, however when writing these atoms into
  a ``MOL2`` file their atomic symbol is written to the SYBYL atom type
  column instead of a string "Du".

* Added :oe:func:`OEChem::OEGetDimensionFromCoords` function that returns the
  dimension of the molecule from its coordinates.

* Residue information is now retained when reading files with MacroModel formats
  (.mmod, .mmd, and .dat).

Major bug fixes
--------------------------------------------------------------------------------

* It used to be possible to perform a substructure search for
  stereochemistry or hybridization on a molecule that did not yet have
  those properties perceived. This led to very subtle to detect
  problems where molecules would not match that were expected to
  match. 

  To combat this, the following :ref:`OESubSearch <OEChem_OESubSearch>` methods
  now throw warnings in case some property that is necessary to
  successfully execute the substructure search has not been perceived
  yet:

  * :oe:meth:`OEChem::OESubSearch::Match`
  * :oe:meth:`OEChem::OESubSearch::SingleMatch`
  * :oe:meth:`OEChem::OESubSearch::AtomMatch`

  These warnings can be suppressed by calling the
  :oe:func:`OEChem::OEPrepareSearch` function on the molecule
  first.

* Utilizing the :oe:const:`OEChem::OEPerceived::AtomStereo` and
  :oe:const:`OEChem::OEPerceived::BondStereo` flag to mark whether
  the atom and bond stereo information is perceived in a molecule.

* It is now thread-safe to copy the same :ref:`OEMol <OEChem_OEMol>` from
  multiple threads at the same time. This was caused by some
  :ref:`OEMCMolBase <OEChem_OEMCMolBase>` methods not actually being const. The
  following methods were marked as const, but were not actually const,
  leading to subtle race conditions:

  - :oe:meth:`OEChem::OEConfBase::GetTitle`
  - :oe:meth:`OEChem::OEMCMolBase::GetActive`


.. oe:language:: c++

   * The const-ness of many OEChem functions and methods have been
     fixed. This can potentially cause code to not compile if the code
     was incorrectly abusing the const-ness of the object. For
     example, the following code used to compile before this release:

     .. code-block:: c++

        const OEGraphMol mol;
        OEAddExplicitHydrogens(mol);

     The const-ness of the following functions and methods have been fixed: 

     - :oe:meth:`OEChem::OEGraphMol::SCMol`
     - :oe:meth:`OEChem::OEGraphMol::operator OEMolBase &`
     - :oe:meth:`OEChem::OEConfBase::GetMCMol`
     - :oe:meth:`OEChem::OEMol::SCMol`
     - :oe:meth:`OEChem::OEMol::MCMol`
     - :oe:meth:`OEChem::OEMol::operator OEMCMolBase &`
     - :oe:meth:`OEChem::OEQMol::SCMol`
     - :oe:meth:`OEChem::OEQMol::operator OEMolBase &`
     - :oe:meth:`OEChem::OEQMol::QMol`
     - :oe:meth:`OEChem::OEQMol::operator OEQMolBase &`
     - :oe:meth:`OEChem::OEQBase::GetExpr`
     - :oe:meth:`OEChem::OEGetNbrAtom::Constructors`
     - :oe:meth:`OEChem::oemolithread::GetIStream`
     - :oe:meth:`OEChem::oemolithread::GetMolStream`
     - :oe:meth:`OEChem::oemolothread::GetOStream`
     - :oe:meth:`OEChem::oemolothread::GetMolStream`

* :oe:meth:`OEChem::OEMCMolBase::GetMCMolTitle` method added to
  provide a way to differentiate between a top-level
  :ref:`OEMCMolBase <OEChem_OEMCMolBase>` title and a conformer title.

* :oe:meth:`OEChem::OEMCSSearch::AddConstraint` now requires that the
  constraint is satisfied in all resulting matches. Previously, the
  documentation stated the following, "Constraints are considered
  satisfied in subgraphs which do not contain any constrained atoms or
  bonds in either the pattern or target molecules." This is no longer
  the intended behavior.

* :oe:meth:`OEChem::OEMCSSearch::AddConstraint` now returns ``false``
  if passed the same pattern atom or bond twice. The user must now use
  :oe:meth:`OEChem::OEMCSSearch::ClearConstraints` in order to rebuild
  a set of constraints.


Minor bug fixes
--------------------------------------------------------------------------------

* :oe:func:`OEChem::OE3DToBondStereo` function returns false if the molecule
  dimension is 0, since no cis or trans bonds can be perceived if there are no
  coordinates.

* Fixed a problem when the max matches value of the :ref:`OESubSearch <OEChem_OESubSearch>`
  was reset to the default value ``1024`` every time the search was initialized
  by the :oe:meth:`OEChem::OESubSearch::Init` method.

* Adjusted the dimension of a molecule to 0 if it is read from either a ``MDL``
  or an ``SDF`` file with no coordinates.

* :oe:func:`OEChem::OE3DToAtomStereo` function throws a warning and
  returns ``false`` if any chiral atom of the molecule is not
  tetrahedral, i.e., if the atom stereo can not be determined from the
  3D coordinates, usually because it is flat.

* The following functions and methods throw additional warnings in cases where either the
  :oe:func:`OEChem::OE3DToAtomStereo` or the :oe:func:`OEChem::OE3DToBondStereo`
  functions encounter any problems when assigning stereo from coordinates:

  * :oe:func:`OEChem::OEPrepareSearch` functions
  * :oe:func:`OEChem::OEWriteMolecule` function when writing the following formats:
    :oe:const:`OEChem::OEFormat::MDL`,
    :oe:const:`OEChem::OEFormat::SDF`
    :oe:const:`OEChem::OEFormat::ISM`,
    :oe:const:`OEChem::OEFormat::INCHI` and
    :oe:const:`OEChem::OEFormat::INCHIKEY`
  * :oe:meth:`OEChem::OEAbsoluteConfTest::CompareMols` method
  * :oe:meth:`OEChem::OEIsomericConfTest::CompareMols` method
  * :oe:meth:`OEChem::OEAbsCanonicalConfTest::CompareMols` method
  * :oe:meth:`OEChem::OEOmegaConfTest::CompareMols` method
  * :oe:meth:`OEChem::OEDefaultConfTest::CompareMols` method

* :oe:func:`OEChem::OESubsetMol` now produces correct results when
  the ``RGroup`` flag was ``true`` and the molecule contained
  :ref:`OEGroupBase <OEChem_OEGroupBase>` objects.

* :oe:func:`OEChem::OEPerceiveChiral` function considers hydrogens with different
  mass as being different *i.e.* it will recognize the C atom in a molecule
  "[3H]C(N)F" as a chiral atom, since it has four different neighbors: N, F, H  and 3H.
 

* The first argument of the following methods is not const any longer:

  * :oe:meth:`OEChem::OEAbsoluteConfTest::CompareMols` method
  * :oe:meth:`OEChem::OEIsomericConfTest::CompareMols` method
  * :oe:meth:`OEChem::OEAbsCanonicalConfTest::CompareMols` method
  * :oe:meth:`OEChem::OEOmegaConfTest::CompareMols` method
  * :oe:meth:`OEChem::OEDefaultConfTest::CompareMols` method

* Improved the performance of the following methods:

  * :oe:meth:`OEChem::OEAbsoluteConfTest::CompareMols` method
  * :oe:meth:`OEChem::OEIsomericConfTest::CompareMols` method
  * :oe:meth:`OEChem::OEOmegaConfTest::CompareMols` method

* :oe:meth:`OEChem::OEAtomBondSet::AddAtom` and
  :oe:meth:`OEChem::OEAtomBondSet::AddBond` will now return false when
  the trying to mix atoms from different molecules.

* :oe:meth:`OEChem::OEAtomBondSet::HasAtom` and
  :oe:meth:`OEChem::OEAtomBondSet::HasBond` added for testing for
  membership.

.. oe:language:: python 

   * :oe:func:`OEChem::OEGetTorsions` now works from Python.

.. oe:language:: python java csharp
 
   * The following functors are now properly wrapped in Python, Java,
     and C#:

     - :oe:cls:`OEIsTrueAtom<OESystem::OEIsTrue>`
     - :oe:cls:`OEIsFalseAtom<OESystem::OEIsFalse>`
     - :oe:cls:`OEIsTrueBond<OESystem::OEIsTrue>`
     - :oe:cls:`OEIsFalseBond<OESystem::OEIsFalse>`
     - :oe:cls:`OEIsTrueConf<OESystem::OEIsTrue>`
     - :oe:cls:`OEIsFalseConf<OESystem::OEIsFalse>`

   * The following functors are now deprecated: 

     - `OEChem::IsTrueAtom` 
     - `OEChem::IsFalseAtom` 
     - `OEChem::IsTrueBond` 
     - `OEChem::IsFalseBond` 
     - `OEChem::IsTrueConf` 
     - `OEChem::IsFalseConf` 


Documentation fixes
--------------------------------------------------------------------------------

* The :oe:constns:`OEChem::OEAroModel` namespace is now accessible from the table
  of contents.


OESystem 1.9.2
================================================================================

New features
--------------------------------------------------------------------------------

* Added the following non-linear color gradients:

  * :ref:`OEExponentColorGradient <OESystem_OEExponentColorGradient>`
  * :ref:`OEExponentialColorGradient <OESystem_OEExponentialColorGradient>`
  * :ref:`OELogarithmicColorGradient <OESystem_OELogarithmicColorGradient>`

  These classes along with the :ref:`OELinearColorGradient <OESystem_OELinearColorGradient>` class
  now derive from the :ref:`OEColorGradientBase <OESystem_OEColorGradientBase>` base class.

.. oe:language:: c++

   * :oe:func:`OESystem::OECount` convenience function added for
     counting the number of items being held in an iterator.

   * :oe:func:`OESystem::OEIsEmpty` convenience function added for
     determining whether an iterator contains any items. 

Minor bug fixes
--------------------------------------------------------------------------------

* Fixed a possible link-time race condition with
  :oe:func:`OESystem::OEGetTag` that could cause a crash if
  :oe:func:`OESystem::OEGetTag` was used during link-time (library
  loading). 

* :ref:`OEColor <OESystem_OEColor>` could encounter a benign race condition
  during color clamping operations. 

.. oe:language:: c++

   * Parameter types for :oe:func:`OESystem::OECopyArray` and
     :oe:func:`OESystem::OEMoveArray` have been changed from unsigned
     int to size_t to reduce compiler warnings and increase
     compatibility with the underlying syscall.

   * :oe:cls:`OESystem::OEProtectedBuffer::Put` fixed to avoid a rare
     race condition when pushing in a null value.

   * :ref:`OEErrorHandler <OESystem_OEErrorHandler>` copy constructor and
     ``operator=`` argument changed from const to non-const as they
     were not actually const. These methods can pass ownership from
     the right-hand-side to the left-hand-side for the underling
     :ref:`OEErrorHandlerImplBase <OESystem_OEErrorHandlerImplBase>` object.

OEPlatform 1.9.2
================================================================================

Major bug fixes
--------------------------------------------------------------------------------

.. oe:language:: c++

   * Windows C++ MT projects will no longer randomly crash at process
     exit due to OpenEye toolkit internals.

   * :ref:`OEThreadLocal <OEPlatform_OEThreadLocal>` destructor will now delete the
     object associated with the current thread. The object has to be
     destroyed at this point since after the
     :ref:`OEThreadLocal <OEPlatform_OEThreadLocal>` destructor finishes it is
     impossible to get the data stored in it again. Note, it is still
     undefined behavior to destroy a
     :ref:`OEThreadLocal <OEPlatform_OEThreadLocal>` object that is still being used by
     another thread.

* Calling `OEPlatform::oeofstream::append` after
  `OEPlatform::oeofstream::open` will no longer hang
  indefinitely once data is written to it.

Minor bug fixes
--------------------------------------------------------------------------------

.. oe:language:: c++
   
   * :ref:`OEOnce <OEPlatform_OEOnce>` performance improvement by using the
     clang compiler's built-in support instead of relying on a pthread
     implementation.

.. oe:language:: java

   * The java JVM can run out of memory when trying to free memory. If
     this is detected, the OpenEye toolkits will print the following
     message, "JNI::OutOfMemory -- the JAVA heap may need to be
     increased -- program terminating". Please increase the size of
     the java heap using the ``-Xmx`` option.


OEBio 1.9.2
================================================================================

* Minor internal improvements. 

OEGrid 1.4.3
================================================================================

Minor bug fixes
--------------------------------------------------------------------------------

* :ref:`OESkewGrid <OESystem_OESkewGrid>` now properly initializes its base
  class :ref:`OEGridAbstractBase <OESystem_OEGridAbstractBase>` during construction.

* The :oe:const:`OESystem::OEGridFileType::Ascii` format will now try
  harder to detect any incorrect file formatting issues and warn about
  them.

Documentation fixes
--------------------------------------------------------------------------------

* The ``ASCIIWriter`` documentation example in the :ref:`Grid Input
  and Output<section_grid_input_output>` section was incorrect as it
  was writing out both grid indices and grid values.
