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.6-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17a96bbb36a091ec6137913979dd69323697d16e5051fb7b8912c26ebdf95254 |
|
MD5 | 4c768db4488d46a751f2a909e13b9e51 |
|
BLAKE2b-256 | b2a98764cc0efea2c1864e86594d850132709a60fc5201495bcf31e6337e4029 |
Hashes for ont_pyguppy_client_lib-6.1.6-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11c91eb74d6a36ef2dc3df3f598c56066798d48f9983d747ab0181196a6da7ba |
|
MD5 | 5bdb3c6d7155ea9e8d3dde9250898ae2 |
|
BLAKE2b-256 | 9e5bb7f7fd72e298e57fbe5ceecaf2d9fcefd6d398d4fb7785e691cf6c8196be |
Hashes for ont_pyguppy_client_lib-6.1.6-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 551c33912f03737174b9b97b9eca4b9c77284964eb447993dd5717b91d9efd3d |
|
MD5 | 64378cbea88214cd27c7b28541c5aef9 |
|
BLAKE2b-256 | 34b6c9d4a96f12519564e1f11ac15cccb9eaeadf116522491f517b81e8955af9 |
Hashes for ont_pyguppy_client_lib-6.1.6-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cac7f7c612f89d2459aa41ef10b5cb9c3faad57d7ffaf23195478043ffce5ee6 |
|
MD5 | 74eb70033f67ede370a18b9804bb0ed0 |
|
BLAKE2b-256 | cb20d5e6815e2f0b686c03ff4996a0c65569c71e681f68be789c1bb614f476d3 |
Hashes for ont_pyguppy_client_lib-6.1.6-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e9ce313e5d75ce7f6791de8d448ca85ddf06ee832effae3b1e8a12ad8ed4b89 |
|
MD5 | 5d87a3066910a809d33e705d41385d0f |
|
BLAKE2b-256 | ce4fa91ddb60a0c2fe791fd103b41d5a466da95bb2bdadae38113538882a42f8 |
Hashes for ont_pyguppy_client_lib-6.1.6-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3708959fd15c76572f27331395af37102a548e28c68f425dd3d913549fa8d580 |
|
MD5 | f56057ba1526b0033dcc5d4d3f7dae27 |
|
BLAKE2b-256 | e4305d67369e8117888f2665557be5106bc3057827a3db4165f4249ee2db0f8b |
Hashes for ont_pyguppy_client_lib-6.1.6-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0737b1f921265dc3413d907fe11c5cc4aa0a5cdbfe612c83a5657a519eb92364 |
|
MD5 | 92aa3c00385ec4eaad10ad5f776e4aa1 |
|
BLAKE2b-256 | cf0a0814291976250f2c51808d32b3ca47eddc93b2a4c2ce9baf7a24bac7561d |
Hashes for ont_pyguppy_client_lib-6.1.6-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51fb9815692fd9b00027b66b0f156d135a3c41c2f367d321d821d7025ef89325 |
|
MD5 | 73473d345e841771d36df5da92abab97 |
|
BLAKE2b-256 | e1012d57efe62e87dc512960ad5b40cde604fac574fdede0f17594d9c3e9b4e0 |
Hashes for ont_pyguppy_client_lib-6.1.6-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5604c4434daabd1404c9ccfbd390949d2d5603d342aa68eab88b9b07574eeb30 |
|
MD5 | 055fa6e60977746e20fd15bf1bee5051 |
|
BLAKE2b-256 | 4e4a7ae28262a885d5a3b6197db3513718eda2f84eaf0915ab5757962d33860a |
Hashes for ont_pyguppy_client_lib-6.1.6-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a9b7093349b95bcab4aa9ce81e6f10d6eb33ce234c73be880f46d54923a52fb |
|
MD5 | e65fef4d12b4cff9fac940a6efe5856d |
|
BLAKE2b-256 | 76806bd30d67c8b5e62d90595a5b102c280fb53f3d4c35a9c8a1c4598dd5d52c |