OpenSMILES: Comments in SMILES files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

OpenSMILES: Comments in SMILES files

Craig James-2
(Cross posted to OpenBabel-discuss and BlueObelisk-discuss)

A discussion has started in the OpenBabel list about comments in SMILES.  Currently, the SMILES spec has no provision for comments, but some implementations allow them.  For example, OpenBabel will silently ignore any line that starts with a non-SMILES character such as a space.  Here is what I wrote in response to a comment by Chris Morley:

---------------
> a) The facility to have comment lines in SMILES files seems
> *very* useful and it would be a great shame to lose it.

That's very true, and perhaps we should add something to the OpenSMILES specification.  Perhaps something like starting a line with '#' or '//', like so many other languages.  Or even starting a line with whitespace -- it doesn't matter, as long as it's formally specified.

As we used to say in my electrical engineering days: "The great thing about standards is that there are so many to choose from!"  In other words, a standard isn't any good unless we all follow it.  If OpenBabel treats these lines as comments, it will produce files that other parsers can't read.

Just to illustrate: Suppose someone else said, "I'm going to skip whitespace that starts a line, and parse SMILES starting at the first non-whitespace character."  In other words, they'd parse indented SMILES.  This isn't hypothetical, I've seen people do this.  They would try to parse the lines that you think are comments, so this file:

  |   This is a comment about
  |   CCO, the ethanol molecule, not to be mistaken with the
  |   CO methanol molecule.
  |CCO

would be interpreted by OpenBabel as one SMILES, and by the other guys as three SMILES and one error.
---------------

So my proposal is to say that any line that starts with '#', '/', or ' ' (space) should be treated as a comment line, and should be ignored completely when processing the file, except that it may be copied to the output if a program's output format supports comments.

Craig

------------------------------------------------------------------------------
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: OpenSMILES: Comments in SMILES files

elizadd
Mmm.. good to be here in your article or post, whatever, I think I should also work hard for my own website like I see some good and updated working in your site.
find out
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

read

robertfcrocker
Hey what a brilliant post I have come across and believe me I have been searching out for this similar kind of post for past a week and hardly came across this. Thank you very much and will look for more postings from you.
read
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

you can check here

elizadd
In reply to this post by Craig James-2
Nice knowledge gaining article. This post is really the best on this valuable topic.
you can check here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

check out the post right here

elizadd
In reply to this post by Craig James-2
Hey, great blog, but I don’t understand how to add your site in my rss reader. Can you Help me please?
check out the post right here
Loading...