ncibtep@nih.gov

Bioinformatics Training and Education Program

Setting up your Mac Computer for the Biostar Class

(last updated May 12, 2020)

Based on the Biostar Handbook see https://www.biostarhandbook.com

Installing Bioinfo Software – Mac SOP (for High Sierra, Mojave or Catalina)

1. Prepare your computer.

a. Ensure that default Terminal shell is bash by typing at the command line (echo dollar zero)

echo $0

If running macOS Catalina (10.15) in particular, the following Terminal command must be run to change your default shell to bash. Press return after entering, and enter your account password when prompted, pressing return again afterward.

chsh -s /bin/bash

b. Initialize the bash Terminal shell environment

Run the following Terminal commands to setup the bash Terminal environment. Press return after entering each.

curl http://data.biostarhandbook.com/install/bash_profile.txt >> ~/.bash_profile
curl http://data.biostarhandbook.com/install/bashrc.txt >> ~/.bashrc
source ~/.bash_profile

c. Install the Xcode Command Line tools

The correct version of the Xcode Command Line tools will vary depending on the OS the Mac is currently running. Use NCI’s JAMF Self Service tool to install the correct version. Search specifically for “Xcode Command Line Tools” to find them.

For information on using JAMF Self Service, see:
NCI-KB0012326

d. Install the Java JDK

Download Java JDK 11 from:
https://www.oracle.com/java/technologies/javase-jdk11-downloads.html

Use the “macOS Installer” link, with the file ending in “.dmg”.

2. Install conda and activate bioconda.

a. miniconda

i. Download and install miniconda from: https://docs.conda.io/en/latest/miniconda.html. Use the following link specifically for the correct PKG: https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.pkg

ii. Install miniconda using the following command specifically. Please note that this is one single line in the Terminal.

sudo installer -verbose -pkg ~/Downloads/Miniconda3-latest-MacOSX-x86_64.pkg  -target /

iii. Initialize miniconda by running the following Terminal command:
/opt/miniconda3/condabin/conda init

iv. Close the terminal and open a new one to make conda activate.

b. Install bioconda

i. Type the following in Terminal, and press Return:
conda config –add channels bioconda

ii. Type the following in Terminal, and press Return:
conda config –add channels conda-forge

3. Install the software.

a. Create a bioinformatics environment

i. Type the following in Terminal, and press Return:
conda create -y –name bioinfo python=3.7

ii. Close and reopen the Terminal window.

b. Activate the bioinformatics environment
Type the following in Terminal, and press Return:
conda activate bioinfo

c. Install most bioinformatics tools covered in the Biostar Handbook.
curl http://data.biostarhandbook.com/install/conda.txt | xargs conda install -y

Note: You will need to run the following command once in each new Terminal window you open to activate the Bioinformatics environment:

conda activate bioinfo

Testing the software installation:

Since Entrez Direct is the tool that seems to cause most problems for our readers we recommend that you verify right away that it works. Once the installation has completed, run the following to verify that you can access NCBI from the command line:

efetch -db nuccore -id 2 -format gb

if the command above produces:

LOCUS A00002 194 bp DNA linear PAT 10-FEB-1993
DEFINITION B.taurus DNA sequence 1 from patent application EP0238993.
ACCESSION A00002
VERSION A00002.1
...
JOURNAL Patent: EP 0238993-A2 1 30-SEP-1987;

then your installation is successful.

How do I verify that all other programs work?

We have created a script that verifies that your settings are correct. Throughout the book, if any of our instructions causes an error, your first choice ought to be to check what the doctor says 🙂 In our experience when the “doctor” is happy all as well on your system:

Download and run our doctor.py script from a terminal:

mkdir -p ~/bin
 curl http://data.biostarhandbook.com/install/doctor.py > ~/bin/doctor.py
 chmod +x ~/bin/doctor.py
When run from a terminal the doctor.py will tell you what (if anything) is out of order 

~/bin/doctor.py 

for further information please see the original documentation at 
https://www.biostarhandbook.com/install-software.html