Macs in Chemistry

Insanely great science

 

Installing Checkmol/Matchmol

Checkmol is a command-line utility program which reads molecular structure files in different formats and analyzes the input molecule for the presence of various functional groups and structural elements. At present, approx. 200 different functional groups are recognized. Output can be either clear text (English or German), a bitstring or its ASCII representation, or a set of special 8-character codes. This output can be easily placed into a database table, permitting the creation of chemical databases with a functional group search option. It was written by Norbert Haider, Department of Pharmaceutical Chemistry (now: Department of Drug and Natural Product Synthesis), University of Vienna, Austria.

The full List of functional groups recognized by checkmol is here.

Matchmol complements the capabilities of checkmol. It compares two (or more) molecular structures and determines whether one of them is a substructure of the other one. This is done by a full atom-by-atom comparison of the input structures. Thus, matchmol can be used as a back-end program for structure/substructure search operations in chemical databases

The software is available both as source code and as a binary compiled for Linux (x86 architecture). It is entirely written in Pascal and it was compiled with Free Pascal 1.0.11 or Free Pascal 2.4.0 (starting from v0.4c). So to install we first need to get a Pascal compiler, this can be downloaded from Sourceforge, but to install it you need the Xcode command line tools installed. Installation of these tools seems to vary depending on the version of Mac OSX and Xcode. This approach seems to work with most combinations.

In a Terminal window type

xcode-select --install

Then follow the on screen instructions.

Now download and install the Pascal compiler.

Now download the checkmol source code from here, the file checkmol.pas is a symbolic link to the latest source file, simply right-click to download the file to you chosen location.

To compile checkmol type the command below in a Terminal window. You will need to give the full path to checkmol or cd into the folder containing it.

fpc checkmol.pas -S2 -Tdarwin

Free Pascal Compiler version 3.0.0 [2015/11/14] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Darwin for i386
Compiling /Users/Chris/Downloads/checkmol.pas
Assembling (pipe) /Users/Chris/Downloads/checkmol.s
Linking /Users/Chris/Downloads/checkmol
14361 lines compiled, 1.3 sec

This will give a file "checkmol.o" and a file "checkmol"

Now move the files to the desired position, I have all command line tools in /usr/local/bin

cp checkmol /usr/local/bin

Then type

cd /usr/local/bin
ln checkmol matchmol

This is needed because checkmol and matchmol are the same executable, but the program behaves differently depending on the name it was invoked with.

If you now type

checkmol

checkmol version 0.5  N. Haider, University of Vienna, 2003-2013
Usage: checkmol [options] <filename> where options can be:
    -l  print a list of fingerprint codes + explanation and exit
    -v  verbose output
    -r  force SSR (set of small rings) ring search mode
    -M  accept metal atoms as ring members and one of the following:
    -e  english text (common name of functional group; default)
    -d  german text (common name of functional group)
    -c  code (acronym-like code for functional group)
    -b  bitstring (in decimal format) representing the presence of each group
    -s  the ASCII representation of the above bitstring, i.e. 0s and 1s)
    -p  lists the position of each functional group (atom number of key atom)
    -x  print molecular statistics (number of various atom types, bond types, ring sizes, etc.
    -X  same as above, listing all records (even if 0) as comma-separated list
    -a  count charges in fingerprint
    -m  write MDL molfile (with special encoding for aromatic atoms/bonds)
    -h  hashed fingerprint mode with boolean output
    -H  hashed fingerprint mode with decimal output
 options can be combined like -vc
<filename> specifies any file in the formats supported (MDL *.mol, Alchemy *.mol, Sybyl *.mol2), the filename "-" (without quotes) specifies standard input

Last updated 21 January 2016.