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.3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ed1292614187ab0477d9a1729e7220de577597a18ef66d7e214799e86b59c06 |
|
MD5 | 0a9a822a34e8617359336892649ecd0b |
|
BLAKE2b-256 | 919f866d4982f26548ed8da48f4a7262d0f937acbf4bfbd3288abed247b8d4f6 |
Hashes for ont_pyguppy_client_lib-6.1.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50e2ec9133569354e100d43facbda233bd56822e6333b352494faf38e07a8702 |
|
MD5 | 57ae5373e538307ca28e2e55a69b39a7 |
|
BLAKE2b-256 | 07f9f9714e10e3c08dbd35c82f58743f43cb87296c4dfe46e6c833caebc23e25 |
Hashes for ont_pyguppy_client_lib-6.1.3-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eab24691e5fe651a8bcdce8a5410d553f3776e1c54080a44897d5755ee1a6038 |
|
MD5 | 22b5b5c6b15111cc49b1516ca4bac2f2 |
|
BLAKE2b-256 | a907e8ce71446cbd5700af7ffa33d67664c70de847b3750384849621e1f34abc |
Hashes for ont_pyguppy_client_lib-6.1.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0770e11c06480b704075fb66b7cea1c4fdfbd64113764ba13baad662fd194d95 |
|
MD5 | a2f1ee62e958d3e42cfa0bd6de68d7ec |
|
BLAKE2b-256 | 46473c453370edf0c874a7effecbba47345141d28c18302f4fca240e78c15820 |
Hashes for ont_pyguppy_client_lib-6.1.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c4b52ff1366949b0fd90eab95c69e99ef5906eaa3b0b54ab8c9086b3b88f4c0 |
|
MD5 | 85eb06bb5b93979c2ec58d0ce8f26519 |
|
BLAKE2b-256 | 7e1c1db9421cd634aacfd817a342f08eeb5b71178f171302060bc11dd3b974f2 |
Hashes for ont_pyguppy_client_lib-6.1.3-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b8d0b582d75397160656d290e78d8f268aaade0e6436f469189e9814c76d3f2 |
|
MD5 | b7cdef802ff0e8f4a46efdae687f6025 |
|
BLAKE2b-256 | ab189a095605fc1f6882716db89577b2501d3253d462e59f3e9e5588f7535821 |
Hashes for ont_pyguppy_client_lib-6.1.3-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71125837e8326d2e7d9389fdc38fd9f2d693004b30ccc7be8717bb100dc44358 |
|
MD5 | 821c0f80a2e64e2f9bfb60bb3ddda754 |
|
BLAKE2b-256 | 31318a32f0f9a5d9d873b28e31ec2155cc28356542903a8dcc55f3b803e2a6f6 |
Hashes for ont_pyguppy_client_lib-6.1.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 723c616c100bb0e879a4a7d13d5450f08e97bdf74e04767a85a4f18b1ddecbaf |
|
MD5 | 95298717f45e0d4074f1dc345ee2050d |
|
BLAKE2b-256 | 99614d2797ee37bf58d0f22d6cdb7b04e942522e31a67bf181eae2b84b30416c |
Hashes for ont_pyguppy_client_lib-6.1.3-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6179d572b1b4021355081625b30b799e98c538f08339b128b8833db5855d3d8d |
|
MD5 | a43a81c28bc9dcc43937100f40806d73 |
|
BLAKE2b-256 | 2646691415459a71033b7380c99d9498e7500c98590146b759391ed2ac19bebd |
Hashes for ont_pyguppy_client_lib-6.1.3-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 687d3473ef91e8675cf523a0cae83fb316bf66f4d1e5f678233433958935d621 |
|
MD5 | 270b8461484403cfd62071c2f64a2644 |
|
BLAKE2b-256 | 6ef3509a691880f865a246dd201ebcd27780203995426687b7a411f4e39e59d2 |