Skip to main content

No project description provided

Project description

Bonito

PyPI version

A PyTorch Basecaller for Oxford Nanopore Reads.

$ pip install ont-bonito
$ bonito basecaller dna_r9.4.1 /data/reads > basecalls.fasta

If a reference is provided in either .fasta or .mmi format then bonito will output in sam format.

$ bonito basecaller dna_r9.4.1 --reference reference.mmi /data/reads > basecalls.sam

Developer Quickstart

$ git clone https://github.com/nanoporetech/bonito.git  # or fork first and clone that
$ cd bonito
$ python3 -m venv venv3
$ source venv3/bin/activate
(venv3) $ pip install --upgrade pip
(venv3) $ pip install -r requirements.txt
(venv3) $ python setup.py develop
(venv3) $ bonito download --models --latest

Training your own model

To train a model using your own reads, first basecall the reads with the additional --save-ctc flag and use the output directory as the input directory for training.

$ bonito basecaller dna_r9.4.1 --save-ctc --reference reference.mmi /data/reads > /data/training/ctc-data/basecalls.sam
$ bonito train --amp --directory /data/training/ctc-data /data/training/model-dir

If you are interested in method development and don't have you own set of reads then a pre-prepared set is provide.

$ bonito download --training
$ bonito train --amp /data/training/model-dir

Automatic mixed precision can be used to speed up training with the --amp flag (however apex needs to be installed manually).

For multi-gpu training use the $CUDA_VISIBLE_DEVICES environment variable to select which GPUs and add the --multi-gpu flag.

$ export CUDA_VISIBLE_DEVICES=0,1,2,3
$ bonito train --amp --multi-gpu --batch 256 /data/model-dir

To evaluate the pretrained model run bonito evaluate dna_r9.4.1.

For a model you have trainined yourself, replace dna_r9.4.1 with the model directory.

Pair Decoding

Pair decoding takes a template and complement read to produce higher quaility calls.

$ bonito pair pairs.csv /data/reads > basecalls.fasta

The pairs.csv file is expected to contain pairs of read ids per line (seperated by a single space).

Interface

  • bonito view - view a model architecture for a given .toml file and the number of parameters in the network.
  • bonito tune - distributed tuning of network hyperparameters.
  • bonito train - train a bonito model.
  • bonito convert - convert a hdf5 training file into a bonito format.
  • bonito evaluate - evaluate a model performance.
  • bonito download - download pretrained models and training datasets.
  • bonito basecaller - basecaller (.fast5 -> .fasta).

Medaka

The Medaka can be downloaded from here.

Coverage B. subtilis E. coli E. faecalis L. monocytogenes P. aeruginosa S. aureus S. enterica
25 38.86 42.60 40.24 41.55 41.55 43.98 36.78
50 39.36 45.23 43.01 43.98 45.34 46.99 38.07
75 43.98 45.23 45.23 45.23 50.00 46.99 38.36
100 43.98 46.99 45.23 46.99 50.00 50.00 39.39
125 45.23 45.23 45.23 45.23 50.00 50.00 39.39
150 45.23 46.99 46.99 46.99 50.00 50.00 39.59
175 45.23 46.99 46.99 46.99 50.00 50.00 39.59
200 46.99 46.99 50.00 50.00 50.00 50.00 40.00

References

Licence and Copyright

(c) 2019 Oxford Nanopore Technologies Ltd.

Bonito is distributed under the terms of the Oxford Nanopore Technologies, Ltd. Public License, v. 1.0. If a copy of the License was not distributed with this file, You can obtain one at http://nanoporetech.com

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ont-bonito-0.3.2a0.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ont_bonito-0.3.2a0-py3-none-any.whl (46.1 kB view details)

Uploaded Python 3

File details

Details for the file ont-bonito-0.3.2a0.tar.gz.

File metadata

  • Download URL: ont-bonito-0.3.2a0.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2

File hashes

Hashes for ont-bonito-0.3.2a0.tar.gz
Algorithm Hash digest
SHA256 2d45b56c511e91a528fbe72392340b64aa88fb69f9ab37dbb9dc803d63407e5b
MD5 bdf78724c7c119d27b1a59e99ce42413
BLAKE2b-256 4fe20f912ead53ac7d84aa202e74ec661d619bf44a736a609eb7e18b9b67ad16

See more details on using hashes here.

File details

Details for the file ont_bonito-0.3.2a0-py3-none-any.whl.

File metadata

  • Download URL: ont_bonito-0.3.2a0-py3-none-any.whl
  • Upload date:
  • Size: 46.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2

File hashes

Hashes for ont_bonito-0.3.2a0-py3-none-any.whl
Algorithm Hash digest
SHA256 c622655cea50f18508ce6830f4f4775bdf1008a83ca168d6ea1cb576ccfc32a1
MD5 9054ab7742915de0414e70f95e29eb47
BLAKE2b-256 da99a3b4beaafacbd03215783a5e9e8f85cefbfcf66ca0d3341a0886acb0f7bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page