depicting SMARTS

User 3af65074b3

23-06-2010 19:14:09

Hi,


I am new to this and i am using Marvin 5.3.3.0. I was wondering if there is a way, i could depict the SMARTS or SMARTS queries that i have written. I know that the queries can be used as a filter to the molecular structure database, but is there any other way?


Also i could paste my queries in Marvin Sketch sometimes which gives rough idea of the molecule i am referring to but it doesnot work often probably because queries are wrong. Thus i need a way to visualize if my SMARTS are hinting to the same kinda of molecules as i want them to. :)


Thanks a bunch,


Barun

User 677b9c22ff

24-06-2010 18:57:55

Barun,


open them in MView or Instant-JChem, so you you can "see" them. Copy paste those SMARTS into a file,


for example Kier-Hall-SMARTS.smi and open them with MVIEW. Be aware that SMARTS are in principle only valid


for the same software. So if you are taking structures  from Daylight or OpenBabel you might be in trouble.


The same works well for reactions and queries.


[OH1]

  • O=

  • [OH0](
  • )

  • [o]
    [NH2]

  • [NH1]=

  • [NH1](
  • )

  • [nH1]
    N#

  • [ND2](=
  • )

  • [nH0]
    N(
  • )(
  • )

  • N(=
  • )(=
  • )

  • [N;+](
  • )(
  • )(
  • )

  • [SH1]

  • S=

  • [SX2](
  • )


  • S(=
    • )(=
    • )(
    • )

    • [F]

    • [Cl]

    • [Br]


      • [CH3]

      • [CH2](
      • )

      • [CH2]=

      • [CH1](
      • )(
      • )

      • [CH1](=
      • )

      • [CH1]#

      • [cH]
        [cH0]
        C(=
      • )=

      • C(#
      • )

      • C(=
      • )(
      • )

      • C(
      • )(
      • )(
      • )




See picture below of those SMARTS.


Cheers


Tobias

ChemAxon a3d59b832c

25-06-2010 07:55:42

Another way of visualization could be to highlight the substructure hit in a molecule, like the picture below.


I took the picture from the following web page:


http://www.chemaxon.com/jchem/examples/sss/index.jsp


(Paste the smarts in the first editor, then draw a target in the second.)


 


- This functionality is also there in each of the search interfaces of ChemAxon.


 


 


Be aware that SMARTS are in principle only 
valid for the same software. So if you are taking structures  from
Daylight or OpenBabel you might be in trouble.


Tobias, are you referring to different dialects here? I thought that Daylight SMARTS is pretty well defined, so most of the features should work exactly the same way in each of those systems.


Do you have a different experience? Can you give any specific examples?


 


Thanks, and best regards,


Szabolcs

User 3af65074b3

25-06-2010 15:10:28

Thanks Tobias, but I am referring in terms of queries and target. My queries are not reffering to the targets.
The link provided by Szabolcs is interesting but i am not able to load the queries in the Query window.
Lets make an hypothetical example. If you look at the target file, I want the double bond near the NO2 and SO2 NOT to react but the other one to react.


I have mapped the double bond as 1 and 2 and the third functionality as 3 and my queries are


match(ratom(1), "[CH2:1]=[CH:2][C:3]", 1) &&
match(ratom(2), "[CH2:1]=[CH:2][C:3]", 2) &&
!match(ratom(3), "[CH2:1]=[CH:2][!#6;!$[CX3]=[OX1];!$([SX3]=[OX1]);!$[([NX3+](=O)[O-]),!$([NX3](=O)=O)]:3]", 3)


what is wrong with the third query? Please detail your answer. thanks

User 677b9c22ff

25-06-2010 16:51:55










Szabolcs wrote:

 


Be aware that SMARTS are in principle only 
valid for the same software. So if you are taking structures  from
Daylight or OpenBabel you might be in trouble.


Tobias, are you referring to different dialects here? I thought that Daylight SMARTS is pretty well defined, so most of the features should work exactly the same way in each of those systems.


Do you have a different experience? Can you give any specific examples?




Hi,


SMARTS are safe, as long as you stay in the same software package, once you leave, you are doomed.


(Similar to SMILES). Example from OpenBabel (works fine in OB but not in Marvin, Mview throws three exceptions).


Source is http://openbabel.svn.sourceforge.net/svnroot/openbabel maybe its even a wrong definition. The point is SMARTS are a defacto standard but not an open and well defined standard. Talking about recursive SMARTS (shudder), besides from understanding them, the best way is really drawing all the molecules and hoping that they work in the same package. Error '[#6^2+0:1]'  (mol 1, 24, 43)


I avoid mixing SMARTS from different sources, or try to validate them again and agin.


SMARTS Example thanks to OpenBabel:


 


O=C(O)C(N)Cc1ccc([O:1])cc1  >> O=C(O)C(N)Cc1ccc([O-:1])cc1  
O=C(O)C(N)Cc1nc[n:1]c1  >> O=C(O)C(N)Cc1nc[n+:1]c1   
O=CN[OD1-0:1]     >> O=CN[O-:1]   
O=CN[OD1-0:1] >> O=CN[O-:1]
O=CN[OD1-0:1][#1:2] >> O=CN[O-:1]
O=CO[#1:1] >> O=CO
O=C[OD1-0:1] >> O=C[O-:1]
O=P([!D1])([O:1][#1:2])[O:3][#1:4] >> O=P([*D2,*D3])([O:1])[O:3]
O=P([!D1])([O:1][#1:2])[OD1]       >> O=P([!D1])([O:1])O
O=P([!D1])([O:1][#1:2])[OD1] >> O=P([!D1])([O:1])O
O=P([*D2,*D3])([OD1:1])[OD1:2] >> O=P([*D2,*D3])([O-:1])[O-:2]
[#6^2+0:1](~[N^2])(~[N^2])* >> [#6+:1](~N)(~N)*
[ND1:1]=[ND2:2]=A >> [N-:1]=[N+:2]=A
[ND2:1]=[ND2:2]=A >> [N:1]=[N+:2]=A
[ND3+0:1]=[#6] >> [ND3+:1]=[#6]
[N^3;!$(N~[!#6;!#1]):1] >> [N+:1]
[O:1]=[C:2][C:3]=[C:4][O:5] >> [O-:1][C:2]=[C:3][C:4]=[O:5]
[PD4](=O)([OD2])([OD2])[OD1:1] >> [PD4](=O)([OD2])([OD2])[O-:1]
[PD4](=O)([OD2])([OD2])[OD1:1] >> [PD4](=O)([OD2])([OD2])[O-:1]
[PD4](=O)([OD2])([OD2])[OD1:1][#1:2] >> [PD4](=O)([OD2])([OD2])[O-:1]
[SD3](=O)[O:1][#1:2] >> [SD3](=O)[O-:1]
[SD3](=O)[O:1][#1:2] >> [SD3](=O)[O-:1]
[SD3](=O)[OD1:1] >> [SD3](=O)[O-:1]
[SD4]([!D1])(=O)(=O)[O:1][#1:2] >> [SD4]([!D1])(=O)(=O)[O-:1]
[SD4]([!D1])(=O)(=O)[O:1][#1:2] >> [SD4]([!D1])(=O)(=O)[O-:1]
[SD4]([!D1])(=O)(=O)[OD1:1] >> [SD4]([!D1])(=O)(=O)[O-:1]
[SD4]([!D1])(=O)(=O)[OD1:1] >> [SD4]([!D1])(=O)(=O)[O-:1]  
[nD2-0:1]1[nD2-0][nD2-0][nD2-0]c1 >> [n-:1]1nnnc1
[nD2-0]1[nD2:1]([#1:2])[nD2-0][nD2-0]c1 >> n1[n-:1]nnc1
[nD2:1]([#1:2])1[nD2-0][nD2-0][nD2-0]c1 >> [n-:1]1nnnc1
[nD2:1]1c[nH]cc1 >> [n+:1]1c[nH]cc1


Tobias

ChemAxon a3d59b832c

28-06-2010 09:39:47

Tobias,


 


Thanks for the examples. It seems that Open Babel indeed forgets some SMARTS terms, adds new ones and sometimes uses even some unorthodox syntax as well. I wonder what "^2" means. - Daylight also does not know about that: http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html


 


Barun,


 











bhhataba wrote:

The link
provided by Szabolcs is interesting but i am not able to load the
queries in the Query window.



Try the menu Edit/Source, paste the SMARTS into the text box and use File/Import as... in the dialog. Select SMARTS from the dialog to force import SMARTS instead of the automatically recognized format.


But for a correct SMARTS, simply paste should be OK.











bhhataba wrote:

Lets make an hypothetical example. If
you look at the target file, I want the double bond near the NO2 and
SO2 NOT to react but the other one to react.


I have mapped the double bond as 1 and 2 and the third functionality
as 3 and my queries are


match(ratom(1), "[CH2:1]=[CH:2][C:3]", 1) &&
match(ratom(2),
"[CH2:1]=[CH:2][C:3]", 2) &&
!match(ratom(3),
"[CH2:1]=[CH:2][!#6;!$[CX3]=[OX1];!$([SX3]=[OX1]);!$[([NX3+](=O)[O-]),!$([NX3](=O)=O)]:3]",
3)


what is wrong with the third query? Please detail your answer. thanks



 


Please note that the correct syntax for recursive SMARTS is $(inner smarts)


- The curly brackets are always required.


 


I suggest to experiment on the above web example. Start with a simple SMARTS, and add terms one by one.


You will get error messages straight away if the syntax is not correct, and you can also check the effect.


 


Alternatively, I can see that you heavily use the match function in Chemical Terms. Instead of SMARTS logic with recursive SMARTS, etc, you could simply use some more match functions with simpler SMARTS expressions. I dare say your Chemical Terms conditions will be more easier to read, and you could use the informative predefined functional group query names of Chemical Terms.


 


Best regards,


Szabolcs

User 3af65074b3

29-06-2010 15:15:34


thanks a bunch for the helpful tips. I will
continue practicing. Meanwhile, i have some basic questions.


Like in the example below, 


match(ratom(1),"[CX3:1]([R1:6])([R2:5])=[CX3H1:2][CX3:3](=[O])[R3:7]",1)
&&


match(ratom(5),"[CX3:1]([R1:6])([#6X4,CH3:5])=[CX3H1:2][CX3:3](=[O])[R3:7])",5)
&&


match(ratom(6),"[CX3:1]([#6X4,CH3:6])([R2:5])=[CX3H1:2][CX3:3](=[O])[R3:7])",6)
&&




I have an ratom say R2:5 in line 2 as ([#6X4,CH3:5]) and again in
Line 3 as R2:5, does that mean my definition is nulled because of
definition in Line 3 or it doesnot matter as i am talking about atom 6.


Do we have to
repeat
every atom representation, every
successive line? Can we define one atom at a time in a line? and
generalize it as i did for R2:5 above.


probably repetition
is necessary
for
showing
bonds and neighboring atoms?


Can
we define two atoms together, as R1 and R2 could be the same? with
&& or ||. Please let me know with examples and point
out any mistakes. Thanks.


ChemAxon b124dd5f17

30-06-2010 08:07:14

HI Barun,


I just saw this post and don't want to comment on the question but suggest you should benefit from attending our developers training in Boston in September, see details here. There is discount for academic users


Cheers/Alex

ChemAxon a3d59b832c

03-07-2010 14:50:37

Hi Barun,


 


No, the match functions are evaluated independently of each other.


So you have to specify each query as a complete search pattern.


 


My other comment is that probably the SMARTS expressions R1, R2, etc. are used in a wrong way.


In SMARTS, R refers to the number of rings that particular atom should be part of.


So "R1" means "part of exactly one ring", R2: "part of exactly two rings", etc.


See: http://www.chemaxon.com/jchem/doc/user/query_features.html#atprop


 


Best regards,


Szabolcs

User 3af65074b3

06-07-2010 15:12:01

thanks all, i figured that out , now i am handling my queries and getting the result .thanks for all the initial help :)

User da00f5c453

06-07-2010 20:07:49

Hi Szabolcs,


Thanks for the examples. It seems that Open Babel indeed forgets some SMARTS terms, adds new ones and sometimes uses even some unorthodox syntax as well. I wonder what "^2" means. - Daylight also does not know about that: http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html />

the "^" atomic primitive is for hybridization, it also supported by OpenEye OEChem toolkit, but not by Daylight. OpenBabel SMARTS implementation is still work in progress:


http://openbabel.org/wiki/SMARTS

not to mention that the aromaticity model they use is still broken and if you use SMARTS expressions with small letters or "a" atomic primitive you will get different matching results from Daylight/ChemAxon.


Best regards, 


Oleg.

ChemAxon a3d59b832c

07-07-2010 07:54:11

Hi Oleg,


Thanks for the info!


Best regards,


Szabolcs