# Predicting chemical property (Boiling Point) from a SMILES string

I was trying to develop a model for predicting Boiling Points (BP) given a chemical name. One good and unique (ok, almost) way to encode a name is the SMILES notation string. The details of the notation are a bit complex ( see here)

 e.g.
Name     Smiles  BP
Benzene c1ccccc1 80
Propane CCC      -42
Ethanol CCO      78
Phenol  c1ccc(cc1)O  181
....


I was wondering if I might be able to extract features from the Smiles String and use it to predict BP's. A large training data set (~10,000 compounds) is already available. One tricky point may be that the notation is case sensitive and various parenthesis have a topological meaning (branching) in there and also certain symbols (= for a double bond, # for a triple bond)

Traditionally the chemical literature uses group contribution methods but those depend on either a human or some smart code to parse the SMILES strings into its constituent entities (e.g. 3 OH groups, 1 double bond etc.) There are good thumbrules already known e.g. Among all alkanes every extra CH2 group adds so many degrees to the BP etc. OR Alcohols are higher boiling due to hydrogen bonding. But I was wondering if it'd be nicer to let the machine learning algorithm figure these out by itself.

Any ideas about what methods to use? Or is this too much to ask of an automated algorithm?

• To calculate molecular descriptors or fingerprints from this you can use yapcwsoft.com/dd/padeldescriptor or R packages rcdk and rcdklibs, to access the Chemistry Development Kit molecular descriptors and ChemmineOB to access OpenBabel fingerprints. To go from there to your boiling points you can e.g. use support vector machines or random forests, see here for a demo in R r-bloggers.com/… onschallenge.wikispaces.com/MeltingPointModel001 Aug 21 '15 at 18:44
• Dragon btw is the best to calculate molecular descriptors, but it's commercial, talete.mi.it/products/dragon_description.htm; a free version of it is E-dragon, vcclab.org/lab/edragon/start.html Aug 21 '15 at 18:49
• @TomWenseleers These are great tips. You should convert them to an answer so I can upvote them. :) Aug 22 '15 at 3:11
• Once I have a complete working script I might post a tutorial! In the meantime here is one by Kurt Varmuza: lcm.tuwien.ac.at/R/QSPRexamplePAC-2012 Aug 23 '15 at 14:37
• I'm working on a similar project in fact, trying to predict GC retention indices based on molecular structures based on a training set of 80 000 molecules in the NIST 2014 library. You'll also need 3D SDF structures to be able to calculate some of the descriptors; for small nrs of molecules you can use library(RMassBank); getCactus("CCCCCCCCCCCCCC(C)C", "sdf?get3d=true") (internally this uses Corina), although you'll likely need the standalone Corina version (molecular-networks.com/products/corina) or Openbabel or Chemaxon Marvin (free academic license) for large nrs of molecules Aug 23 '15 at 14:45

It is a matter of generating features or variables that describe the SMILE representation of a chemical compound. Computational chemistry has proposed good definitions of different chemical descriptors that can be trasnformed into fingerprints. These fingerprints, are vectors of numbers (binary or real) that gives a description of the chemical compound based on the SMILE representation. Once you generate these features, you can start building your classification or regression model using the common known methods.

In order to generate these fingerprints (features), some nice chemoinformatics toolkits are there such as RDKit and OpenBabel. For example, as illustrated on the online documentation page of RDKit, you can create some features using the following simple Python code, after importing the right packages:

ms = Chem.MolFromSmiles('c1ccc(cc1)O')fps = FingerprintMols.FingerprintMol(ms)

Some of the features for c1ccc(cc1)O will be:
0 1 0 1 1 0 1 1 0 1 0 1 1 0 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 1 0 1 1 1 0 0 1 0 0

You continue generating these features including others (which are based on different definitions such as MACCS keys) available in the toolkit for every compound. Then, you start building a regression model to predict the boiling points for every compound. In a sense it is true that these generated features might not necessarily reflect the chemical properties reflected by a bioling point. Nevertheless, it worths trying !!

• Very interesting sugesstion. I didn't know of ready-made fingerprinting functions. This is definitely worth a shot. It's a little funny that all the responses seem 1/0. Was this tailor made for a Genetic Algorithm? Apr 14 '13 at 14:32
• It was not tailor for GA and its definition led to the binary output. 1/0 refers to existing or missing different atoms or bonds in the compound. You can generate other fingerprints that shows the repetation or concentraton of a specific characteristic in the compound. So, you end up with a real value. You may, also, check the following link for generating other real values: rdkit.org/docs/… Apr 14 '13 at 16:28

Very interesting topic. Here are my 2ct:

• as we already know that various groups influence the boiling point, I think it would make sense to put this knowledge into features the algorithm can use (like feature generation for image analysis). It may be much easier to improve the estimates that are available from such predefined features than learning without any guidance how to generate meaningful input.

• Coding features like alkyl chain length, various functional groups etc. may give you an idea what kind of algorithm would be suitable, because you need a method that can cover this kind of complexity.

• The choice of method will depend on your aim: prediction only or also description (i.e. do you also want to learn/interprete what the model uses to calculate boiling point)?

• The easy rules for estimating boiling point are similar to decision trees. So maybe decision trees (random forest) with regression in the leaves would be a starting point.

• In other respects, the rules would formulate differences compared to another substance, which would maybe more similar to e.g. artificial neural networks (e.g. a node "cis double bond" would lower the bp, and this lowering would be added up together with the output of other "functional group" nodes). The decision tree would build a completely different regression for saturated and unsaturated substances.

• Thanks! Does your first bullet point mean I do a pre-parsing step on the SMILES string to extract stuff like number of OH groups, number of rings, number of double bonds etc? And then feed these as predictors to the learning algorithm? Is that what you meant? Apr 13 '13 at 20:57
• My aim's purely good prediction. I'm somewhat sick of the descriptive theories actually. Most of them are post hoc rationalizations and only work till the next exception trips them. Apr 13 '13 at 20:59
• In my opinion, the workflow {Smiles->Chemical Structure->Molecular descriptors->Statistical Model} should be used Apr 14 '13 at 10:35
• @O_Devinyak: Thanks! What do you mean by "molecular descriptors"? Something like the fingerprints what soufanom writes below? Or...? Apr 14 '13 at 14:34
• Yes, @soufanom's fingerprints are what I refer to as features. Apr 15 '13 at 8:02