/nanocall

An Oxford Nanopore Basecaller

Primary LanguageC++MIT LicenseMIT

Nanocall: An Oxford Nanopore Basecaller

http://travis-ci.org/mateidavid/nanocall.svg?branch=master

Installation

Nanocall can be built from source in a classical UNIX environment, or directly under Docker. The Docker build might run under Windows, though this is not tested.

Under a Classical UNIX Environment

Nanocall uses cmake for configuration and make for building. The prerequisites needed for building are zlib and hdf5. On UNIX systems, hdf5 can be optionally built as a submodule. Example build:

mkdir /some/source/dir && cd /some/source/dir
git clone --recursive https://github.com/mateidavid/nanocall.git
cd nanocall
mkdir build && cd build
cmake ../src [-DCMAKE_INSTALL_PREFIX=/some/install/dir] [-DBUILD_HDF5=1] [-DHDF5_ROOT=/path/to/hdf5]
make
make install
/some/install/dir/bin/nanocall --version

NOTES:

  • The default install prefix is /usr/local.
  • Setting BUILD_HDF5 will cause hdf5 to be downloaded and built as a submodule.
  • Setting HDF5_ROOT is only necessary if a copy of hdf5 is installed in a non-standard location. This is not needed when BUILD_HDF5 is used.
Under Docker

To avoid dealing with prerequisites, Nanocall can be conveniently built under Docker. The installation and configuration of Docker itself is outside of the scope of this document.

Simple “fat” build

The simplest way to run Nanocall under Docker is:

docker build -t nanocall https://github.com/mateidavid/nanocall.git
docker run --rm nanocall --version
docker run --rm -u $(id -u):$(id -g) -v /path/to/data:/data nanocall -t 4 . >output.fa

Howver, there are several problems with this build:

  • The docker image is “fat”, in that it contains all the build time dependencies of Nanocall, which are not needed at run time.
  • Without using -u, the image will create files with a UID of 0 on the mounted volumes of the host. To remove them, you will have to use sudo rm or sudo chown.
  • The timezone inside the image might be different from the host. This might confuse programs which depend on comparing modification times, most notably make.
Alternate “slim” build

To alleviate the problems mentioned above, you can build a “slim” Docker image as follows:

git clone --recursive --depth 1 https://github.com/mateidavid/nanocall.git
nanocall/script/build-slim-docker-image
docker run --rm nanocall --version
docker run --rm -v /path/to/data:/data nanocall -t 4 . >output.fa

Usage Examples

# Check version
nanocall --version

# Check command line parameters
nanocall --help

# Run on single file, save output and log
nanocall /path/to/file.fast5 >output.fa 2>log

# Run on directory, using 24 threads, discard log
nanocall -t 24 /path/to/data >output.fa 2>/dev/null

# Run on file-of-file-names
nanocall /path/to/files.fofn >output.fa

# Run Docker build on directory, using 4 threads
# Note: -u is not needed with the "slim" build
docker run --rm -u $(id -u):$(id -g) -v /path/to/data:/data nanocall -t 4 . >output.fa

License

Released under the MIT license.