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.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af08bebebd93ccd5973fc9d6060ba606edd97c004a3c41438a166ac29ba5afdd |
|
MD5 | 9e570bb89eb7a9508e21e41553909c00 |
|
BLAKE2b-256 | 427b39d2712a81301ab6cdec96b39bd6e74dbe27be73bcedd14622abcb5b4399 |
Hashes for ont_pyguppy_client_lib-6.1.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b78d4ff7f03720f5b25e60f453f8e686b9d7b8032de7d85bb235ef23fa52fa0 |
|
MD5 | 87e666322d419711e4e678a105a63e0d |
|
BLAKE2b-256 | c27adfc325f7fb3eaeb5969c81911190ade61dea3b53a9c25781b9e64054d612 |
Hashes for ont_pyguppy_client_lib-6.1.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71b4feca30e846eb5af64a3c176bbe0e765b04ded632f52a3f353c223095a300 |
|
MD5 | d44c209dd974639a2a2c2f66b126d6b9 |
|
BLAKE2b-256 | b67c21fa21430389f392fbcd6b9a482f0fe20bb130e9f688a6b322da8a285a5c |
Hashes for ont_pyguppy_client_lib-6.1.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e66ff20756d5df04ae294d7b8d797a9d5b54e13ce7b6d98e6c5c70054a53f2c |
|
MD5 | 029801ae79957a5a3cbbfa15833b6934 |
|
BLAKE2b-256 | c3ba26b25f5ba47b36af37c67b0fd3b0e9c3a61a3091132ab5fce9f0a0eab8a8 |
Hashes for ont_pyguppy_client_lib-6.1.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff60d267fe1ecd1fce33b93d70e572d2911758321865ca5f9e079d74d1267660 |
|
MD5 | a7f12d12f47f18af2e31a5e82ed57282 |
|
BLAKE2b-256 | 66e18152b0ece721a3ebe704b886c5007838770b87515d30096db4e21064bd3f |
Hashes for ont_pyguppy_client_lib-6.1.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3c3d3b2d180ca4e771aa541cf491c93443db6574daed5e681cf24cbdb5bcad5 |
|
MD5 | de0e20548af0e48358ff6e1ddcb8c998 |
|
BLAKE2b-256 | 0edb4433e7f3963f5f4654539e6f2b7a5484c4fc273c8dba04fe046ff21c8ae8 |
Hashes for ont_pyguppy_client_lib-6.1.2-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d47eaa27d737f0bd942b61b81f6d3c3294f51a86ca0b0950e52229e23b85d142 |
|
MD5 | a4608fd40a29917066f3b5f7a7476d8a |
|
BLAKE2b-256 | 33eb2b20e941be602799d1c5adefa370f80b07c49e0f39c03deb429b9287199d |
Hashes for ont_pyguppy_client_lib-6.1.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3380d2b56f1d0ab0c5a6f864109efc1081835c962f3a3efeeb89cea1418fc3ff |
|
MD5 | a64f67487d995d08457427fac5e8b4d3 |
|
BLAKE2b-256 | c224d0e3bb96777f65bff001e9c730565b3b9435f3611b64f3bda4fcdaf34905 |
Hashes for ont_pyguppy_client_lib-6.1.2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27a73d65bada52070831576740517cab3e361b667eefe42553d8fd2bbba392e4 |
|
MD5 | 0ea019ba0d1fdb605b2abcb8836d9c1e |
|
BLAKE2b-256 | 38ed3321bbd8c569bb73bb33d0c1e5213f96aa53d9e7314620d21e0b14110a96 |
Hashes for ont_pyguppy_client_lib-6.1.2-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6580c795d85b4a6ab6b9d4ec0b814bb32bd2b0e7c87641bc6209d3eecd6de38 |
|
MD5 | 80838ca2275d1ca67ab84e55050138de |
|
BLAKE2b-256 | 502a09a91b6130ba62e8206282adb757189f82ff73340766669c8067291abfe8 |