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.5-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c73ac7fb8a5c70feddfcb1e7bbfc4f99a492a94103a5549898ced794575e3efe |
|
MD5 | 0ca9a99284ca51a31c66fece0d851d3d |
|
BLAKE2b-256 | 9ebdc398ae1e6ebee294f3f7ea76de346c9de89b23626a70baa77657f77c7f4c |
Hashes for ont_pyguppy_client_lib-6.1.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70f0513237dc464e5bd231de15dda631a70964d3728b3b617ccb35616eb5b3cb |
|
MD5 | 91a155603a79e8cead3f27c87b0fd678 |
|
BLAKE2b-256 | 1f3edfb3ffad7f085e863e0bcb028df70db055bb93a7dfcc776cdc32ec8fde83 |
Hashes for ont_pyguppy_client_lib-6.1.5-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b50f780f150ae3a0fc2ea1d3d7a0cec1db4a3a26b3f9803c246d3af28c2a257 |
|
MD5 | ece81f230272b0c684d6a1b124e8bf10 |
|
BLAKE2b-256 | 21df4653b152116bbd5afa6eb48f458593dc119e0c2f0fea2b3d266ef6c6263c |
Hashes for ont_pyguppy_client_lib-6.1.5-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05a27a8637bd3ce1662461b4faaefb0481522978503b569b042993727dbacbe9 |
|
MD5 | 8a0b49bc5c2721f958b616e41aba2d88 |
|
BLAKE2b-256 | a05e40cb7e9f75ed2707d9c87d4b7fc7494ec9542e1bc31df3b3d3bc012fad64 |
Hashes for ont_pyguppy_client_lib-6.1.5-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66087535e07afbbc59f7253398dba393750f7d9111a7a32954ff09fb07a66501 |
|
MD5 | 4a3f72c737d5739f6dfd8768ea0b82c5 |
|
BLAKE2b-256 | aae9c39b985f25c60a2aad243b7b203117384e368632923598daa9bb060575b5 |
Hashes for ont_pyguppy_client_lib-6.1.5-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e7bae98b5fb14e0b55eac19a2201f852327bccb7cda9aec30c46a67f3dcec3b |
|
MD5 | 33bacd426d427aa52715eab35b6e2f59 |
|
BLAKE2b-256 | 3e2f1a2770f1aae77ad3cdc5a10b124271e4f7d1f53785a452eed0d27e483fcf |
Hashes for ont_pyguppy_client_lib-6.1.5-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b24a20f7c2d4ce5fabd1e193cfb19be4902c2eb69b97efe13a6341983435fdf |
|
MD5 | 0e02c9c7ac1dbf81a106f408b7237012 |
|
BLAKE2b-256 | 81d0e0b77d5bec8122a5ccfd90145d1371c88362958b85c8dddf473999207fe6 |
Hashes for ont_pyguppy_client_lib-6.1.5-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b15ace4be592086eb8fab0f4ab131de6afe762471740b098554e6027e9a764e |
|
MD5 | 43bf70197101da7d571062cb5130bfa1 |
|
BLAKE2b-256 | b9060ea72409c85e14426378b995a094da222b787269dee2b7f88577ea01f9c8 |
Hashes for ont_pyguppy_client_lib-6.1.5-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 520218faebbcc100d801d80092141c521dcf1dfc71a28daed603656f5a28efb4 |
|
MD5 | e315902645c040cf8ddeb19cb863c89a |
|
BLAKE2b-256 | c9663dd46184630dbdec204b6c248841adecbf9144e1cfec897ff1866bffe6c1 |
Hashes for ont_pyguppy_client_lib-6.1.5-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 271d08d27c946b9c722e9598923927852bf1fc9b50bf6e8e9526563beb6f67e0 |
|
MD5 | 367e68ff1cb046a7de43cf1267282575 |
|
BLAKE2b-256 | a9fefe0fd7626881c66a4047dc54e22e1ddf748ee4bf7341fe7b2fb5feb56da7 |