There have been some changes with Homebrew which have meant that a few of the scientific applications are no longer available so I’ve decided to rewrite the page on installing them to use Anaconda which is now my preferred way to install.

Installation of Homebrew

Homebrew is a package manager for Mac OSX that installs packages in it’s own directory then symlinks the files to /usr/local. The reason I went with Homebrew rather than MacPorts is that I found on occasions MacPorts overwrote existing files. Homebrew instead warns you of any clashes and allows you to decide which version to keep. If you need to remove MacPorts there is a detailed guide. You may also need to update your BASH profile.

To install Homebrew you first need to have access to the command line tools for Xcode, the easiest way to do this is to download Xcode from the Mac Appstore

  1. Start Xcode on the Mac.
  2. Choose Preferences from the Xcode menu.
  3. In the General panel, click Downloads.
  4. On the Downloads window, choose the Components tab.
  5. Click the Install button next to Command Line Tools. You are asked for your Apple Developer login during the install process.

Or You can download the Xcode command line tools directly from the developer portal as a .dmg file. https://developer.apple.com/downloads/index.action. On the “Downloads for Apple Developers” list, select the Command Line Tools entry that you want.

For many scientific applications you will also need X11, the easiest way to get this is to install XQuartz. The XQuartz project is an open-source effort to develop a version of the X.Org X Window System that runs on OS X. Together with supporting libraries and applications, it forms the X11.app. the latest downloads are available here

To install Homebrew type this command in the Terminal

Then type

The ‘brew doctor’ command checks everything is fine. e.g. it will warn if the developer tools are missing, and if there are unexpected items in /usr/local/bin and /usr/local/lib that may clash and might need to be deleted.

Installing packages using Homebrew

The way Homebrew works is it installs everything to /usr/local/Cellar, then creates aliases in /usr/local/bin and /usr/local/lib so they are on your $PATH. You will likely have stuff manually installed in these directories – this is fine, but if they are things that can be installed using homebrew it’s best to delete them and then reinstall using homebrew.

It is a good idea to first update the package list

Then we can just run “brew install ” for everything we want. A few examples that you may want:

gfortran is now part of gcc we can check gfortran is installed, in the Terminal type

and the location

which should be an alias to “/usr/local/Cellar/gcc/6.2.0/bin/gfortran”.

Then run

You may get errors something like (these are probably older installations).

I deleted the highlighted files, then

Update

I just saw this message on the RDKit users message board which offers a method to install RDKit using Homebrew, I use Anaconda (below) to install RDKit so I’ve not tested it.

Recently, I updated the brew install recipe for rdkit on Mac. The biggest change is that boost and boost-python’s versions were pinned down, so that the brew install recipe should be much more reproducible than before. Here is a fail-safe way to install rdkit with it (with Python wrappers, and InChI support):

It should install a tagged version of rdkit (Release201903_2) more details are on GitHub https://github.com/rdkit/homebrew-rdkit.

Also came across this video showing how to install MOLDENhttps://www.youtube.com/watch?v=zvrfVNzb-zs

Installation Using Anaconda

Anaconda is a modern package manager and seems to be becoming the preferred source of scientific software. There is a getting started tutorial here

Install Conda using the instructions here https://docs.conda.io/projects/conda/en/latest/user-guide/install/macos.html

You do not need to uninstall other Python installations or packages in order to use conda. Even if you already have a system Python, another Python installation from a source such as the macOS Homebrew package manager and globally installed packages from conda such as pandas and NumPy, you do not need to uninstall, remove, or change any of them before using conda.

Install Anaconda or Miniconda normally (I used miniconda), and let the installer add the conda installation of Python to your PATH environment variable. There is no need to set the PYTHONPATH environment variable

You can check using these commands in the Terminal

By default, conda now prefers packages from a higher priority channel over any version from a lower priority channel even if a lower priority channel has a newer version of a package.

The following command adds the channel “yournewchannel” to the top of the channel list, making it the highest priority:

Conda also now has a command that adds the new channel to the bottom of the channel list, making it the lowest priority:

A while back I mentioned BioConda. You can read more details in this publication “Bioconda: A sustainable and comprehensive software distribution for the life sciences”, DOIBioconda is a channel for the conda package manager specializing in bioinformatics software. Currently 7377 packages

Bioconda supports only 64-bit Linux and Mac OSX.

You can search Anaconda here https://anaconda.org/search?

To install a package type

Of course if you are doing any python scripting you will probably also want to install some or all of.

If a package is not available from conda or Anaconda.org, you may be able to find and install the package with another package manager like pip.

Checking it all works

We can now test the applications are working, to test Opsin in a Terminal window type:

To check that the rdkit python bindings are working: Type ‘python’ to enter the python interpreter, then try:

To check OpenBabel is working type this in a Terminal window:

To test InChi type this in the Terminal:

To test chemspot in the Terminal type (change username to your name), beware chemspot is pretty resource hungry.

This will create a file on your desktop called test.txt, now type the following

This will create a file on your desktop called untitled.txt

If you open it in a text editor it should read

To test OSRA you will need an image of chemical structure, you can drag the image below to your desktop.

Then in the Terminal type:

For some reason screenshots don’t work at present, a workaround is to open the screenshot image in Preview and save it as a jpeg file.

Or it can be done from the command line using GraphicsMagick

or

To test filter-it (and the other tools from silicos-it) in the terminal type

Beaker

Chembl_beaker package was developed at ChEMBL group, EMBL-EBI, Cambridge, UK. It is a wrapper for RDKit and OSRA, which exposes the following methods:

  • Format convertion
  • Compound recognition
  • Raster image (PNG) generation
  • Vector image (SVG) generation
  • HTML5 ready compound representation
  • Fingerprints
  • Descriptors
  • Maximum Common Substructure
  • Smiliarity maps
  • ChEMBL standardisation process, consisting of neutralisation, bond breaking, salt removal and applying various rules.
  • 3D coordinates generation, using Universal Force Field
  • Various other calculations (for example kekulisation)
  • Marvin 4 JS compilant webservices

As a portable, lightweight, CORS-ready, REST-speaking, SPORE-documented webserver. This particular implementation wraps RDKit in Bottle on Tornado. To start the web server, in a Terminal window type

The open a web browser and type in the URL 

and you should see the following

If you select smiles23D/:CTAB and type in a SMILES string and click on the green “GET” button you should see the following response.

Open Drug Discovery Toolkit (ODDT): a new open-source player in the drug discovery field

A recent paper in J Cheminformatics described Open Drug Discovery Toolkit (ODDT): a new open-source player in the drug discovery field DOI a free and open source tool for both computer aided drug discovery (CADD) developers and researchers. Open Drug Discovery Toolkit is released on a permissive 3-clause BSD license for both academic and industrial use. ODDT’s source code, additional examples and documentation are available on GitHub.

You can easily check all is working by running python in a terminal window

The publication also includes a series of iPython notebooks to get you started.

Installing Amber/AmberTools on macOS

I don’t use Amber but a number of readers have asked me about installation. Rather than go though it here I would simply refer you to a superb detailed explanation here https://www.ovetande.se/software/amber/install/ambertools19-macos-10-14-4-xcode-10-2-1/.

Installing Amber/AmberTools on macOS has become much easier though is not to be considered completely trivial. Below different methods are presented to install the current version of AmberTools, where the method should be the same for Amber

Updated 21 August 2021

Related Posts

One thought on “Cheminformatics on a Mac

Comments are closed.