Neural network sequence error correction.
Project description
![Oxford Nanopore Technologies logo](images/ONT_logo_590x106.png)
Medaka
[![Build Status](https://travis-ci.org/nanoporetech/medaka.svg?branch=master)](https://travis-ci.org/nanoporetech/medaka)
medaka is a tool to create a consensus sequence of nanopore sequencing data. This task is performed using neural networks applied a pileup of individual sequencing reads against a draft assembly. It outperforms graph-based methods operating on basecalled data, and can be competitive with state-of-the-art signal-based methods whilst being much faster.
© 2018 Oxford Nanopore Technologies Ltd.
Features
Requires only basecalled data. (.fasta or .fastq)
Improved accurary over graph-based methods (e.g. Racon).
50X faster than Nanopolish (and can run on GPUs).
Benchmarks are provided [here](https://nanoporetech.github.io/medaka/benchmarks.html).
Includes extras for implementing and training bespoke correction networks.
Works on Linux (MacOS and Windows support is untested).
Open source (Mozilla Public License 2.0).
Tools to enable the creation of draft assemblies can be found in a sister project [pomoxis](https://github.com/nanoporetech/pomoxis).
Documentation can be found at https://nanoporetech.github.io/medaka/.
Installation
There are currently two installation methods for medaka, detailed below.
Installation with pip
Medaka can be installed using the python package manager, pip:
pip install medaka
On Linux platforms this will install a precompiled binary, on MacOS (and other) platforms this will fetch and compile a source distribution.
We recommend using medaka within a virtual environment, viz.:
virtualenv medaka –python=python3 –prompt “(medaka) ” . medaka/bin/activate pip install medaka
Using this method requires the user to provide a [samtools](https://github.com/samtools/samtools) and [minimap2](https://github.com/lh3/minimap2) binary and place these within the PATH. samtools version 1.3.1 and minimap2 version 2.11 are recommended as these are those used in development of medaka.
Installation from source
Medaka can be installed from its source quite easily on most systems.
> Before installing medaka it may be required to install some > prerequisite libraries, best installed by a package manager. On Ubuntu > theses are: > * gcc > * zlib1g-dev > * libbz2-dev > * liblzma-dev > * libffi-dev > * libncurses5-dev > * make > * wget > * python3-all-dev > * python-virtualenv
A Makefile is provided to fetch, compile and install all direct dependencies into a python virtual environment. To setup the environment run:
git clone https://github.com/nanoporetech/medaka.git cd medaka make install . ./venv/bin/activate
Using this method both samtools and minimap2 are built from source and need not be provided by the user.
Using a GPU
All installation methods will allow medaka to be used with CPU resource only. To enable the use of GPU resource it is necessary to install the tensorflow-gpu package. In outline this can be achieve with:
pip uninstall tensorflow pip install tensorflow-gpu
However, note that The tensorflow-gpu GPU package is compiled against a specific version of the NVIDIA CUDA library; users are directed to the [tensorflow installation](https://www.tensorflow.org/install/gpu) pages for further information.
Usage
medaka can be run using its default settings through the medaka_consensus program. An assembly in .fasta format and basecalls in .fasta or .fastq format are required. The program uses both samtools and minimap2. If medaka has been installed using the from-source method these will be present within the medaka environment, else they will need to be provided by the user.
source ${MEDAKA} # i.e. medaka/venv/bin/activate NPROC=$(nproc) BASECALLS=basecalls.fa DRAFT=draft_assm/assm_final.fa OUTDIR=medaka_consensus medaka_consensus -i ${BASECALLS} -d ${DRAFT} -o ${OUTDIR} -t ${NPROC} -m r94
The variables BASECALLS, DRAFT, and OUTDIR in the above should be set appropriately. When medaka_consensus has finished running, the consensus will be saved to ${OUTDIR}/consensus.fasta.
It is crucially important to specify the correct model, `-m` in the above, according to the basecaller used. Allowed values can be found by running `medaka consensus –help`. For example to run medaka with a model suitable for the flip-flop basecaller in Guppy use `-m r941_flip`.
### Origin of the draft sequence
Medaka has been trained to correct draft sequences processed through [racon](https://github.com/isovic/racon), specifically racon run four times iteratively with:
racon -m 8 -x -6 -g -8 -w 500 …
Processing a draft sequence from alternative sources (e.g. the output of [canu](https://github.com/marbl/canu) or [wtdbg2](https://github.com/ruanjue/wtdbg2)) may lead to poorer results even when the draft is of a superior quality than that obtained from racon.
The [walkthrough](https://nanoporetech.github.io/medaka/walkthrough.html#walkthrough) outlines one recommended workflow rapid construction of a draft for input into medaka. A second approach would be to run canu followed by racon applied twice iteratively before entry into medaka.
Acknowledgements
We thank [Joanna Pineda](https://github.com/jopineda) and [Jared Simpson](https://github.com/jts) for providing htslib code samples which aided greatly development of the optimised feature generation code, and for testing the version 0.4 release candidates.
Help
Licence and Copyright
© 2018 Oxford Nanopore Technologies Ltd.
medaka is distributed under the terms of the Mozilla Public License 2.0.
Research Release
Research releases are provided as technology demonstrators to provide early access to features or stimulate Community development of tools. Support for this software will be minimal and is only provided directly by the developers. Feature requests, improvements, and discussions are welcome and can be implemented by forking and pull requests. However much as we would like to rectify every issue and piece of feedback users may have, the developers may have limited resource for support of this software. Research releases may be unstable and subject to rapid iteration by Oxford Nanopore Technologies.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for medaka-0.5.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a6f6472674690a412ff704bb812acf143bbc6c1c22b6b22260a9baa6668e73a |
|
MD5 | f66842c37c1b9df9296f6c4456da89c3 |
|
BLAKE2b-256 | 56964b273f88330ee8721c731ebc3784895d5f0be4ec9e62ebc5adbf5acfb26e |
Hashes for medaka-0.5.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a398018ccee51ae1638d1a66355e75e5780c71e4aab6033a263b0ca6d95beb2d |
|
MD5 | cc0f04f077d3b46260a8a862dc765347 |
|
BLAKE2b-256 | 58dc02ffe455cc9fe8e5437f7c14386c798f30774a32b81986d0e08178f2a43b |
Hashes for medaka-0.5.2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e61b6a649bd945544a20d2fd0032cb778456310b4faa1da010cfe7f8dc7b9255 |
|
MD5 | dba0f7a076cc92493e6fe6bd50e4686e |
|
BLAKE2b-256 | dfeaca83da715b81858ffeb3d754e78435cfebd48d39534f4849885067ac51eb |