Tutorial: Building mosdepth on macOS
gravatar for ATpoint
8 months ago by
ATpoint44k wrote:

This is just a tiny tutorial on how to build mosdepth on Mac. There is currently no version for Mac available at conda (hope that changes soon), and from what I've read building from source was a pain so far, still these simple steps worked for me (macOS 10.14.6). mosdepth is a wickedly fast tool from brentp for depth calculations (e.g. bedGraphs) starting from BAM and CRAM files.

=> Edit: brentp now also provides binaries for macOS, see here and here. Note that these are not static binaries so htslib still needs to be installed, see below. Unpack the linked archive, chmod +x the binary, get htslib and you should be ready to go. The macOS-one is labelled 10.15 but worked for me on 10.14.6 as well. If you have trouble please add a comment to the GitHub issue.

1. Install the Nim programming language

For this use choosenim via the command:

curl https://nim-lang.org/choosenim/init.sh -sSf | sh

The script will instruct you to put the folder that contains the binaries into your PATH. On Mac this is typically done by putting this into your ~/.bash_profile:

export PATH=$HOME/.nimble/bin:$PATH

2. Get htslib

Either compile from source or get it via a package manager such as conda:

conda install -c bioconda htslib

Be sure it is version >= 1.10 since the current hts-nim (which mosdepth automatically installs and depends on) does not support older versions. Put the path to the library (lib) folder that contains htslib.dylib into your LD_LIBRARY_PATH, e.g when using miniconda:

export LD_LIBRARY_PATH=$HOME/miniconda3/lib

3. Install mosdepth

Get the source, extract it and cd into the folder, then install:

nimble install -y

A mosdepth binary should now be available in this folder. Feel free to comment if problems come up.

tutorial nim mosdepth • 422 views
ADD COMMENTlink modified 8 months ago • written 8 months ago by ATpoint44k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 964 users visited in the last hour