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.7-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d2048721170c4a9533a1d4212b23eed552312fdab05836b3d73c9af55454510 |
|
MD5 | 3b98898e70ba3d684bd711700817e1eb |
|
BLAKE2b-256 | 8c253ba886bfcab2e7ed748fb1b4278606f9ef8aaba69f0353a6ebdbddb51f27 |
Hashes for ont_pyguppy_client_lib-6.1.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfdcd10ca6528c9273a2bb571bf61ca6a7b7f6110bc9ddfbf16fd3b74f7d0491 |
|
MD5 | 11791a2b1010eddd7386fcc4eb08521f |
|
BLAKE2b-256 | 66b07eded6014eac9c8db6999487ee5f4d2c6c2da62f7e123782c5368a80d2d4 |
Hashes for ont_pyguppy_client_lib-6.1.7-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 434937342fbc3bc13fd67dc562b7ce88e2f30c772fca2a37c42c43badc0aef2e |
|
MD5 | 99f7782ffaf9860a1bc6fc95d4c1d9f7 |
|
BLAKE2b-256 | dbda2e0e3a0993188f9772b1b12973d751ab6a47ddfd76517eb638e1005fa3c8 |
Hashes for ont_pyguppy_client_lib-6.1.7-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c990c679634481711714850a3f4f6d588f489c319113b2561e223c7e2a5cfcf |
|
MD5 | 3e8c77c7fd1008bbbf7014ef2438745f |
|
BLAKE2b-256 | 14fb7f646c1030396b183b5cd49de164eb21c92b55fd3b5b2c65723de0db8cf1 |
Hashes for ont_pyguppy_client_lib-6.1.7-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3bcb19aaeffeac339bcdf46cb23214445fcd6e58afbaf771edbb6961677f31e |
|
MD5 | 2f227bbe8a00576596269a05b2944eed |
|
BLAKE2b-256 | 74aa3102282933b9a0ca9fa6ea6135ccc7dc4e0d682504685d2307fbac56f0f9 |
Hashes for ont_pyguppy_client_lib-6.1.7-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea5934b0a9cbc074a8d5f75919ca7a28f1c1c816e403dcfc6740084c36a104df |
|
MD5 | e7905d4b073d99ef7cf1a944fe1e52ab |
|
BLAKE2b-256 | 53b62ef53e2c0bac5e57446afbafa66b782333a734b34d8ebde0802b88a53f3a |
Hashes for ont_pyguppy_client_lib-6.1.7-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9476095da416fb62444e528d72889d2401e4c5c18525f66a3ac26c6acb78c3da |
|
MD5 | f78f478fb2b495cb3296375541b798e8 |
|
BLAKE2b-256 | c20b329c4609d4e122efa3d07b58c3a051e55d9fd7174f22494eee0a1d5c50ed |
Hashes for ont_pyguppy_client_lib-6.1.7-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 714965877279ae1e07849975631dd354a73c66bca84c6de5a464b5162bb83ddf |
|
MD5 | 8552742d28372e6950fc2c128eb3b5b8 |
|
BLAKE2b-256 | fb98b2de459d515e97e8925d85530158e12553d5064499dfb832dbc6e9ba3176 |
Hashes for ont_pyguppy_client_lib-6.1.7-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e73d05c8f4aa70e0a361fb578e6e2feee070b4523c23224d3a04211748aa9c36 |
|
MD5 | c1f6f7b9c5ac2ba7ce41aad199a2ea6c |
|
BLAKE2b-256 | 9e5517da8c4f19c9a26fe5e6c65ed474b0792417ebb2341b683e7ef265ed3fe7 |
Hashes for ont_pyguppy_client_lib-6.1.7-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b46c7b90ed368adcfafac42f2909d8a6077a2fc35936792fe31aa7f88980c2fb |
|
MD5 | 7abe8b79f7d6d0446df9ca4eb87e5381 |
|
BLAKE2b-256 | 1cd980d509bb05744bb70a201b60d11bc9a9930d98ed67d38ed46ac341e0ac71 |