Skip to content
John Mayfield edited this page Oct 31, 2018 · 26 revisions

DOI Maven Central

Download complete JAR: cdk-2.2.jar (26MB)

Potential Incompatibilities

  • As with all releases, code that has been deprecated (in this release this includes a lot of the existing SMARTS stack) has been moved to the cdk-legacy module. Including this module in your project will allow your code to compile. Please note that usage of deprecated classes is not supported and your code should update to use newer APIs.
  • The "AtomContainer2" API is now the default implementation. To disable this set the environment or system property CdkUseLegacyAtomContainer=true. Potential problems with existing code bases are described here.
  • SMARTS now treats [D2] as the number of explicit neighbours rather than number of heavy neighbours. You can match the old behaviour with the Smarts.FLAVOR_CDK_LEGACY flag.
  • IElement implementations no longer stores the symbol explicitly and only the atomic number. Setting the symbol of atom to something other than one defined in the periodic table (e.g. "X") will default to 'R'. The IPseudoAtom is still the correct method to store atoms with custom labels, atom.setLabel("Lys") for example.
  • MurckoFragmenter now will not calculate 'frameworks' by default and only the main scaffold.

Core

  • New APIs for reading, writing, and manipulating SMARTS expressions. SMARTS is read/written with the Smarts API:
IQueryAtomContainer query = new QueryAtomContainer();
if (!Smarts.parse(query, "[n,o]1cccc1"))
  System.err.println(Smarts.getLastErrorMesg());
QueryAtom qatom = (QueryAtom) query.getAtom(0);
qatom.getExpression()
     .and(new Expr(Expr.Type.TOTAL_H_COUNT, 0).negate());
String sma = Smarts.write(query); // sma=[n,o;!H0]1cccc1

The parser allows a flavor to be parsed in that enables support for syntax or behaviour extensions from various toolkits.

// #X means a hetero atom
Smarts.parse(query, "[#X]", Smarts.FLAVOR_MOE);
// z<num> = num hetero nbrs
Smarts.parse(query, "[z2]", Smarts.FLAVOR_CACTVS);
// R2 in OEChem is the same as x2
Smarts.parse(query, "[R2]", Smarts.FLAVOR_OECHEM);
// SSSR based R2, Z<num> = in ring of size <num>
Smarts.parse(query, "[R2]", Smarts.FLAVOR_DAYLIGHT);
// old CDK interpretation was num non-H neighbours
Smarts.parse(query, "[D2]", Smarts.FLAVOR_CDK_LEGACY);
  • SMARTS atom/bond expression trees are now represented by the single Expr class. Previously each expression was defined as a separate class making it very difficult to inspect and modify values.
Expr e = new Expr(ELEMENT, 8); // #8
e.and(DEGREE, 2); // [#8D2]
e.or(ELEMENT, 7); // [#8D2,#7]
  • Creating a query from 'real' molecule is now easier with QueryAtomContainer.create(), see QueryAtomContainer.
  • New subgraph search algorithm available, DfPattern. Note this algorithm will only with CdkUseLegacyAtomContainer=false (now the default).
  • Cleaned up logging, quieter builds, set level from API ILoggingTool.setLevel(). Default logging to standard error can now be configured with system property: -Dcdk.logging.level=ERROR.
  • Custom comparator in Canonical labelling, Canon.label(), Atom-Maps in SMILES can now define ordering - #465

Descriptors/Fingerprinting

Depiction

  • Support EPS output from Depiction - #433
  • Render delocalised bonds as dashes - #403
  • Better abbreviations of fragments/salts - #491
  • Improved reaction layout when aligning mapped atoms.
  • SVG units - can now render SVG in px as well as mm - #414
  • New highlight style that adds a white outline around text - #258

Formula / Mass

  • Improved IsotopePatternGenerator speed and output now provides the isotopic compositions of the generated masses (most abundant MF).
  • Round trip charge and explicit isotopes from/to molecular formulas. [[13]CCH5O]-
  • Improved mass calculations, missing isotopes are not considered to be the most abundant (major) but rather the natural mass. Setting the isotopes explicitly allows the old behaviour.

IO

  • Smaller V2000 molfile by truncating default property blocks, behaviour matches current BIOVIA tools.
MDLV2000Writer mdlw = new MDLV2000Writer();
mdlw.getSetting(MDLV2000Writer.OptWriteDefaultProperties)
                .setSetting("false");

Example:


  CDK     0425181143

  5  4  0  0  1  0  0  0  0  0999 V2000
    0.0000    0.0000    0.0000 C   0  0  1  0  0  0
    0.0000    0.0000    0.0000 C   0  0
    0.0000    0.0000    0.0000 C   0  0
    0.0000    0.0000    0.0000 O   0  0
    0.0000    0.0000    0.0000 C   0  0
  1  2  1  0
  2  3  1  0
  1  4  1  0
  1  5  1  0
M  END
  • Correctly read implicit D/T when reading InChIs

Authors

 213 John Mayfield
  35 Saulius Gražulis
  17 Kazuya Ujihara
   9 bach
   8 Egon Willighagen
   6 michaelwenk
   4 Rajarshi Guha
   4 Lyle D. Burgoon
   2 Katrin Leinweber
   1 potatostodie
   1 meier-rene
   1 balaji
   1 Sundaram
   1 Raven
   1 Matt Swain
   1 Martin Gütlein

Reviews (merges)

  43 Egon Willighagen
  26 John Mayfield

Full Change Log