.. include:: ../../toolkit-substitutions

********************************************************************************
Version 1.7.0
********************************************************************************

OEChem 1.7.0
================================================================================

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

* Canonical isomeric SMILES generation has been significantly improved
  (:oe:func:`OEChem::OECreateIsoSmiString`). On a test set of
  9,962,003 compounds (4,025,817 with atom or bond stereo) *OEChem*
  1.6.1 would generate different canonical isomeric smiles for
  135,985 of the compounds based on random reordering of the
  atoms. This failure rate has been reduced to just 78 compounds, a
  99.94% improvement. Furthermore, the generation has been optimized
  so that it is roughly 10-30% faster than the *OEChem* 1.6.1
  algorithm.

* :oe:func:`OEChem::OEReadMDLQueryFile` has been added to read MDL
  query files into the :ref:`OEQMol <OEChem_OEQMol>` object. This allows for
  easy integration of MDL query files with the swath of *OEChem* tools
  based upon query molecules.  The MDL query based substructure search
  was tested on a set of 655 query files. 

  .. seealso::

     The :ref:`Substructure Search with MDL Queries <chapter_mdlqueries>`
     chapter in the *OEChem* theory manual.

* *OEChem* also supports MDL reaction based library generation.
  Reaction file can be imported into a :ref:`OEQMol <OEChem_OEQMol>` object
  by calling :oe:func:`OEChem::OEReadMDLReactionQueryFile` function.
  The :ref:`OELibraryGen <OEChem_OELibraryGen>` object then can be initialized
  with the imported reaction.  The library generation was extensive
  tested on a set of 160 diverse reactions. 

  .. seealso::
  
     The :ref:`MDL Reaction Query File <subsection_reactions_libgen_MDL>`
     section in the *OEChem* theory manual.

* The :oe:const:`MiniMol<OEChem::OEMolBaseType::OEMiniMol>`
  implementation of :ref:`OEGraphMol <OEChem_OEGraphMol>` has been made more
  robust and optimized significantly for both speed and size. There
  used to be an arbitrary 1000 atom and bond limit, the limit is now a
  lot higher, :math:`2^{15}`. This implementation requires
  :oe:meth:`Compress<OEChem::OEMolBase::Compress>` be called on the
  molecule after construction to maximize space efficiency, but does
  not require :oe:meth:`UnCompress<OEChem::OEMolBase::UnCompress>` be
  called on it before it can be used. This makes it an ideal molecule
  implementation for in-memory substructure searching.

* Added :ref:`oemolithread <OEChem_oemolithread>` and
  :ref:`oemolothread <OEChem_oemolothread>` for threaded molecule
  I/O. :oe:func:`OEChem::OEReadMolecule` and
  :oe:func:`OEChem::OEWriteMolecule` are thread-safe on
  :ref:`oemolithread <OEChem_oemolithread>` and :ref:`oemolothread <OEChem_oemolothread>`
  respectively. 

  .. seealso::
   
     The :ref:`Input and Output Threads <section_inputandoutputthreads>`
     section in the *OEChem* theory manual.

* Added implementation of Zap 9 Radii from [Nicholls-2008]_
  through the :oe:func:`OEChem::OEAssignZap9Radii` function.

* Added :oe:func:`OEChem::OEShortestPath` function since it is an
  often-asked-for algorithm.

* Added :ref:`OEIdxSelected <OEChem_OEIdxSelected>` predicate for easy sub-setting
  of a molecule using an array of ``bool`` indexed by :ref:`indices
  <chapter_atombondindices>`.

* Added :oe:func:`OEChem::OECount` function for easily counting atoms
  or bonds in a molecule based on arbitrary :ref:`predicates
  <chapter_predicates>`.

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

* Fixed seg fault in SMARTS parsing when the SMARTS contained the
  [<atomic mass>H<charge>] combination.

* Fixed ``invalid address alignment`` crash in the sketch file reader on
  Sparc.

* SD tag names were limited to 75 characters. This release raises the
  limit to 4096.

* Several major changes are made in the library generation process in
  order to ensure that products are generated with a valid |Kekule|
  form.  If there is an explicit hydrogen in the product side of the
  input reaction, then :ref:`OELibraryGen <OEChem_OELibraryGen>` will add
  hydrogens to the generated products accordingly and the first
  Kekulization will be based on this reaction specification.  If it is
  unsuccessful, *i.e.* :oe:func:`OEChem::OEKekulize` returns ``false``,
  then alternatives are tried by adding and removing implicit
  hydrogens from specific atoms until a valid (but arbitrary) |Kekule|
  form is identified. 

  .. seealso:: 
   
     The :ref:`Product Kekulization
     <subsection_reactions_libgen_kekule>` section in the *OEChem*
     theory manual.

* Significant number of improvements were added to *OEChem*'s PDB file parser 
  (:oe:func:`OEChem::OEReadPDBFile`) in the area of atomic number
  determination. By default PDB atomic symbol field is used to determine
  the atom type.
  However, for a subset of "known" residues, including all of the
  amino and nucleic acids, we continue to use the atom name
  heuristics, which for this subset are more reliable.
  Currently, there are no conflicts/discrepancies between the PDB atomic
  symbol and the atomic number we perceive in the PDB file
  reader in the entire wwPDB repository. 


* The refinement of the hydrogen placement method (:oe:func:`OEChem::OESet3DHydrogenGeom`)  
  improved numerical stability and increased speed for most 
  simple placement operations, special heuristics for carboxylic acids, 
  toluene-like methyl rotors attached to aromatic rings,
  fleeing heuristics for alkanes and perpendicular support for allenic systems.
  Additionally, hydroxyl rotors are placed using a quick local scan for strong
  acceptors (alpha acceptors) within a 3.0 Angstrom radius. 
  More hydrogen bond lengths data  specifically to As, Ge, Se and
  Te was also added ([Sutton-1958]_).

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

* :oe:meth:`OEChem::OEGraphMol::operator=` does the same thing as the
  :ref:`OEGraphMol <OEChem_OEGraphMol>` copy constructor. This allows
  :ref:`OEGraphMol <OEChem_OEGraphMol>` to be used directly inside STL containers
  without losing the selected :ref:`OEMolBase <OEChem_OEMolBase>`
  implementation. Previous versions of *OEChem* would change the
  molecule implementation unexpectedly if the STL container needed
  to relocate the object in memory. However, the following code changes
  meaning with the switch from 1.6.1 to 1.7.0:

  .. code-block:: c++
   
     OEGraphMol gm1; 
     OEGraphMol gm2(OEMolBaseType::OEDBMol); 
     gm1 = gm2;
     // gm1 is now an OEDBMol implementation, 
     // in 1.6.1 it would be the default implementation

* The :oe:const:`OEChem::OEMolBaseType::OEDBMol` implementation can
  now copy construct in compressed mode.

* :oe:func:`OEChem::OEReadMolecule` would sometimes return ``true`` when an
  empty molecule was present in the input file. The high level
  :oe:func:`OEChem::OEReadMolecule` function will never return ``true`` when the
  molecule does not contain any atoms. Low-level molecule routines
  should be used if empty molecules are desired.

* Stabilized the atom output order from successive calls to
  :oe:func:`OEChem::OEWriteMolecule` to MOL2 when the molecule contained
  residues. 

* Deprecated the non-OE prefixed ``SmartsLexReplace`` function
  name. Renamed to :oe:func:`OEChem::OESmartsLexReplace`. 

* Fixed the bug in substructure search that occurred when :ref:`OESubSearch <OEChem_OESubSearch>`
  was initialized with a SMARTS string starting with a hydrogen atom (such as ``[#1]O[C,N,S,P]=O``).
  The order of the atoms were reordered  even when  allowReorder parameter was set to be
  ``false``.

* When initializing an :ref:`OESubSearch <OEChem_OESubSearch>` object with a SMARTS pattern the
  'reorder' parameter is  changed to ``false`` by default.  
  This parameter is currently ignored *i.e* the atom order in the returned 
  matches is always identical of the atom order in the SMARTS pattern.

* Fixed a bug in ``OEGetAromatic`` and ``OEGetBondOrder`` 
  to retrieve aromaticity/bond order from query expressions.

* A restriction is added to the interpretation of SMIRKS in 'strict' mode. 
  This requires that all atom maps in the reaction have to be pairwise
  when :ref:`OELibraryGen <OEChem_OELibraryGen>` is initialized with a SMIRKS string
  or :ref:`OEQMolBase <OEChem_OEQMolBase>` object.

* DBREF, SEQADV, MTRIX1, MTRIX2 and MTRIX3 pdb data lines are now kept when
  parsing the file. The data can be accessed by :oe:func:`OEChem::OEGetPDBData`. 

* Fixed the bug in :oe:func:`OEChem::OEWritePDBFile` that caused writing the MODEL 
  number into a wrong position in a pdb file.
   
* Fixed the bug in the SMILES canonicalization process for special cases when the input
  SMILES contains R-Group information (such as  ``[R1]c1ccc(cc1c2cccc(c2)[R3]``).

* Tweaked the *OpenEye* charge model such that the three valent Beryllium has a negative 
  one charge.  
  This makes ``F[Be-](F)F`` equivalent to the charge separated form ``[Be+2].[F-].[F-].[F-]``
  fixing 61 ligands in the PDB data set.

* Improved the bond order perception (:oe:func:`OEChem::OEPerceiveBondOrders`) support:

     * for arsenic acids, including the 'cacodylate' ion (example in 3DUE pdb).

     * for uric acid and related heterocycles.

     * for azobenzenes and similar compounds.  All acyclic 'nitrogen(2)-nitrogen(2)' bonds 
       now undergo a strict distance check independent of the (single) bond angle at each end.  
       This corrects 1SRE, 1SRF and 2GBY pdb entries.  

     * for benzoquinones and anthraquinones.

* Addressed the problem in :oe:func:`OEChem::OEAssignAromaticFlags` that caused long
  processing times when reading  (:oe:func:`OEChem::OEReadMDLFile`) on some pathological pseudo-fullerenes.

* Added PDB support for the following:
   
   * sidechain recognition for the RNA residue 'YG' and 'H2U'

   * naming of PDB residue 'BME'

   * the N-terminal modification 'FOR'

   * the cofactor 'FMT' (which is "formic acid" or "formate")


* The following problems were fixed in the PDB file parser (:oe:func:`OEChem::OEReadPDBFile`):  

  * 'anomalous mercury' problem for the  residue 'DVA' (example in 2IZQ pdb)
   
  *  spurious Holmium problem (in residues 'CEH' and 'NGR')

  *  naming of the ' P  ', ' O1P', ' O2P' and ' O3P' atoms in the 
     nonstandard PDB residues 'PTR', 'SEP' and 'TPO'.

* Improved the initial partial charge parameterization (:oe:func:`OEChem::OEMMFF94InitialCharges`)
  for selenium (atom type 83).

* Improved the perception of reactions in ISIS Sketch files.  
  Most importantly we now support the 'rxnarrow' object generated by recent versions 
  of ISIS, such as MDL Draw and Symyx Draw.  We also now allow the sketch to contain
  multiple lines, provided that only one has an arrow, and to allow
  the arrow direction and arrow coordinates to be specified in
  arbitrary order.

.. oe:language:: java
 
   * In order to make the Java interface more user-friendly, many
     functions that formerly took an opaque pointer wrapper (*i.e*
     ``SWIGTYPE_p_float``) now take an instance of OEFloatArray, for
     example. This eliminates the need to call OEFloatArray.cast() to
     call the function.

OEGrid 1.3.2
================================================================================

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

* The user is no longer required to call
  :oe:func:`OESystem::OEInitGridHandlers` in order to attach grids to
  molecules and then write them out to OEB. This occurs at library
  link time now.

  .. seealso::
   
     The :ref:`Generic Data <section_grids_genericdata>` section in
     the :ref:`Grids <chapter_grids>` chapter for details of attaching
     grids to molecules.

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

* :oe:func:`OESystem::OEReadGrid` would crash on gzipped files. It now
  properly uncompresses the data before reading it into a grid.


OESystem 1.7.0
================================================================================

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

* :ref:`OERandom <OESystem_OERandom>` can now produce random integers through
  the :oe:meth:`OESystem::OERandom::NextInt` method.

* Added an :ref:`OEBitVector <OESystem_OEBitVector>` constructor which takes an
  :ref:`OERandom <OESystem_OERandom>` for generating random bit strings. Added
  :oe:meth:`OESystem::OEBitVector::operator\<` method so
  :ref:`OEBitVector <OESystem_OEBitVector>` can be used in STL containers.

* Added :ref:`OEBoundedBuffer <OESystem_OEBoundedBuffer>` and
  :ref:`OEProtectedBuffer <OESystem_OEProtectedBuffer>` objects useful for communicating
  between threads in multi-threaded applications.

* Added :ref:`OEWallTimer <OESystem_OEWallTimer>` since
  :ref:`OEStopwatch <OESystem_OEStopwatch>` actually reports CPU time so if
  multiple threads are being used it reports the added CPU time from
  each thread. Also added :ref:`OECycleTimer <OESystem_OECycleTimer>` for doing
  high precision timing based on clock cycles. For example, on x86
  this uses the ``rdtsc`` instruction and is thus susceptible to its
  trade offs in comparison to using CPU time from
  :ref:`OEStopwatch <OESystem_OEStopwatch>`.

* Added :oe:meth:`convenience
  constructor<OESystem::OEInterface::Constructors>` to
  :ref:`OEInterface <OESystem_OEInterface>` for the most common use case. Where
  a commandline needs to be parsed relative to a particular interface
  definition.

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

* Deprecated ``OESetThreadSafe`` as it only gave the illusion of
  thread safety to the *OEChem* toolkits. Use
  :oe:func:`OESystem::OESetMemPoolMode` instead as outlined in the
  :ref:`Memory Management <section_memorymanagement>` section. Most
  users should just ignore this issue altogether, as the defaults are
  sufficient (and have been optimized in 1.7.0). The user should only
  consider calling :oe:func:`OESystem::OESetMemPoolMode` when passing
  *OEChem* objects between threads.

* Fixed regression where
  :oe:meth:`OESystem::OEBitVector::FromHexString` would no longer
  recognize hex strings in lowercase. It should also be noted that
  :oe:meth:`OESystem::OEBitVector::ToHexString` encodes the fractional
  length of the last 4 bits as the last character.

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

* Added :oe:meth:`OESystem::OEErrorHandler::Debug` as another output option to
  match :oe:const:`OESystem::OEErrorLevel::Debug`

* :ref:`OEErrorHandler <OESystem_OEErrorHandler>` now properly does nothing when
  :oe:const:`OESystem::OEErrorLevel::Quiet` is passed.

* Added :ref:`OEUnaryTrue <OESystem_OEUnaryTrue>` and
  :ref:`OEBinaryTrue <OESystem_OEBinaryTrue>` to match their inverses that already
  existed.

OEPlatform  1.7.0
================================================================================

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

* Added :ref:`OELock <OEPlatform_OELock>` class to do scoped locking around
  :ref:`OEMutex <OEPlatform_OEMutex>` objects. This ensures mutexes are
  released in the event of stack unwinding, such as when exceptions
  are thrown.

* Added the following cross-platform threading primitives:
  :ref:`OEThread <OEPlatform_OEThread>`, :ref:`OEThreadLocal <OEPlatform_OEThreadLocal>`,
  :ref:`OECondition <OEPlatform_OECondition>`, and :ref:`OEOnce <OEPlatform_OEOnce>`.

* Added :oe:func:`OEPlatform::OEGetTimeOfDay` to wrap gettimeofday on
  posix, but provide our own implementation on Windows since it doesn't
  exist on Windows.

* Added :oe:func:`OEPlatform::OEGetNumProcessors` to return the number
  of cores available on the system.

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

*  Fixed rare off by one buffer overflow in
   :ref:`oeogzstream <OEPlatform_oeogzstream>` initialization.

*  Fixed ``seek`` and ``tell`` on files greater than 4 gigabytes on
   Windows.

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

*  The :ref:`OEMutex <OEPlatform_OEMutex>` implementation would default to a
   no-op implementation even when a valid mutex implementation was
   available through pthreads and compiling with a non-GCC compiler.

*  :ref:`oeifstream <OEPlatform_oeifstream>` will return ``false`` when
   :oe:meth:`OEPlatform::oestream::seek` is called and return ``0`` when
   :oe:meth:`OEPlatform::oestream::size` is called when the stream points
   to ``stdin``.

*  Corrected instances where streams were using ``oefpos_t`` for
   memory operations and ``oesize_t`` for file operations. The rule is
   memory operations should use ``oesize_t``
   (*e.g.* :oe:meth:`OEPlatform::oeistream::read`), and file operations
   should use ``oefpos_t`` (*e.g.* :oe:meth:`OEPlatform::oestream::seek`).

*  Changing ``unsigned int`` arguments to ``oesize_t`` for
   :ref:`oeisstream <OEPlatform_oeisstream>` to be able to handle memory larger
   than 4 gigabytes on 64-bit machines.

*  The following functions were global scope:
   :oe:func:`OEPlatform::OEGetIPAddress`,
   :oe:func:`OEPlatform::OEGetHostIdent`,
   :oe:func:`OEPlatform::OEGetDomainName`, and
   :oe:func:`OEPlatform::OEGetHostName`. They are now located in the
   :ref:`OEPlatform <chapter_oeplatform_functions>` namespace.

