Re: [Rdkit-discuss] Issue with PandaTools Export to Excel
Answer to myself... Le 27/10/2022 à 00:54, Stéphane Téletchéa a écrit : Any idea if I'm doing something wrong? Yes I was using "frame" and not "antibiotics"... The update about pandas concat instead of "append" stands :-) Do I need to submit a git pull request? Have a good day, Stéphane -- Assistant Professor, USBB, UMR 6286 CNRS, Bioinformatique Structurale UFR Sciences et Techniques, 2, rue de la Houssinière, Bât. 25, 44322 Nantes cedex 03, France Tél : +33 251 125 636 / Fax : +33 251 125 632 http://www.ufip.univ-nantes.fr/ -http://www.steletch.org ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] Issue with PandaTools Export to Excel
Dear all, I was willing to export a list of molecules using the molecule image + some properties, but ran out a strange error. I have thus came back to the documentation (http://rdkit.org/docs/source/rdkit.Chem.PandasTools.html), but still encounter the same error. Rdkit version : 2022.09.1 The exact error is: File~/projets/docknmine/venv/lib/python3.9/site-packages/rdkit/Chem/PandasTools.py:506, inSaveXlsxFromFrame(frame, outFile, molCol, size) 489 """ 490 Saves pandas DataFrame as a xlsx file with embedded images. 491 It maps numpy data types to excel cell types: (...) 501 This feature is only available at runtime from within Excel. 502 """ 504 import xlsxwriter # don't want to make this a RDKit dependency --> 506 cols= list(frame.columns) 507 cols.remove(molCol) 508 dataTypes= dict(frame.dtypes) AttributeError: 'NoneType' object has no attribute 'columns' Any idea if I'm doing something wrong? Second, I also get a warning about the "append" deprecation in pandas. One should now use "concat", so the documentation should be updated as is: For instance I added "Daunostin" to the antibiotics list : daunoblastin = pd.DataFrame([{'Smiles':'CC1C(C(CC(O1)OC2CC(CC3=C2C(=C4C(=C3O)C(=O)C5=C(C4=O)C(=CC=C5)OC)O)(C(=O)C)O)N)O.Cl', 'Name':'Daunoblastin'}]) # PubChem 3085106 antibiotics = pd.concat([antibiotics,daunoblastin], ignore_index=True) -> No warning in this case. Any idea why the export to Excel fails? Thanks a lor in advance, Stéphane -- Assistant Professor, USBB, UMR 6286 CNRS, Bioinformatique Structurale UFR Sciences et Techniques, 2, rue de la Houssinière, Bât. 25, 44322 Nantes cedex 03, France Tél : +33 251 125 636 / Fax : +33 251 125 632 http://www.ufip.univ-nantes.fr/ -http://www.steletch.org { "cells": [ { "cell_type": "code", "execution_count": 1, "id": "83a450ec", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2022.09.1\n" ] } ], "source": [ "from rdkit.Chem import PandasTools\n", "import pandas as pd\n", "import os\n", "from rdkit import RDConfig\n", "import rdkit\n", "print(rdkit.__version__)" ] }, { "cell_type": "code", "execution_count": 2, "id": "a0a1a711", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['Name', 'Smiles']\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/j2/f6jpp0b97dl48k1nlwsstc2rgn/T/ipykernel_5514/2372667806.py:2: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.\n", " antibiotics = antibiotics.append({'Smiles':'CC1(C(N2C(S1)C(C2=O)NC(=O)CC3=CC=CC=C3)C(=O)O)C', 'Name':'Penicilline G'}, ignore_index=True)#Penicilline G\n", "/var/folders/j2/f6jpp0b97dl48k1nlwsstc2rgn/T/ipykernel_5514/2372667806.py:3: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.\n", " antibiotics = antibiotics.append({'Smiles':'CC1(C2CC3C(C(=O)C(=C(C3(C(=O)C2=C(C4=C1C=CC=C4O)O)O)O)C(=O)N)N(C)C)O', 'Name':'Tetracycline'}, ignore_index=True)#Tetracycline\n", "/var/folders/j2/f6jpp0b97dl48k1nlwsstc2rgn/T/ipykernel_5514/2372667806.py:4: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.\n", " antibiotics = antibiotics.append({'Smiles':'CC1(C(N2C(S1)C(C2=O)NC(=O)C(C3=CC=CC=C3)N)C(=O)O)C','Name':'Ampicilline'}, ignore_index=True)#Ampicilline\n" ] } ], "source": [ "antibiotics = pd.DataFrame(columns=['Name','Smiles'])\n", "antibiotics = antibiotics.append({'Smiles':'CC1(C(N2C(S1)C(C2=O)NC(=O)CC3=CC=CC=C3)C(=O)O)C', 'Name':'Penicilline G'}, ignore_index=True)#Penicilline G\n", "antibiotics = antibiotics.append({'Smiles':'CC1(C2CC3C(C(=O)C(=C(C3(C(=O)C2=C(C4=C1C=CC=C4O)O)O)O)C(=O)N)N(C)C)O', 'Name':'Tetracycline'}, ignore_index=True)#Tetracycline\n", "antibiotics = antibiotics.append({'Smiles':'CC1(C(N2C(S1)C(C2=O)NC(=O)C(C3=CC=CC=C3)N)C(=O)O)C','Name':'Ampicilline'}, ignore_index=True)#Ampicilline\n", "\n", "print([str(x) for x in antibiotics.columns])\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "f42993ea", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Name Smiles\n", "0 Penicilline GCC1(C(N2C(S1)C(C2=O)NC(=O)CC3=CC=CC=C3)C(=O)O)C\n", "1 Tetracycline CC1(C2CC3C(C(=O)C(=C(C3(C(=O)C2=C(C4=C1C=CC=C4...\n", "2Ampicilline CC1(C(N2C(S1)C(C2=O)NC(=O)C(C3=CC=CC=C3)N)C(=O...\n" ] } ], "source": [ "print(antibiotics)" ] }, { "cell_type": "code", "execution_count": 4, "id":
Re: [Rdkit-discuss] Drawing molecules from .smiles or from .sdf file
Hi, Something like this: https://www.pirika.com/Program/2019/JSME-RDKit19-3DMol.html of like this: https://github.com/3dmol/3Dmol.js/blob/master/py3Dmol/rdkit.ipynb ? Best, Stéphane Le 11/10/2021 à 15:35, Ahmed Almuntaser a écrit : Dear all, I have a problem with converting files from .smiles to .sdf because I wanted to draw the molecules. perhaps the molecules from .sdf draw more easily than from .smiles. because i tried to draw the molecules from .smiles but didn't work. So I wanted to draw the molecules either from .sdf or from .smiles can someone help me please? Best regards Almuntaser -- Assistant Professor, UFIP, UMR 6286 CNRS, Team Protein Design In Silico UFR Sciences et Techniques, 2, rue de la Houssinière, Bât. 25, 44322 Nantes cedex 03, France Tél : +33 251 125 636 / Fax : +33 251 125 632 http://www.ufip.univ-nantes.fr/ - http://www.steletch.org ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] Automatic conformation assignment
Le 15/09/2020 à 20:59, Navid Shervani-Tabar a écrit : Dear RDKiters, I was wondering if RDKit can assign conformation type for molecules such as alanine dipeptide based on their dihedral angles/atom positions. If not, any software/package suggestions would be appreciated. Best, Navid Hi Navid, Many can do that easily, use biopython, PyMol, Chimera, ... If you want something more "biological", I'd recomment using PEP-Fold: https://bioserv.rpbs.univ-paris-diderot.fr/services/PEP-FOLD/ HTH, Stéphane -- Assistant Professor, UFIP, UMR 6286 CNRS, Team Protein Design In Silico UFR Sciences et Techniques, 2, rue de la Houssinière, Bât. 25, 44322 Nantes cedex 03, France Tél : +33 251 125 636 / Fax : +33 251 125 632 http://www.ufip.univ-nantes.fr/ - http://www.steletch.org ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] Atom coordinates from PDB-file
Hi all, Le 25/02/2019 à 12:38, Lukas Pravda a écrit : Hi Illimar, If you need to access coordinates without creating conformer object do you really need to use rdkit I the first place? PDB file is column based format, so extracting coordinates for atoms for example with python is very straightforward. Lukas To pick certains atoms on a PDB file, I'd go for biopython's Bio.PDB -> https://biopython.org/wiki/The_Biopython_Structural_Bioinformatics_FAQ HTH, Stéphane -- Lecturer, UFIP, UMR 6286 CNRS, Team Protein Design In Silico UFR Sciences et Techniques, 2, rue de la Houssinière, Bât. 25, 44322 Nantes cedex 03, France Tél : +33 251 125 636 / Fax : +33 251 125 632 http://www.ufip.univ-nantes.fr/ - http://www.steletch.org ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] Struggling with apache + rdkit + django
Le 22/06/2016 à 02:56, Stéphane Téletchéa a écrit : > Since I have tried to reproduce all the > steps properly I'll set up soon a post > on my blog about this, so others will be able to reproduce easily the > initial steps without being blocked like > me for some days ... Once the post is up, I'll post it here. Dear all, I tool little time to assemble my tests on a dedicated page, with no github link for now, but most (if not all) code is indicated in the blog post. Thanks again for the comments and remarks, I hope this entry will be useful to someone else than me :-) http://www.steletch.org/spip.php?article91 Many thanks, Stéphane -- Lecturer, UFIP, UMR 6286 CNRS, Team Protein Design In Silico UFR Sciences et Techniques, 2, rue de la Houssinière, Bât. 25, 44322 Nantes cedex 03, France Tél : +33 251 125 636 / Fax : +33 251 125 632 http://www.ufip.univ-nantes.fr/ - http://www.steletch.org -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] Struggling with apache + rdkit + django
Dear Michał, I already went there and I'm really happy ChEMBL is using the same technologies as I do :-) (or the other way around :-) For sure I will consider the Beaker facility for inclusion in my project, but for now I'm too "old-school" minded, I want everything at home before querying the world (so for now I'm querying ChEMBL once to grab already known ligands for a given protein target, that's it). I'm sure my "student-to-come" will be more open minded and look more closely to this approach. Thanks for the links and the tremendous work done @EBI... Best, Stéphane Le 21/06/2016 à 21:24, Michał Nowotka a écrit : > Hi Stéphane, > > Just to let you know about two things: > > 1. ChEMBL web services are a Django application written using RDKit. > We deploy it using gunicorn and Apache through Reverse Proxy and put > on a Virtual Machine named myChEMBL that you can download. Here are > some example configuration files: > https://github.com/chembl/mychembl/tree/master/webservices/conf but > I'm happy to explain more if you want. > > 2. There is a project called Beaker that exposes most of RDKit methods > as RESTful API. The source code is here: > https://github.com/chembl/chembl_beaker and a live instance here: > https://www.ebi.ac.uk/chembl/api/utils/docs -- Lecturer, UFIP, UMR 6286 CNRS, Team Protein Design In Silico UFR Sciences et Techniques, 2, rue de la Houssinière, Bât. 25, 44322 Nantes cedex 03, France Tél : +33 251 125 636 / Fax : +33 251 125 632 http://www.ufip.univ-nantes.fr/ - http://www.steletch.org -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] Struggling with apache + rdkit + django
Dear Paolon Le 21/06/2016 à 20:09, Paolo Tosco a écrit : > Dear Stéphane, > > I can run Python scripts import RDKit modules on CentOS 7 by putting > the following rdkit.conf file in /etc/ld.so.conf.d: > > $ cat /etc/ld.so.conf.d/rdkit.conf > /var/www/cgi-bin/rdkit/rdkit-Release_2016_03_1/lib > Yes, I did that already (see below) ... > and adding two SetEnv directives in the section of my > Apache rdkit.conf: > > $ cat /etc/httpd/conf.d/rdkit.conf > Alias /rdkit /var/www/cgi-bin/rdkit > > > SetEnv RDBASE /var/www/cgi-bin/rdkit/rdkit-Release_2016_03_1 > SetEnv PYTHONPATH /var/www/cgi-bin/rdkit/rdkit-Release_2016_03_1 > [...] > > > Hope this helps, > Paolo Well, this is also what I did (not using the RDBASE env variable, though), but it was not sufficient, so since I was not able to find out where my error was, I did the search the other way around: check again on my system to find where the error was ... I have unapplied migrations on the DB so this is the cause of my error, it seems. In the meantime since I'm curious and stubborn I have also started from scratch a new django project, and there everything is fine ... Since I have tried to reproduce all the steps properly I'll set up soon a post on my blog about this, so others will be able to reproduce easily the initial steps without being blocked like me for some days ... Once the post is up, I'll post it here. Thanks all a lot for your time and contributions, Stéphane -- Lecturer, UFIP, UMR 6286 CNRS, Team Protein Design In Silico UFR Sciences et Techniques, 2, rue de la Houssinière, Bât. 25, 44322 Nantes cedex 03, France Tél : +33 251 125 636 / Fax : +33 251 125 632 http://www.ufip.univ-nantes.fr/ - http://www.steletch.org -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss