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.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e48e30b0ccb20e8d48b7f2cb5e69022151684e673d304d5c07962641ab155f11 |
|
MD5 | 281685d1b748e7e5954d60f51213e47e |
|
BLAKE2b-256 | c83afb7e3824d6eae798ecd69b57417e7bf52011ed7f86bf59ff49bec7ca378e |
Hashes for ont_pyguppy_client_lib-6.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b066b71f9d4a38a53012bf9df2442f9d7f9e7b819098960ef9346e3db2f92100 |
|
MD5 | af9d0ab4fc6c5a05c5b201a6cbd9aa74 |
|
BLAKE2b-256 | cc52c15fa88d0f8e1ddf81a6ad72ac4b89eef9d02834ad009ff67151a238a9c1 |
Hashes for ont_pyguppy_client_lib-6.4.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6ff0d7578fe29d5a044669cc0459100107f02aa82aa6f230afc7e63aad925ef |
|
MD5 | b410d5987a34c78ac78ea0eee3909311 |
|
BLAKE2b-256 | cbf196c74b44470f46e3115f4a534179180ce9e65487be1ff3c0d2259f6cc90a |
Hashes for ont_pyguppy_client_lib-6.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaab53d3d12a6cac37efffea8bc351180b3fbc31bffa776d3e55fd7f06d0bbd8 |
|
MD5 | 4b12bbce72ab07ffedfc8be3e2221a3b |
|
BLAKE2b-256 | d7efc336a7511d813037bfb21cb9ab31e6b876ba0e1abbe5de7493554587df72 |
Hashes for ont_pyguppy_client_lib-6.4.2-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9721f7fee4cf7fa23eeb5f67d1dc28f7a17f4dd69de194a39683da68c17b81f |
|
MD5 | 35eecea57cbba28caff3a1e50c0b1dcf |
|
BLAKE2b-256 | 57308457f154fbf4f783eee3ecb8aeb0c96b231d2614f1feab7506b284766757 |
Hashes for ont_pyguppy_client_lib-6.4.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebcf04c6fc500c8dac36b77cbd367591ef3a6afd378a6512ecb9f657cc2f8e4a |
|
MD5 | a7d4f5ba018736a870441f79f51bce15 |
|
BLAKE2b-256 | e66985d3d71d4bf66d21ab3be9961a79f1a9a6b907b64d8a19bdd9504a4330c9 |
Hashes for ont_pyguppy_client_lib-6.4.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97173edc9833563bfcfc4c95a4324f18eed397275eb5678dd5d20924a0417cd7 |
|
MD5 | 587a93df4afee45d862c525129077731 |
|
BLAKE2b-256 | d5e5832ea4c51046c7eb232cf7f359fd4fe9b7112d1069b928398f6e5d4aaba9 |
Hashes for ont_pyguppy_client_lib-6.4.2-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | baecd08d966eebf24b41bc93354135e41e2e568a12f46a4d2bffc7cb6a724f7d |
|
MD5 | 97399dab4740e9c72d412240f6acd454 |
|
BLAKE2b-256 | 6a554ffe5433afc3152e1fa78d0643d87ee4722e5743d646881be792e68e6f17 |
Hashes for ont_pyguppy_client_lib-6.4.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3408bcfcd0ffc913de859ab37a12e6a0e0ec88866bdab318f5e89d227a53df7b |
|
MD5 | 600552f01219a3344e3a5db1effba864 |
|
BLAKE2b-256 | 9f16de92e39c68b4eada241e5c6c86acf77bd5bb812e52587f0198da21f528c7 |
Hashes for ont_pyguppy_client_lib-6.4.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85204d4c85916a1b5d3f6deb371a5fee2c55b08c1baaec19c782f011a4e9213b |
|
MD5 | 36368a3d99a0b4780204f81eb5d36279 |
|
BLAKE2b-256 | e65a99cb580cdd0240b661a098541b1398ce00be1cba4e201e7847d992d7c1a6 |
Hashes for ont_pyguppy_client_lib-6.4.2-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f87efd93a026509027d97d22b7c3aa2bbf15a5114683e4c3550ac748655f867f |
|
MD5 | 4715f414a5a75821c1c35c6d7dc39220 |
|
BLAKE2b-256 | 3b98ea8d60b54cb152a41502459dff5105e3bef083a9cec2b2cd18e169be9b43 |