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.4.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cc06abef1420e1ba1a92aa60623bfd87faebeefbc604b8963c97391a4bfdefd |
|
MD5 | c308068729ad1fd5c0cd2ac100961d63 |
|
BLAKE2b-256 | dad81de315c973aa1d7ca04cf15b48db4a8771183fbb4d97f6795845d17f8ecf |
Hashes for ont_pyguppy_client_lib-6.4.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78c473ae67bcfed3706fe6fa7e922c517ce59673e4f4aafe3fc2f7263a900a7b |
|
MD5 | 06d452ee3748d50d6851e6012c9f2187 |
|
BLAKE2b-256 | 77f3d68b706651fa96a2c4597cc2b73f3af98253d95b0fb1b9d32541e92f760a |
Hashes for ont_pyguppy_client_lib-6.4.6-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0bcbeef8e90ffcc5abbfa0b348074bb2a5b91eed641639b8123edb9bafaff64 |
|
MD5 | 91d95cde03ad588fcb12cd1a1270dcc6 |
|
BLAKE2b-256 | 4c51781031fe4b5a092eead8369cf87576b9e2102aea36e92b03e0a5ce6d651e |
Hashes for ont_pyguppy_client_lib-6.4.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebe30c53317228c3f3e091dc05b36363e0b1a79b1a77b08284b7ce7003261aa7 |
|
MD5 | 72d19e7004b2c8875d0a73dfaabcdce2 |
|
BLAKE2b-256 | 1eb515c8ec33293d0b4f1eff41756a4d7d12de8ee530d40b83ba693c36e39345 |
Hashes for ont_pyguppy_client_lib-6.4.6-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ce978c544476dc720e3a1a96dca7f601fe4a2ab2812183c7c3591b2e082de27 |
|
MD5 | 9b6b449a51dd86e1abccea1a87d0968f |
|
BLAKE2b-256 | 7c7876ee36723b3c6f454b217eb77c05e5cfeca1dafff296b95653d2a0c9e630 |
Hashes for ont_pyguppy_client_lib-6.4.6-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 926d1c78c84a4b24b2a6f1d738376f2384d313e4724c75fd4d1a46e64aaca1ff |
|
MD5 | 4657ce40c8ed508a6458afc4acae91ef |
|
BLAKE2b-256 | f511b568f642175bb6797aae797121de736bb1913931123f759374426a4c2b14 |
Hashes for ont_pyguppy_client_lib-6.4.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc64cf04a5094772331ae5f4a9924f2036cebdd74cf3182cd5634bb012700901 |
|
MD5 | e28894f405821b583668bdc636002865 |
|
BLAKE2b-256 | f4bd0d0b40acf0dab302882ff4ad659e9c7750f24c12269832018f185ce5f4e8 |
Hashes for ont_pyguppy_client_lib-6.4.6-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9772c6859b06460fb8429a2cd4e43b86e425cc0c5238eb1029917e9aaadd32d4 |
|
MD5 | 5e12c73b9bedae27f5b0edc25810d5ea |
|
BLAKE2b-256 | 6c31df329b63fbe14942ef166cc9f3e4ff922d2dbc7c54d51c61d893ea956562 |
Hashes for ont_pyguppy_client_lib-6.4.6-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5715cf5586b322920f3d589da168defe8e7e54b1b3c4468147f6205c4808a83e |
|
MD5 | 0f8a231b449e7b0fea945d54e27db5ad |
|
BLAKE2b-256 | 3240b181f5c11bc26c1edd36eb930c7317079ae4f108b634a8ea69a0146d273a |
Hashes for ont_pyguppy_client_lib-6.4.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 104c3df22d7d83ffd4bd9a4546e1bbfdd155701038dc5d942509600071ca2f02 |
|
MD5 | c664c0786ec69f9753e6029d729db807 |
|
BLAKE2b-256 | 44ce762d99978bd78f5ce9efcf3ad805a5d062472f49aab4187377c2ce087c4f |
Hashes for ont_pyguppy_client_lib-6.4.6-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c250ab4ecb40e195383e8b99ae52a28f91359eca14487815eb0a2ac18a13c32 |
|
MD5 | af4dd7a4ed3addf129526a233b76be28 |
|
BLAKE2b-256 | dedc479b2025f4536b729354102d1f9e60e8fb641fc1277c93a9fcd0a0111aef |