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.2.11-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78555604ea13638730cc374ee3880dbec4048c1b4ce688b6b3b70f56b69d8b08 |
|
MD5 | 3f7d6a681bc4d915b7dc07ba3de37ef3 |
|
BLAKE2b-256 | 616963ba1b64b6334126fea46964701806b731fb28f8499d714211d6a1544dac |
Hashes for ont_pyguppy_client_lib-6.2.11-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f85293614099e05bf0edaa16966791264f2bf5ab05084edb6fbe7981345af3e7 |
|
MD5 | 27ab90bed303e2e370b6535f4fea4f23 |
|
BLAKE2b-256 | d2567ef3d424e81953a74dc4e57816e0aa40816a5ecaca6286bbd2b7b468ed70 |
Hashes for ont_pyguppy_client_lib-6.2.11-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb461c55d9fc7c50c074add396a36805a987c2cc8e807e3d694aa0d610dd65ae |
|
MD5 | beb42a3782f26b48e6f1355ad0b5df12 |
|
BLAKE2b-256 | 8eb6a831578fb43872d6f5726576792acc99429dfb0305d532ed44c02ad3415c |
Hashes for ont_pyguppy_client_lib-6.2.11-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 165c7b2435cfcb106b1fb9d340c34373e36f4687a532ecb82b07dc03c77377fb |
|
MD5 | 51e0ae1bfbdcd7df7b2ddcc29468b896 |
|
BLAKE2b-256 | e3c36ccae5a60c5e62153af48c70e4dcdf8c9b51acadd40447ac5b5e0e007c97 |
Hashes for ont_pyguppy_client_lib-6.2.11-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f353f0e16cd44482a8f1164cc473185ccf76787e305167397e17d6f5fc3f8fd |
|
MD5 | 68036c78d5d14839ae65b5eb43a1d4fd |
|
BLAKE2b-256 | 4917afdd038907759c4df466b822222a1db60f78eacae3774bc469785f92acdb |
Hashes for ont_pyguppy_client_lib-6.2.11-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52bf5ae6189fbf6f791276bbb4a8bb7032bf93cc408e349bc1728ae3d0a203c3 |
|
MD5 | 90e5557f10ad8211ae064824bc84dd8b |
|
BLAKE2b-256 | 227dbbc3032dcf32cd547e649dc782479a136f3f4570464afa86787a1ec41cd9 |
Hashes for ont_pyguppy_client_lib-6.2.11-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6994d87356ececb663c1cb89fae13c0fc780d7bb6a605cf99e31aa0fd974554 |
|
MD5 | 11fbd89c3633cd242cb3c93e3e21a000 |
|
BLAKE2b-256 | 1c9619d8ef9ca0095a982080734f222367bd0bf723f8c9765064e32488512eec |
Hashes for ont_pyguppy_client_lib-6.2.11-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9aa12d99f178d53889c6f3a23e06bd17e7442a15393d8a582f06d4d8805e918b |
|
MD5 | 40fd0db39d631939dbb06ec16db6339f |
|
BLAKE2b-256 | 9a8c522c70f0a02cb1ca31371f0fbfe14f398f6771e3b84f3695314e34c879ba |
Hashes for ont_pyguppy_client_lib-6.2.11-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 040edea4b4d15d3d39e37b7c0b54e349311419906f72b9323cad861a196f031c |
|
MD5 | 1c5d35f2653dade75975319f0ae5f8ad |
|
BLAKE2b-256 | 402c3d1a72383317a0b14d6d6f82ced96149f26e370a0d54afee6a4cf39c1cdd |
Hashes for ont_pyguppy_client_lib-6.2.11-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9d43438da32abfb3737b178d7fbc4e5f21eb64dc743ccc7218e6966a2fe53dc |
|
MD5 | 26803fc3ac774b226899babf947911a2 |
|
BLAKE2b-256 | f70ad76861439ba2d0551e51a91d9c647c6b53b8a6b17a3daf0c2b3fce70ebdf |