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.1.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24c73a492aa8ce3b25adc248ee419168172d3188c95d787f629423c8abddb561 |
|
MD5 | 02c16795d99f80456b2fd7dbb4d739ab |
|
BLAKE2b-256 | a69d58d8150c8d07399bae7ef83aa80d58fc63fb3f57e1551af632ed53a26342 |
Hashes for ont_pyguppy_client_lib-6.1.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eb500cc25235ac0721e9edb4f5027917e91c998e3e20e20d47adb1d5ba3e6cc |
|
MD5 | 9910c71d7e6126ee7b765776f8372ac5 |
|
BLAKE2b-256 | 78fda962183184bedf8b2f7daedf4365ac72234b68abd4e33173d0b63add3c3a |
Hashes for ont_pyguppy_client_lib-6.1.1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36843d7bfb2b56d943d5fc3c9de69df086a1f236d338f149f218ff428d3269b6 |
|
MD5 | bb20bfa4f65e9d1afb4a0fb4d2034236 |
|
BLAKE2b-256 | 80ac409dff2042195a134788ab6d0d91e4343c630825918952be043b009bde9a |
Hashes for ont_pyguppy_client_lib-6.1.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffdb0305f966728f5e4d9c4743be1f518d320826de24d904d42328615bf11e3d |
|
MD5 | 42a3a754ab4a866964ec2eb66ee2f19c |
|
BLAKE2b-256 | a848e6e36f00bfabc94164b1cc6d20c9d2c43d0ae080a7cc60e930865b63734e |
Hashes for ont_pyguppy_client_lib-6.1.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08b96f13d0bff547344435be521c65d93ceb545b40e772930f620e6bd667d349 |
|
MD5 | bbf0dc6a30bfcddc08374ba2406c5ef8 |
|
BLAKE2b-256 | c61a394d0b5e22e707e0b9229eae949faf5194c120890b70b07094cec69f9fd0 |
Hashes for ont_pyguppy_client_lib-6.1.1-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aa6d7c13d054e283ad07d3f3ae1cc6fc317e847e707a85ffd74a5a1f4d27c18 |
|
MD5 | d61f9c8cba9c842e12e2dbfbf9c38c12 |
|
BLAKE2b-256 | 8b1304dd03fce79e5d3cf26157696752f4b0698393c8b94c90efe9628bc0830b |
Hashes for ont_pyguppy_client_lib-6.1.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90cb2794a6e8af31515ae893ae8b8f15e83d30756a5ad65a8982226df4856ada |
|
MD5 | c3b0ea635adec0455ba45d29da8204c5 |
|
BLAKE2b-256 | 3a27c6677a7a38ade2aa823bc5e07efc41700014aa8b935b58a428faf7cfce67 |
Hashes for ont_pyguppy_client_lib-6.1.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b70e64c2b64c1e05b17666a88dbc333090a3824047f87ac491c615638ace55e1 |
|
MD5 | f6f3d4d1cef07fcfbbb8460bb08cd819 |
|
BLAKE2b-256 | 90c4f82607158f181e986f2fa057561c02efe574d732e59ecdc916da7261d6ec |
Hashes for ont_pyguppy_client_lib-6.1.1-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a9dfa9e2a37740c80c18b839251460ad837ce9d73563163581d1df30ea9e5b9 |
|
MD5 | f82fdbfe0c0a4d64ccccd3fc6a30b29b |
|
BLAKE2b-256 | d12366c7fef57bced6cb0d370d2de5017bbafa05dadd64b15d002fc3bc76f252 |
Hashes for ont_pyguppy_client_lib-6.1.1-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00ace045c1fe70f90b018c134b1e08f7da7619896064d2add7959b4899ca21d5 |
|
MD5 | 2893640ba33eb2bdb95c042542766ec3 |
|
BLAKE2b-256 | c200a93baac776354186aed03e77476a0e0fc2ad4ae801289462b2d4009f892d |