SMARTS which is a language for describing molecular patterns like regular expression for NLP is really useful for chemoinformatician. However it’s difficult to understand due to difficulty of visualization SMARTS query.
As far as I know, there are few software which can visualize beautiful SMARTS pattern. BioSolveIT provides unique SMARTS editor but it’s required commercial license so it’s difficult to use personally.
So I used the other free tool which named ‘SMARTS plus‘. The tool is managed by team of university of hamburg.
The tool is easy to use from web site, but also the site provides REST service. So user can use SMARTS plus from python. I tried it. Here is an example, as you can see SMARTS plus provides rich information of SMARTS.
TIPs for using SMARTS plus from REST, to pass the query with get method, some character should be encoded. The details are described in following url.
https://smarts.plus/rest
I think visualize chemical structure and query is really interesting and useful for learning chemoinforamtics.
Yes, I am testing some SMARTS based reactions and MMPDB outputs, so I also occasionally access to this site.
But I did not know they had REST interface!.
Great thanks!!
class SMARTSView:
BASE_URL = “https://smarts.plus/smartsview/download_rest”
DEFAULT_filetype = “png”
DEFAULT_vmode = 0
DEFAULT_vbonds = 1
DEFAULT_textdesc = 0
DEFAULT_depsymbols = 0
DEFAULT_smartsheading = 0
DEFAULT_trim = 1
DEFAULT_labels = 1
DEFAULT_detectarom = 1
DEFAULT_smileslikearom = 1
I am afraid if my previous comment is badly dedented.
sv = SMARTSView()
Image(sv(fr”[CH0;$(C-[#6]):1]#[CH1:2].[C;H1,H2;A;!$(C=O):3]-[*;#17,#35,#53,OH1]”))
Thanks for your comment!!!