
.. _section_oechem_releasenotes_201:

********************************************************************************
Version 2.0.1
********************************************************************************

OEChem 2.0.1
================================================================================

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

* :oe:meth:`OEChem::OEMolBase::SetCoords` will now reset the atom and
  bond stereo perception flags,
  :oe:const:`OEChem::OEPerceived::AtomStereo` and
  :oe:const:`OEChem::OEPerceived::BondStereo` respectively. This can
  force reperception of the stereo information from the new
  coordinates by other functions that may need it. For example, a
  later call to :oe:func:`OEChem::OEWriteMolecule` will now
  automatically call :oe:func:`OEChem::OE3DToAtomStereo`.

* :oe:func:`OEChem::OECopyMol` function added to make a copy of a molecule and return
  the atom or bond associations between the source and destination molecules.

* :oe:meth:`OEChem::OEMolBase::ClearBase` method added to allow
  clearing generic data on the :ref:`OEMolBase <OEChem_OEMolBase>` without
  destroying the molecule itself.

* :oe:meth:`OEChem::OEUniMolecularRxn::SetValidateKekule` method added
  to allow skipping the Kekule validation step after the reaction is
  applied. Note, this allows :ref:`OEUniMolecularRxn <OEChem_OEUniMolecularRxn>` to
  return radicals, leaving clean up to the user.

* :oe:func:`OEChem::OESuppressHydrogens` can now suppress hydrogens at
  specific heavy atom sites.

* :ref:`OENthAtom <OEChem_OENthAtom>` predicate's 2nd argument now defaults to ``0`` to be
  easier to use.

* :oe:func:`OEChem::OEGetMolDatabaseIdxFileName` added to generate
  index file names from database file names using the same rules as
  :oe:func:`OEChem::OECreateMolDatabaseIdx` and
  :oe:cls:`OEChem::OEMolDatabase::Save`.

.. oe:language:: python

   * :ref:`OEAtomBondSet <OEChem_OEAtomBondSet>` now supports the ``str`` Python
     built-in function. Calling ``str`` on an
     :ref:`OEAtomBondSet <OEChem_OEAtomBondSet>` will now return a string like the
     following:

     .. code-block:: python

        >>> mol = OEGraphMol()
        >>> OESmilesToMol(mol, "c1ccccc1O")
        True
        >>> str(OEAtomBondSet(mol.GetAtoms()))
        '[7] 0C 1C 2C 3C 4C 5C 6O '

   * :ref:`oemolistream <OEChem_oemolistream>`, :ref:`oemolithread <OEChem_oemolithread>`,
     :ref:`oemolostream <OEChem_oemolostream>`, :ref:`oemolothread <OEChem_oemolothread>` now
     support the Python ``with`` statement. This ensures that files
     are automatically flushed and closed whenever falling out of
     the ``with`` scope. For example:

     .. code-block:: python

        mol = # some initialized molecule
        with oemolostream("file.oeb") as ofs:
            OEWriteMolecule(ofs, mol)

        # file.oeb is guaranteed to contain the molecule
        with oemolistream("file.oeb") as ifs:
            for mol in ifs.GetOEMols():
                # do something with mol

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

* :oe:func:`OEChem::OEMMFFAtomType` will no longer crash whenever an
  unbonded sulfur with a single implicit hydrogen is encountered.

* :oe:func:`OEChem::OEAssignAromaticFlags` now invokes the
  :oe:func:`OEChem::OEFindRingAtomsAndBonds` function, when necessary.
  If no ring atoms are detected in the molecule, the
  :oe:func:`OEChem::OEAssignAromaticFlags` functions
  returns after setting all atoms and bonds of the molecule to be non-aromatic.

* The :ref:`OESubSearch <OEChem_OESubSearch>` class now throws a warning in the following
  two cases:

  * If there are only explicit hydrogens in the pattern, but the target has only
    implicit hydrogens.
  * If there are only implicit hydrogens in the pattern, but the target has only
    explicit hydrogens.

  These warnings are necessary in order to avoid substructure match failures that
  are the result of mismatched hydrogen representation.

* The :oe:func:`OEChem::OEGetFileType` function now returns
  :oe:const:`OEChem::OEFormat::UNDEFINED` for file extensions that
  contain extra characters after the known file extension. For
  example, ``ismama`` used to inappropriately return
  :oe:const:`OEChem::OEFormat::ISM`. The only exception is if the extra
  characters are preceded by ".". Therefore, the following strings are
  still considered valid: ``sdf.gz``, ``sdf.bin``, and ``sdf.zip``.

* V3000 entries with a broken atom or bond block will no longer crash,
  the reader will now throw a warning and skip the molecule.

* :oe:func:`OEChem::OEMDLPerceiveBondStereo` function will no longer
  clear wavy bonds, :oe:const:`OEChem::OEBondStereo::Wavy`, since this
  property can not be re-perceived from other information.  The MDL
  bond stereo can be removed by calling the new
  :oe:func:`OEChem::OEMDLClearBondStereo` function.

* :oe:func:`OEChem::OEWriteMDLFile` no longer has a subtle race
  condition that could lead to incorrect time stamps being written in
  the header. The race condition was caused by the use of the standard
  C library ``localtime`` function.

* `OEChem::oemolithread::open` will no longer crash when given
  an empty :file:`.csv` file.

* :oe:func:`OEChem::OEReadMDLReactionQueryFile` previously incorrectly
  required "M END" lines between reactant and product blocks. These
  lines are no longer required and will be ignored if they are
  encountered. This change allows reaction query files to be read that
  are generated by ChemDraw and the Accelrys Enterprise Platform.

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

* :oe:meth:`OEChem::OEMolDatabase::GetTitle` will no longer return a
  corrupted title for multi-molecule :file:`.mol2` files.

* :oe:func:`OEChem::OEGenerate2DCoordinates` will now handle a molecule
  as a reaction if any of its atoms have a reaction role other than
  :oe:const:`OEChem::OERxnRole::None`. Previously, only molecules that
  returned ``true`` from :oe:meth:`OEChem::OEMolBase::IsRxn` would be
  handled as reactions.

* **OEChem 2.0.0**, the previous release, introduced automatic 2D
  coordinate generation when writing to the following file formats:
  :oe:const:`OEChem::OEFormat::SDF`, :oe:const:`OEChem::OEFormat::MDL`,
  and :oe:const:`OEChem::OEFormat::CDX`. However, coordinate generation
  will only occur if :oe:meth:`OEChem::OEMolBase::GetDimension` does
  not return 2 or 3, indicating that the molecule already contains
  coordinates. :oe:func:`OEChem::OEWriteMolecule` will now throw a
  warning message if coordinates are detected on the molecule and
  :oe:meth:`OEChem::OEMolBase::SetDimension` was not appropriately
  called. Users should either call
  :oe:meth:`OEChem::OEMolBase::SetDimension` to the appropriate
  dimensionality of the molecule, or clear the molecule's coordinates.

  .. note::

     :file:`.cdx` files will still automatically generate 2D
     coordinates from 3D molecules since :file:`.cdx` is a 2D molecule
     format only.

* :oe:func:`OEChem::OEAssignAromaticFlags` used to only set atoms to
  non-aromatic if no ring bonds were found. Bond aromaticity will now
  be cleared as well if no ring atoms are found.

* :oe:func:`OEChem::OECreateMolDatabaseIdx` will no longer crash
  whenever called inside a directory without write permissions.

* `OEChem::oemolostream::seekp` removed since it did not do
  anything.

* :oe:func:`OEChem::OESmartsLexReplace` argument is now ``const`` since
  the function does not need to alter the vector.

* Removed unbounded stack allocations.

* The partial support for CPSS-style rxnfiles has been entirely removed as this format
  is documented as obsolete in the CTfile format specification.

* :oe:func:`OEChem::OEAddExplicitHydrogens` no longer has the rare
  chance of using uninitialized memory when sprouting hydrogens in 3D.

* :oe:func:`OEChem::OEReadMDLQueryFile` will now interpret ``![N,O,S]``
  as ``![N,O,S,H]`` to be consistent with MDL matching
  behavior.

* :oe:meth:`OEChem::OEOmegaConfTest::CompareMols`,
  :oe:meth:`OEChem::OEIsomericConfTest::CompareMols`,
  :oe:meth:`OEChem::OEAbsoluteConfTest::CompareMols` will all now
  return ``true`` if the only difference between the bonds of the two
  molecules is whether the ``Bgn`` and ``End`` bonds have been
  swapped.

.. oe:language:: java

   * :oe:func:`OEChem::OESmartsLexReplace` is now properly wrapped in Java.

.. oe:language:: java csharp

   * The :ref:`OETorsion <OEChem_OETorsion>` parameters to
     :oe:meth:`OEChem::OEMCMolBase::NewConf` are now properly wrapped.

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

* All examples should now use :oe:func:`OEChem::OESmilesToMol` instead of
  :oe:func:`OEChem::OEParseSmiles`. :oe:func:`OEChem::OESmilesToMol` is
  the preferred safer method for parsing :term:`SMILES`.

* Simplified the documentation for the basic molecule class
  hierarchy. Previously, documentation was spread between the base
  class and the concrete classes. The base class sections should now
  be the canonical place to look for specific method documentation.

  * For :ref:`OEGraphMol <OEChem_OEGraphMol>` methods, see the
    :ref:`OEMolBase <OEChem_OEMolBase>` section

  * For :ref:`OEMol <OEChem_OEMol>` methods, see the
    :ref:`OEMCMolBase <OEChem_OEMCMolBase>` section

  * For :ref:`OEQMol <OEChem_OEQMol>` methods, see the
    :ref:`OEMolBase <OEChem_OEMolBase>` section

* Added documentation for :ref:`OEConfBase <OEChem_OEConfBase>` and
  :ref:`OEMCMolBase <OEChem_OEMCMolBase>` classes that are instantiations of
  ``OEChem::OEConfBaseT`` and ``OEChem::OEMCMolBaseT``
  template classes, respectively.

* Added missing documentation for the :ref:`OEConfBase <OEChem_OEConfBase>`
  and :ref:`OEMCMolBase <OEChem_OEMCMolBase>` classes.

* Generated new images for the :ref:`Explicit Hydrogens
  <section_mdlqueries_hydrogens>` section of the :ref:`Substructure
  Search with MDL Queries <chapter_mdlqueries>` chapter

* Memory leak fixed in ``NewConfFromCoords`` documentation example.

* Corrected a link to the CTfile format document from Accelrys, Inc.

* :oe:constns:`OEChem::OEProperty` namespace formatting fixed in PDF
  files to actually be readable.

* :ref:`OEOmegaConfTest <OEChem_OEOmegaConfTest>` added to the conformer test section
  for :ref:`Input and Output <section_oemol_inputandoutput>`.

.. oe:language:: csharp

   * C# code snippets added to the :ref:`Molecular Database Handling
     <chapter_moldatabase>` chapter.

OEBio 2.0.1
================================================================================

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

* :oe:func:`OEBio::OESetRotamer` can properly set rotamers with angles of 0.0.
  Previously the angle was silently left unchanged.



OESystem 2.0.1
================================================================================

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

* :ref:`OEInterface <OESystem_OEInterface>` can now report all the OpenEye
  toolkit libraries being used by specifying ``--help versions`` on
  the command line.

* :oe:func:`OESystem::OEParseCommandLine` now accepts an argument for
  specifying the program's version number. This version number will be
  printed whenever ``--version`` is found on the command line.

* :oe:const:`OESystem::OEMemPoolMode::Spinlocked` memory pool mode
  added to provide a more efficient mutual exclusion mechanism than
  mutexes for the small object caches.

* Added the following functions to provide predefined sets
  of colors:

  * :oe:func:`OESystem::OEGetColors`
  * :oe:func:`OESystem::OEGetContrastColors`
  * :oe:func:`OESystem::OEGetDeepColors`
  * :oe:func:`OESystem::OEGetLightColors`
  * :oe:func:`OESystem::OEGetVividColors`

* Added the following colors:

  * :oe:const:`OESystem::OESystem::OEBrass`
  * :oe:const:`OESystem::OESystem::OECopper`
  * :oe:const:`OESystem::OESystem::OEGold` (the original color was renamed to :oe:const:`OESystem::OESystem::OEMandarin`)
  * :oe:const:`OESystem::OESystem::OESilver`
  * :oe:const:`OESystem::OESystem::OEPewter`

.. oe:language:: python

   * :oe:meth:`OESystem::OEBase::SetData` now accepts Python sequences
     of strings for data. Note, this data can not be read or written
     to :file:`.oeb` files.

   * :ref:`OEColor <OESystem_OEColor>` will now ``repr`` to a more
     appropriate string representation suitable for the Python
     interpreter as shown below.

   .. code-block:: python

      >>> OERed
      OEColor(r=255,g=0,b=0,a=255)
      >>> OEGreen
      OEColor(r=0,g=255,b=0,a=255)
      >>> OETransparentColor
      OEColor(r=255,g=255,b=255,a=0)


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

* Removed unbounded stack allocations.

* :oe:cls:`OESystem::OEHeader::SetDate` no longer has a subtle race
  condition due to the use of the standard C library ``localtime``
  function.

.. oe:language:: python

   * ``OE*Array`` classes will now throw a reasonable error message
     when attempting to index with a floating point number. This can
     occur more easily due to division change in Python 3.

.. oe:language:: c++

   * :oe:func:`OESystem::OEMakeString` used to be limited by an
     internal buffer to only output strings with less than 8192
     characters. The function will now allow any output size string to
     be created.

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

* Added missing documentation for the following colors:

  * :oe:const:`OESystem::OESystem::OEGreenBlue`
  * :oe:const:`OESystem::OESystem::OEGreenTint`


OEPlatform 2.0.1
================================================================================

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

.. oe:language:: c++

   * :ref:`OESpinlock <OEPlatform_OESpinlock>` and
     :ref:`OELockSpinlock <OEPlatform_OELockSpinlock>` classes added to provide
     mutual exclusion to cheap sections of code with less overhead
     than :ref:`OEMutex <OEPlatform_OEMutex>`.

   * :oe:func:`OEPlatform::OELocalTime` added as a cross platform thread
     safe equivalent to the standard C library ``localtime`` function.

   * :oe:func:`OEPlatform::OECurrentTime` overload added to return the
     current time in a standard C library ``struct tm`` object in a
     thread safe manner.


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

* :oe:func:`OEPlatform::OEGetPlatformInfo` will now return Windows
  versions for ``Windows Vista`` through ``Windows 8.1``.

* :oe:func:`OEPlatform::OEGetProcessorInfo` would previously only show
  Pentium III for newer chips on Windows. The function will now interrogate the
  chip using the ``cpuid`` instruction.

.. oe:language:: c++

   * :oe:func:`OEPlatform::OECurrentTime` is now thread safe. The function
     was not thread safe due to the standard C library ``localtime`` and
     ``asctime`` functions not being thread safe. This was causing
     writing files to the following file formats to not be thread safe:
     :file:`.svg`, :file:`.ps`.

   * :oe:meth:`OEPlatform::OEFile::DirContents` will no longer leak
     memory by leaving open a ``DIR *`` object.

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

.. oe:language:: java python csharp

   * :oe:func:`OEPlatform::OEAddLicenseFromHttp` will now accept HTTP
     responses with a content-type of ``text/html;
     charset=utf-8``. Previously, only ``text/plain`` was accepted.

.. oe:language:: c++

   * :oe:func:`OEPlatform::OEGetTimeOfDay` will now return a ``bool``
     instead of an ``int`` to more clearly show when the function fails.

   * :oe:meth:`OEPlatform::OEOnce::GetValue` method is now provided on
     all platforms.

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

.. oe:language:: java python csharp

   * :oe:func:`OEPlatform::OEAddLicenseFromHttp` now includes example
     code in the documentation for its use.

.. oe:language:: c++

   * The following functions and class are not available in Python, Java, or C# and
     are only documented in the C++ documentation:

     - :oe:func:`OEPlatform::OECurrentTime`
     - :oe:func:`OEPlatform::OEGetTimeOfDay`
     - :oe:func:`OEPlatform::OELocalTime`
     - :oe:func:`OEPlatform::OESleep`
     - :oe:cls:`OESystem::OECycleTimer`


OEGrid 1.4.6
================================================================================

New Features
--------------------------------------------------------------------------------

* :oe:func:`OESystem::OEMakeMolecularGaussianGrid` now has an overload
  to allow a grid with existing dimensions, mid-point, and spacing to
  be filled. Previously, the grid size would always be recreated based
  upon the size of the molecule.

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

* Better support for output of non crystallographic grids to CCP4
  file. Now the CCP4 ARMS value is set to 1.0 and the CCP4 MEAN is
  set to 0.0 to prevent scaling and offsetting in CCP4 map
  visualizers. Additionally, the spacegroup is now output as 146 (H3)
  as opposed to the nonstandard 1146 (R3) to facilitate viewing in
  MOE. Please note that values appearing outside of the
  specified unit cell will be incorrect.


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

* Adding missing :oe:constns:`OESystem::OEMTZMapType` namespace to the
  documentation.

* OEChem release notes for 2.0.0 and 1.9.3 had the OEGrid version
  slightly wrong. The OEGrid version numbers have been corrected to
  1.4.5 and 1.4.4 respectively.
