Skip to content

Installing NetProphet on MacOS

yiming-kang edited this page Sep 9, 2020 · 9 revisions

Introduction

We use Conda to manage the list of dependencies required for NetProphet, as well as specific versions of R and Python needed for execution. This provides an equivalent of virtual environment that can be loaded or unloaded on demand in order to prevent clashing with your other projects, or with other environments on a shared cluster.

If you already have either Anaconda or Miniconda installed, you can skip the first step.

1. Install Conda

Install miniconda3 (64bit) for Mac from https://conda.io.
After installation, for MacOS Catalina:

$ source ~/opt/miniconda3/bin/activate 
$ conda init zsh

For other MacOS versions:

$ source ~/opt/miniconda3/bin/activate 
$ conda init

Restart the terminal.

To verify installation, run: $ conda info
You should see conda output its version, etc.

2. Add Conda channels

$ conda config --add channels bioconda  
$ conda config --add channels conda-forge

3. Create NetProphet2 environment

$ conda create -n np2 r=3.2.1 readline=6.2 pcre snakemake=3.8.2 numpy=1.15 scipy 
$ conda activate np2

4. Install brew & gawk (if not available)

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"   
$ sudo chown -R $(whoami) /usr/local/share/man/*
$ brew install gawk
$ brew install pcre

5. Setup Environment variables:

Open ~/.profile (or ~/.zsh_profile for MacOS Catalina) and add the following:

NETPROPHET2_DIR=<your_path_to_NetProphet_2.0_dir>    
MEME_BIN=$NETPROPHET2_DIR/SRC/meme/bin  
MEME_LIB=$NETPROPHET2_DIR/SRC/meme/libexec/meme-5.1.0  
FIREDIR=$NETPROPHET2_DIR/SRC/FIRE-1.1a/  
export PATH=${NETPROPHET2_DIR}:${MEME_BIN}:${MEME_LIB}:${FIREDIR}:${PATH}

Save it.
Then update your bash profile by $ source ~/.profile (or ~/.zsh_profile for MacOS Catalina).

6. Install dependencies

a. Install gfortran-6.1.pkg from: https://cloud.r-project.org/bin/macosx/tools/gfortran-6.1.pkg
b. Install FIRE library:

$ cd $NETPROPHET2_DIR/SRC
$ unzip -q FIRE-1.1a.zip
$ cd FIRE-1.1a/ 
$ chmod 775 configure 
$ ./configure 
$ make 

c. Install MEME library:

$ cd $NETPROPHET2_DIR/SRC/
$ mkdir -p meme/
$ wget http://meme-suite.org/meme-software/5.1.0/meme-5.1.0.tar.gz
$ tar zxf meme-5.1.0.tar.gz
$ cd meme-5.1.0
$ ./configure --prefix=${NETPROPHET2_DIR}/SRC/meme --with-url=http://meme-suite.org/ --enable-build-libxml2 --enable-build-libxslt 
$ make
$ make test
$ make install

7. Install custom R packages:

$ cd $NETPROPHET2_DIR/SRC/R_pkgs 
$ R CMD INSTALL BayesTree_0.3-1.3.tar.gz  
$ R CMD INSTALL lars_0.9-8.tar.gz