用于在 ONT 测序仪上实现灵活、快速的自适应采样的 CLI 工具
If you are anything like us (Matt), reading a README is the last thing you do when running code. PLEASE DON'T DO THAT FOR READFISH. This will effect changes to your sequencing and - if you use it incorrectly - cost you money. We have added a list of GOTCHAs at the end of this README. We have almost certainly missed some... so - if something goes wrong, let us know so we can add you to the GOTCHA hall of fame!
[!NOTE]
We also have more detailed documentation for your perusal at https://looselab.github.io/readfish
[!NOTE]
Now also see our cool FAQ.
[!WARNING] Breaking for any version of
MinKNOW =2024.3.0we no longer support guppy.
readfish is a Python package that integrates with the Read Until API.
The Read Until API provides a mechanism for an application to connect to a MinKNOW server to obtain read data in real-time. The data can be analysed in the way most fit for purpose, and a return call can be made to the server to unblock the read in progress and so direct sequencing capacity towards reads of interest.
This implementation of readfish requires Dorado server version >= 7.3.9 and MinKNOW version core >= 6.0.0 . It will not work on earlier versions.
To run with earlier versions of MinKNOW please use an earlier version of readfish.
The code here has been tested with Dorado in GPU mode using GridION Mk1 and NVIDIA RTX4090s on live sequencing runs and on MacOSX M2Max using playback on a simulated run (see below for how to test this). This code is run at your own risk as it DOES affect sequencing output. You are strongly advised to test your setup prior to running (see below for example tests).
The following platforms are supported:
[!WARNING] PromethION support is currently only available using the Mappy-rs plugin only. See here for more information.
The following OSs are supported:
[!NOTE]
Note - MacOS supports is on MinKNOW 5.7 and greater using Dorado basecaller on Apple Silicon devices only.
The paper is available at nature biotechnology and bioRxiv
If you use this software please cite: 10.1038/s41587-020-00746-x
Readfish enables targeted nanopore sequencing of gigabase-sized genomes Alexander Payne, Nadine Holmes, Thomas Clarke, Rory Munro, Bisrat Debebe, Matthew Loose Nat Biotechnol (2020); doi: https://doi.org/10.1038/s41587-020-00746-x
An update preprint is available at bioRxiv
Barcode aware adaptive sampling for Oxford Nanopore sequencers Alexander Payne, Rory Munro, Nadine Holmes, Christopher Moore, Matt Carlile, Matthew Loose bioRxiv (2021); doi: https://doi.org/10.1101/2021.12.01.470722
Our preferred installation method is via conda.
The environment is specified as:
name: readfish
channels:
- bioconda
- conda-forge
- defaults
dependencies:
- python=3.10
- pip
- pip:
- readfish[all]Saving the snippet above as readfish_env.yml and running the following commands will create the environment.
conda env create -f readfish_env.yml
conda activate readfishSome users may encounter an issue with grpcio on apple silicon. This can be fixed by reinstalling grpcio as follows:
pip uninstall grpcio
GRPC_PYTHON_LDFLAGS=" -framework CoreFoundation" pip install grpcio --no-binary :all:A conda yaml file is available for installing with dev dependencies - development.yml
curl -LO https://raw.githubusercontent.com/LooseLab/readfish/e30f1fa8ac7a37bb39e9d8b49251426fe1674c98/docs/development.yml?token=GHSAT0AAAAAACBZL42IS3QVM4ZGPPW4SHB6ZE67V6Q
conda env create -f development.yml
conda activate readfish_dev| ‼️ Important !! |
|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| MinKNOW has now transitioned from Guppy to Dorado. Until MinKNOW version 5.9 both Guppy and Dorado used ont-pyguppy-client-lib.
As of MinKNOW version 5.9 and Dorado server version 7.3.9 and greater Dorado required an alternate library, ont-pybasecall-client-lib, but guppy could still be used.
As of MinKNOW 6.0 Guppy support has been deprecated and only Dorado support is provided. It is important to ensure the correct library is installed for your specific configuration and the listed ont-pyguppy-client-lib or ont-pybasecaller-client-lib version may not match the versions installed on your system. To fix this, Please see this issue, using the appropriate library. |
ONT's Dorado Basecall Server GPU should be installed and running as a server.
Alternatively, install readfish into a python virtual-environment
# Make a virtual environment
python3 -m venv readfish
. ./readfish/bin/activate
pip install --upgrade pip
# Install our readfish Software
pip install readfish[all]
# Install ont_pybasecall_client that matches your dorado basecall server version. E.G.
pip install ont_pybasecall_client_lib==7.1.2Usage
usage: readfish [-h] [--version] ...
positional arguments:
Sub-commands
targets Run targeted sequencing
barcode-targets
Run targeted sequencing
unblock-all Unblock all reads
validate readfish TOML Validator
options:
-h, --help show this help message and exit
--version show program's version number and exit
See ' --help' to read about a specific sub-command.
For information on the TOML files see TOML.md. There are several example TOMLS, with comments explaining what each field does, as well as the overall purpose of the TOML file here .
Testing
To test readfish on your configuration we recommend first running a playback experiment to test unblock speed and then selection.
The following steps should all happen with a configuration (test) flow cell inserted into the target device. A simulated device can also be created within MinKNOW, following these instructions. This assumes that you are runnning MinKNOW locally, using default ports. If this is not the case a developer API token is required on the commands as well, as well as setting the correct port.
If no test flow cell is available, a simulated device can be created within MinKNOW, following the below instructions.
Adding a simulated position for testing
Linux
In the readfish virtual environment we created earlier:
python -m minknow_api.examples.manage_simulated_devices --helppython -m minknow_api.examples.manage_simulated_devices --add MS00000python -m minknow_api.examples.manage_simulated_devices --prom --add S0Mac
In the readfish virtual environment we created earlier:
python -m minknow_api.examples.manage_simulated_devices --helppython -m minknow_api.examples.manage_simulated_devices --add MS00000python -m minknow_api.examples.manage_simulated_devices --prom --add S0As a back up it is possible to restart MinKNOW with a simulated device. This is done as follows:
Stop minknow
On Linux:
cd /opt/ont/minknow/bin
sudo systemctl stop minknowStart MinKNOW with a simulated device
On Linux
sudo ./mk_manager_svc -c /opt/ont/minknow/conf --simulated-minion-devices=1 &You may need to add the host 127.0.0.1 in the MinKNOW UI.
Configuring bulk FAST5 file Playback
Download an open access bulk FAST5 file, either R9.4.1 4khz or R10 (5khz). This file is 21Gb so make sure you have sufficient space. A promethION bulkfile is also available but please note this is R10.4 4khz and so will give slightly unexpected results on MinKNOW which assumes 5khz. This file is approx 35Gb in size.
Previously to set up Playback using a pre-recorded bulk FAST5 file, it was necessary to edit the sequencing configuration file that MinKNOW uses. This is currently no longer the case. The "old method" steps are left after this section for reference only or if the direct playback from a bulk file option is removed in future.
To start sequencing using playback, simply begin setting up the run in the MinKNOW UI as you would usually. Under Run Options you can select Simulated Playback and browse to the downloaded Bulk Fast5 file.
[!NOTE]
Note - The below instructions, whilst they will still work, are no longer required. They are left here for reference only. As of Minknow 5.7, it is possible to select a bulk FAST5 file for playback in the MinKNOW UI.
Old method Configuring bulk FAST5 file Playback
To setup a simulation the sequencing configuration file that MinKNOW uses must be edited. Steps:
暂无开放 Issues,或尚未同步最近议题。