Blitzing fast beam search.
$ pip install fast-ctc-decode
>>> 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'
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 |
$ 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.
The original beam search implementation was developed by @usamec for deepnano-blitz.
(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 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.