Open Babel 3.0.0

Released on 2019-10-10.

This is a major release. It fixes some long-standing issues affecting performance in terms of chemical accuracy and speed, and all users are recommended to upgrade. It also removes deprecated components and breaks the API in a few places. For information on migrating from the previous version, please see Updating to Open Babel 3.0 from 2.x.

Notable changes

  • The babel program has been removed, and the replacement obabel should be used instead. The obabel program fixes some flaws with the original babel (not least that the user could accidentally overwrite an input file) and so has been preferred for many years.
  • The Python bindings are now accessed via “from openbabel import pybel” or “from openbabel import openbabel”.
  • Under the hood, the code for handling implicit hydrogens and kekulization has been entirely replaced in order to address problems with the original approach that had resulted in multiple bug reports over the years. As well as being accurate, the new approach is much faster.
  • The speed of reading and writing SMILES has been improved by more than 50-fold.
  • A faster and more accurate fragment-based 3D coordinate generation code has been added, part of Google Summer of Code 2018 and 2019, detailed in *J. Cheminf.* (2019) **11**, Art. 49.<https://doi.org/10.1186/s13321-019-0372-5>
  • New functionality in the API:
    • A new class for managing reactions stored as OBMols (OBReactionFacade)
    • A new method to copy part of an OBMol into a new OBMol (OBMol::CopySubstructure)

New file formats

  • Add basic support for RInChI (Reaction InChI) (by baoilleach, PR#1667)
  • Added basic ADF Band and ADF DFTB readers (by psavery, PR#1793)
  • Add support for COF format (Culgi object file) plus tests (by pbecherer, PR#1944)
  • Add maeparser support to openbabel (by lorton, PR#1993)

New file format capabilities and options

  • Improve svg ball and stick (by ghutchis, PR#360)
  • Add an option to the canonical SMILES format to specify the timeout. (by timvdm, PR#386)
  • Allow to set space group origin in PDB CRYST1 section (by afonari, PR#1558)
  • Parse _space_group_symop_operation_xyz in mmcif (by afonari, PR#1578)
  • Improve performance of SMILES parser (by baoilleach, PR#1589)
  • Handle undervalent atoms and radicals in Mol files and Smiles (by baoilleach, PR#1626)
  • Add support for agents to RXN file format (by baoilleach, PR#1656)
  • Allow RSMI format to read partial reactions (by baoilleach, PR#1660)
  • Add support for %(NNN) notation for SMILES ring closures (by baoilleach, PR#1677)
  • By default, don’t perceive stereo when reading SMILES, but have the option (by baoilleach, PR#1696)
  • Speed up the SMILES writer (by baoilleach, PR#1699)
  • Faster SMILES: Replace std::endl by “n” (by baoilleach, PR#1706)
  • Speed up SMILES writer by replacement of SSSR in SMILES writer with a bounded BFS (by baoilleach, PR#1715)
  • Speed up SMILES reading: don’t pre-scan the SMILES string for illegal characters (by baoilleach, PR#1716)
  • Minor speedup in SMILES: avoid repeated calls to IsOption by caching some options (by baoilleach, PR#1718)
  • Read reaction map from ChemDraw CDX files (by CamAnNguyen, PR#1720)
  • Two minor SMILES speed improvements (by baoilleach, PR#1725)
  • Speed up SMILES reading: Moved more inside the switch statement for SMILES parsing (by baoilleach, PR#1727)
  • Speed up SMILES reading: In the SMILES reader, avoid allocating a BUFSIZE buffer, and the associated string copy (by baoilleach, PR#1728)
  • Speed up SMILES writing: Make generation of the SMILES atom order vector optional (by baoilleach, PR#1712)
  • Add support for using atom classes as Tinker atom types. (by ghutchis, PR#1734)
  • Gaussformat reading electrostatic potentials (by mmghahremanpour, PR#1748)
  • Reading Exact Polairzability from Gaussian log file (by mmghahremanpour, PR#1751)
  • Gaussformat reading multiple charge models (by mmghahremanpour, PR#1752)
  • Write atom occupancy (if present) to PDB (by afonari, PR#1799)
  • Update reaction support in ChemDraw (by baoilleach, PR#1878)
  • ADF DFTB: Add new detection string for ADF 2018 (by psavery, PR#1888)
  • Update Gaussian format (by e-kwsm, PR#1969)
  • Update URLs of specification of gromacs (by e-kwsm, PR#1974)
  • Update URL of specification of MDL MOL (by e-kwsm, PR#1980)
  • Add SMILES support for elements specified by 3-digit number, e.g. [#101] (by baoilleach, PR#1997)

Other new features and improvements

  • Include original when there are zero rotatable bonds in confab (by cowsandmilk, PR#370)
  • Improve thread safety for global objects (by baoilleach, PR#381)
  • Change the OBAromTyper from using SMARTS patterns to a switch statement (rebased) (by baoilleach, PR#1545)
  • Keep count of implicit hydrogens instead of inferring them (by baoilleach, PR#1576)
  • Obthermo update patch (by mmghahremanpour, PR#1598)
  • Improve performance of element handling (by baoilleach, PR#1601)
  • Implement the Daylight aromaticity model as described by John Mayfield (by baoilleach, PR#1638)
  • Allow multiple agents in OBReaction (by baoilleach, PR#1640)
  • Clarify python examples (by theavey, PR#1657)
  • Add support for wrapping GetRGB() call to return r, g, b params. (by ghutchis, PR#1670)
  • Adding missing manpages (by merkys, PR#1678)
  • Expose obfunctions api through python bindings (by cstein, PR#1697)
  • Avoid logging messages that are taking time (by baoilleach, PR#1714)
  • warning/error messages for fastindex when the structure file is compressed (by adalke, PR#1733)
  • Refactor atom class to being data on an atom rather than on a molecule (by baoilleach, PR#1741)
  • Add Molecule.make2D function (by eloyfelix, PR#1765)
  • Change the behavior of OBMol.Separate so that it preserves atom order (by baoilleach, PR#1773)
  • When calling OBMol.Separate, preserve whether aromaticity has been perceived (by baoilleach, PR#1800)
  • Add OBMol::CopySubstructure (by baoilleach, PR#1811)
  • Add OBMol::SetChainsPerceived(false) (by baoilleach, PR#1813)
  • Add stereo + obfunctions + kekulize to ruby binding (by CamAnNguyen, PR#1824)
  • Generate useful error messages if plugins can’t be found. (by dkoes, PR#1826)
  • Allow public access to retrieve gradients (by ghutchis, PR#1833)
  • Re-enable vector.clear() to allow wrapped std::vectors to be reused (by baoilleach, PR#1834)
  • Implement reaction handling as part of OBMol (by baoilleach, PR#1836)
  • Added rotors as a descriptor/filter. (by ghutchis, PR#1846)
  • Keep aromaticity in EndModify() (by baoilleach, PR#1847)
  • Fragment-based coordinate generation (by n-yoshikawa, PR#1850)
  • Rebuild OBMM tool for interactive MM optimization (by ghutchis, PR#1873)
  • Update fragment based builder (by n-yoshikawa, PR#1931)
  • Refactor python bindings so that openbabel.py and pybel.py are within an openbabel folder (by baoilleach, PR#1946)
  • Tidy setting/unsetting of molecule perception flags (by baoilleach, PR#1951)
  • Remove outdated stereo code (by baoilleach, PR#1967)
  • Remove OBBond::GetBO() and SetBO() (by baoilleach, PR#1953)
  • Remove OBRandom from the public API (by baoilleach, PR#1954)
  • Remove miscellanous headers from mol.h, atom.h and bond.h (by baoilleach, PR#1958)
  • enhancements to obrms to support optimization of pose alignment (by dkoes, PR#1961)
  • Remove GetGenericValueDef from OBGenericData (by baoilleach, PR#1964)
  • Remove low-hanging deprecated methods (by baoilleach, PR#1968)
  • Improve python script (by e-kwsm, PR#1970)
  • Make pybel.Outputfile compatible with with statment (by yishutu, PR#1971)
  • Obrms enhancement (by dkoes, PR#1978)
  • Move to a single function for setting/unsetting bond and atom flags (by baoilleach, PR#1965)
  • Rename/add valence and degree methods (by baoilleach, PR#1975)
  • Do not stoke around the (svg) text (by Artoria2e5, PR#2012)
  • Add a warning message when both -p and -h options are set (by yishutu, PR#2031)
  • “Bye bye babel” - remove the babel binary (by baoilleach, PR#1976)
  • Add force field support for dielectric constants in charge terms. (by ghutchis, PR#2022)

Development/Build/Install Improvements

  • Change default build type to RELEASE and add -O3 switch (by baoilleach, PR#352)
  • Add a default issue template for Open Babel - Suggestions welcome (by ghutchis, PR#383)
  • Compile position independent code for shared libraries. (by susilehtola, PR#1575)
  • Introduce std:isnan for older versions of MSVC (by mwojcikowski, PR#1586)
  • Prepend to LD_LIBRARY_PATH instead of overwrite (by barrymoo, PR#1588)
  • Changes needed to compile with C++17 (by arkose, PR#1619)
  • Compiler version parsing and comparison from CMake 2.8 (by cowsandmilk, PR#1630)
  • Create CODE_OF_CONDUCT.md (by ghutchis, PR#1671)
  • Clarify option needed to generate SWIG bindings. (by jeffjanes, PR#1686)
  • Correct spelling of file name for Perl bindings (by jeffjanes, PR#1687)
  • In the Python bindings, avoid adding methods from the iterated object to the iterator itself (by baoilleach, PR#1729)
  • Ensure portability to ARM platforms (by baoilleach, PR#1744)
  • Switch to rapidjson library for JSON parsing/writing (by mcs07, PR#1776)
  • Fix linking of python bindings on Mac (by mcs07, PR#1807)
  • Using pillow instead of PIL (by hille721, PR#1822)
  • Ignore compile warnings on inchi directory. (by ghutchis, PR#1864)
  • Compile project in Cygwin without xtcformat (by bbucior, PR#1894)
  • Hyperlink DOIs to preferred resolver (by katrinleinweber, PR#1909)
  • For Travis builds, include output for build failures (by baoilleach, PR#1959)
  • Add __init__.py to gitignore (by yishutu, PR#1972)
  • Ignore in-source installation (by RMeli, PR#2027)
  • Add a GitHub funding link to the open collective page. (by ghutchis, PR#2042)

Bug Fixes

  • Fix for missing ZLIB on win32 (by philthiel, PR#357)
  • Depict headers were missing in the installation (by tgaudin, PR#359)
  • Avoid IndexError for plugins with empty names (by langner, PR#361)
  • Fixed a few errors in space-groups.txt (by psavery, PR#367)
  • SF #909 - Fix segfault when ReadMolecule() called with PubChem document but file extension was generic .xml (by derekharmon, PR#369)
  • Preserve triple bond when reading SMILES with a triple bond in an aromatic ring (by baoilleach, PR#371)
  • Fix bug #368: Python3.6 openbabel: No module named ‘DLFCN’ (by hseara, PR#372)
  • Fastsearch 64 fix (by dkoes, PR#1546)
  • Don’t try to install aromatic.txt as it is no longer present (by baoilleach, PR#1547)
  • Make sure to add conformers after performing bond perception. (by ghutchis, PR#1549)
  • Set default coordinates before doing bond perception. (by ghutchis, PR#1550)
  • Ignore some non-functioning python SWIG bindings. (by djhogan, PR#1554)
  • Remove delete statement. (by djhogan, PR#1556)
  • Link libinchi with math library (by nsoranzo, PR#1564)
  • Fix segfault in OBMol::GetSpacedFormula (by bbucior, PR#1565)
  • Fix regression + minor cppcheck report (by serval2412, PR#1567)
  • Convert tabs to spaces in testpdbformat.py (by adamjstewart, PR#1568)
  • cppcheck: Condition ‘1==0’ is always false (by serval2412, PR#1572)
  • UFF: Fix conversion constant (by aandi, PR#1579)
  • Remove the change in resonance structure from the vinylogous carboxylic acid pH model (by kyle-roberts-arzeda, PR#1580)
  • Fix wedge/hash in cyclopropyl (by fredrikw, PR#1582)
  • Fix multifragment depiction (by fredrikw, PR#1585)
  • Fix wrong spin multiplicity assignment (by nakatamaho, PR#1592)
  • Change silicon to correct MM3 atom type (by keipertk, PR#1593)
  • Fix pubchem JSON handling of enum types as ints (by mcs07, PR#1596)
  • Correct MM3 carboxyl oxygen atom type definition (by keipertk, PR#1599)
  • Fix for calculating implicit H count when reading SMILES (by baoilleach, PR#1606)
  • Fix some small misspellings in the csharp bindings (by cmanion, PR#1608)
  • Tweak the handling of implicit Hs when reading SMILES (by baoilleach, PR#1609)
  • Fix underflow causing a noticeable delay when e.g. writing a molfile (by baoilleach, PR#1610)
  • Fix install regression with element data (by bbucior, PR#1617)
  • Added some missing formats to the static build (by psavery, PR#1622)
  • In SiestaFormat, print warnings to cerr (by psavery, PR#1623)
  • For SIESTA format, use obErrorLog instead of cerr (by psavery, PR#1627)
  • Correct the spelling of the Frerejacque number in a comment (by baoilleach, PR#1629)
  • Lowercase second element letter in PDB and test (by cowsandmilk, PR#1631)
  • Remove erroneous -1 in switch statement (by baoilleach, PR#1632)
  • Make sure to handle molecular total charge by default for keywords (by ghutchis, PR#1634)
  • Added fix for OBMolAtomBFSIter in Python3 (by oititov, PR#1637)
  • space-groups.txt: correct Hall symbol for C -4 2 b (by wojdyr, PR#1645)
  • Reset path to empty in kekulization code (potential segfault) (by baoilleach, PR#1650)
  • Correct handling of stereo when writing InChIs (by baoilleach, PR#1652)
  • ECFP Fixup (by johnmay, PR#1653)
  • Fix “folding” for fingerprints to larger bit sizes - #1654. (by ghutchis, PR#1658)
  • Fix reading atom symbols from XSF file (by sencer, PR#1663)
  • Minor fixes in the nwchem format reader (by xomachine, PR#1666)
  • use isinstance to test if filename is bytes (by cowsandmilk, PR#1673)
  • Fix bug found due to MSVC warning (by baoilleach, PR#1674)
  • Fix MSVC warning about unused variable (by baoilleach, PR#1675)
  • Correct handling of atom maps (by baoilleach, PR#1698)
  • Fix #1701 - a GCC compiler error (by baoilleach, PR#1704)
  • Remove some audit messages (by baoilleach, PR#1707)
  • Fix bug when copying stereo during obmol += obmolB (by baoilleach, PR#1719)
  • Fix uninitialized read in kekulize.cpp found by Dr Memory. (by baoilleach, PR#1721)
  • Fixes for ring closure parsing (by baoilleach, PR#1723)
  • Make sure that OBAtom::IsInRing always triggers ring perception if not set as perceived (by baoilleach, PR#1724)
  • Fix code error found from @baoilleach compiler warnings (by ghutchis, PR#1736)
  • Fix Python3 compatibility (by ghutchis, PR#1737)
  • Fix ChemDraw CDX incremental value (by CamAnNguyen, PR#1743)
  • Fix error in VASPformat found by static code analysis (by baoilleach, PR#1745)
  • Fix for 1731. Store atom classes in CML atomids by appending _ATOMCLASS. (by baoilleach, PR#1746)
  • Fix GCC warnings (by baoilleach, PR#1747)
  • Fix warning in fastsearch substructure fingerprint screen (by baoilleach, PR#1749)
  • Fix #1684 - string comparison does not work with numeric sd titles (by cowsandmilk, PR#1750)
  • Fixing minor things for reading ESP from log files (by mmghahremanpour, PR#1753)
  • Fix #1569 - OB 2.4.1 loses the second molecule in a HIN file (by yishutu, PR#1755)
  • Fix TESTDIR definition to allow space in path (by mcs07, PR#1757)
  • Fix regression. Ensure that asterisk is unbracketed when writing a SMILES string (by baoilleach, PR#1759)
  • Fix MSVC warning about type conversion (by baoilleach, PR#1762)
  • Fix SMILES parsing fuzz test failures from AFL (by baoilleach, PR#1770)
  • Fix warning about size_t versus int cast (by baoilleach, PR#1771)
  • A small improvement of a bugfix solving segfault when reading GAMESS output with vibrations (by boryszef, PR#1772)
  • In the Python bindings, reset the DL open flags after importing _openbabel (by baoilleach, PR#1775)
  • fix cdxml stereo bonds (by JasonYCHuang, PR#1777)
  • Install obabel target if using static build (by torcolvin, PR#1779)
  • Fix #1769 by correctly handling the mass difference field in MDL mol files (by baoilleach, PR#1784)
  • Kekulize hypervalent aromatic N and S (by baoilleach, PR#1787)
  • Pdbqt fix (by dkoes, PR#1790)
  • Raise a warning when coordinate is NaN (by n-yoshikawa, PR#1792)
  • Use the InChI values for the average atomic mass when reading/writing isotopes (by baoilleach, PR#1795)
  • Fix compile failure after recent Molden commit (by baoilleach, PR#1796)
  • Fix segfault due to running off the start of an iterator in PDBQT format (by baoilleach, PR#1797)
  • Fix#1768: Segfault upon reading GAMESS outputs of DFTB3 calculations (by serval2412, PR#1798)
  • Always ensure hybridization (by ghutchis, PR#1801)
  • Fix #1786 by changing the return value of OBResidue::GetNum() (by baoilleach, PR#1804)
  • Apply fixes from Benoit Leblanc to address int/double type warnings. (by baoilleach, PR#1806)
  • Fix#1607: check dynamic cast return (by serval2412, PR#1815)
  • Fixes #1282: check format input is provided (by serval2412, PR#1818)
  • Fix#1331: avoid crash with Q-Chem fragment (by serval2412, PR#1820)
  • Set default to read CIFs with specified coordinates, no wrapping. (by ghutchis, PR#1823)
  • Fix#1056: remove a debug output (by serval2412, PR#1825)
  • Get ECFP working (by baoilleach, PR#1829)
  • Fix cdxml upside down format (by JasonYCHuang, PR#1831)
  • Fix to CopySubstructure found when running over ChEMBL (by baoilleach, PR#1832)
  • Fix#192: parse and use ‘-a’ flag for obrotate (by serval2412, PR#1835)
  • Ensure carbonyl groups are checked at both 0 and 180. (by ghutchis, PR#1845)
  • Ensure that the check for OBBond::IsInRing obeys the OBMol perception flags (by baoilleach, PR#1848)
  • Simplify/fix behavior of OBAtom::GetResidue so that it behaves like other lazy properties (by baoilleach, PR#1849)
  • Fixes #1851: check some limits when converting smi to sdf using –gen2D (by serval2412, PR#1852)
  • Modify cleaning blank line behaviors (by yishutu, PR#1855)
  • Ring membership of atoms and bonds was not being reset during perception (by baoilleach, PR#1856)
  • Update qeq.txt (by mkrykunov, PR#1882)
  • Support lone pair stereo on nitrogen as well as sulfur (by baoilleach, PR#1885)
  • Changed indexing of fragments, should fix #1889 (by fredrikw, PR#1890)
  • Avoid out-of-range access in OBMolBondBFSIter (by baoilleach, PR#1892)
  • Fix OBChemTsfm wrapping of implicit H counts (by baoilleach, PR#1896)
  • Updated the coordinate generation from templates. (by fredrikw, PR#1902)
  • Fix incorrect use of memcpy. (by sunoru, PR#1908)
  • Add SetChainsPerceived() after EndModify() in formats that add residues (by baoilleach, PR#1914)
  • define isfinite removed. (by orex, PR#1928)
  • Teach the isomorphism mapper to respect atom identity (by johnmay, PR#1939)
  • Fix memory leak in OBSmartsPattern::Init() (by n-yoshikawa, PR#1945)
  • Address CMake build warning about policy CMP0005 being set to OLD (by baoilleach, PR#1948)
  • Fix clang warning about in-class init of a non-static data member (by baoilleach, PR#1949)
  • Update bindings for changes to headers (by baoilleach, PR#1963)
  • Fix randomly failing Python gradient test (by baoilleach, PR#1966)
  • Exit with non-zero if an error occurs (by e-kwsm, PR#1973)
  • Avoid non-finite bond vectors (by dkoes, PR#1981)
  • Include babelconfig in vector3.h (by dkoes, PR#1985)
  • Fix #1987: CMake failing at FindRapidJSON (by RMeli, PR#1988)
  • fpsformat.cpp: compile bugfix header added. (by orex, PR#1991)
  • Address Ubuntu bug in defining python install dir (by dkoes, PR#1992)
  • PDB and PDBQT Insertion Code Fixes (by RMeli, PR#1998)
  • Make pybel compatible with #1975 (by yishutu, PR#2005)
  • H vector fix (by dkoes, PR#2010)
  • Change forcefield.cpp so that steepest descent and conjugate gradient update maxgrad (by PeaWagon, PR#2017)
  • Update coordinates in the fast option of obabel (by n-yoshikawa, PR#2026)
  • Update the CSharp bindings (by baoilleach, PR#2032)
  • Don’t make kekule SMILES the default in the GUI (by baoilleach, PR#2039)
  • Bumping the major version requires more changes throughout the library. (by baoilleach, PR#2036)
  • Fix reading of uninitialized data. (by dkoes, PR#2038)
  • Remove minor version from some names (by baoilleach, PR#2040)
  • Fixed alias expansion for files with multiple aliases (by fredrikw, PR#2035)
  • Update doc (by e-kwsm, PR#1979)
  • Fix compilation with GCC 4.8 (standard compiler on CentOS 7.5) (by baoilleach, PR#2047)
  • Some tests (by dkoes, PR#2008)

Cast of contributors

aandi, adalke (Andrew Dalke), adamjstewart (Adam J. Stewart), afonari (Alexandr Fonari), artoria2e5 (Mingye Wang), baoilleach (Noel O’Boyle), barrymoo (Barry Moore), bbucior (Ben Bucior), boryszef (Borys Szefczyk), camannguyen (An Nguyen), cmanion (Charles A. Manion), cowsandmilk (David Hall), cstein (Casper Steinmann), derekharmon (Derek Harmon), djhogan (Daniel Hogan), dkoes (David Koes), e-kwsm (Eisuke Kawashima), eloyfelix (Eloy Felix), fredrikw (Fredrik Wallner), ghutchis (Geoff Hutchison), hille721 (Christoph Hille), hseara (Hector Martinez-Seara), jasonychuang (Jason Huang), jeffjanes (Jeff Janes), johnmay (John Mayfield), katrinleinweber (Katrin Leinweber), keipertk (Kristopher Keipert), kyle-roberts-arzeda, langner (Karol M. Langner), lorton (Pat Lorton), mcs07 (Matt Swain), merkys (Andrius Merkys), mkrykunov, mmghahremanpour (Mohammad Ghahremanpour), mwojcikowski (Maciej Wójcikowski), n-yoshikawa (Naruki Yoshikawa), nakatamaho (Nakata Maho), nsoranzo (Nicola Soranzo), oititov (Titov Oleg), orex (Kirill Okhotnikov), pbecherer (Paul Becherer), peawagon (Jen), philthiel (Philipp Thiel), psavery (Patrick Avery), rmeli (Rocco Meli), serval2412 (Julien Nabet), sunoru, susilehtola (Susi Lehtola), tgaudin (Théophile Gaudin), theavey (Thomas Heavey), timvdm (Tim Vandermeersch), torcolvin (Tor Colvin), wojdyr (Marcin Wojdyr), xomachine (Dmitriy Fomichev), yishutu (Yi-Shu Tu)