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.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d77045c0dcb98c8e3fca7de9da69454350f63f37643217bce5490e484303744 |
|
MD5 | 60d5faeaf450e8d004c5b1275febbb5e |
|
BLAKE2b-256 | 5455c35cde6b2d3075203abc7c748fd18408e567adbbeffff4bfb7128eac793c |
Hashes for ont_pyguppy_client_lib-6.3.9-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1b8a2a02bec4e8285d1ebb6f32892aea4a747ebd788742fd53d0f42f6ad4a6f |
|
MD5 | 9e3b01d730522f55b7888ff4d5990741 |
|
BLAKE2b-256 | 68da106585cc924c409b77000c6c58a4a81e4a7560bfcd4452b70b0f97bed051 |
Hashes for ont_pyguppy_client_lib-6.3.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d370e88afa064567447dae65cef7edc58590291dde0588cc19fe075a8e78967b |
|
MD5 | 015707bcd5f1f1e959ef1816c7089659 |
|
BLAKE2b-256 | 182deecd4a796a53e86a03412e6ed698b2286c7b4a50d5305aa6d40d2491f825 |
Hashes for ont_pyguppy_client_lib-6.3.9-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ed2441296eaed74b4766a53e48b36ff75bdf516c855e6f9e404f098b47c5093 |
|
MD5 | 791a5aa2e1126b302baee20109266d96 |
|
BLAKE2b-256 | 50645c637d7020ae7176fd8f039e378c667b29572863409b2498f9af4afc132c |
Hashes for ont_pyguppy_client_lib-6.3.9-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5009fede364449a176fdee77326c393615b3558b46406ffdfae3d716a7c20340 |
|
MD5 | 07f9d8c457aa36bd8e2193596eab675a |
|
BLAKE2b-256 | e5d7cd6b3a8a59cf290001e7d5c1b0b4a92b754bb2de3d4cf09530249d1d99a3 |
Hashes for ont_pyguppy_client_lib-6.3.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f71bc1befd4743a8b0c28d442fcde96f85db7285364c65fc7a3ab4c76194271 |
|
MD5 | a6f73e70778a29f66e78eb5369768d6b |
|
BLAKE2b-256 | d31279b82d2433b3d25e3e0a535d058b409bdeaa34cb10a8219c2bb79b6bfbf7 |
Hashes for ont_pyguppy_client_lib-6.3.9-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bf3138e33ce2d2f2bb77c9233f5a491bea77d0e2a8f3a34702815ad7be958a7 |
|
MD5 | 0bfdf86383dc16b51306a171d4fc8163 |
|
BLAKE2b-256 | 5f1757d2d71131c654eaa5c8441fb161b5c5c9afa41de9a06e44258ebfb19f38 |
Hashes for ont_pyguppy_client_lib-6.3.9-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f48feb7ed5a2eb30fa9cb8431e5c2b669175557b56d57c630e3d464a61342de |
|
MD5 | 26f165ca90a7e824a427b75ebd10ccc5 |
|
BLAKE2b-256 | 308c097f7f760a4d336c46965477c50a7bf2d3ad762da40c821132c5f59373d4 |
Hashes for ont_pyguppy_client_lib-6.3.9-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48cd46390ef6b6f7f9c57eab4c8930ecc6bd4de90ad0d088c7be50055d31481f |
|
MD5 | 9f0452e011304daedef6b2797e2aee84 |
|
BLAKE2b-256 | 2884ad227975a63e327f2fecf4b22cc2265e949390b74fee259a8f213ab51284 |
Hashes for ont_pyguppy_client_lib-6.3.9-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70bf1972ff18142a51e76603a91935d06c0ea46cbfbafbfe347fca3a7a7e261c |
|
MD5 | c5db035c8a246d00a498d60146615b2c |
|
BLAKE2b-256 | d21e4e5d137b4f028335eebda60c9fe1a3855c8247922061b327ecf3353e2ecf |