rdkit / rdkit

The official sources for the RDKit library
BSD 3-Clause "New" or "Revised" License
2.62k stars 875 forks source link

Deprecation warning from Descriptors.CalcMolDescriptors #7625

Closed kienerj closed 2 months ago

kienerj commented 2 months ago

Describe the bug Not really a bug just an observation. When using the function Descriptors.CalcMolDescriptors for every call 3 warnings DEPRECATION WARNING: please use MorganGenerator are emitted.

To Reproduce from rdkit import Chem mol = Chem.MolFromSmiles("CCC") desc = Descriptors.CalcMolDescriptors(mol)

Expected behavior Adjust the functions used inside CalcMolDescriptors so that they all uses the new way to generate Fingerprints. And maybe there is potential for some minor optimization to not calculate it 3 times for every molecule

Configuration (please complete the following information):

VladaMilch commented 2 months ago

Hi all, I am still having this issue, though I've installed rdkit with pip (on MacOS). Here is the version: rdkit-2024.3.5-cp312-cp312-macosx_11_0_arm64.whl.metadata

FirthMike commented 1 month ago

I am also seeing this deprecation warning when using AllChem.GetMorganFingerprintAsBitVect. I updated Descriptors.py to the updated version from github.

greglandrum commented 1 month ago

Hi all, I am still having this issue, though I've installed rdkit with pip (on MacOS). Here is the version: rdkit-2024.3.5-cp312-cp312-macosx_11_0_arm64.whl.metadata

The fix will be in the 2024.03.6 release, due next week

greglandrum commented 1 month ago

I am also seeing this deprecation warning when using AllChem.GetMorganFingerprintAsBitVect. I updated Descriptors.py to the updated version from github.

I'm not sure what you mean @FirthMike : are you calling GetMorganFingerprintAsBitVect() yourself? That function is deprecated and we suggest that you use a fingeprint generator instead (https://greglandrum.github.io/rdkit-blog/posts/2023-01-18-fingerprint-generator-tutorial.html)

FirthMike commented 1 month ago

I am also seeing this deprecation warning when using AllChem.GetMorganFingerprintAsBitVect. I updated Descriptors.py to the updated version from github.

I'm not sure what you mean @FirthMike : are you calling GetMorganFingerprintAsBitVect() yourself? That function is deprecated and we suggest that you use a fingeprint generator instead (https://greglandrum.github.io/rdkit-blog/posts/2023-01-18-fingerprint-generator-tutorial.html)

Thank you for the lighning response!

Yes - I'm calling AllChem.GetMorganFingerprintAsBitVect - it wasn't clear that AllChem.GetMorganFingerprintAsBitVect is deprecated from the warning - so I assumed it was a similar issue to CalcMolDescriptors above.

Thank you for the URL - I will use the fingerprint generator from now on.