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.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29e65670961ceedc93d0d49c9c629ef4ac7dc5508241936f8e59a4ce16dc8a86 |
|
MD5 | bd6a2f3e373a0034ffaac9b8c73683c0 |
|
BLAKE2b-256 | ae371a6bf81133dcef181b8fb3428b0a51237d5ad92a00112c51a3bddbb12ed5 |
Hashes for ont_pyguppy_client_lib-6.3.8-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af0faf85743bcb5e66d71700377ea2fb01916d87edae23db23c58dadad8558fa |
|
MD5 | 335804afa538b4dba97db06ce84a6886 |
|
BLAKE2b-256 | d35ce9db21eb4d4e1b247693ac46ffd3d4275ffd199be45130f2018b8a3df18b |
Hashes for ont_pyguppy_client_lib-6.3.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83586bf71eba6996c8a4009c7f27cff483e3db4069a9d674414efefc5e2411e2 |
|
MD5 | 900a3df5894a16690bde47e86c1101d4 |
|
BLAKE2b-256 | 2bfdf29c9f0d390d819e66a8328e5c58a5a141b22e9423891b12b78164bcedd7 |
Hashes for ont_pyguppy_client_lib-6.3.8-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 016439788d5e94f5a77647501bb7f0138cd37694f05a78191cab2edef3536496 |
|
MD5 | 334aff6dbe3f115eee40c61691c93004 |
|
BLAKE2b-256 | 42212f8b7e5e9746b7b9c918221faab4a979d021a1f1cd551a07b8c467119d48 |
Hashes for ont_pyguppy_client_lib-6.3.8-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20c3ad7712c36ec398982e97b98f5b6f625a92cacc0b13ca8e84eae764025779 |
|
MD5 | e0e9cba47c77b342fbd1ee613ab1a58e |
|
BLAKE2b-256 | 6135ab2b117edfa5c36c30ccf129557ce99b158f39b8009350b9bb52d787bf27 |
Hashes for ont_pyguppy_client_lib-6.3.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5984c37b5daf495e1661146a299b207529647568d140f7d4fc590f159bc274f |
|
MD5 | 05b64b3000a33d4487ebd1dc7f301915 |
|
BLAKE2b-256 | efd0f8fa50c611983ade7bb8aca5764cf1ad8ed47de38e9ffd05394f4fc12be8 |
Hashes for ont_pyguppy_client_lib-6.3.8-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f4b70f2d2480fcc9c0d6e8f9a3c39a941d0a3acd4a53d829eedb9406fd9619b |
|
MD5 | 4212afd78e1ada2bc54dfee7573c323d |
|
BLAKE2b-256 | da5897c82ebaae237ed05b3be9c0ca5f2cd2d83684ed2db29c61234041a0a154 |
Hashes for ont_pyguppy_client_lib-6.3.8-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b34b07d1759b326dbcf7bbd9f8629ec2417099535cc17514537108ae4cc12b76 |
|
MD5 | 4c13e59b90f746eebe91cfb4fa19642c |
|
BLAKE2b-256 | fbe93548b82a621e10938f0e52972f9c5ba144771f190dc360cf0d0cfa518de8 |
Hashes for ont_pyguppy_client_lib-6.3.8-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b90e8c2c83da2f60e096598c6845d8a702c2cee75d9ccb99b27d4821cd9aebdf |
|
MD5 | 540fa5a10b4bca1fd147215df74fc66d |
|
BLAKE2b-256 | e47a7d39f55d1d29fe97e0f04e3996cb4cf6540e99fe8c7bdb8fd8ce1163c20f |
Hashes for ont_pyguppy_client_lib-6.3.8-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7e322ae761cf0385c9af56e056447511eaee3fb7a87a4f9867d153b5912b711 |
|
MD5 | ec4ada9c4afe2f237423e5a25e99370e |
|
BLAKE2b-256 | 21dc00ceda688eb1dffaf9b0f1dbbc73c642d1c28e3707b743c57fde5a0b51a5 |