On Sat, Nov 27, 2010 at 6:49 AM, Greg Landrum <[email protected]> wrote:
> At the moment there isn't a particularly satisfying way of doing an
> equality search aside from adding a smiles column to the database and
> just doing a straight equality search on that.

Ok.

> To that end it's probably useful to know that the smiles generated by
> the cartridge when you convert a molecule to text is canonical.

If I'm not getting fooled, it seems the structure is also stored in
canonical format; e.g if I store:

'COc(cc1)ccc1C#N'

then I "select * from molecules;" I get back 'COc1ccc(C#N)cc1'

If this is correct I should be able to search with the "=" operator
directly, provided I prepare the query smilles with Chem.CanonSmiles,
isn't it? That would avoid adding a specific smiles column.


>
> Without adding the smiles column, another option that should be
> correct, though it's somewhat ugly, is:
> select * from mols where m<@'CC(=O)c1ccc2c(c1)C(=O)C(=O)N2C' and
> m@>'CC(=O)c1ccc2c(c1)C(=O)C(=O)N2' and
> m::text='CC(=O)c1ccc2c(c1)C(=O)C(=O)N2C'::mol::text;
>
> If the molecule column is indexed, this will use the index so it's
> actually reasonably efficient. If you don't care about stereochemistry
> you can leave the last bit (SMILES comparison) out.
>

Yeah, ugly but I just tried and it actually works.


> Having a less ugly way of doing equality querying would be useful;
> that would be a good feature request.

Ok, so where should I report it ? ;-)

-- 
Gianluca Sforna

http://morefedora.blogspot.com
http://identi.ca/giallu - http://twitter.com/giallu

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to