mordred-descriptor / mordred

a molecular descriptor calculator
http://mordred-descriptor.github.io/documentation/master/
BSD 3-Clause "New" or "Revised" License
355 stars 95 forks source link

How to read .mol ​​files to calculate molecular descriptors using Mordred? #97

Open lsvalenciac opened 3 years ago

lsvalenciac commented 3 years ago

Description

Hello everybody,

I am currently working on a program that uses Mordred to calculate molecular descriptors. To draw the chemical structures I am using Gabedit and exporting the coordinates of the atoms as .mol ​​files

However, when I try to read the mol file created using the Colab -Python 3.0 notebook, I get error codes for some descriptors, for example:

'DetourIndex': module 'networkx' has no attribute 'biconnected_component_subgraphs' invalid value encountered in true_divide (Mor02) 'MDEN-13': float division by zero (MDEN-13)

The code I am using is:

calc = Calculator(descriptors, ignore_3D=True) mol=Chem.MolFromMolFile("M001.mol") Des = calc(mol)

So can anyone help me with how to read .mol ​​file formats correctly?

Sincerely, Laura

```
JacksonBurns commented 3 years ago

This is related to #84 and #80 and should be resolved by PR #90 but this repository is not being maintained apparently.

If you do pip install 'networkx==2.1.0' --force-reinstall it might resolve the issue.