Re: Creating SMARTS from SMILES/InChI's - depends on canonical SMILES ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Creating SMARTS from SMILES/InChI's - depends on canonical SMILES ?

Steffen Neumann
Hi,

I tried to investigate this, but my C++ is quite rusty,
so unless somebody else is on this SMARTS problem,
could anyone point me what to look for ?

Yours,
Steffen


On Mon, 2010-09-13 at 09:14 +0200, Steffen Neumann wrote:

> Hi,
>
> I've hit a problem using SMILES as SMARTS,
> which in my case requires using *canonical* SMILES as input,
> see the example below. The problem occurs both with ob-2.2.3
> and todays SVN trunk.
>
> Did I miss anything, or should I open a bug ?
>
> Yours,
> Steffen
>
> #-------- Cut & Paste from here ------------
>
> echo 'InChI=1S/C9H7N5O/c10-8-7-9(12-4-11-8)14(5-13-7)6-2-1-3-15-6/h2-6H,(H2,10,11,12)' | babel -i inchi - -o smi
> #C1=CC(n2cnc3c(N)ncnc23)OC=1
> #1 molecule converted
> #1 info messages 25 audit log messages
>
> echo 'O' |  babel -i smi - -s 'C1=CC(n2cnc3c(N)ncnc23)OC=1' -o smi -
> #==============================
> #*** Open Babel Error  in SMARTSError
> #  SMARTS Error:
> #C1=CC(n2cnc3c(N)ncnc23)OC=1
> #                           ^
>
> echo 'InChI=1S/C9H7N5O/c10-8-7-9(12-4-11-8)14(5-13-7)6-2-1-3-15-6/h2-6H,(H2,10,11,12)' | babel -i inchi - -o can
> #Nc1ncnc2c1ncn2C1C=C=CO1
> #1 molecule converted
> #1 info messages 25 audit log messages
>
> # Correct:
> echo 'O' |  babel -i smi - -s 'Nc1ncnc2c1ncn2C1C=C=CO1' -o smi -
> #0 molecules converted
>

--
IPB Halle                    AG Massenspektrometrie & Bioinformatik
Dr. Steffen Neumann          http://www.IPB-Halle.DE
Weinberg 3                   http://msbi.bic-gh.de
06120 Halle                  Tel. +49 (0) 345 5582 - 1470
                                  +49 (0) 345 5582 - 0
sneumann(at)IPB-Halle.DE     Fax. +49 (0) 345 5582 - 1409



------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Creating SMARTS from SMILES/InChI's - depends on canonical SMILES ?

Tim Vandermeersch
On Sun, Sep 26, 2010 at 7:22 PM, Steffen Neumann <[hidden email]> wrote:
> Hi,
>
> I tried to investigate this, but my C++ is quite rusty,
> so unless somebody else is on this SMARTS problem,
> could anyone point me what to look for ?

The problem seems to be the explicit closure bond at the end of the
SMARTS. The source is in src/parsmarts.cpp but I'm not familiar with
the code. The error originates from line 1522. If this is removed, a
unit test fail to identify these invalid SMARTS:

C=1CCCCC#1
C-1CCCCC:1

However, your SMARTS should be valid I think. For example,

C1CCC=1

means we should use the bond expression next to the second closure digit.

The fix is in svn now.

Tim


> Yours,
> Steffen
>
>
> On Mon, 2010-09-13 at 09:14 +0200, Steffen Neumann wrote:
>> Hi,
>>
>> I've hit a problem using SMILES as SMARTS,
>> which in my case requires using *canonical* SMILES as input,
>> see the example below. The problem occurs both with ob-2.2.3
>> and todays SVN trunk.
>>
>> Did I miss anything, or should I open a bug ?
>>
>> Yours,
>> Steffen
>>
>> #-------- Cut & Paste from here ------------
>>
>> echo 'InChI=1S/C9H7N5O/c10-8-7-9(12-4-11-8)14(5-13-7)6-2-1-3-15-6/h2-6H,(H2,10,11,12)' | babel -i inchi - -o smi
>> #C1=CC(n2cnc3c(N)ncnc23)OC=1
>> #1 molecule converted
>> #1 info messages 25 audit log messages
>>
>> echo 'O' |  babel -i smi - -s 'C1=CC(n2cnc3c(N)ncnc23)OC=1' -o smi -
>> #==============================
>> #*** Open Babel Error  in SMARTSError
>> #  SMARTS Error:
>> #C1=CC(n2cnc3c(N)ncnc23)OC=1
>> #                           ^
>>
>> echo 'InChI=1S/C9H7N5O/c10-8-7-9(12-4-11-8)14(5-13-7)6-2-1-3-15-6/h2-6H,(H2,10,11,12)' | babel -i inchi - -o can
>> #Nc1ncnc2c1ncn2C1C=C=CO1
>> #1 molecule converted
>> #1 info messages 25 audit log messages
>>
>> # Correct:
>> echo 'O' |  babel -i smi - -s 'Nc1ncnc2c1ncn2C1C=C=CO1' -o smi -
>> #0 molecules converted
>>
>
> --
> IPB Halle                    AG Massenspektrometrie & Bioinformatik
> Dr. Steffen Neumann          http://www.IPB-Halle.DE
> Weinberg 3                   http://msbi.bic-gh.de
> 06120 Halle                  Tel. +49 (0) 345 5582 - 1470
>                                  +49 (0) 345 5582 - 0
> sneumann(at)IPB-Halle.DE     Fax. +49 (0) 345 5582 - 1409
>
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss