Dear Jean-Marc,
in Python 3 you need to use next(suppl) or suppl.__next__().
Cheers,
p.
On 10/15/19 21:34, Jean-Marc Nuzillard wrote:
Dear all,
The code:
from rdkit import Chem
sdfnamein = "simple.sdf"
suppl = Chem.SDMolSupplier(sdfnamein)
m = suppl.next()
print(m.GetNumAtoms())
prints:
Dear all,
The code:
from rdkit import Chem
sdfnamein = "simple.sdf"
suppl = Chem.SDMolSupplier(sdfnamein)
m = suppl.next()
print(m.GetNumAtoms())
prints:
Traceback (most recent call last):
File "demo.py", line 4, in
m = suppl.next()
AttributeError: 'SDMolSupplier' object has no
> 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
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 =
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
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")
6 matches
Mail list logo