Not an exhaustive list, covers people who have been acknowledged in the release notes of recent versions or who have contributed code or bug reports to the upcoming release.
|
|
|
|
(Release 2018.03)
Move to using C++14 (mostly) for the core. In addition to making developers' lives more pleasant, this has resulted in a nice performance boost and reduced memory requirements.
As a little example of how much this changes things, here's what looping over atoms in the molecule used to require:
ROMol::VERTEX_ITER this_at, end_at;
boost::tie(this_at, end_at) = mol.getVertices();
while (this_at != end_at) {
const Atom *atom = mol[*this_at].get();
++this_at;
<do something with the atom>
}
and here's what it looks like now:
for (const auto atom : mol.atoms()) {
<do something with the atom>
}
the improvement is hopefully obvious even if you don't know C++. :-)
(Release 2018.03)
We made a series of changes to the default values of arguments to RDKit functions in order to make using the toolkit less error prone.
MolToSmiles()
now generates isomeric SMILES by default.MolToMolBlock()
will now by default generate a set of 2D coordinates for
molecules when the includeStereo option is set to True. The changes are made
to a copy of the molecule; the molecule itself will not be modified.(Ongoing)
We've started to gradually make other changes to the code that may be either backwards incompatible or may change the default results. These will be documented in a section of the release notes and are tagged with Changes Results
in github.
Here's an example from the (upcoming) 2019.09 release notes:
## Backwards incompatible changes
This release includes a set of changes to make the default arguments to common
functions less error prone (github #1679).
- GetAtomSmiles() now generates isomeric SMILES by default.
- The ringMatchesRingOnly option to the FindMCS() function now applies to
atom-atom matches as well as bond-bond matches.
(Release 2018.09)
epydoc is no longer maintained and does not work with Python 3. Sphinx autodoc is under active development, integrates better with the rest of the RDKit documentation system, and looks better. Unfortunately some documentation needs to be reformatted in order to look good; this may take another release. You can help here!
Some for which the PR is still being reviewed:
Hopefully these will also make it into the 2019.09 release
(2018.03 release)
This allows the coordgen library from Nicola Zonta (Schroedinger) to be used to generate 2D coordinates in the RDKit.
from rdkit import Chem
from rdkit.Chem import rdDepictor
from rdkit.Chem.Draw import IPythonConsole
epinephrine = Chem.MolFromSmiles('CNC[C@H](O)c1ccc(O)c(O)c1')
epinephrine
rdDepictor.SetPreferCoordGen(True)
rdDepictor.Compute2DCoords(epinephrine)
epinephrine
Something harder:
IPythonConsole.molSize = (350,300)
emodepside = Chem.MolFromSmiles('CC(C)C[C@H]1C(=O)O[C@H](Cc2ccc(N3CCOCC3)cc2)C(=O)N(C)[C@@H](CC(C)C)C(=O)O[C@H](C)C(=O)N(C)[C@@H](CC(C)C)C(=O)O[C@H](Cc2ccc(N3CCOCC3)cc2)C(=O)N(C)[C@@H](CC(C)C)C(=O)O[C@H](C)C(=O)N1C')
rdDepictor.SetPreferCoordGen(False)
rdDepictor.Compute2DCoords(emodepside)
emodepside
rdDepictor.SetPreferCoordGen(True)
rdDepictor.Compute2DCoords(emodepside)
emodepside
from rdkit import Chem
from rdkit.Chem import rdMolDescriptors
from rdkit.Chem.Draw import IPythonConsole
from rdkit.Chem import Draw
epinephrine = Chem.MolFromSmiles('CNC[C@H](O)c1ccc(O)c(O)c1')
epinephrine
bi = {}
fp = rdMolDescriptors.GetMorganFingerprintAsBitVect(epinephrine, radius=2, bitInfo=bi)
list(fp.GetOnBits())[:10]
Draw.DrawMorganBit(epinephrine,589,bi)
Draw.DrawMorganBit(epinephrine,80,bi)
Draw.DrawMorganBit(epinephrine,589,bi,aromaticColor=None,ringColor=None,extraColor=(.6,.6,.9),centerColor=(.9,.6,.6))
Draw.DrawMorganBit(epinephrine,589,bi,aromaticColor=None,ringColor=None,extraColor=(.6,.6,.9),centerColor=(.9,.6,.6),baseRad=0.6)
rdkbi = {}
rdkfp = Chem.RDKFingerprint(epinephrine, maxPath=5, bitInfo=rdkbi)
list(rdkfp.GetOnBits())[:10]
Draw.DrawRDKitBit(epinephrine,166,rdkbi)
Draw.DrawRDKitBit(epinephrine,222,rdkbi)
Draw.DrawRDKitBit(epinephrine,222,rdkbi,aromaticColor=(.9,.6,.6),nonAromaticColor=(.6,.6,.9))
Draw.DrawRDKitBit(epinephrine,222,rdkbi,aromaticColor=(.9,.6,.6),nonAromaticColor=(.6,.6,.9),baseRad=.5)
from ipywidgets import interact,fixed,IntSlider
def renderFpBit(mol,bitIdx,bitInfo,fn):
bid = bitIdx
return(display(fn(mol,bid,bitInfo)))
interact(renderFpBit, bitIdx=list(bi.keys()),mol=fixed(epinephrine),bitInfo=fixed(bi),fn=fixed(Draw.DrawMorganBit));
interact(renderFpBit, bitIdx=list(rdkbi.keys()),mol=fixed(epinephrine),bitInfo=fixed(rdkbi),fn=fixed(Draw.DrawRDKitBit));
(2018.03 release)
A JSON-based format derived from CommonChem for exchanging information about molecules between software packages.
from rdkit import Chem
from rdkit.Chem.Draw import IPythonConsole
from rdkit.Chem import rdMolInterchange
import json
doravirine = Chem.MolFromSmiles('Cn1c(n[nH]c1=O)Cn2ccc(c(c2=O)Oc3cc(cc(c3)Cl)C#N)C(F)(F)F')
doravirine
mjson = rdMolInterchange.MolToJSON(doravirine)
print(json.dumps(json.loads(mjson),indent=4))
nmol = rdMolInterchange.JSONToMols(mjson)[0]
nmol
Chem.MolToSmiles(nmol)==Chem.MolToSmiles(doravirine)
(2017.09 release)
from rdkit import Chem
from rdkit.Chem.Draw import IPythonConsole
from rdkit.Chem import rdMolDescriptors
from rdkit.Chem import AllChem
from rdkit.Chem import Descriptors3D
doravirine = Chem.AddHs(Chem.MolFromSmiles('Cn1c(n[nH]c1=O)Cn2ccc(c(c2=O)Oc3cc(cc(c3)Cl)C#N)C(F)(F)F'))
ps = AllChem.ETKDGv2()
ps.randomSeed = 0xf00d
AllChem.EmbedMolecule(doravirine,ps)
IPythonConsole.drawMol3D(doravirine)
print("AutoCorr3D:",len(rdMolDescriptors.CalcAUTOCORR3D(doravirine)))
print("Morse:",len(rdMolDescriptors.CalcMORSE(doravirine)))
print("RDF:",len(rdMolDescriptors.CalcRDF(doravirine)))
print("WHIM:",len(rdMolDescriptors.CalcWHIM(doravirine)))
print("GETAWAY:",len(rdMolDescriptors.CalcGETAWAY(doravirine)))
Note that a collection of principal moment descriptors is also available (these have been there for a while):
descrs = ('PBF','PMI1','PMI2','PMI3','NPR1','NPR2','RadiusOfGyration','InertialShapeFactor',
'Eccentricity','Asphericity','SpherocityIndex')
for descr in descrs:
calc_fn = getattr(rdMolDescriptors,'Calc%s'%descr)
print(f"{descr} {calc_fn(doravirine):.4f}")
It's now possible to add some RDKit-specific metadata to the SVG output by the MolDraw2DSVG
object and construct molecules from that data.
This is still beta level, and we can't guarantee backwards compatibility between releases (though we'll certainly try), but I'd love to get some feedback on whether or not it's useful.
from rdkit import Chem
from rdkit.Chem.Draw import IPythonConsole
from rdkit.Chem import Draw
from IPython.display import SVG
doravirine = Chem.MolFromSmiles('Cn1c(n[nH]c1=O)Cn2ccc(c(c2=O)Oc3cc(cc(c3)Cl)C#N)C(F)(F)F')
ddoravirine = Draw.PrepareMolForDrawing(doravirine)
d = Draw.MolDraw2DSVG(250,200)
d.DrawMolecule(ddoravirine)
d.AddMoleculeMetadata(ddoravirine)
d.FinishDrawing()
svg = d.GetDrawingText()
SVG(svg)
print(svg)
nm = Chem.MolFromRDKitSVG(svg)
nm.ClearComputedProps()
Chem.SanitizeMol(nm)
nm
Chem.MolToSmiles(nm) == Chem.MolToSmiles(doravirine)