Sciencemadness Discussion Board

OpenBabel - Informative Thread

The Volatile Chemist - 9-4-2016 at 19:26

This isn't quite teaching quality, and isn't entirely useful to the amateur chemist's experimentation. Blogfast did approve of a thread on this topic, though, so I might as well bring up a few things about OpenBabel, and maybe some of the members who use it [better than I] could contribute ideas... So if you already know how to program but haven't heard of OpenBabel, read on - you might be interested.

OpenBabel is a chemistry programming library and a command line molecule file converter. But given the fact that some files used to store molecular structures are more and less detailed in certain information, the conversion software has to have some fancy algorithms.

One of the most basic molecule file types is the SMILES format. Perhaps another thread would be useful which taught SMILES/IUPAC. Regardless, smiles only gives the most basic molecular information - structure. So propane in smiles is represented as 'CCC'. If this is stored in a file smilespropane.smi, OpenBabel could convert it into another format - or also analyze it.

OpenBabel, to store molecules in certain formats, has to calculate the 3D shape of a molecule. If the OpenBabel library is used in a programming file, you can get the 3D structure of a molecule from simply smiles structural code very easily. So if you thought the distance between the ester group in a molecule and the molecule's center of gravity correlated with the smell of the molecule, you could use OpenBabel to throw together a quick test of that theory. Or if you came up with an idea for predicting the stability of a molecule, you might be able to throw together a test.

In fact, Google's Code competition/challenge (for students, I think) has OpenBabel listed as one of the categories for submission. So although it's probably not useful for amateur chemistry, it's quite useful as a tool for science fairs, coding competitions, etc. I'd be interested if someone came up with an amateur chemistry application for knowing/predicting molecular shape (and electron fields d shape, chirality of molecules, ring shape, etc.).

Nathan

blogfast25 - 10-4-2016 at 05:29

Quote: Originally posted by The Volatile Chemist  
Perhaps another thread would be useful which taught SMILES/IUPAC.


If IUPAC chemical nomenclature is what you're referring to then I think an introductory course on that here at SM could be useful. But these topics tend not to trend well with amateur chemists, I'm afraid.

aga - 10-4-2016 at 14:36

Even having a Clue what IUPAC is talking about would 'trend' well with me, so go for it TVC.

Personally i'm up for learning as much as i can from Any source of knowledge that is willing to offer it, and will even put in quite a lot of effort in order to try to understand.

Sadly that is not the general case, however all you need is 1 student, and here i am !

(pretty certain that many people read stuff, learn, then never even say thanks)

Edit:

B, D & TVC has a kinda ring to it (press for a bursary) ;)

[Edited on 10-4-2016 by aga]

tshirtdr1 - 10-4-2016 at 18:26

I used openbabel in a script that I wrote about 10 years ago as a pre-docking setup. I cannot remember which file types I was converting, but I do remember that it had trouble with chiral centers for my conversions. I didn't have a lot of chiral centers to deal with, so I ignored the problem.

[Edited on 11-4-2016 by tshirtdr1]

aga - 11-4-2016 at 14:01

C'mon TVC.

Time to stick your head over the parapet and shove some information out there.

Sure, some knobs will take pot-shots at you, but that's Normal.
(happens to everyone)

Perhaps part of becoming super-bullet-proof is to Educate ?

Give it a shot ;)

chemrox - 11-4-2016 at 21:51

aga's profile confirms my sanity

Loptr - 12-4-2016 at 04:55

SMILES is one of those things I mean to eventually look into, but it seemed to me to be something a molecule application would generate and accept for me. I have enough of an understanding of IUPAC to wing it in most cases, and where I have issue, I simply goto ChemSpider and draw the strucuture, search for it in their database, and then see the various names for it in the listing. I also use ChemAxon MarvinSketch to generate the name for a structure. This get's me 99.99% of the way there in majority of the cases.

I will take a look at this OpenBabel. I think I have come across it before in my searches across the web for source code, especially since I seem to recall it being an open-source project.

EDIT:In fact, yes, I have been to its website because I just typed "openbabel" into my address bar and it autocompleted to a URL in my browse history, so I will check it out again.

OpenBabel has to be more interesting than the relational operators I am writing in awk to work against CSV files at the moment. My regular expression-fu has become very strong. Oh, how I get distracted by things on SM.

[Edited on 12-4-2016 by Loptr]

[Edited on 12-4-2016 by Loptr]

The Volatile Chemist - 12-4-2016 at 13:29

Quote: Originally posted by Loptr  

OpenBabel has to be more interesting than the relational operators I am writing in awk to work against CSV files at the moment. My regular expression-fu has become very strong. Oh, how I get distracted by things on SM.

[Edited on 12-4-2016 by Loptr]

[Edited on 12-4-2016 by Loptr]

SMILES is very easy to learn, well worth your time. It's the equivalent of drawing a structure, but on the command line, or similar text input. It ignores non-chiral hydrogens, and writed very similarly to normal in-text structure notation found in Vogel and the like. Canonical SMILES, though, is *not* worth the time... There's no need to Canonize your smiles code if it's meant to be analyzed properly anyways.

Got to love those RegEx golfing skills :) I haven't done much chemistry-related work with regex, since I'm familiar with OpenBabel, but what I have done has been annoyingly tough...

Indeed, easy to be distracted on SM...