Mod:Second Year Modelling Workshop
Contents
- 1 Introduction
- 1.1 Ghemical
- 1.1.1 What does the Ghemical Program do?
- 1.1.2 Starting and Using the Ghemical Program
- 1.1.3 An illustration of how to build and optimise a substituted Cyclohexene
- 1.1.4 Troubleshooting
- 1.1.5 Modifying a structure to change it into an isomer
- 1.1.6 Comparing two isomers
- 1.1.7 Changing the molecular representation
- 1.1.8 Saving a molecule for use later
- 1.1.9 Starting a New molecule
- 1.1.10 Importing a New molecule from the CIT Course
- 1.2 Avogadro
- 1.3 ChemBio3D
- 1.1 Ghemical
- 2 Follow ups to this Course
Introduction
This workshop comprises a single 2 hour session which serves as an introduction to a technique known as molecular mechanics modelling. The course consists of the following components
- A short introduction to the molecular modelling programs Ghemical
- An opportunity for you to try these programs out on up to a set of mini-projects, each on a slightly different theme (do as many as you can in the workshop time. You should target doing at least the first five).
- At the end of the workshop, you will have produced numerical answers to questions posed in each problem.
- The idea is that you will then use such techniques whenever the opportunity arises during the course of lectures, labs and tutorial problems (but unfortunately not, yet, examinations!).
Ghemical
This is an opensource program for molecular modelling. You are free to install it on your own computer if you wish.
What does the Ghemical Program do?
Ghemical is a molecular mechanics program, coded to do two things in particular (and to not do one thing);
- To define a mechanical model of a molecule based in essence on Hook's law. This defines how much energy it takes to distort a spring (in this case a bond or angle) from its equilibrium position. Ghemical has force constants for various types of bond (and angle) encoded. Together with other terms, this collection is called a force field, and the total energy calculated using this field is called the strain energy.
- This energy is then minimised using standard algorithms by adjusting the values of the bond lengths, angles, torsions (and non-bonded terms), producing an optimised geometry. Any given geometry represents only one minimum of potentially many. There is no easy way of finding the lowest minimum of all, often called the global minimum, and you have to use your knowledge of chemistry and molecules to search for this.
- One feature characteristic of molecular mechanics models is that once defined, a bond cannot break (Hook's law, a quadratic function, predicts the energy rises to ∞ as the distance increases). This has an advantage: you decide what atoms are connected, by which type of bond, and they remain so! The disadvantage is that reactions cannot be studied using this methodology.
- Currently, the Ghemical program can handle only (some) combinations of the following elements: H, C, N, O, F, P, S, Cl, Br, I. Note the absence of e.g. silicon.
- If you want a broader range of elements, or wish to study bond breaking, have a look at section 2.3, which describes a quantum mechanical approach.
Starting and Using the Ghemical Program
- Log into a Windows computer in the department, and find an icon on the desktop with the name Ghemical. Double click this.
- The following display will (eventually) appear. Do not worry if it takes a minute or so!
- The (only) important menu item is File/New. Use this for each new set problem.
- The most important screen buttons are the following: Draw, erase, select, trans XY, Orbit XY, Measure, Element, Bond Type, Add Hydrogens, Geometry optimisation.
- The other menu items are used less often, and are mostly self-explanatory.
- A further menu can be invoked by placing the mouse cursor in the black display area, and pressing the rhs mouse button. The following menu should then appear. This allows you to save the current model (in drive H: of your Windows session) or export the model in a different file format (which allows you to open the model in another modelling program). If you plan to complete the entire session in one sitting, there is probably no need for you to save any of the models. Note: When using the save us command, expect a rather long delay between invoking the command and something happening. We don't know why this happens.
An illustration of how to build and optimise a substituted Cyclohexene
- Click on the Draw button
- Press the lhs mouse button down in the centre of the black screen, keep it pressed, and drag it to create a bond. Release the mouse. Two carbon atoms should appear, connected by a bond.
- Move the cursor to the second atom, press the lhs mouse button down, drag a new bond, and release the mouse button again. The second bond should now appear connected to the first.
- If you don't have three atoms connected by two bonds, you can erase some or all of what you have drawn with the Erase button. There is no undo command, so you will have to make do with Erase.
- Continue drawing until you have a cyclic hexagon on the screen. The last drag should be to the atom you started with. Don't worry if it is not a regular hexagon, it will be tidied up during a later step.
- From the bond type button, select a double bond from the menu that appears. Now move the mouse cursor to one atom of a pair, press the lhs button, and drag to the second atom, and release. A double bond should replace the single one between those two atoms. (HINT: When drawing a phenyl ring or other conjugated system, use a conjugated bond type rather than double or single).
- You should now reset the bond type back to single (if you don't, all bonds drawn will appear as double until you do reset the bond type).
- Now some 3D perspective will be added. Select the orbit XY button, and with the mouse, rotate the hexagon about the x-axis (drag the mouse up the screen). You may need to rotate the molecule more than once during the course of building a more complex 3D structure. It may be necessary to build a small part of the molecule, rotate, add a few groups, rotate again, until the full 3D molecule has been built.
- Select draw again, and at one of the sp3 centres, add a C-C bond to the top face of the molecule.
- Repeat again from the bottom face. You now have some stereochemistry!
- We might as well add a heteroatom at this stage. Select the element button, and from the Periodic table display, select say an oxygen. Position the mouse cursor over the atom you want to change (from C to O) and click.
- Now click on the add hydrogens button. They will sprout at all the missing valencies you currently have. Select orbit xy and inspect the molecule from a few directions to make sure it now represents a sensible molecule in terms of its valencies.
- The geometry now needs to be optimized. Click on the geometry optimisation button. A force field is invoked (in effect a collection of simple energy functions relating to how the bonds stretch, how bond angles bend, how twist angles rotate, and how non-bonded atoms interact). A technique of energy minimisation is used to predict, after just a few seconds, the minimum energy geometry.
- At the bottom of the panel, the total number of iterations required to optimize the geometry is indicated (it could be 1000 or more) together with the final energy in kJ/mol. Record this energy carefully, and have it ready for analysis during and at the end of the workshop. Its value should be +ve, and somewhere in the range 0-1000, and it (approximately) represents the strain in the system. A high value represents a strained molecule. A high value could either mean that the molecule you have drawn is indeed strained, or it could indicate that some aspect of the geometry is unreasonable. If your value is indeed high, check very carefully that your optimised structure is sensible. The value in this example is 11.9 or 5.5 kJ depending on the conformation.
Troubleshooting
- Ghemical does not do valency checking. So you should be very careful to ensure that you have adhered to normal valencies for organic molecules.
- Various combinations of Ghemical modes can be confusing. For example, if you have selected some atoms (purple colour), they tend to remain selected. If you then perform another operation such as add hydrogens, this attempts to add Hs only to the selected atoms, and not the whole molecule. To prevent this, select none before using the add hydrogens command. Another (dangerous) combination is if you have previously selected erase to delete say a single atom, it is common to follow this up with element to change to another type. But, clicking on an existing atom (in the expectation of changing it to the new element) will in fact still erase it. You have to remember to first select draw again.
- The force field used in this program, if given a sensible starting geometry, normally manages to produce sensible optimized geometries. But its not always easy to draw a molecule sensibly in three dimensions. And accordingly, the optimization can end up with silly answers. So, never believe what it tells you; always have a good look at the geometry to see if you can spot anomalies.
- One characteristic anomaly is what can be called hemispherical carbon coordination, ie all four substituents at an sp3 carbon lie within one half sphere. If you see this, the energy is also likely to be high. Either delete one or two offending atoms (normally hydrogens) and re-add them (most easily done by invoking remove hydrogens followed by add hydrogens), or move them into a more suitable position.
- It is always worth checking whether the stereochemistry at a double bond is correct. Likewise whether the stereochemistry at a ring junction is that desired.
- Another feature to look out for is to check if any e.g. six membered ring is in the boat or the chair conformation. If in a boat, check that the alternative chair might be lower in energy.
- The force field used is a general purpose one (the Tripos 5.2 force field; DOI:10.1002/jcc.540100804 ). The equations describing it have no knowledge of electrons (and explicit manifestations of electrons such as heteroatom lone pairs); they operate on a Hooke's Law principle. They may also fail if given unusual combinations of atoms. Normally, C.H.N,O, P, S, halogen is considered reasonably safe. Ghemical also currently appears incapable of handling ions, ie carbocations, carbanions, and the like, so only give it neutral molecules. Finally, and perhaps obviously, properties such as conjugation, aromaticity, organic:anomeric effects are all electronic, and rather difficult to model without electrons! To address such molecules, one would have to move up to quantum mechanical treatments of such molecules. You will do that, but not in this course!
- The force field is (sort of) capable of modelling hydrogen bonds by using an electrostatic model derived from assigned partial charges on certain atoms, but the directionality of these bonds is not always quite right. However, if you want to model say solvation by adding one or more water molecules, they will stick on more or less correctly, and the steric bulk of this solvent will probably model the effect you were looking for.
Modifying a structure to change it into an isomer
- We are now going to change the stereochemistry. The instructions above resulted in a trans dimethyl oxa-cyclohexene. Lets make it the cis isomer instead.
- One way is to delete entirely one methyl group using the erase button, then re-draw it again with the new stereochemistry. You will in this instance also have to delete the H atom attached to the same carbon as the methyl, and either re-draw it directly, or add it using the add hydrogens command.
- A second way is to move the group into the correct position. To do this, first go to the select button and click on e.g. the four atoms of a methyl group. They should go purple.
- Now go to the trans XY button and press it. Finally, hold down the SHIFT key on the keyboard and whilst holding it down, move the cursor to the (purple) methyl group, and drag it to a new position. The entire group will migrate. You will now have to repeat the procedure for the hydrogen atom attached to the same carbon as the moved methyl.
- Now repeat the geometry optimization procedure. You might get a value of 4.4 kJ this time (or 12.7) depending on the conformation of the final ring. If you do repeat several times and get both forms, compare them and ask yourself how they differ?
Comparing two isomers
- We are now in a position to compare the energies of the two isomers. The somewhat surprising result is that the lowest cis isomer appears to be slightly lower in energy than the lowest trans form. Record this difference for each set problem you are asked to do.
- You could try to identify any difference by making a few measurements. Select the measure button and click on two atoms (a distance appears), three (an angle appears) or four (a dihedral angle appears). The dihedral angle is particularly interesting, since we can measure the degree of antiperiplanarity any two groups may have.
- In the preceeding example, we inverted the stereochemistry at a chiral centre. You can also make conformational changes in the same way. For example, judicious movement of one carbon can convert a chair form of cyclohexane to a boat (or what passes for a boat). This is how you will achieve the answer to the very first set problem (see below).
- Modelling only ever gives you energies (or more meaningfully, energy differences). Experiment often gives instead isomer ratios. These two apparently different properties are connected by the equation ΔG = -RT ln K, where R is the gas constant, T the temperature of the observation, and K is the equilibrium constant connecting the two isomers being compared (here we assume that the energy difference predicted by molecular mechanics modelling can be equated with the free energy difference. This is a reasonable first order approximation). See Project 9 for an application of this concept.
Changing the molecular representation
Sometimes, insight about the behaviour of a molecule can be obtained by changing the way in which it is represented. The most common representation is the space filling mode, invoked by pressing the rhs mouse button down in the black molecule drawing area, and invoking spacefill (also known as van der Waals) as shown on the right. The effect is that shown on the left here. This particular view is of cyclohexane viewed from the top, and showing three of the axial hydrogens. Note in particular how little space there is between these hydrogens. Any group larger than a hydrogen will have difficulty fitting into this space. You can also try experimenting with other modes. In general in spacefill mode, if there is white space between adjacent spheres, they are probably not sterically interacting, but if the spheres bump, or even interpenetrate, this can mean either a significant steric and very probably destabilising interaction, or alternatively a strong attractive interaction (hydrogen bonds belong to this latter category). The Render/Label mode can be used to display computed partial charges on atoms, useful if you have polar molecules and want to identify potential regions for attraction or repulsion.Saving a molecule for use later
- After all the hard work we have put in, its time to save the molecule. Place the mouse cursor in the molecule area, and click on rhs mouse button. From the menu that appears, select File/Save as.
- In the dialog that next appears, type the name of your molecule. Do not change the extension of this file ( .gpr). The file will appear in your drive H:
- The procedure can be reversed by repeating the above, but this time selecting open. Alternatively, you could go to the main program panel, and select File/open from there.
- You can now terminate your Windows session without fear of losing any drawing.
- If you want to create a file that can be used in other programs (e.g the CIT course or use of the SCAN as described in section 5.3), select instead File/Export. You can then save the molecule in a wide variety of formats, suitable for other applications. Select for example MDL Molfile or CML for creating web pages of your molecule.
Starting a New molecule
- To erase an existing molecule (but remember to save it if you think you may need it again), go to the top File menu, and from there, select new. The screen goes blank and you can start your new molecule
Importing a New molecule from the CIT Course
If you have saved molecule coordinates from a database search during the CIT course, you may be able to use these to initiate a molecular modelling calculation. Place the mouse cursor in the molecule area, and click on rhs mouse button. From the menu that appears, select Import, select the file type (e.g. Protein Databank) and navigate to the file you want to load. Its probably best to clean the structure by removing/adding hydrogens. Check that bond types are correct etc.
Avogadro
This is the successor to the Ghemical program, currently under development by Geoff Hutchison. Whilst based on the same opensource libraries as Ghemical, it implements a more modern and extensible interface, which can take a little while to get used to.
What does the Avogadro program do?
It does all that Ghemical does, but extends in in several significant aspects. The most important is that it implements the UFF (Universal force field), which allows a much wider range of elements to be incorporated into your model (including inorganics). Another obvious change is the geometry optimiser, which can run constantly during the process of building and editing a molecule (often also called the rubber-band mode, since you can tug at individual atoms and have them snap back into place under the influence of the optimizer).
Starting the Avogadro program
- The program is invoked by clicking on the icon on the desktop with the name Avogadro. This opens up the display shown on the right.
- The most important controls are shown bounded by a red box in the graphic on the right. If you hover the mouse over each icon, an explanation of its function will appear on the screen.
- The left most (of the nine icons) is the build mode. The atom type and bond type currently in force for building are shown in the menu which appears when this icon is selected. It also includes a fragment library which you can use for building.
- The next icon along is the Navigation of viewing tool. If you click with the mouse anywhere except on an atom, moving the mouse will rotate the molecule. If you do click on an atom, that is used as the centre of origin for the rotation. A right mouse click will translate the molecule, whilst Zoom is achieved with the scroll (middle) button.
- The third icon is a bond-centric manipulation and information tool. Most simply, press (and keep pressed) the mouse on an atom or bond, and information about this will be displayed.
- The 4th icon can be used to manipulate (move) the position of individual atoms, as for example to change a trans relationship to a cis relationship. Click on an atom, and whilst keep the mouse depressed, move it to where you want it to appear.
- The 5th icon is a selection tool.
- The 6th icon is an auto-rotation tool
- The 7th icon is the auto-optimization tool. Here you can select the force field (the default, Ghemical, is fine for most organic molecules) and the algorithm used to minimise the energy calculated using this force field (conjugate gradients is fine here). Once you start the otpimization, it will remain in force for the rest of your session (unless you stop it using this menu). This if you go back to the build menu, the positions of extra atoms will be optimized on the fly as you add them. With optimization on, you will find using the 4th icon (manipulation) is an interesting battle between you and the optimizer (the rubber-band effect!).
- The 8th icon is the measure tool. You really do not want the optimizer on whilst you use this one!
You will also need to use some of the other (pull down) menus.
- In the Build top row menu, you can add and remove hydrogens.
- In the extensions/Molecular mechanics, you can display the current energy.
ChemBio3D
A Site License for a program system called ChemBio3D is available for you to install on your own computer. Its a rather heavyweight solution for these particular exercises, but if you have installed it and become familiar with its use, please feel free to use it instead of Ghemical.
Follow ups to this Course
The molecular mechanics procedure is quick and simple, but not always accurate. Different molecular mechanics force fields also vary in their accuracy.
A proper molecular model must also take into account electrons, as noted above. But solving the necessary equations takes much more computer time. In later courses in 2nd year, you will be shown how to do this, using programs such as Gaussview, Gaussian, GAMESS, and the like. Third and fourth year courses deal with the theory and practice in much more detail.
Further Documentation, Reading and Viewing
- Ghemical Manual gives more advanced options, but be aware it relates to an earlier version of Ghemical.
- Second year modelling experiment on the thermal expansion of MgO.
- Third year modelling experiment undertaken in the third year organic chemistry laboratory.
- Third year modelling lab on Inorganic Chemistry, including three advanced individual projects on Mo(CO)4L2, boron based acids and Gold interactions with Water.
- A local third year course on organic molecular modelling with a number of more elaborate case studies illustrating the application of molecular modelling.
- Some further local examples of molecular models deriving from first and second year problem classes and tutorials.
- The Wikipedia page on molecular modelling, a short summary which gives some good further leads.
- The Wikipedia page on molecular graphics, a technique that goes hand in hand with molecular modelling.
- A Wikibook on organic chemistry
- The grand Daddy of all molecular models, invented at Imperial College around 1860, and now in the archives of the Royal Institution. These models are the source of the familar colour scheme now used, i.e. Hydrogen=White, Oxygen=Red, Nitrogen=blue, etc.
- Another father of molecular modelling, but only on paper!, also achieved in 1861. Loschmidt constructed these models in the same sense that Watson and Crick did for DNA, as proposals, and not representing structural proof in any way.
- For an interesting way of presenting scientific genealogies of scientists, see J. Andraos, Scientific genealogies of physical and mechanistic organic chemists, Can. J. Chem./Rev. Can. Chim., 2005, 83, 1400-1414. DOI:
- The preception of the 3D character of many molecules can be enhanced by viewing using stereoscopic systems. One such system is available for student use, and lecture theatre C is equipped with stereoscopic projection.
Running Ghemical and other modelling programs on your own Computer
- Get Ghemical from here. It installs on either Windows XP or MacOS X. For installation notes see here
- Get Avogadro from here. It is available for Windows, OS X and Linux.
- The department also has a Site License for a program system called ChemBio3D, the terms of which allow individual undergraduates to acquire a copy of the program and to install it on their personal computer. The license is an annual one.
Submitting more accurate calculations to the Departmental SCAN Cluster
The Chemistry department runs a SCAN (Supercomputer at Night) system, whereby teaching computers which would otherwise only idle in the middle of the night, can be used to run more time consuming calculations than is possible interactively on a single computer whilst sitting in front of it.One far more reliable and quantitative way of modelling a molecule is to subject it to quantum mechanical modelling using Density Functional theory. In practice, this is implemented here using a program called Gaussian 03. The procedure to submit such a job is as follows:
Creating an Input file
- After you have optimised your sketched molecule using Ghemical, as described above, right click in the black display window. This will produce the floating menu, from which you select file and then Export. Select Gaussian 98/03 Cartesian Input for the type and type a name for the file (make sure that the name of the file ends with .gjf). It will be saved in your H: drive by default.
- The file will have to be edited before it can be submitted. You can do this either with Gaussview as the program, but a much simpler method is to open the file (pentahelicene.gjf in this example) using eg the Windows Wordpad editor. This is invoked simply by double clicking on the file. Remove any existing lines starting with % or # and replace them with one of the following single lines (the second example also results in the vibrational frequences and from these the entropy being computed, and hence the zero-point and free-energy corrected value, ΔG). This latter option will take significantly longer however.
# B3LYP/6-31G(d) opt
or
# B3LYP/6-31G(d) opt freq
to produce a file that looks like the one shown on the right.
- For a molecule the size of e.g. pentahelicene, the calculation will take about 4-5 hours overnite. If for some reason, your molecule is taking longer, you can always reduce the size of the basis set to e.g. B3LYP/3-21G*, or submit the job on a Friday, when it will have the entire weekend available to it. If you want greater accuracy (but for longer computing time), try e.g. # B3LYP/cc-pVTZ opt freq.
Submitting the Input file
- You will have to login as yourself. You can submit as many jobs as you wish through this mechanism, but you must prepare the input (.gjf) file for each first. The SCAN operates during the period 23.00-07.30 overnight. If a job is not completed during this period, it will be scheduled to run again (from the beginning) the next night. For this reason, you should only schedule jobs that can complete in an 8 hour window. In practice this means submitting molecules only a little bit larger than pentahelicene.
- After you are logged in you should organise your jobs by project. Create a suitable new project, then select New job, the Application (currently only Gaussian) the Project, and press continue.
- You now have to find the Gaussian input file, as prepared above. You should Browse to drive H: to find this file. Add a description which will help you identify the job.
- The job will be added to your list of jobs, andyou can view its status (but this depends on there being a vacant machine in the Condor pool).
- When the job has completed, click on the Job List link. This will show all available outputs. Download the program Log file (this will help you chart whether the calculation was successfull) or the Gaussian Formatted Checkpoint file onto the desktop of the computer you are using, and the file should open up Gaussview, where the molecule can be viewed and checked. You can use the latter file to e.g. plot molecular orbitals for the molecule, view vibrational modes, etc. Full details of these procedures are described in the Gaussview manuals.
Archiving the output into a digital repository
A very recent innovation is the Institutional digital repository, a resource for permanently archiving calculations, spectra and crystal structures. You can get a flavour of this by archiving your own calculation in the SPECTRa digital repository. To the right of the Portal display is a link termed Publish. If you click on this, and the calculation is actually in a state to be published (it may for example have failed for some reason) then appropriate metadata for the calculation is collected, and the collection deposited into the repository. From here, it can be retrieved in future.== About this wiki: Opencoursew
are ==
This course is presented as a wiki. This differs from conventional hand-outs or web pages in several aspects.
- Anyone (who has a valid Imperial College login and password) can edit it, for the purpose of correcting errors, clarifying ambiguities, and even adding more examples, or references to existing examples. However, this activity is not anonymous; you can see who has done what by inspecting the history of the article. If you are considering making changes, go read these rules first.
- You may notice that some terms appear in red. This is because the original author has enclosed the term thus: [[red]], acting as a suggestion or hint that someone may wish to pick up this term, and expand it into something informative. If you think you can add something helpful to others, please go ahead: click on the red section and starting editing! If the result contains inaccuracies, someone may come along and correct them. If you are dubious that this scheme works, just go visit Wikipedia. The idea behind this is that we produce joined up courses and not just isolated islands of information and knowledge.
- You can also hit the edit button if you want to find out how any particular effect is achieved. You do not have to actually change anything.
- This is an experiment! If you have any comments on the experiment, or suggestions for improvements, go instead to the discussion page and say something there. Do however remember that anyone in the world (!) can see this (it is opencourseware, go read this stimulating and provocative view of how knowledge may be owned and disseminated in the future), so remember not to write anything inappropriate. You cannot do so anonymously!







