Comments (4)
@adam-of-barot the problem sounds like could be related to a mismatching RDKit version (for example trying to unpickle a molecule with an older RDKit version), but I have the impression I am missing some information. Where did you update RDKit, in the django application environment, on the postgres server, or on both? And (sorry in case it should be obvious) with frontend and backend, what are you more exactly referring to, in this context? A more detailed description of the query you are performing I think would be also helpful to me.
from django-rdkit.
@rvianello I updated RDKit in the conda environment that the Django application uses. I did not upgrade anything related to the cartridge. Running the SQL command SELECT rdkit_version();
gives me 0.73.0.
By frontend I meant that I tried performing the searches through a browser with the web pages that I've built, and by backend I meant performing the searches through the command line with python manage.py shell
.
Here is a query that just tried to run through the aforementioned shell as a test:
In [1]: from app.models import ReagentStructure
In [2]: r = ReagentStructure.objects.last()
In [3]: print(r.molecule, r.smiles)
Out[3]: <rdkit.Chem.rdchem.Mol object at 0x00000212855768B0> NNC(=O)OCc1ccccc1
In [4]: ReagentStructure.objects.filter(molecule=r.smiles) # search for an already existing molecule
Out[4]: ---------------------------------------------------------------------------
DataException Traceback (most recent call last)
~\Miniconda3\envs\app\lib\site-packages\django\db\backends\utils.py in _execute(self, sql, params, *ignored_wrapper_args)
83 else:
---> 84 return self.cursor.execute(sql, params)
85
DataException: problem generating molecule from blob data
I also attached the full traceback here: traceback.txt
from django-rdkit.
Thank you for the additional details. I browsed the rdkit repository for some information, and I think version 0.73.0 refers to the 2018.03 RDKit release, implying that the postgres database is running on a version of RDKit that is now quite older than the one available to the django application.
I think the problem is probably that, because django-rdkit sends the molecule argument in binary form, the database cartridge may be unable to deserialize the data sent by the application and reconstruct a molecule instance (this is what the "problem generating molecule from blob data" error message refers to).
from django-rdkit.
I did some testing on my home linux system to check things with the out-of-date and up-to-date versions.
I tried out a fresh conda environment installation of RDKit (v2021.09.03), django-rdkit (v0.3.1), and in another fresh conda environment installed rdkit-postgresql (v2021.09.02) and made the necessary database setups.
I also made a quick test Django model with a single MolField.
SELECT rdkit_version();
gives 0.76.0.
A quick query of TestModel.objects.filter(mol__hassubstruct='CCCCC')
on an empty database gives a proper empty QuerySet.
I then made another environment, this time having rdkit-postgresql v2018.03.03. After setting up the database the same way, running the same query above gave the "problem generating molecule from blob data" error.
So yeah, the problem is definitely the out-of-date RDKit version on the database side.
Thank you for looking into it @rvianello !
from django-rdkit.
Related Issues (20)
- Recent install on Mac unusable due to Python ImportError HOT 1
- Issue with Django 3 HOT 4
- Exact structure searches HOT 3
- Django Gist Index HOT 4
- New release for conda-forge package HOT 2
- Issue with migrate HOT 2
- Error preventing to move to django 4 (ugettext_lazy no longer supported)
- Migrations with Fingerprint Fields
- problem generating molecule from blob data HOT 4
- Unable to set cartridge parameters through django_rdkit.config HOT 1
- Using Mol Field HOT 12
- MolField hassubstruct perfomance for complex molecules
- Using mol_adjust_query_properties()
- QMOL field
- Release as package on PyPI
- Unique molfield error HOT 6
- Where to set do_chiral_sss? HOT 5
- NameError: name 'forms' is not defined HOT 1
- PyPI package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-rdkit.