On Wed, Feb 26, 2014 at 7:26 PM, Adrian Jasiński
<[email protected]>wrote:
> you can try use razi:
>
Unfortunately, razi is currenly a bit old and unmaintained. Moreover it's
based on sqlalchemy and it wouldn't therefore integrate easily with the
django database api. One might consider having a look at django-chem, but
that is also quite old (iirc it targeted django 1.3), and it's based on an
implementation approach that I think is becoming in part obsolete.
As it has been also mentioned in reply to Hari's question on stackoverflow,
the upcoming version 1.7 of django will support custom lookup operators.
This is likely to help, but I also partly agree that extending the database
api is still quite a lot of work compared to the fraction of
domain-specific queries, and a single application project could just
consider using raw SQL queries in the few places where it is needed.
Of course things are much simpler if one doesn't need/want to abstract the
api from the database backend and it could be also of interest that there's
currently a kickstarter project which is aimed at contributing extended
postgresql support to django:
https://www.kickstarter.com/projects/mjtamlyn/improved-postgresql-support-in-django
.
Best regards,
Riccardo
>
> http://razi.readthedocs.org/en/latest/database_creation_tutorial.html
>
> pozdrawiam
> Adrian
>
>
> 2014-02-26 18:34 GMT+01:00 Greg Landrum <[email protected]>:
>
> Hi Hari,
>>
>> You can use "mol_from_pkl()". Here's a quick demo:
>> In [20]: m = Chem.MolFromSmiles('c1cnccc1')
>>
>> In [21]: pkl = buffer(m.ToBinary())
>>
>> In [22]: curs.execute('select mol_from_pkl(%s)',(pkl,))
>>
>> In [23]: curs.fetchone()
>> Out[23]: ('c1ccncc1',)
>>
>> Is that enough to get you started?
>> -greg
>>
>>
>>
>> On Tue, Feb 25, 2014 at 8:28 PM, hari jayaram <[email protected]> wrote:
>>
>>> Hi ,
>>> I am a newbie to postgres and the rdkit postgres database cartridge.
>>>
>>> I have gotten the cartridge installed and can query sub-structure
>>> similarity and do other things as documented in the cartridge documentation
>>> page.
>>>
>>> To create a molecule from the cartridge the documentation
>>> <http://www.rdkit.org/docs/Cartridge.html>recommends something like:
>>>
>>>
>>> >>> curs.execute('select molregno,mol_send(m) from rdk.mols where m@
>>> >%s',('c1cccc2c1nncc2',))
>>> >>> row = curs.fetchone()
>>> >>> row
>>> (9830, <read-only buffer for 0x...>)
>>>
>>> Then the pickled output of mol_send will be used to create a new molecule
>>>
>>> >>> from rdkit import Chem
>>> >>> m = Chem.Mol(str(row[1]))
>>> >>> Chem.MolToSmiles(m,True)
>>> 'CC(C)Sc1ccc(CC2CCN(C3CCN(C(=O)c4cnnc5ccccc54)CC3)CC2)cc1'
>>>
>>>
>>> My question is : how about the other way .Is the only way to use the
>>> smiles and do an sql insert with the smiles and the mol_from_smiles
>>> function as in :
>>>
>>> insert into compounds (smiles,rdkit_mol,internal,external) VALUES
>>> ('CCCCC',mol_from_smiles('CCCCC);'ID-1111111','EI-2222222');
>>>
>>> Is there a way to insert the python rdkit mol object into the database
>>> rdkit "mol" column directly.
>>>
>>> This is in some ways connected to a question I just asked ( django
>>> related) on stack
>>> overflow.<http://stackoverflow.com/questions/22022163/how-to-handle-map-custom-postgresql-type-to-django-model>
>>>
>>> Thanks a tonne for your help in advance
>>> Hari
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Flow-based real-time traffic analytics software. Cisco certified tool.
>>> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
>>> Customize your own dashboards, set traffic alerts and generate reports.
>>> Network behavioral analysis & security monitoring. All-in-one tool.
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Rdkit-discuss mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Flow-based real-time traffic analytics software. Cisco certified tool.
>> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
>> Customize your own dashboards, set traffic alerts and generate reports.
>> Network behavioral analysis & security monitoring. All-in-one tool.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Rdkit-discuss mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>>
>
>
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss