JacksonBurns / mordred-community

Community-Maintained Version of mordred
https://jacksonburns.github.io/mordred-community/
BSD 3-Clause "New" or "Revised" License
44 stars 3 forks source link

Unable to calculate majority of MorSE descriptors from 3D structures #15

Closed brunocalcada closed 4 months ago

brunocalcada commented 4 months ago

Hi again,

I'm trying to retrieve the MorSE descriptors, based on sdf 3D structures, in fact the only ones I'm able to calculate are the Mor01 (5 total) and for all the others (remaining 155) I'm getting the error invalid value encountered in divide. In my list of chemicals only a minority has the descriptors calculated and I'm not understanding why it was even able to calculate for some but not all.

I leave here two examples where the descriptors where calculated (molecule_1) and another where they did not (molecule_2).

molecule_1.txt molecule_2.txt

These are the versions I'm using: python v.3.8.19 networkx v.2.1 mordredcommunity v.2.0.5 rdkit 2022.09.5

Note: I even tried with newer versions of networkx but the unability to calculate the descriptors remains the same.

Thank you for all the help you may give me :)

JacksonBurns commented 4 months ago

Hi @brunocalcada sorry for the slow reply I realized my notifications were off for this repo for some reason.

Anyway, I think the issues is that you need to specify the -3 command line flag, i.e. python -m mordred -t sdf -d MoRSE -3 /home/jackson/Desktop/molecule_*.txt. This gave me all of the MoRSE descriptors for the two molecules.

If you are using mordred as a Python module you just need to set ignore_3D=False when you instantiate the Calculator class.

It's a weird quirk of this library that you have to both request 3D-based descriptors and then tell mordred not to ignore them...

brunocalcada commented 3 months ago

Hi Jackson, No problem, thank you for taking the time to reply me.

I'm using mordred as a python module in fact and I have the parameter ignore_3D set to false when using the calculator class. You were able to calculate the descriptors with the command line but did you try it as python module? With the ignore_3D were they calculated?

JacksonBurns commented 3 months ago

I didn't try it as a Python module - I would double check that the descriptors you are requesting include the 3D descriptors, or else just use mordred as a command line utility.