Skip to content

Representing Chemical Structures

Max Liu edited this page Aug 18, 2017 · 1 revision

Introduction

There are a number of classes in RMG which are used to represent chemical structures, and it's important to understand their differences. The classes which will be discussed here are Graph, Group, Molecule, and Species. In addition resonance structures play an important role within RMG, so they will be discussed briefly as well.

Class Terminology

The base class for chemical structures in RMG is Graph, which is a basic implementation of a 2D mathematical graph. A graph is comprised of a set of vertices connected by a set of edges. In RMG, the Graph class does not store any chemical information on its own, but it is the parent class of Group and Molecule.

The Group class is used to represent a molecular fragment, whereas the Molecule class is used to represent a specific molecular structure. The primary difference is that a Group object can have a list of allowed specifications for each atom or bond property while a Molecule object can only have one. Additionally, a Group object does not have to have a complete molecule while a Molecule object must be a full chemical structure.

Finally, there is the Species class. Although colloquially we use molecules and species interchangeably, these terms have precise meanings in RMG. A Species object contains a list of molecule objects which are different representations of the same chemical compound (ie. resonance structures). The object also contains a descriptive label for the species, its thermo properties, transport data, and molecular weight.

This distinction is important because many chemical compounds have resonance structures. Therefore, a Molecule object is a graph that denotes the structure of a specific resonance isomer, while a Species incorporates all resonance structures found into one object. This prevents duplicate reactions from being generated for two molecule objects that are really the same chemical compound.

Resonance Structures

As mentioned, resonance structures are very important for reaction generation in order to properly evaluate all possible reactions and prevent duplicates. For an overview of resonance in chemistry, please see the Wikipedia page.

In RMG, most of the methods for generating resonance structures are in the rmgpy.molecule.resonance module.