Python bindings for the GuppyClient library.
Project description
ont-pyguppy-client-lib
ont-pyguppy-client-lib provides python bindings for connecting to a Guppy basecall server. It allows you to interact with the server to do anything you could normally do using the guppy basecall client. This includes:
Basecalling
Barcoding / demultiplexing
Alignment
For example:
>>> from pyguppy_client_lib.pyclient import PyGuppyClient >>> caller = PyGuppyClient( "127.0.0.1:5555", "dna_r9.4.1_450bps_fast", alignment_index_file="/path/to/index.mmi", bed_file="/path/to/targets.bed" ) >>> caller.connect()
Getting started
ont-pyguppy-client-lib is available on PyPI and may be installed via pip:
pip install ont-pyguppy-client-lib
ont-pyguppy-client-lib requires an instance of the Guppy basecall server is running. Guppy may be obtained from the Oxford Nanopore Community
The version of ont-pyguppy-client-lib should exactly match the version of Guppy being used. You can find your Guppy version like this:
$ <location of guppy_basecall_server>/guppy_basecall_server --version
For example, this Guppy basecall server is version 4.2.2:
$ ./ont-guppy/bin/guppy_basecall_server --version : Guppy Basecall Service Software, (C) Oxford Nanopore Technologies, Limited. Version 4.2.2+effbaf8, client-server API version 3.2.0
Install a specific version of ont-pyguppy-client-lib like this:
pip install ont-pyguppy-client-lib==<version>
Dependencies
ont-pyguppy-client-lib requires numpy in order to run. In order to use included helper functions for reading data from fast5 files it is also necessary to manually install ont-fast5-api:
pip install ont-fast5-api
Documentation and help
Information on the methods available may be viewed through Python’s help command::
>>> from pyguppy_client_lib import pyclient >>> help(pyclient) >>> from pyguppy_client_lib import client_lib >>> help(client_lib)
Interface / Examples
ont-pyguppy-client-lib comprises three Python modules:
pyclient A user-friendly wrapper around guppy_client. This is what you should use to interact with a Guppy basecall server.
guppy_client A compiled library which provides direct Python bindings to Guppy’s C++ API.
helper_functions A set of functions for running a Guppy basecall server and loading reads from fast5 files.
Starting a basecall server
There must be a Guppy basecall server running in order to communicate with it. On most Oxford Nanopore devices a basecall server is always running on port 5555. On other devices, or if you want to run a separate basecall server, you must start one yourself:
from pyguppy_client_lib import helper_functions # A basecall server requires: # * A location to put log files (on your PC) # * An initial config file to load # * A port to run on server_args = ["--log_path", "/home/myuser/guppy_server_logs", "--config", "dna_r9.4.1_450bps_fast.cfg", "--port", 5556] # The second argument is the directory where the # guppy_basecall_server executable is found. Update this as # appropriate. helper_functions.run_server(server_args, "/home/myuser/ont-guppy/bin")
See the Guppy protocol for more information on server arguments.
Create a client and connect to a server
from pyguppy_client_lib.pyclient import PyGuppyClient client = PyGuppyClient( "127.0.0.1:5555", "dna_r9.4.1_450bps_fast" ) client.connect()
Basecall all the reads in a folder
Note that the helper_functions module requires that ont-fast5-api is installed.:
from pyguppy_client_lib import helper_functions # Using the client generated in the previous example results = helper_functions.basecall_with_pyguppy( caller, <input_folder> )
Glossary of Terms:
Guppy - Oxford Nanopore Technologies’ production basecaller, which translates electrical signals measured from nanopores into DNA or RNA bases.
Fast5 - an implementation of the HDF5 file format, with specific data schemas for Oxford Nanopore Technologies sequencing data.
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 Distributions
Built Distributions
Hashes for ont_pyguppy_client_lib-5.1.17-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d4b0d71b30e2bacdc1aba6f38f259aa143a4a012cae37b795cfb25360013005 |
|
MD5 | 57605f688cb6fe2349e337e40b14fc34 |
|
BLAKE2b-256 | 2185ed601632f1a1a18d883a2ef6e01053c51fbe176642afdd300eb3cbf4464d |
Hashes for ont_pyguppy_client_lib-5.1.17-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c1a284ed2bb4b5cd9a768d8e8b5a7ac65f9d9a4a537e2764384108330ae51d6 |
|
MD5 | d476a7cab0072a5f32103b16d4c3f70c |
|
BLAKE2b-256 | 18541a44ad6571cc322826d1cb555129648b404efa29d98775668ad96cb9f51e |
Hashes for ont_pyguppy_client_lib-5.1.17-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c94b7d1f2d746f1cb338f865cefa45fe971f034ee1575d35d83801e8a0daef5 |
|
MD5 | fe5f82c176da5501985f714d51d2f759 |
|
BLAKE2b-256 | eb0353e56e867d7f32bc67eb03537f5d6e3a59b8cbb0e938d6b484f14de5a7dd |
Hashes for ont_pyguppy_client_lib-5.1.17-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3063ad6a98e9e65bf23de653b259ce771e6cdd58be275fc87d64753750c9920e |
|
MD5 | 6d188ddbbadaa03319dc36927cb0409c |
|
BLAKE2b-256 | 60b0a3b3af7d50b1b22cd86c9799971a5a87355013344f4523ea6b35204ffb4d |
Hashes for ont_pyguppy_client_lib-5.1.17-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dddbe07203dd90fabdb7faf6e71d4abd705a8e3086051468a55bfb701870867 |
|
MD5 | c2f56721881658e988f853a6329f8dfc |
|
BLAKE2b-256 | 283247c7c752e6e35035d1c307990c9465e39b5bbf4c5eb282ce9008b41fb0d2 |
Hashes for ont_pyguppy_client_lib-5.1.17-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a1a395e36ce270622d095ffd182b88fe9e7eabf50882716e6de0e1cd3ae9631 |
|
MD5 | 5d0e021ccedfcf39381fbdec3e030239 |
|
BLAKE2b-256 | 101185f27a1c8acdbd41dd8a3971d42be84e38852d7e5ebee448aa564e85c2fa |
Hashes for ont_pyguppy_client_lib-5.1.17-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17b5e8789ff9ca4f55100939d53e447db5bff720e4b21060a78cfedee0f347c8 |
|
MD5 | 270a7151830aadd05adb62d6bbcf11ab |
|
BLAKE2b-256 | 19c4166b95445aaaa0c4482fa0bb990382a25e1a936f7b2dd319cd1a8ae1a70d |
Hashes for ont_pyguppy_client_lib-5.1.17-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8503144448505f2b7913f5333bf5764f3cef0a381b0ab9b6b31e01f0434fb73e |
|
MD5 | 115787edc44973bbbedef468cfb72639 |
|
BLAKE2b-256 | 560970eb3d24a4a1ff28ab22f02e37ee08bededb3d241c8039cb305e2fed791f |
Hashes for ont_pyguppy_client_lib-5.1.17-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 776b607bf5d97c3a7a198a927beac54ff50e49397990c6aaf98d1bc7f4553b1e |
|
MD5 | 16f429a5e4b253b5996724b75c217535 |
|
BLAKE2b-256 | 7f3413b6eca62edb467b759ec111ab158fd22248bbc9effafc90fbb39b2586c5 |