PS: I found that if you want to use the non-strict version, you can do this:
from rdkit.Chem import rdMolDescriptors rdMolDescriptors.CalcNumRotatableBonds(mol, 0) (where 0 means NonStrict, 1 means Strict, and -1 means Default.) I tested this with a molecule containing t-butyl and got different results for strict and non-strict, as expected, and the default was the same as strict. On Tue, Oct 15, 2019 at 1:57 PM Ivan Tubert-Brohman < ivan.tubert-broh...@schrodinger.com> wrote: > This is from lipinski.cpp: > > if (strict == NonStrict) { > std::string pattern = "[!$(*#*)&!D1]-&!@[!$(*#*)&!D1]"; > pattern_flyweight m(pattern); > return m.get().countMatches(mol); > } > else if (strict==Strict) { > std::string strict_pattern = > > "[!$(*#*)&!D1&!$(C(F)(F)F)&!$(C(Cl)(Cl)Cl)&!$(C(Br)(Br)Br)&!$(C([CH3])(" > > "[CH3])[CH3])&!$([CD3](=[N,O,S])-!@[#7,O,S!D1])&!$([#7,O,S!D1]-!@[CD3]=" > > "[N,O,S])&!$([CD3](=[N+])-!@[#7!D1])&!$([#7!D1]-!@[CD3]=[N+])]-!@[!$(*#" > > "*)&!D1&!$(C(F)(F)F)&!$(C(Cl)(Cl)Cl)&!$(C(Br)(Br)Br)&!$(C([CH3])([CH3])" > "[CH3])]"; > pattern_flyweight m(strict_pattern); > return m.get().countMatches(mol); > } else { > > I suspect that it's taking the "Strict" brach, where the SMARTS pattern is > more complex and actually has a rule that excludes tert-butyl (the > "&!$(C([CH3])([CH3])[CH3])]" at the end). > > Ivan > > > On Tue, Oct 15, 2019 at 1:06 PM Geoffrey Hutchison < > geoff.hutchi...@gmail.com> wrote: > >> I'm using a script in RDKit to grab a bunch of descriptors for QSAR / ML. >> I have a particular question about the # of rotatable bonds: >> >> Consider: >> >> from rdkit import Chem >> from rdkit.Chem import Descriptors >> example = Chem.MolFromSmiles("CN(C(=O)OC(C)(C)C)C(=S)NC(=O)OC(C)(C)C") >> Descriptors.NumRotatableBonds(example) >> 0 >> >> example2 = Chem.MolFromSmiles("CC(C)(C)CCC(C)(C)C") >> Descriptors.NumRotatableBonds(example2) >> 1 >> >> >> Can someone explain why a terminal butyl isn't a rotatable bond? Based on >> mailing list questions, I thought NumRotatableBonds was supposed to return >> matches for the SMARTS "[!$(*#*)&!D1]-&!@[!$(*#*)&!D1]" (e.g. what's >> defined in the Lipinski code). >> >> Thanks, >> -Geoff >> >> >> >> _______________________________________________ >> Rdkit-discuss mailing list >> Rdkit-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >> >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss