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.7-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2ee9de0f551d99f50393e0036a188fb2c30c1acad08e8cf406d622995c1c4bb |
|
MD5 | 1b96f1501ccf7d2e8413696432fc51ea |
|
BLAKE2b-256 | 135c8087d6246c8190bb9aef1636067f8d2f9b5db88dc9b8fe9355f563132c2d |
Hashes for ont_pyguppy_client_lib-6.3.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff82622cef7793f6450261c125db55bc2684ac18533ad4894ebb17d79c339a3b |
|
MD5 | 059b80278a10962fad783367a0e15b67 |
|
BLAKE2b-256 | f0d962ae202e6b085192bc696a16f9b6aa87404626bb7efdf0dbd45522837afc |
Hashes for ont_pyguppy_client_lib-6.3.7-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4122e1e90e4ea7d2d4b5dce3a9364f882de4c359ef0db971486d9bb46b82cfaa |
|
MD5 | e9d0e056c5e64876c2cbd897bbc25e07 |
|
BLAKE2b-256 | 87f16edcf49ddecef6116cf640c219378093316ca33314f8576eeaf06c9b0cba |
Hashes for ont_pyguppy_client_lib-6.3.7-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a08bed94dcfe252db5ff91b20c9c28f10973dc90fabe60a671d8437c59996f7 |
|
MD5 | a3eb414d360e6d53e87c6bd2a2937835 |
|
BLAKE2b-256 | ffb7c12b8963f802a83adc67793fc333229235cb295f951a656d705063c15def |
Hashes for ont_pyguppy_client_lib-6.3.7-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 297e257579e27e95ae0383dfaf92df52a7264d288a6917cdc7d597d2ea648344 |
|
MD5 | 8dce1670220fd9d5263b7b012cdc924e |
|
BLAKE2b-256 | dbc7ba344342aff75f1793ff8a86c69d01e54595a76c2e45c509bb567dc11750 |
Hashes for ont_pyguppy_client_lib-6.3.7-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3387d8aacba17968f4d854642b898fa3126d0d66464b30df3180a2c3d776393 |
|
MD5 | c38319061bce8b38ed83d8a3a3272638 |
|
BLAKE2b-256 | 8294e26923d6404a3fc6db077a7d4d92a5933d92d0367aa9c4afe68f052be578 |
Hashes for ont_pyguppy_client_lib-6.3.7-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14045ec8ad0042a717f1896d2879372fcea5a5d681b0d85ee7c2b46653985777 |
|
MD5 | 8a15aa37a0a0b40deaea8fd0ce9e95db |
|
BLAKE2b-256 | 29e1a0ee5b04317c6722de053f352f316fb6206c85cb0e4514c3eaeb3cf85508 |
Hashes for ont_pyguppy_client_lib-6.3.7-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a90832d60c50c2461a09cddbf22c824fa8937e88be8d2e176cad6b3e5888e15 |
|
MD5 | bedce498212a5c5ec906ed2ec894ac7f |
|
BLAKE2b-256 | 914dde1c874409291d2b30bc8ef53f7a0105403cc740af5fce311c99c38aed20 |
Hashes for ont_pyguppy_client_lib-6.3.7-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ebc33c959e9a55e95e55cb2f60cac0aec632f2d18255182fedd374d3d204912 |
|
MD5 | 67af0652120ba93670d4881e56df3187 |
|
BLAKE2b-256 | d63a2715a8f0f494e34e7375769a06c02337b4fe5651d2b6431eed01a0e94c15 |
Hashes for ont_pyguppy_client_lib-6.3.7-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ea217598fd67ae5d74b9da2892653948adbf7e1acf8c9cefc3c653f5c396181 |
|
MD5 | 9363cb3e9de6824cdc04b1c05e7f89e0 |
|
BLAKE2b-256 | 17b004120eb24bf4af90a93466fc49738821923f7ffe1e9cd0beaed38cb9fbbe |