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-4.5.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5789004d6ec63a4bd458e31bc332d74f550f9d9874e619d4b1c89a3130b2796b |
|
MD5 | 909a5910f63a849146b50d78412150ff |
|
BLAKE2b-256 | 748b5399660656dbb0a6d8bfea0089a1f0a917f2e9cd6108e09487f60ebd1924 |
Hashes for ont_pyguppy_client_lib-4.5.3-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 447d01c954804de64a1c60f6d9891d32fdd3a4cefa83f247591eb2d494611170 |
|
MD5 | 877fb47aab135c8d3cd812bd306b27d5 |
|
BLAKE2b-256 | 6b448f0d46c634ec6dc8561371a17141325a5f3b066448e558a62c407a6b7027 |
Hashes for ont_pyguppy_client_lib-4.5.3-cp38-cp38-macosx_10_11_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e2ffb4e95ff3be3a584971e2eca56bc5f88d3b774640305561563742dab0e8c |
|
MD5 | 7403a3c124e3a0dbeb324af5df554c36 |
|
BLAKE2b-256 | e69781002afa463c8a21972270669db1b630d9ff83d4e1bab9934e7ced4fde29 |
Hashes for ont_pyguppy_client_lib-4.5.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 755f403a4c7e1d07e98c65a4c5ac2610246cf313297dbc226eaef13a604ce718 |
|
MD5 | 546674972102087fe6607cded7f0ab7d |
|
BLAKE2b-256 | 245d88b908caf6363e71712ba0a18af25b14b864f5ad361b0ff5f599cfaec619 |
Hashes for ont_pyguppy_client_lib-4.5.3-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37b0fbc674bc15c67330de24a51ccd6bad2e10080fb8e8b60aa548959eb6a5db |
|
MD5 | b008ff2d5f555814d1f64d7c8c038aec |
|
BLAKE2b-256 | 030bf6991acbffb7ab14c78c0fe3276f0acc9a6b0666c5cee12c1f7d8be5e2dc |
Hashes for ont_pyguppy_client_lib-4.5.3-cp37-cp37m-macosx_10_11_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de67bc907854196d02501528117bc6992e61497679447c59f891947c3d8e45bb |
|
MD5 | c794107c7f4202dbae307e3ff310a97b |
|
BLAKE2b-256 | 642e0be56d7c9b2ad2f8413cd7077c6593101b744fbe4eeea35a5e86c6a41228 |
Hashes for ont_pyguppy_client_lib-4.5.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e71567f45f8aba24630c4c2cda7cfbc431047d511b2bec413a1818f8ddfbf397 |
|
MD5 | af2f2975ddce7457c32505e812a40163 |
|
BLAKE2b-256 | 337b37acd34582be8b1a60f03b1d59446c149cf3a1b2f50f0b371774c8c93fbc |
Hashes for ont_pyguppy_client_lib-4.5.3-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09db217d292d9d72c2cc1de0df52fd686bce9e51a99c36fed16b996f455490ce |
|
MD5 | 7702b4936da287773c474a107d8db4cd |
|
BLAKE2b-256 | 596bb70c06ab31ba9543db62c562dfb8a1092ea0cf33e8ca579baeef65cf9aad |
Hashes for ont_pyguppy_client_lib-4.5.3-cp36-cp36m-macosx_10_11_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d7bb8af8cc7e55bd612b925b6a74b72608efaea7f4c0924a3682031a5188a66 |
|
MD5 | c852f8b0db1a39163677a582df248544 |
|
BLAKE2b-256 | 6be546147b4c44b54b1a3f2328cf6ed7c73d904ea13e628babd4533455d281d4 |
Hashes for ont_pyguppy_client_lib-4.5.3-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dd309a3b0738366826191deb9571734c7b0cde99a8c7948d4e1a31741fe01c4 |
|
MD5 | e8ac2a4d4cfe9b67a561647bdc3afb81 |
|
BLAKE2b-256 | 4bed563ee663911a363b1936568e92d149b8aca989f6d868310732eeb61844dd |
Hashes for ont_pyguppy_client_lib-4.5.3-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9f14243b0f701034697afef059b7748eb99191a0e90221a6cf16b4b3e4458d6 |
|
MD5 | 562e8ad06c8843d123e6ffeb765b6a96 |
|
BLAKE2b-256 | 49432a4196ab5e6b84f7e3d6c7b25518588326add30fac53839562b89c9e8e71 |
Hashes for ont_pyguppy_client_lib-4.5.3-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23e261a6b0e9d3f86ad8c9fccc47254e4cf432d0ed664a957dc2375be0c9c737 |
|
MD5 | 810f111864e4b533d53dcc88be18697d |
|
BLAKE2b-256 | 24468e5f101cbd9d3771bc5849aa3d8298887bbd96d46a94fa8a2546d71193d9 |