Technical Support Forum Index
Technical Support Forum
Access ChemAxon scientists and developers here. For registration and login issues contact website support.

Support Ticket System is replacing forum

This forum was converted into a searchable archive. You cannot add posts here any more. For support please use our new Ticket System.

Create your first ticket
Running a SMART test on a SMILES molecule
To watch this topic for replies  Register (enables digests) or give email address:
This topic is locked: you cannot edit posts or make replies.
Display posts from previous:   
    View previous topic :: View next topic    
Author Message
jason

Joined: 05 Oct 2016
Posts: 5

View user's profile

Back to top
Link to postPosted: Mon Oct 10, 2016 5:48 pmPost subject: Running a SMART test on a SMILES molecule Reply with quote

I'm hoping to do something super simple:

  1. Create a molecule using SMILES -- I don't want a file, I don't need it translated or anything.  I just need the chemical makeup of the SMILES formula represented
  2. Using a serious of SMART filters, verify which SMART the SMILES molecule most represents.
Daniel
ChemAxon personnel
Joined: 22 Jan 2012
Posts: 315

View user's profile

Back to top
Link to postPosted: Tue Oct 18, 2016 11:57 amPost subject: Reply with quote

Hi Jason,

1. What do you mean by creating? I mean you can read a molecule represented by a SMILES code and do different things with it: visualize in MarvinView, or calculate different properties for it. To look at the chemical makeup of a molecule, you should visualize it somehow. Can you give more information on what you want to do?

2. We have a language called Chemical Terms, which has functions that can help you find and count fragments represented by SMARTS codes. The match() and matchCount() do these. By using them you can make a script that finds the fragment, which  occurs the most in the molecule.

Here is the manual of these match functions with usage examples:

https://docs.chemaxon.com/display/docs/Functions+by+Categories#match_functions

I hope this helps,

Daniel 

jason

Joined: 05 Oct 2016
Posts: 5

View user's profile

Back to top
Link to postPosted: Tue Oct 18, 2016 5:37 pmPost subject: Reply with quote

Daniel,

I might not be going about this the correct way, but what I have is some SMILES representation: HCOOH (which is Formic Acid).  And then I have a list of SMART filters.  I want to check which SMART filter best represents my SMILES notation.

Now, I believe the best way to do this, from reading the documentation, is to build a molecule from my SMILES notation and then just ask the molecule: "are you like x, y, or z?"  As luck would have it, the docs.chemaxon.com is currently down.  But I will read that documentation you sent when it's back up to see how well it will fit my needs.

Thanks,

Jason

Daniel
ChemAxon personnel
Joined: 20 Mar 2006
Posts: 494

View user's profile

Back to top
Link to postPosted: Wed Oct 19, 2016 7:33 amPost subject: Reply with quote

For information, HCOOH is not in the SMILES format. In SMILES double bonds are explicit, one possible SMILES representation for formic acid is OC=O.

Daniel
ChemAxon personnel
Joined: 22 Jan 2012
Posts: 315

View user's profile

Back to top
Link to postPosted: Wed Oct 19, 2016 10:43 amPost subject: Reply with quote

Hi Jason !

First, our docs site is available again, so you can browse our manuals. 

Second, for your case I would experiment with the match and matchCount functions. (as I mentioned in my last email) Here is an easy example of using these functions for the formic acid molecule:

./evaluate -e "match('[#8]C=O')" "OC=O"
1
./evaluate -e "matchCount('[#8]C=O')" "OC=O"
1

So I filtered the molecule for the -COOH group, and got a single hit.

I hope this helps, 

Daniel

jason

Joined: 05 Oct 2016
Posts: 5

View user's profile

Back to top
Link to postPosted: Wed Oct 19, 2016 7:41 pmPost subject: Reply with quote

dszisz wrote:

Hi Jason !

First, our docs site is available again, so you can browse our manuals. 

Second, for your case I would experiment with the match and matchCount functions. (as I mentioned in my last email) Here is an easy example of using these functions for the formic acid molecule:

./evaluate -e "match('[#8]C=O')" "OC=O"
1
./evaluate -e "matchCount('[#8]C=O')" "OC=O"
1

So I filtered the molecule for the -COOH group, and got a single hit.

I hope this helps, 

Daniel

Ok, so I have to use the command line?  I cannot us a programmatic API to do this?  It's mostly ok for what I need, just orders of magnitude slower than what I was hoping for.

 

Thanks,

Jason

Daniel
ChemAxon personnel
Joined: 22 Jan 2012
Posts: 315

View user's profile

Back to top
Link to postPosted: Thu Oct 20, 2016 3:04 pmPost subject: Reply with quote

Hi, 

No, of course we have an API as well for you. Look at this API documentation of the evaluator tool:

https://www.chemaxon.com/jchem/doc/dev/java/api/chemaxon/jep/Evaluator.html

Please check if this is what you need. 

Daniel

jason

Joined: 05 Oct 2016
Posts: 5

View user's profile

Back to top
Link to postPosted: Thu Oct 20, 2016 6:28 pmPost subject: Nailed it -- mostly! Reply with quote

This is exactly what I need.  Thank you!

I already have a solution coded up and mostly working.  My only followup question is: how do you get this to allow recursive SMART statements, I have a SMART filter for Epoxides: [$([#7+][OX1-]),$([#7v5]=[OX1]);!$([#7](~[O])~[O]);!$([#7]=[#7])]

However, this throws a ParseException error at line 1, column 1:

Exception in thread "main" chemaxon.nfunk.jep.ParseException: Error while compiling expression:

[$([#7+][OX1-]),$([#7v5]=[OX1]);!$([#7](~[O])~[O]);!$([#7]=[#7])]

    Encountered "[" at line 1, column 1.

Was expecting one of:

    <EOF> 

    ";" ...

    "+" ...

    "-" ...

    <NOT> ...

    <STRING_LITERAL> ...

    <INTEGER_LITERAL> ...

    <FLOATING_POINT_LITERAL> ...

    <IDENTIFIER> ...

    "(" ...

    

at chemaxon.nfunk.jep.JEP.parseExpression(JEP.java:437)

at chemaxon.jep.ChemJEP.compile(ChemJEP.java:118)

at chemaxon.jep.Evaluator.compile(Evaluator.java:955)

at chemaxon.jep.Evaluator.compile(Evaluator.java:872)

at ChemAxionMain.runEvaluator(ChemAxionMain.java:27)

at ChemAxionMain.main(ChemAxionMain.java:19)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

Caused by:

chemaxon.nfunk.jep.ParseException: Encountered "[" at line 1, column 1.

Was expecting one of:

    <EOF> 

    ";" ...

    "+" ...

    "-" ...

    <NOT> ...

    <STRING_LITERAL> ...

    <INTEGER_LITERAL> ...

    <FLOATING_POINT_LITERAL> ...

    <IDENTIFIER> ...

    "(" ...

    

at chemaxon.nfunk.jep.Parser.generateParseException(Parser.java:1761)

at chemaxon.nfunk.jep.Parser.jj_consume_token(Parser.java:1641)

at chemaxon.nfunk.jep.Parser.Start(Parser.java:60)

at chemaxon.nfunk.jep.Parser.parseStream(Parser.java:26)

at chemaxon.nfunk.jep.JEP.parseExpression(JEP.java:404)

at chemaxon.jep.ChemJEP.compile(ChemJEP.java:118)

at chemaxon.jep.Evaluator.compile(Evaluator.java:955)

at chemaxon.jep.Evaluator.compile(Evaluator.java:872)

 

at ChemAxionMain.runEvaluator(ChemAxionMain.java:27)

 

Thanks so much for your help thus far!  I greatly appreciate it.

jason

Joined: 05 Oct 2016
Posts: 5

View user's profile

Back to top
Link to postPosted: Mon Nov 07, 2016 12:37 amPost subject: I'm an idiot Reply with quote

....i realized my issue.  I wasn't prepending the "match()" method call to the smart string.

Daniel
ChemAxon personnel
Joined: 22 Jan 2012
Posts: 315

View user's profile

Back to top
Link to postPosted: Mon Nov 07, 2016 11:06 amPost subject: Reply with quote

Hi Jason, 

Thank you for this correction. We unfortunately haven't started to investigate your issue on a code level, so if you still encounter the problem, please tell us and we will go on with it.

Thank you,

Daniel 

This topic is locked: you cannot edit posts or make replies.
Page 1 of 1


To watch this topic for replies   Register (enables digests) or give email address  
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum