How Many Structures Can You Generate From A Molecular Formula?

03 Feb

I’ve been involved in a number of conversations recently around how monoisotopic masses can be used and the chance of “elucidating a structure” from a molecular formula. There are some shockingly naive views of this possibility. With the availability of accurate mass determinations by mass spectrometry, and the possibility to extract a molecular formula from the data, there are some who believe it is possible to “elucidate structures” using a monoisotopic mass. Let’s clear this naivety up…

Recently I gave a presentation at a local university regarding informatics. During the presentation I asked the students how many structures could be generated “withint the rules of basic organic chemistry” for some very short elemental formulae. General rules means no inappropriate valences but no limitations on the nature of the rings (except none base don 2-carbons 🙂 ) etc. EVERYONE underestimated by many factors.

While working on a structure elucidation software program the issue of how many structures could be generated from some fairly nominal formulae became very clear. Below are some example formulae, the “correct” structure associated with the data under analysis and the number of chemical structures that can be generated from this formula. Notice those numbers….numbers like: 138,136,211,624 structures from a formula of C15H22O2 !

Therefore,_the story that monoisotopic mass, that can give a single molecular formula, can give you an unambiguous chemical structure needs to stop. Now, that said, since we have close to 20 million structures online at present the question “What is the distribution of molecular formulae across ChemSpider?” was an interesting question. So, we ran a query to determine the highest frequency of formulae. The formula C18H20N2O3 occurred 5110 times in the database, 4804 times when looking at single components only. Some representative structures are shown:


I imported the data into Excel (Office 2003) with a 65000 row limit. While there are single molecular formula compounds in the list at the end of the file (viewed in wordpad) at the 65000’th row the frequency was still 45 entries in the database. It’s a long tail..


Now, many people are using mI masses to examine metabonomics data so it may be more appropriate to do the analysis on a more restricted dataset. For example, databases of interest to metabonomics people include KEGG and HMDB. Isolating the search to such databases shows that while there is a much shorter list of unique formulae (8590) a similar distribution persists . The most common formula is C6H12O6 with 71 hits. Searching this in the database shows a number of linear and cyclic carbohydrates, some with stereo, some without as shown below. if you are confused about “linear versus cyclic” see this Wikipedia article.


Monoisotopic mass isn’t going to provide the stereo information anyways and all you will get is a lot of similar structures…but of course there are MANY carbohydrates with that formula. I’ve the listed a group of some of the top formulae here and leave it to you to investigate!

Formula Number

C12H22O11 = 55 hits

C6H8O7 = 52 hits

C5H10O5 = 46 hits

C20H3205 = 46 hits

C8H803 = 40 hits

C20H32O3 = 39 hits

C20H32O4 = 38 hits

C2H4O2 = 38 hits

C24H40O4 = 37 hits

CH4O3S = 36 hits

Bottom line…even removing stereo issues and isolating to a small number of databases it is still an issue to declare that a structure is elucidated just from a mass and some form of prior knowledge or additional information such as elution order or time is necessary.

Now, this observation may not be surprising to many people. The response may be that tandem Mass Spectrometry would give an ambiguous structure. This is also not true unfortunately and in general even tandem MS (MS^n) cannot give a conclusive structure. Certainly, if stereochemistry is involved (as with many carbohydrate molecules) you are still stuck. While library look-ups using monoisotopic mass ARE valuable, and tandem MS adds more criteria for structure identification, neither are unambiguous.


About tony

Antony (Tony) J. Williams received his BSc in 1985 from the University of Liverpool (UK) and PhD in 1988 from the University of London (UK). His PhD research interests were in studying the effects of high pressure on molecular motions within lubricant related systems using Nuclear Magnetic Resonance. He moved to Ottawa, Canada to work for the National Research Council performing fundamental research on the electron paramagnetic resonance of radicals trapped in single crystals. Following his postdoctoral position he became the NMR Facility Manager for Ottawa University. Tony joined the Eastman Kodak Company in Rochester, New York as their NMR Technology Leader. He led the laboratory to develop quality control across multiple spectroscopy labs and helped establish walk-up laboratories providing NMR, LC-MS and other forms of spectroscopy to hundreds of chemists across multiple sites. This included the delivery of spectroscopic data to the desktop, automated processing and his initial interests in computer-assisted structure elucidation (CASE) systems. He also worked with a team to develop the worlds’ first web-based LIMS system, WIMS, capable of allowing chemical structure searching and spectral display. With his developing cheminformatic skills and passion for data management he left corporate America to join a small start-up company working out of Toronto, Canada. He joined ACD/Labs as their NMR Product Manager and various roles, including Chief Science Officer, during his 10 years with the company. His responsibilities included managing over 50 products at one time prior to developing a product management team, managing sales, marketing, technical support and technical services. ACD/Labs was one of Canada’s Fast 50 Tech Companies, and Forbes Fast 500 companies in 2001. His primary passions during his tenure with ACD/Labs was the continued adoption of web-based technologies and developing automated structure verification and elucidation platforms. While at ACD/Labs he suggested the possibility of developing a public resource for chemists attempting to integrate internet available chemical data. He finally pursued this vision with some close friends as a hobby project in the evenings and the result was the ChemSpider database ( Even while running out of a basement on hand built servers the website developed a large community following that eventually culminated in the acquisition of the website by the Royal Society of Chemistry (RSC) based in Cambridge, United Kingdom. Tony joined the organization, together with some of the other ChemSpider team, and became their Vice President of Strategic Development. At RSC he continued to develop cheminformatics tools, specifically ChemSpider, and was the technical lead for the chemistry aspects of the Open PHACTS project (, a project focused on the delivery of open data, open source and open systems to support the pharmaceutical sciences. He was also the technical lead for the UK National Chemical Database Service ( and the RSC lead for the PharmaSea project ( attempting to identify novel natural products from the ocean. He left RSC in 2015 to become a Computational Chemist in the National Center of Computational Toxicology at the Environmental Protection Agency where he is bringing his skills to bear working with a team on the delivery of a new software architecture for the management and delivery of data, algorithms and visualization tools. The “Chemistry Dashboard” was released on April 1st, no fooling, at, and provides access to over 700,000 chemicals, experimental and predicted properties and a developing link network to support the environmental sciences. Tony remains passionate about computer-assisted structure elucidation and verification approaches and continues to publish in this area. He is also passionate about teaching scientists to benefit from the developing array of social networking tools for scientists and is known as the ChemConnector on the networks. Over the years he has had adjunct roles at a number of institutions and presently enjoys working with scientists at both UNC Chapel Hill and NC State University. He is widely published with over 200 papers and book chapters and was the recipient of the Jim Gray Award for eScience in 2012. In 2016 he was awarded the North Carolina ACS Distinguished Speaker Award.
Leave a comment

Posted by on February 3, 2008 in ChemSpider Chemistry


0 Responses to How Many Structures Can You Generate From A Molecular Formula?

  1. Rich Apodaca

    February 4, 2008 at 11:56 am

    Antony – interesting stuff. CDK can enumerate structures given a molecular formula. I’ve written a little about it here:

    It’s amazing to see just how quickly the number of valid structures increase with molecular weight.

  2. John Shockcor

    February 4, 2008 at 3:28 pm

    Thanks Tony,

    I have wanted to do this myself, but did not have the tools. This might be an interesting avenue to explore with some added constraints provided by NMR, IR or even “God forbid” UV data. How quickly does the number of structures hits shrink?

  3. Eric Milgram

    February 4, 2008 at 4:21 pm


    Thanks for putting together this information. I know that many people will find it useful. Also, Rich Apodaca’s reply with information about using the Ruby CDK for generating valid chemical structures from a formula was very useful.


  4. Chris Singleton

    February 4, 2008 at 6:46 pm

    Excellent article Tony,

    Is anyone aware of how fast the available dataset is reduced when using something like a fragmentation library search? Of course, if you’re using triple-quad, I’ve seen people that require two fragments to unambiguously assign a molecule, but if you’re using a high-res (QTOF or FTMS or something) one high res fragment should be enough and will should considerably reduce the number of likely candidates. Any of the readers know what size of a set you’re working with when you consider fragments (either low-res or high-res)?

  5. Andrew Anderson

    February 4, 2008 at 8:55 pm

    Great Article….indeed a very interesting thing to consider: even with corresponding analytical data, how much constitutes a “proof of structure?”

    How many structures of “elucidated compounds” in the literature are actually incorrect? I’ve heard a few horror stories on this front 🙂

  6. Eric Milgram

    February 8, 2008 at 5:17 am

    I’m writing to respond to Chris’ inquiry. First, let me reiterate a point about stereochemistry and mass spectrometry. Most people are aware that mass spectrometry has virtually no capability to give insight into stereochemical differences.

    As for Chris’ statement here, there are some fundamental things we should consider.

    “…require two fragments to unambiguously assign a molecule, but if you’re using a high-res (QTOF or FTMS or something) one high res fragment should be enough and will should considerably reduce the number of likely candidates.”

    The practice of using one confirmation ion and one quantitation ion with techniques such as EI-GC/MS or LC/MS/MS, where a fragmention pattern is generated, is widely used in targeted, quantitative studies, especially in regulated environments.

    However, I contend that when using mass spectrometry (or any analytical technique for that matter), one can never say that a molecular structure is “unambiguous.” Rather, regardless of which type of instrument one is using (e.g. nominal mass, high-res/acc, MS^n, hybrid, etc), one can only be absolutely sure when a measured chemical elicits a response that is “definitely not” the target chemical.

    However, when the measured signals from a test sample “match” the signals for the target molecule, one can only say that the signals “are consistent with” a given structure, but one cannot legitimately state that the assignment is “unambiguous”. Statisticians face this problem all the time. They can never prove sameness, rather, they can only prove difference by determining when the null hypothesis fails.

    In the targeted analysis case, one usually has more information to “confirm” a structure than just a series of masses from a fragmentation pattern. For example, if using a separation technique combined with mass spectrometry, which is often the case for a number of reasons, the additional information gained, such as retention/elution/migration time or mobility gives one further confidence as to whether a given signal is “definitely not” from a given chemical or “is consistent with” that chemical.

    As for Chris’ other question, which is listed here, I have wondered the same thing for some time.

    “Any of the readers know what size of a set you’re working with when you consider fragments (either low-res or high-res)?”

    Although use of tandem MS will decrease the number of possibilities, my experience has been that there are more chemical structures than there are unique fragmentation patterns to match to each one. For example, take a look at the fragmentation patterns for leucine and isoleucine or eladic acid and oleic acid. Whether looking at this via EI-GC/MS or LC/MS/MS, in both of these cases, many of the same ions are obtained. The ratios of some of the ions will be different, but I would challenge anyone to predict these differences a priori.

    When DNA evidence is used in a court of law, no one ever says that there is a 100% match to a suspect. Rather, the concept of “discriminating power” or “power of exclusion” is employed. For example, in cases where there is a high degree of belief that DNA found at a crime scene came from a suspect, the crime lab scientist will give a probability that the DNA “did not” come from the suspect. When that probability is along the lines of 1 in 20 billion, most people are comfortable with saying there is a “match.”

    We follow a similar line of reasoning in mass spectrometry, but we usually aren’t as precise as the molecular biologists/geneticists. In their case, they have measured allelle frequencies extensively and they can assign a probability of a certain match occurring by random chance.

    In the case of small molecules, two different compounds could certainly give the same signals regardless of the analytical configuration one is using (i.e. spectral interference). However, if one is assigning identity based on just a nominal mass, there is a significant (in my opinion anyway) probability of obtaining a false positive identification. By combining the nominal mass with a chromatographic (e.g. GC) retention time, the probability of false identification is decreased, but not eliminated. If one then switches the mass analyzer from nominal mass to accurate mass, the probability of a false positive ID further decreases. Adding tandem MS will decrease the probability even further.

    Although we cannot assign random match probabilities as precisely as the biologists, we can give a rough estimate. For example, if one assumes that with a given GC or LC method, all measureable analytes are evenly spaced throughout the run, calculating the method’s peak capacity gives an upper limit for the number of chemical species that can be discriminated.

    Similarly, one can do a similar calculation for the mass analyzer. For a typical open-tubular, capillary GC method, a peak capacity of ~1000 is not unreasonable. Similarly, for a nominal mass instrument scanning from m/z 100 – 1000, the upper limit for peak capacity would be ~1,500. Thus, if all species capable of being measured with such a method were evenly distributed in mass and retention time, the probability of any given measured species randomly matching a target species would be 1 in 1,500,000. These odds might sound good to some people, but one has to consider a number of factors. The most important is the cost of being wrong. If someone’s freedom hangs in the balance, such as in a criminal case, these odds are not good enough. Also, we know that due to chemical bonding rules and physico-chemical properties, all measured species will not be evenly distributed, so these odds represent an upper limit.

    If I’m given the choice between accurate mass or MS/MS for confirmation, I’ll take MS/MS. My reasoning is very simple. We know that all molecules with the same elemental formula will have the same accurate mass, and as Tony has illustrated, a single formula can have billions of chemical structures. However, the atom connectivity can result in different MS/MS spectra, but such differences are not guaranteed.

    However, if I can have both accurate mass and MS/MS (or MS^n), I’ll gladly take it. The bottom line is that asking whether a given measured analytical signal in a test sample is consistent with a reference signal is a very different problem than asking “what structure(s) are consistent with a given signal in a test sample?” To use DNA matching as an analogy, asking, “does the DNA that came from the crime scene match the suspect in custody?” is a much simpler problem than asking “who are all of the suspects that could match the DNA we found at the crime scene?”

  7. Ryan

    February 21, 2008 at 6:34 pm

    Anthony —

    Nice post. This reiterates just how big chemical space is!

    Question: The first figure you show (the one with the structures and number of isomers) seems to be taken from somewhere else (journal article?). A reference to the data also seems to be present in the figure caption. Can you point me to the source?



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.