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.4-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd8c909f3c9f8f5844975eb7b7a0726c3eda8bfb2972251125525114d7efaa42 |
|
MD5 | c4bbbba7584e0934221f5e95fb9332ab |
|
BLAKE2b-256 | 9e0ea89b612712af97b7b0e3c65c249ff8cb338b370f6d6c0952097848f6fc5d |
Hashes for ont_pyguppy_client_lib-6.3.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecc3f6427d124440d75fb307daad912fedc0a3f23954db4107c8eca7cd422a5c |
|
MD5 | 35e3b373a033dc3489c01a8e6087395c |
|
BLAKE2b-256 | b7a6c05f0076aa842b9eaec10ebea2d74204c141dd8e83072ace48d432b58b97 |
Hashes for ont_pyguppy_client_lib-6.3.4-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16e018d15d54acaaeadc6eb1ef3c657bc37d30cee46e1e396b571e760f44d239 |
|
MD5 | 768d2aabb1dec12627291d7bce5d5bee |
|
BLAKE2b-256 | 1c28c7804b8ce68eca8aadde5e9c3839f110fbb654a5c3d1c956e013a9617ca2 |
Hashes for ont_pyguppy_client_lib-6.3.4-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b07bb12eadfe1971c0c90adbd8b9ab6c51aa803f832d7c7625bdca936ed276cc |
|
MD5 | 024b3dd4471a78202f13f7b625416c8a |
|
BLAKE2b-256 | 6a8f47d6abba3ea2e33be9539738e613e784c2e1b6a6905749294dc06fb97373 |
Hashes for ont_pyguppy_client_lib-6.3.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ab8fd8e6b111cb7f3aee0a48b5783a86074bba285b3c59381cad0e6a8eb2052 |
|
MD5 | 39bebfe893379d3a7e08491037df804a |
|
BLAKE2b-256 | 65112fc61c78f52998bff0b5a0a12f3824c70cf7808e68ab87e43f71ff42db2c |
Hashes for ont_pyguppy_client_lib-6.3.4-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b83edb2a845a5084aad81d56eca7c4ec0183e592e8ae4d08a6faf4a49cf061d |
|
MD5 | 30936afbf02316e2ede3f791129078d4 |
|
BLAKE2b-256 | 9746e80115d7a8babcd7607b11759729e0373ec5c16cd98796c50adb12bcc528 |
Hashes for ont_pyguppy_client_lib-6.3.4-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aad317715a24365fda237996752ebc6cb7380846252aa8e932dfa5ee28873c24 |
|
MD5 | f68b9b88f74f1c59085c2b701d93c906 |
|
BLAKE2b-256 | 8cc54e8e5add32501b41934d2ca97f7bf83c6f80dbdf2098d08788b47d3db694 |
Hashes for ont_pyguppy_client_lib-6.3.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a7618623806d8af7e0e517a673a3db2e1cb62b14b322455edfc794d5decc878 |
|
MD5 | 6b7fcbd1aecbc105b035424678dd200b |
|
BLAKE2b-256 | e94e3729e9f96fdb394de79fee9aa63ca52d786d31dee12d2232378619827b53 |
Hashes for ont_pyguppy_client_lib-6.3.4-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c15b6dc8fd66c508c4c8e3d1517b85fd93a3932f48b43430c6c061eb6ffa59be |
|
MD5 | be5621d5b7150b547013efa578e9e551 |
|
BLAKE2b-256 | 584dc6b3b044a256741f887d6cd8efdbe697bd933f80633e1b4fb1c783f7206a |
Hashes for ont_pyguppy_client_lib-6.3.4-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee1e9a9c7fe3b566a1db008f36f947768c2cc2278a5d99bdec644f07867bdd01 |
|
MD5 | f7ca0e1d50343e0cb9231ef7bffb3805 |
|
BLAKE2b-256 | bcb6cd056bb23a5488514b23b96f1a84c5a8db8ab0a9762da06479efd3f5ce3b |