Next Previous Table of Contents

3. Using qmol

3.1 Calculating molecular weights.

Enter a chemical formula in the formula field. Click on [Calculate], or just press "Enter". To clear the results, press [Clear]. Or just erase the old formula.

The formula syntax is very similar to what a regular chemical formula would look like, if subscripts are written as normal characters. To avoid the possible ambiguities, however, a few restrictions must be imposed:

3.1.1 One-letter amino acids

One-letter amino acid symbols may be used when enclosing them in square brackets, e.g. [APC3G] will be interpreted as AlaPro(Cys)3Gly. The molecular weight depends on whether Protein Mode is switchen on or off.

3.1.2 Protein mode

When Protein Mode is switched on (which is the default, but can be changed in the Preferences dialog), the amino acid symbols within the square brackets are interpreted as a protein, i.e. the water molecules which are split off upon formation of a peptide bond are subtracted from the formula automatically (#peptide bonds = #subtracted H2O = #amino acids - 1). I.e. the aforementioned formula [APC3G] will be C19H32N6O7S3, MW 552.697 g/mol. With Protein Mode switched off, it would be C19H42N6O12S3, MW 642.774 g/mol. To calculate the corresponding peptide/protein in non-Protein Mode, you could write [APC3G]-5H2O, but of course you would have to count the amino acids manually then.

The predefined three-letter amino acids may also be used within the square brackets.

For example, the weight of Aspartame could be calculated in protein mode with [AspPhe]Me-H when the predefined three-letter amino acid symbols are switched on (default). This is the same as [DF]Me-H (294.307 g/mol).

qmol can be used to calculate the mass of large proteins like this page too: Proline-rich protein 12 (1215 amino acids, 129992 g/mol).

3.2 Defining your own groups.

By clicking on "Edit" > "Define" (or hitting CTRL+D), you can start an interactive symbol definition editor. Enter the name for the group to be defined in the symbol field. Follow the proper syntax. Hit Enter or Tab or select the "Definition" input field to enter its formula or an atomic weight. (Group symbols are of course allowed in the formula, as long as they have already been defined.) Example: Cp* could be defined as C10H15, C5(CH3)5, or C5Me5 (if Me has been defined before).

You can also define it as an element with weight 135.23, but then you won't have the information about its elemental composition, rather, it will be treated as if it was an Element!
Click on [Add] or hit Enter to define the new symbol. The newly defined symbol and its definition will be added to the table below. The definitions are stored in a

To confirm all your new definitions choose [Apply] or [Done] (which will save the new definitions to your groups file1) with the latter also closing the window. Clicking [Discard] or [Cancel] will discard the changes you made in the current session, with the latter also closing the window.

If you want to redefine an already defined group, do so by editing its entry in the table. To delete an already defined group, select the row and click [Delete row] (you can also select multiple entries).

1 On Linux, the customized group definitions, the ones with formulas as well as those with weights, will be stored in the file <home>/.local/share/data/qmol/groups. In its current implementation, the definitions with weights will come after the ones with formulas after you reopen the group definitions, I hope you don't mind that little inconvenience.

3.2.1 Overriding element symbols

Say you want to define the acetyl group CH3COO as Ac. Since this would clash with the element Ac (actinium), it simply overrides it. To still access actinium, you would have to enter it as Ac!.

Analogously, if you use the pre-defined alkyl groups, in which propyl overrides praseodymium, and you still need to use praseodymium, you must enter it as 'Pr!' (i.e. a formula like tripropylpraseodymium must be entered as Pr3Pr!).

3.2.2 Pre-defined groups

You can activate two sets of pre-defined groups in the group definitions window:

SymbolDefinitionName
Alkyls
MeCH3Methyl
EtC2H5Ethyl
PrC3H7Propyl
BuC4H9Butyl
PeC5H11Pentyl
HexC6H13Hexyl
HepC7H15Heptyl
OctC8H17Octyl
NonC9H19Nonyl
DecC10H21Decyl
Aryls
PhC6H5Phenyl
BzC7H7Benzyl
MesC9H11Mesityl
CpC5H5Cyclopentadienyl
Cp*C10H15Pentamethyl
cyclopentadienyl
SymbolDefinitionName
Amino acids
AlaC3H7NO2 Alanine
ArgC6H14N4O2 Arginine
AsnC4H8N2O3 Asparagine
AspC4H7NO4 Aspartic acid
CysC3H7NO2S Cysteine
GluC5H9NO4 Glutamic acid
GlnC5H10N2O3 Glutamine
GlyC2H5NO2 Glycine
HisC6H9N3O2 Histidine
IleC6H13NO2 Isoleucine
LeuC6H13NO2 Leucine
LysC6H14N2O2 Lysine
MetC5H11NO2S Methionine
PheC9H11NO2 Phenylalanine
ProC5H9NO2 Proline
SerC3H7NO3 Serine
ThrC4H9NO3 Threonine
TrpC11H12N2O2 Tryptophan
TyrC9H11NO3 Tyrosine
ValC5H11NO2 Valine

Note that if you activate the pre-defined group set “Alkyls, Aryls”, the propyl group Pr overrides the element Pr (praseodymium), see Overriding element symbols,

3.3 History Feature

By default, the last formula entered will be displayed at the top of the history table. This can be changed by unchecking the 'Reverse' checkbox. Only items which are not yet in the history are added to it.

When selecting an entry from the history, its composition will be displayed in the Composition view. When you select multiple entries (e.g. with CTRL+Click), all selected formulae will be added together. For this total formula, the weight and composition will be displayed as if all of the selected items had been entered together in the first place.

Selected entries can be removed from the history by clicking on [Remove]. To clear all entries, click on [Clear all].

If you don't like the history feature, you can just hide it by dragging the handle between the Composition view and the History label firmly to the bottom. To reopen the history, grab the handle and pull it up again.

3.4 Preferences Dialog

In the Preferences Dialog you can choose whether the coefficients in a sum formula will be subscripted or not, and their color.

You can also configure the format of the results output both, when you use qmol from the command line and when you use it with the GUI. See section 3.5 for details.

3.5 Command Line Mode

You can use qmol for calculating molecular weights without the graphical interface. When you start qmol from the command line, you can pass one or more formulae to it and have their sum formulae, weights and composition printed. Example:

> qmol Al2O3 "Cp*2Fe"
Al2O3 = Al2O3: 101.961 g/mol
Al      52.93
O       47.07
Cp*2Fe = C20FeH30: 326.305 g/mol
C       73.62
Fe      17.11
H       9.27
Note that I needed to put the second formula in quotes in order to prevent the shell from interpreting the asteriks (*).

3.6 Results Output Format

You can control what is printed on the command line and in the GUI Analysis Results in the Preferences dialog using a format string which contains special tokens. (At this time, you must use the preferences dialog in the GUI to configure the format string of the command line. This might be changed in a future version).

The default format string for the command line is (tokens highlighted) is:

%i = %o:\n%w g/mol\n%a%c
The tokens have the following meaning:
%i: input formula
%o: output (sum) formula
%w: weight
%c: composition
%a: number of amino acids
\n: new line
\t: tabulator

So to just output the sum formula and the weight you could e.g. set the command line format string to:

%o:\t%w
Output:
> qmol CaSO4+2H2O  
CaH4O6S:        172.172

To configure how the composition list is formatted, use the “Elemental composition” input field in the options dialog. Default is “%E\t%C %\n”, but you could also make the output more compact e.g. with “%E: %C; ”.

Analogously, you can configure the output of the number of amino acids in the formula with the “Sum of amino acids” input field. Default is “Sum of AA: %N\n”. Note that if the sum of amino acids in the formula is 0, this output is omitted, even when you have a “%a” in your general output formatting definition.

Next Previous Table of Contents