Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem generating molecule from blob data #22

Closed
nicokant opened this issue Jan 18, 2022 · 4 comments
Closed

problem generating molecule from blob data #22

nicokant opened this issue Jan 18, 2022 · 4 comments

Comments

@nicokant
Copy link

I'm following the tutorial, but when I try to add a new compound using
Compound.objects.create(name='benzene', molecule='c1ccccc1') I got the following error:

django.db.utils.DataError
django.db.utils.DataError: problem generating molecule from blob data

my requirements.txt file has:

# RDKIT
rdkit-pypi==2021.9.4
-e git+https://github.com/rdkit/django-rdkit.git@v0.3.1#egg=django_rdkit

while my models.py file is:

from django_rdkit import models

class Compound(models.Model):
    name = models.CharField(max_length=500)
    structure = models.MolField(verbose_name="Structure")
@rvianello
Copy link
Contributor

@nicokant I think this error is probably originating from a postgres server running with a version of the rdkit cartridge which is too old to support the binary format submitted by the rdkit code on the client side (see also #21). You could try either upgrading the postgres server to the current rdkit release, or downgrading the rdkit toolkit on the client side.

@nicokant
Copy link
Author

@rvianello I'm using a docker container for running the postgres database with the cartridge, in particular https://github.com/mcs07/docker-postgres-rdkit. I think it uses the 2020.03.2 version, to which version should I port it? to the same as my requirements? (2021.9.4)

Thanks for your help!

@rvianello
Copy link
Contributor

@nicokant yes, ideally the same version (or at least the same major release, currently 2021.09) should be available on the database server and client sides. Please note that rebuilding the last RDKit release may currently run into a configuration-time error (rdkit/rdkit#4892). You can try adding the workaround documented at the linked RDKit issue into your Dockerfile.

@nicokant
Copy link
Author

Thank you for your support, I ended up using a custom docker image using the conda distribution to avoid rebuilding rdkit from source and now everything works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants