tadas-subonis / fast-ctc-decode

Blitzing Fast CTC Beam Search Decoder

Home Page:https://nanoporetech.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fast-ctc-decode

test-fast-ctc-decode PyPI version

Blitzing fast beam search.

$ pip install fast-ctc-decode

Usage

>>> from fast_ctc_decode import beam_search
>>>
>>> beam_size = 5
>>> alphabet = "NACGT"
>>> beam_prune_threshold = 0.1
>>> posteriors = np.random.rand(100, len(alphabet)).astype(np.float32)
>>>
>>> seq, path = beam_search(posteriors, alphabet, beam_size, beam_prune_threshold)
>>> seq
'ACACTCGCAGCGCGATACGACTGATCGAGATATACTCAGTGTACACAGT'

Benchmark

Implementation Time (s) URL
Greedy (Python) 0.0022
Beam Search (Rust) 0.0033 nanoporetech/fast-ctc-decode
Beam Search (C++) 0.1034 parlance/ctcdecode
Beam Search (Python) 3.3337 githubharald/CTCDecoder

Developer Quickstart

$ git clone https://github.com/nanoporetech/fast-ctc-decode.git
$ cd fast-ctc-decode
$ pip install --user maturin
$ make test

Note: You'll need a recent rust compiler on your path to build the project.

Credits

The original beam search implementation was developed by @usamec for deepnano-blitz.

Licence and Copyright

(c) 2019 Oxford Nanopore Technologies Ltd.

fast-ctc-decode is distributed under the terms of the MIT License. If a copy of the License was not distributed with this file, You can obtain one at https://github.com/nanoporetech/fast-ctc-decode/

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.

About

Blitzing Fast CTC Beam Search Decoder

https://nanoporetech.com/

License:MIT License


Languages

Language:Rust 55.6%Language:Python 42.8%Language:Shell 1.0%Language:Makefile 0.6%