Re: [Rdkit-devel] [Cartridge] Cis/Trans in SMILES bug (backslashes)
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Greg L. <gre...@gm...> - 2011-04-01 15:24:32
|
Hi Adrian,
On Fri, Apr 1, 2011 at 3:15 PM, Adrian Schreyer <am...@ca...> wrote:
>
> I have noticed that trans backslashes in SMILES strings will cause
> problems in PostgreSQL because they are not treated as literals by
> default. The E'' syntax will not escape the backslash and just remove
> it instead. select 'F\C=C/F' = 'F\C=C/F' is by default the same as
> select 'FC=C/F' = 'F\C=C/F.
Nice catch.
Apparently the E and \\ works :
vendors=# select E'F\\C=C/F'::mol::text;
text
---------
F/C=C\F
(1 row)
Happily, when inserting from a file, \\ works as well:
~ > cat > blah.smi
C/C=C/C
C\\C=C/C
~ > psql vendors
psql (9.0.0)
Type "help" for help.
vendors=# create table blah (m mol);
CREATE TABLE
vendors=# copy blah (m) from '/Users/landrgr1/blah.smi';
COPY 2
vendors=# select * from blah
vendors-# ;
m
---------
C/C=C/C
C/C=C\C
(2 rows)
Best Regards,
-greg
|