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-6.3.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00099c3e6a36cf81cf07d439c0ecb35f9044496310141ca0c8e824c53879095d |
|
MD5 | 0668793fd3cfbdd22e8f17c9ff6a11ad |
|
BLAKE2b-256 | bdd6fd909c9f14a09bdceebd35960b16c75822d7f3ab61c076a0ef3f74624788 |
Hashes for ont_pyguppy_client_lib-6.3.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac0d5dd8bf3ea80a4f46296cc4ca2250fee427036b767c59d1dd3fbb0b18a792 |
|
MD5 | bbed592c4c0bbd0e4eee72f2a0219414 |
|
BLAKE2b-256 | fa85b6880b9ae1d4a7cfdc516c641f0a4d44eb33d461c33df50e71557db07ee6 |
Hashes for ont_pyguppy_client_lib-6.3.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2474f508e3a278d156772f0dfb83fd2f19079784a81d55d32d805ef0e6026c1 |
|
MD5 | d4d6aa07ba06c30dbb1e1693188b7a18 |
|
BLAKE2b-256 | c3851e422c6edb0e8833881d9eb297c46b50db623da2fd37f000a6dfa1a5d0dd |
Hashes for ont_pyguppy_client_lib-6.3.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ce609912869044179b868e4ea1c86822a1668a8728891063b4090cc81cafabf |
|
MD5 | aa8c02189fbd928aab35893365d0b022 |
|
BLAKE2b-256 | cca39c0b56e0538429fe017e0343dd57d40d80772ba18949119abdbeb935373e |
Hashes for ont_pyguppy_client_lib-6.3.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02783503e1b6184cb1bff2b91f4f039cbea5f80a82a3e815a15d65c977c37835 |
|
MD5 | fd60f82a6e216ccb53a99fd060c3de7e |
|
BLAKE2b-256 | 4285ec2e30a96aee6d0ee6eaafbdfa6ba9b705a5ac137d434d573cc5e5d114df |
Hashes for ont_pyguppy_client_lib-6.3.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5a2d0faaebcf6bb8ae930b1b1ccf11cb03305b7404e0ca68cfb98c146d93df2 |
|
MD5 | e6f943fb7b6f36e13efda97f571cc26f |
|
BLAKE2b-256 | 24708bd771d548478794d125521e523b4b1a2552e17393a3ceb5164d41a46af5 |
Hashes for ont_pyguppy_client_lib-6.3.2-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f8b23e77a0cf00a9523831fb78fb380431113c22d30fc97e2e3221d8a304b6f |
|
MD5 | 86a1a16cd4bc463409a28d1f3ffe9990 |
|
BLAKE2b-256 | d368eddb202da310c39ee1dbab1ee7e6e47227635d1a0a1bc4f55af9cb751353 |
Hashes for ont_pyguppy_client_lib-6.3.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a3b08a252a085f6444bb9679f3810022f3bb83b90c227257c20b5107a81fee5 |
|
MD5 | 9ed253b7936400baa6ffb71e4810fc68 |
|
BLAKE2b-256 | 7336ece69c0db2e25a8f79258522a5e36ad29bd3a8117f45b3fb10125071abf2 |
Hashes for ont_pyguppy_client_lib-6.3.2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9e86656e9292f27cb279ee2f3de171f37f50dc8ce3ea0626dd9bc56b50851b7 |
|
MD5 | 8d194526aad32ce02c5e5c2425135712 |
|
BLAKE2b-256 | dcb31a815f06b0eb14010ce54c7993650d24151a195e05efe34523446bbbdec2 |
Hashes for ont_pyguppy_client_lib-6.3.2-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d40495fde5262c106e533c3a51103ab4ea4d409090164ba6a9e19cd8514178ea |
|
MD5 | 71e5d382d4a970c1578c5529b37df2e5 |
|
BLAKE2b-256 | 736e39a97657cdfd61c4e21fe98d84c504791c71dda856efcc058db59fd9e565 |