From de599ba38c0a8b114d82af5f33c6861883e3b367 Mon Sep 17 00:00:00 2001 From: mattloose Date: Wed, 31 Jul 2024 21:42:25 +0100 Subject: [PATCH 1/7] This commit addresses the removal of guppy.py, partial removal of guppy tests, edits to documentation to largely replace guppy with dorado, removes the ont-pyguppy-client-lib and adds a warning to the readme. It also adds some extra classes to the read_until init in targets. --- README.md | 30 +- docs/basecalling-params.md | 24 ++ docs/developers-guide.md | 12 +- docs/guppy-params.md | 38 --- docs/index.md | 2 +- docs/readfish.plugins.rst | 4 +- docs/toml.md | 50 +-- pyproject.toml | 5 +- src/readfish/entry_points/targets.py | 1 + src/readfish/plugins/guppy.py | 292 ------------------ .../pass/001_correct_debug.toml | 14 - .../pass/002_correct_no_debug.toml | 14 - 12 files changed, 80 insertions(+), 406 deletions(-) create mode 100644 docs/basecalling-params.md delete mode 100644 docs/guppy-params.md delete mode 100644 src/readfish/plugins/guppy.py delete mode 100644 tests/static/guppy_validation_test/pass/001_correct_debug.toml delete mode 100644 tests/static/guppy_validation_test/pass/002_correct_no_debug.toml diff --git a/README.md b/README.md index 366b8307..34b42a25 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,10 @@ wrong, let us know so we can add you to the GOTCHA hall of fame! > We also have more detailed documentation for your perusal at https://looselab.github.io/readfish > [!NOTE] -> Now also see our cool [FAQ](docs/FAQ.md). +> Now also see our cool [FAQ](docs/FAQ.md). + +> [!WARNING] +Breaking for any version of `MinKNOW <= 6.0.0` readfish is a Python package that integrates with the [Read Until API](https://github.com/nanoporetech/read_until_api). @@ -23,13 +26,13 @@ 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 Guppy version >= 6.0.0 and MinKNOW version core >= 5.0.0 . It will not work on earlier versions.** +**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.** -**Since MinKNOW version core >=5.9.0 and Dorado server version >=7.3.9, Dorado requires an alternate library, `ont-pybasecall-client-lib`. We have introduced a new`dorado` module to handle this.** +**To run with earlier versions of MinKNOW please use an earlier version of ReadFish.** -The code here has been tested with Guppy in GPU mode using GridION Mk1 and -NVIDIA RTX2080 on live sequencing runs and an NVIDIA GTX1080 using playback +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 @@ -41,6 +44,7 @@ The following platforms are supported: - **PromethION** Big Boy - **P2Solo** Smol Big Boy +- **P2i** Not so Smol Big Boy - **GridION** Box - **MinION** Smol Boy @@ -50,7 +54,7 @@ The following platforms are supported: The following OSs are supported: - **Linux** yay - - **MacOS** boo (Apple Silicon, Only with Dorado) + - **MacOS** boo (Apple Silicon Only) > [!NOTE] @@ -298,8 +302,9 @@ Steps: ``` Change the text between the quotes to point to your downloaded bulk FAST5 file. -1. Optional, If running GUPPY in GPU mode, set the parameter `break_reads_after_seconds = 1.0` +1. Optional, If running Dorado in GPU mode, you can set the parameter `break_reads_after_seconds = 1.0` to `break_reads_after_seconds = 0.4`. This results in a smaller read chunk. For R10.4 this is not required but can be tried. For adaptive sampling on PromethION, this should be left at 1 second. +1. In MinKNOW >= 6.0.0 this value defaults to 0.8 which is a reasonable balance. 1. In the MinKNOW GUI, right click on a sequencing position and select `Reload Scripts`. Your version of MinKNOW will now playback the bulkfile rather than live sequencing. 1. Start a sequencing run as you would normally, selecting the corresponding flow @@ -335,13 +340,10 @@ Note: The plots here are generated from running readfish unblock-all on an Apple

Testing base-calling and mapping

-To test selective sequencing you must have access to either a -[guppy basecall server](https://community.nanoporetech.com/downloads/guppy/release_notes) (>=6.0.0) or a [dorado basecall server](https://community.nanoporetech.com/downloads/dorado/release_notes). +To test selective sequencing you must have access to a [dorado basecall server](https://community.nanoporetech.com/downloads/dorado/release_notes). and a readfish TOML configuration file. -NOTE: guppy and dorado are used here interchangeably as the basecall server. Dorado is gradually replacing guppy. All readfish code is compatible with Guppy >=6.0.0 and dorado >=0.4.0 - 1. First make a local copy of the example TOML file: ```console curl -O https://raw.githubusercontent.com/LooseLab/readfish/master/docs/_static/example_tomls/human_chr_selection.toml @@ -559,6 +561,12 @@ And for our Awesome Logo please checkout out [@tim_bassford](https://twitter.com # Changelog +## 2024.3.0 +1. Introducing support for MinKNOW >=6.0.0 and deprecating support for earlier versions. +1. Removing support for legacy guppy base caller and only supporting Dorado in future. +1. Optimising batch sending to the base caller. +1. Changing default accepted read types to receive from minknow. + ## 2024.2.0 1. Add a dorado base-caller which addressed issue [#347](https://github.com/LooseLab/readfish/issues/347) - chiefly in Dorado 7.3.9 ONT have moved to `ont-pybasecall-client-lib`, and connections from `ont_pyguppy_client_lib` raise `Connection error. ... LOAD_CONFIG. Reply: INVALID_PROTOCOL` [(#344)](https://github.com/LooseLab/readfish/pull/344) diff --git a/docs/basecalling-params.md b/docs/basecalling-params.md new file mode 100644 index 00000000..bb277bd4 --- /dev/null +++ b/docs/basecalling-params.md @@ -0,0 +1,24 @@ +# Base-calling server parameters + +The default settings for `Dorado` GPU should be sufficient for most use cases. + +The one trick we sometimes use, on a _really_ high performance flow cell is to split the GPUs between `readfish` and `dorado`. + +This of course assumes that you have a multiple GPU machine, such as PromethION tower. +In the new P24 towers, there are 4x NVIDIA A100 GPUs. + +1. Stop dorado `sudo systemctl stop doradod` +1. View the available CUDA devices. `nvidia-smi` +1. Restart two dorado instances, splitting the devices between each. + +Dorado: + +```console +/opt/ont/dorado/bin/dorado_basecall_server --log_path /var/log/dorado --config dna_r10.4.1_e8.2_400bps_fast.cfg --ipc_threads 3 --port /tmp/.guppy/5555 --dorado_download_path /opt/ont/dorado-models --device cuda:0 +``` + +```console +/opt/ont/dorado/bin/dorado_basecall_server --log_path /var/log/dorado --config dna_r10.4.1_e8.2_400bps_fast.cfg --ipc_threads 3 --port /tmp/.guppy/5556 --dorado_download_path /opt/ont/dorado-models --device cuda:1 +``` + +1. Start readfish, base calling on port 5556 diff --git a/docs/developers-guide.md b/docs/developers-guide.md index a32c64ad..972b21f3 100644 --- a/docs/developers-guide.md +++ b/docs/developers-guide.md @@ -32,8 +32,8 @@ dev = ["readfish[all,docs,tests]"] # Running dependencies, this is a little bit clunky but works for now mappy = ["mappy"] mappy-rs = ["mappy-rs"] -guppy = ["ont_pyguppy_client_lib"] -all = ["readfish[mappy,mappy-rs,guppy]"] +dorado = ["ont-pybasecall-client-lib"] +all = ["readfish[mappy,mappy-rs,dorado]"] ``` An example install command would be `pip install readfish[all]`. @@ -159,11 +159,11 @@ Plugins are loaded as instances of `_PluginModules` - see source of `_PluginModu This would try to load the `foo` module from the `bar` package. ```toml -[caller_settings.readfish.plugins.guppy] +[caller_settings.readfish.plugins.dorado] ``` -This would load the readfish guppy `Caller` plugin explicitly. -There are instances of "builtin" plugins, which are the included `mappy`, `mappy_rs` and `guppy` plugins. +This would load the readfish dorado `Caller` plugin explicitly. +There are instances of "builtin" plugins, which are the included `mappy`, `mappy_rs` and `dorado` plugins. See the source of `readfish._config._PluginModule.load_module` for more details. ```{eval-rst} .. automethod:: readfish._config._PluginModule.load_module @@ -209,7 +209,7 @@ This next method is important. `validate()` The validate function is intended to be called in the __init__ method, before the actual `Aligner` or `Caller` is initialised. The contents of this method are left up to the author, however we suggest that people check for the things listed above. -The purpose of `validate` is to check that the given parameters will create a valid `Aligner` or `Caller`. For example, in the `guppy.py` `Caller` plugin, we check the permissions of the provided `Guppy` socket. If these are insufficient, Guppy only errors out after a 10 minute timeout. However of this is caught in `validate`, everyone ends up being left a lot happier. +The purpose of `validate` is to check that the given parameters will create a valid `Aligner` or `Caller`. For example, in the `dorado.py` `Caller` plugin, we check the permissions of the provided `dorado` socket. If these are insufficient, dorado only errors out after a 10 minute timeout. However if this is caught in `validate`, everyone ends up being left a lot happier. ```{literalinclude} ../src/readfish/plugins/_mappy.py :language: python diff --git a/docs/guppy-params.md b/docs/guppy-params.md deleted file mode 100644 index e25b803a..00000000 --- a/docs/guppy-params.md +++ /dev/null @@ -1,38 +0,0 @@ -# Base-calling server parameters - -The default settings for `Guppy` GPU should be sufficient for most use cases. -If you are really into optimisation, we recommend reading [Miles Benton's Guppy tuning guide] - until Dorado comes along this all should work. - -The one trick we sometimes use, on a _really_ high performance flow cell is to split the GPUs between `readfish` and `guppy`. - -This of course assumes that you have a multiple GPU machine, such as PromethION tower. -In the new P24 towers, there are 4x NVIDIA A100 GPUs. - -1. Stop guppy `sudo systemctl stop guppyd` or stop dorado `sudo systemctl stop doradod` -1. View the available CUDA devices. `nvidia-smi` -1. Restart two guppy/dorado instances, splitting the devices between each. - -Guppy: - -```console -guppy_basecall_server --port ipc:///tmp/.guppy/5555 --ipc_threads 2 --trim_adapters -c /opt/ont/guppy/data/dna_r10.4.1_e8.2_400bps_fast.cfg -x cuda:0 --log_path /tmp/ -``` - -```console -guppy_basecall_server --port ipc:///tmp/.guppy/5556 --ipc_threads 2 --trim_adapters -c /opt/ont/guppy/data/dna_r10.4.1_e8.2_400bps_fast.cfg -x cuda:1 --log_path /tmp/ -``` - -Dorado: - -```console -/opt/ont/dorado/bin/dorado_basecall_server --log_path /var/log/dorado --config dna_r10.4.1_e8.2_400bps_fast.cfg --ipc_threads 3 --port /tmp/.guppy/5555 --dorado_download_path /opt/ont/dorado-models --device cuda:0 -``` - -```console -/opt/ont/dorado/bin/dorado_basecall_server --log_path /var/log/dorado --config dna_r10.4.1_e8.2_400bps_fast.cfg --ipc_threads 3 --port /tmp/.guppy/5556 --dorado_download_path /opt/ont/dorado-models --device cuda:1 -``` - -1. Start readfish, base calling on port 5556 - - -[Miles Benton's Guppy tuning guide]: https://hackmd.io/@Miles/S12SKP115 diff --git a/docs/index.md b/docs/index.md index 682b4c4f..59aa2362 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,7 +6,7 @@ hidden: true getting-started toml readfish.console -guppy-params +basecalling-params FAQ post-analysis developers-guide diff --git a/docs/readfish.plugins.rst b/docs/readfish.plugins.rst index baab9ff5..27ec23ed 100644 --- a/docs/readfish.plugins.rst +++ b/docs/readfish.plugins.rst @@ -22,10 +22,10 @@ readfish plugins API ---- -``readfish.plugins.guppy`` module +``readfish.plugins.dorado`` module --------------------------------- -.. automodule:: readfish.plugins.guppy +.. automodule:: readfish.plugins.dorado :members: :undoc-members: :show-inheritance: diff --git a/docs/toml.md b/docs/toml.md index 06269b95..80846de9 100644 --- a/docs/toml.md +++ b/docs/toml.md @@ -39,45 +39,45 @@ These are expanded on in the {ref}`barcode configuration ` and ## Plugin configuration Readfish uses "plugins" to configure basecalling and alignment. -We provide some default plugins using Guppy (via [`ont-pyguppy-client-lib`]) and mappy (via [`mappy`]), for basecalling and alignment respectively. +We provide some default plugins using Dorado (via [`ont-pybasecall-client-lib`]) and mappy (via [`mappy`]), for basecalling and alignment respectively. The way that you tell readfish what plugin to load is by specifying it after the table name, for example: ```toml -[caller_settings.guppy] +[caller_settings.dorado] # ^^^^^^ - # Chooses the Guppy plugin + # Chooses the Dorado plugin ``` -This indicates that readfish should use Guppy for basecalling. +This indicates that readfish should use Dorado for basecalling. ### Basecaller -#### Guppy +#### Dorado -This section is specific to the Guppy plugin for basecalling. -The `caller_settings.guppy` [table] specifies the basecalling parameters used by the basecaller. +This section is specific to the Dorado plugin for basecalling. +The `caller_settings.dorado` [table] specifies the basecalling parameters used by the basecaller. An example table is given below: ```toml -[caller_settings.guppy] +[caller_settings.dorado] config = "dna_r10.4.1_e8.2_400bps_hac" address = "ipc:///tmp/.guppy/5555" debug_log = "basecalled_chunks.fq" #optional ``` -The only required keys are `address` and `config` these indicate to Guppy what server to connect to and what basecalling model to load. -The `config` parameter must a valid Guppy configuration excluding the file extension; these are found in the Guppy `data` folder (on linux `ls /opt/ont/guppy/data/*.cfg`). -The `address` is the path to the IPC socket Guppy is listening on, for Guppy servers run by MinKNOW the default is `ipc:///tmp/.guppy/5555`. +The only required keys are `address` and `config` these indicate to Dorado what server to connect to and what basecalling model to load. +The `config` parameter must be a valid Dorado configuration excluding the file extension; these are found in the Dorado `data` folder (on linux `ls /opt/ont/dorado/data/*.cfg`). +The `address` is the path to the IPC socket Dorado is listening on, for Dorado servers run by MinKNOW the default is `ipc:///tmp/.guppy/5555`. Why guppy? Blame history... The `debug_log` is an optional file that the basecalled FASTQ are written to. -| Key | Type | Description | Required | -| ------------: | :----: | :----------------------------------------------------------------------------: | :------- | -| `config` | string | Name of base calling config | True | -| ` address` | string | Address of Guppy socket - default ipc:///tmp/.guppy/5555 | True | +| Key | Type | Description | Required | +| ------------: | :----: |:------------------------------------------------------------------------------:| :------- | +| `config` | string | Name of base calling config | True | +| ` address` | string | Address of Dorado socket - default ipc:///tmp/.guppy/5555 | True | | `debug_log` | string | Optional - Filepath to write out base-calls to - should end in a FASTQ suffix. | False | -Any extra key value pairs are passed varbatim to the `PyGuppyClient` instance upon initialisation as keyword arguments. +Any extra key value pairs are passed verbatim to the `PyBasecallClient` instance upon initialisation as keyword arguments. For example: @@ -85,27 +85,27 @@ For example: server_file_load_timeout = 60 ``` -Will set the `server_file_load_timeout` parameter to 60 seconds for Guppy. +Will set the `server_file_load_timeout` parameter to 60 seconds for Dorado.
-Example Guppy server parameters +Example Dorado server parameters ```{eval-rst} -.. automethod:: pyguppy_client_lib.pyclient.PyGuppyClient.set_params +.. automethod:: pybasecall_client_lib.pyclient.PyBasecallClient.set_params :noindex: ```
-To see parameters that _your_ Guppy installation has run the following python snippet in your `readfish` environment +To see parameters that _your_ Dorado installation has run the following python snippet in your `readfish` environment ```console -PAGER=cat python -c "import pyguppy_client_lib.pyclient as pgc; help(pgc.PyGuppyClient.set_params)" +PAGER=cat python -c "import pybasecall_client_lib.pyclient as pgc; help(pgc.PyBasecallClient.set_params)" ``` #### Basecaller no operation (`no_op`) -In addition to the Guppy basecaller we provide a "no operation" basecaller. +In addition to the Dorado basecaller we provide a "no operation" basecaller. This plugin does nothing. It will only iterate the live chunks of data and pass through the minimal amount of data that is needed for the next steps. This is added using: @@ -306,10 +306,10 @@ Targets given in this format specify the entire contig as a target to select for (barcodes-config)= ## Barcode specific configuration -If you are using Guppy for basecalling then the additional `barcode_kits` parameter is required on the `caller_settings` table. +If you are using Dorado for basecalling then the additional `barcode_kits` parameter is required on the `caller_settings` table. ```toml -[caller_settings.guppy] +[caller_settings.dorado] config = "dna_r10.4.1_e8.2_400bps_fast" address = "ipc:///tmp/.guppy/5555" debug_log = "basecalled_chunks.fq" @@ -405,7 +405,7 @@ This can be disabled by passing the `--no-describe` flag. [tables]: https://toml.io/en/v1.0.0#table [arrays of tables]: https://toml.io/en/v1.0.0#array-of-tables [key-value pairs]: https://toml.io/en/v1.0.0#keyvalue-pair -[`ont-pyguppy-client-lib`]: https://pypi.org/p/ont-pyguppy-client-lib +[`ont-pybasecall-client-lib`]: https://pypi.org/p/ont-pybasecall-client-lib [`mappy`]: https://github.com/lh3/minimap2/tree/master/python [`mappy-rs`]: https://github.com/Adoni5/mappy-rs [`mappy` documentation]: https://github.com/lh3/minimap2/tree/master/python#class-mappyaligner diff --git a/pyproject.toml b/pyproject.toml index cfa247fa..fd85a7e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,14 +48,13 @@ readfish = "readfish._cli_base:main" # Development dependencies docs = ["sphinx-copybutton", "furo", "myst-parser", "faqtory"] tests = ["pytest", "coverage[toml]"] -tests-mappy = ["readfish[tests,mappy,guppy]"] +tests-mappy = ["readfish[tests,mappy]"] dev = ["readfish[all,docs,tests]", "pre-commit"] # Running dependencies, this is a little bit clunky but works for now mappy = ["mappy"] mappy-rs = ["mappy-rs >= 0.0.6"] -guppy = ["ont_pyguppy_client_lib"] dorado = ["ont-pybasecall-client-lib"] -all = ["readfish[mappy,mappy-rs,guppy,dorado]"] +all = ["readfish[mappy,mappy-rs,dorado]"] [project.urls] Documentation = "https://looselab.github.io/readfish" diff --git a/src/readfish/entry_points/targets.py b/src/readfish/entry_points/targets.py index 59eb44e5..362cbed7 100644 --- a/src/readfish/entry_points/targets.py +++ b/src/readfish/entry_points/targets.py @@ -647,6 +647,7 @@ def run( first_channel=1, last_channel=read_until_client.channel_count, max_unblock_read_length_seconds=args.max_unblock_read_length_seconds, + accepted_first_chunk_classifications=["strand", "strand2", "short_strand", "adapter", "unknown_positive"], ) worker = Analysis( diff --git a/src/readfish/plugins/guppy.py b/src/readfish/plugins/guppy.py deleted file mode 100644 index 4432cc0d..00000000 --- a/src/readfish/plugins/guppy.py +++ /dev/null @@ -1,292 +0,0 @@ -"""Guppy plugin module - -Extension of pyguppy Caller that maintains a connection to the basecaller -""" - -from __future__ import annotations -import logging -import os -import time -from collections import namedtuple -from pathlib import Path -from typing import Iterable, TYPE_CHECKING -from packaging.version import parse as parse_version - -import numpy as np -import numpy.typing as npt -from minknow_api.protocol_pb2 import ProtocolRunInfo - -try: - from pyguppy_client_lib.helper_functions import package_read - from pyguppy_client_lib.pyclient import PyGuppyClient -except ImportError: - pass - -from readfish._loggers import setup_logger -from readfish.plugins.abc import CallerABC -from readfish.plugins.utils import Result -from readfish._utils import nice_join - - -if TYPE_CHECKING: - import minknow_api - -__all__ = ["Caller"] - -logger = logging.getLogger("RU_basecaller") -CALIBRATION = namedtuple("calibration", "scaling offset") - - -class DefaultDAQValues: - """Provides default calibration values - - Mimics the read_until_api calibration dict value from - https://github.com/nanoporetech/read_until_api/blob/2319bbe/read_until/base.py#L34 - all keys return scaling=1.0 and offset=0.0 - """ - - calibration = CALIBRATION(1.0, 0.0) - - def __getitem__(self, _): - return self.calibration - - -_DefaultDAQValues = DefaultDAQValues() - - -class Caller(CallerABC): - def __init__( - self, run_information: ProtocolRunInfo = None, debug_log=None, **kwargs - ): - self.logger = setup_logger("readfish_guppy_logger", log_file=debug_log) - self.supported_barcode_kits = None - self.supported_basecall_models = None - self.run_information = run_information - logging.warn( - "Deprecation warning - As ONT has moved fully to dorado, this plugin is no longer maintained, and will be deprecated in a future release of readfish." - ) - if self.run_information: - self.guppy_version = ( - self.run_information.software_versions.guppy_connected_version - ) - - if parse_version(self.guppy_version) < parse_version("7.3.9"): - logging.info(f"Connected to caller version {self.guppy_version}.") - else: - logging.info( - f"Trying to connect to minKNOW with caller version {self.guppy_version}. This plugin requires a version of Dorado or Guppy < 7.3.9. If this is stopping readfish from running try changing [caller_settings.guppy] to [caller_settings.dorado]. You should also check for any updates available to readfish." - ) - - # Set our own priority - self.guppy_params = kwargs - - # Remove the sample rate from the guppy params as it isn't required for the PyGuppyClient - self.guppy_params.pop("sample_rate", None) - self.guppy_params["priority"] = PyGuppyClient.high_priority - # Set our own client name to appear in the guppy server logs - self.guppy_params["client_name"] = "Readfish_connection" - self.validate() - self.caller = PyGuppyClient(**self.guppy_params) - self.caller.connect() - - def validate(self) -> None: - """Validate the parameters passed to Guppy to ensure they will initialise PyGuppy Client correctly - - Currently checks: - 1. That the socket file exists - 2. That the Socket file has the correct permissions - 3. That the version of py guppy client lib installed matches the system version - - :return: None, if the parameters pass all the checks - - """ - for key in ("address", "config"): - if key not in self.guppy_params: - raise KeyError( - f"Required `caller_settings.guppy` {key} was not found in provided TOML. Please add." - ) - if self.guppy_params["address"].startswith("ipc://"): - # User is attempting to connect to an IPC socket - socket_path = Path(self.guppy_params["address"][6:]) - if not socket_path.exists(): - raise FileNotFoundError( - f"The provided guppy base-caller socket address doesn't appear to exist. Please check your Guppy Settings. {self.guppy_params['address']}" - ) - - # check user permissions: - if not os.access(socket_path, os.R_OK): - raise RuntimeError( - f"The user account running readfish doesn't appear to have permissions to read the guppy base-caller socket. Please check permissions on {self.guppy_params['address']}. See https://github.com/LooseLab/readfish/issues/221#issuecomment-1375673490 for more information." - ) - if not os.access(socket_path, os.W_OK): - raise RuntimeError( - f"The user account running readfish doesn't appear to have permissions to write to the guppy base-caller socket. Please check permissions on {self.guppy_params['address']}. See https://github.com/LooseLab/readfish/issues/221#issuecomment-1375673490 for more information." - ) - # If we are connected to a live run, test if the base-caller model is acceptable. - # Connected to a live run via the minknow_api - get supported basecall and barcoding kits from the run info. - # Check them against provided values - if self.run_information is not None: - tags = self.run_information.meta_info.tags - - self.supported_basecall_models = tags[ - "available basecall models" - ].array_value - # Make a CSV str a list of strings, removing quotes and square brackets - if self.supported_basecall_models and isinstance( - self.supported_basecall_models, str - ): - self.supported_basecall_models = ( - tags["available basecall models"] - .array_value[1:-1] - .replace('"', "") - .split(",") - ) - # Faff on with sorting out available barcoding kits - # See https://github.com/nanoporetech/minknow_api/blob/829dbe8ac8e49efdf268d385b50440c52473188b/python/minknow_api/tools/protocols.py#L97C1-L97C7 - self.supported_barcode_kits = tags["barcoding kits"].array_value - # workaround for the set of barcoding kits being returned as a string rather - # that array of strings - if self.supported_barcode_kits and isinstance( - self.supported_barcode_kits, str - ): - self.supported_barcode_kits = ( - tags["barcoding kits"].array_value[1:-1].replace('"', "").split(",") - ) - - if tags["barcoding"].bool_value: - self.supported_barcode_kits.append(tags["kit"].string_value) - # If we are connected to a live run, and have suitable base calling models check the base-caller model is suitable for the flowcell and kit - if ( - self.supported_basecall_models - and f"{self.guppy_params['config'].replace('.cfg', '')}.cfg" - not in self.supported_basecall_models - ): - raise RuntimeError( - """The {} base-calling config listed in the readfish config TOML is not suitable for this flowcell and kit combination. - Please check the guppy_config value in the caller_settings.guppy section of your TOML file. - The following models are are given by ONT as suitable for this flow cell/kit combo:\n\t{}""".format( - self.guppy_params["config"], - nice_join( - self.supported_basecall_models, - sep="\n\t", - conjunction="and", - ), - ) - ) - - # If we are barcoding and have connected to a live run - try checking the listed barcode kit works with the flowcell and kit - if ( - barcoding_kits := self.guppy_params.get("barcode_kits", None) - ) is not None: - barcoding_kits = barcoding_kits.split() - if barcoding_kits and not set(barcoding_kits).issubset( - self.supported_barcode_kits - ): - raise RuntimeError( - "Barcoding kits specified in TOML {} not amongst those supported by the selected kit and protocol.\nSupported kits are:\n\t{}".format( - nice_join(barcoding_kits, conjunction="and"), - nice_join( - self.supported_barcode_kits, sep="\n\t", conjunction="and" - ), - ), - ) - return None - - def disconnect(self) -> None: - """Call the disconnect method on the PyGuppyClient""" - return self.caller.disconnect() - - def basecall( - self, - reads: Iterable[tuple[int, minknow_api.data_pb2.GetLiveReadsResponse.ReadData]], - signal_dtype: npt.DTypeLike, - daq_values: dict[int, namedtuple] = None, - ): - """Basecall live data from minknow RPC - - :param reads: List or generator of tuples containing (channel, MinKNOW.rpc.Read) - :param signal_dtype: Numpy dtype of the raw data - :param daq_values: Dictionary mapping channel to offset and scaling values. - If not provided default values of 1.0 and 0.0 are used. - :yield: - :rtype: readfish.plugins.utils.Result - """ - # FIXME: Occasionally guppy can report a read as not sent when it is - # successfully sent. Therefore we capture not sent reads - cache, skipped = {}, {} - reads_received, reads_sent = 0, 0 - daq_values = _DefaultDAQValues if daq_values is None else daq_values - - for channel, read in reads: - # Attach the "RF-" prefix - read_id = f"RF-{read.id}" - t0 = time.time() - cache[read_id] = (channel, read.number, t0) - success = self.caller.pass_read( - package_read( - read_id=read_id, - raw_data=np.frombuffer(read.raw_data, signal_dtype), - daq_offset=daq_values[channel].offset, - daq_scaling=daq_values[channel].scaling, - ) - ) - if not success: - logging.warning(f"Could not send read {read_id!r} to Guppy") - # FIXME: This is resolved in later versions of guppy. - skipped[read_id] = cache.pop(read_id) - continue - else: - reads_sent += 1 - - sleep_time = self.caller.throttle - t0 - if sleep_time > 0: - time.sleep(sleep_time) - - while reads_received < reads_sent: - results = self.caller.get_completed_reads() - # TODO: incorporate time_received into logging? - # time_received = time.time() - - if not results: - time.sleep(self.caller.throttle) - continue - - for res_batch in results: - for res in res_batch: - read_id = res["metadata"]["read_id"] - try: - channel, read_number, time_sent = cache.pop(read_id) - except KeyError: - # FIXME: This is resolved in later versions of guppy. - channel, read_number, time_sent = skipped.pop(read_id) - reads_sent += 1 - res["metadata"]["read_id"] = read_id[3:] - self.logger.debug( - "@%s ch=%s\n%s\n+\n%s", - res["metadata"]["read_id"], - channel, - res["datasets"]["sequence"], - res["datasets"]["qstring"], - ) - barcode = res["metadata"].get("barcode_arrangement", None) - # TODO: Add Filter here - yield Result( - channel=channel, - read_number=read_number, - read_id=res["metadata"]["read_id"], - seq=res["datasets"]["sequence"], - barcode=barcode if barcode else None, - basecall_data=res, - ) - reads_received += 1 - - def describe(self) -> str: - """ - Describe the guppy Caller - - :return: Description of parameters passed to this guppy Caller plugin - """ - description = ["Utilising the Guppy base-caller plugin:"] - for param in self.guppy_params.keys(): - description.append(f"\t- {param}: {self.guppy_params[param]}") - return "\n".join(description) diff --git a/tests/static/guppy_validation_test/pass/001_correct_debug.toml b/tests/static/guppy_validation_test/pass/001_correct_debug.toml deleted file mode 100644 index dbc44ac2..00000000 --- a/tests/static/guppy_validation_test/pass/001_correct_debug.toml +++ /dev/null @@ -1,14 +0,0 @@ -[caller_settings.no_op] -address = "ipc://tests/static/guppy_validation_test/pass/5555_pass" -config = "dna_r10.4.1_e8.2_400bps_hac" - -[mapper_settings.no_op] - -[[regions]] -name = "abc" -no_seq = "proceed" -no_map = "proceed" -single_on = "proceed" -single_off = "proceed" -multi_on = "proceed" -multi_off = "proceed" diff --git a/tests/static/guppy_validation_test/pass/002_correct_no_debug.toml b/tests/static/guppy_validation_test/pass/002_correct_no_debug.toml deleted file mode 100644 index dbc44ac2..00000000 --- a/tests/static/guppy_validation_test/pass/002_correct_no_debug.toml +++ /dev/null @@ -1,14 +0,0 @@ -[caller_settings.no_op] -address = "ipc://tests/static/guppy_validation_test/pass/5555_pass" -config = "dna_r10.4.1_e8.2_400bps_hac" - -[mapper_settings.no_op] - -[[regions]] -name = "abc" -no_seq = "proceed" -no_map = "proceed" -single_on = "proceed" -single_off = "proceed" -multi_on = "proceed" -multi_off = "proceed" From cb28ecb445191ceaf19bb61f45a89273708a2b56 Mon Sep 17 00:00:00 2001 From: Adoni5 Date: Tue, 20 Aug 2024 13:57:34 +0100 Subject: [PATCH 2/7] Remove builtin module for guppy --- src/readfish/_config.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/readfish/_config.py b/src/readfish/_config.py index 227daeec..8734d8dc 100644 --- a/src/readfish/_config.py +++ b/src/readfish/_config.py @@ -170,7 +170,6 @@ def load_module(self, override=False): override=True, the builtin module names are ignored. """ builtins = { - "guppy": "guppy", "dorado": "dorado", "mappy": "mappy", "mappy_rs": "mappy_rs", From 0c54b580edb3ca46e67962464b525497d9d14fe1 Mon Sep 17 00:00:00 2001 From: Adoni5 Date: Tue, 20 Aug 2024 14:16:32 +0100 Subject: [PATCH 3/7] Update FAQ questions to focus dorado as well as Guppy --- .../creating_readfish-environment.question.md | 16 ++++++++++------ .../questions/py-guppy-client-error.question.md | 17 +++++++++++++---- .../py-guppy-client-version.question.md | 4 ++++ 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/docs/questions/creating_readfish-environment.question.md b/docs/questions/creating_readfish-environment.question.md index 11354c8c..2c10af4f 100644 --- a/docs/questions/creating_readfish-environment.question.md +++ b/docs/questions/creating_readfish-environment.question.md @@ -8,17 +8,21 @@ We recommend using conda to manage your readfish environments, especially on ONT To install conda instructions can be found [here](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html#regular-installation). An explanation is found in an answer to this [issue](https://github.com/LooseLab/readfish/issues/124#issuecomment-759599319) as well. -Once Conda is installed, copy the following code snippet into a file on your system, and replace the X.X.X of the `ont-pyguppy-client-lib` with the version output of +Once Conda is installed, copy the following code snippet into a file on your system, and replace the X.X.X of the `ont-pybasecall-client-lib` with the version output of ```console - guppy_basecall_server --version + dorado_basecall_server --version ``` You should get something like this back - Guppy Basecall Service Software, (C) Oxford Nanopore Technologies plc. Version 6.1.5+446c35524, client-server API version 11.0.0 + : Dorado Basecall Service Software, (C)Oxford Nanopore Technologies plc. Version 7.4.12+0e5e75c49, client-server API version 20.0.0 -The important part is the first three numbers of the version, in this case `6.1.5`. + Use of this software is permitted solely under the terms of the end user license agreement (EULA). + By running, copying or accessing this software, you are demonstrating your acceptance of the EULA. + The EULA may be found in /opt/ont/dorado/bin + +The important part is the first three numbers of the version, in this case `7.4.12`. ```yaml name: readfish @@ -27,10 +31,10 @@ channels: - conda-forge - defaults dependencies: - - python=3.9 + - python=3.11 - pip - pip: - git+https://github.com/nanoporetech/read_until_api@3.4.1 - - ont-pyguppy-client-lib==X.X.X + - ont-pybasecall-client-lib==X.X.X - git+https://github.com/LooseLab/readfish@main ``` diff --git a/docs/questions/py-guppy-client-error.question.md b/docs/questions/py-guppy-client-error.question.md index 49419a99..573abcc7 100644 --- a/docs/questions/py-guppy-client-error.question.md +++ b/docs/questions/py-guppy-client-error.question.md @@ -2,6 +2,7 @@ title: "Connection error. \\[timed_out\\] Timeout waiting for reply to request: LOAD_CONFIG" alt_titles: - "Error connecting to Guppy" + - "Error connecting to Dorado" - "LOAD_CONFIG error when connecting to py-guppy-client" - "LOAD_CONFIG error when connecting to Guppy" --- @@ -9,7 +10,7 @@ alt_titles: N.B. The answer below was taken from this [issue](https://github.com/LooseLab/readfish/issues/221#issuecomment-1375673490) Theoretically this should be caught in the latest readfish release, but if you are still having issues, please try the below. -This error often stems from a couple of sources. To test your Guppy Connection you can run +This error often stems from a couple of sources. To test your Guppy/Dorado Connection you can run ```console python -c 'from pyguppy_client_lib.pyclient import PyGuppyClient as PGC; \ @@ -17,9 +18,17 @@ python -c 'from pyguppy_client_lib.pyclient import PyGuppyClient as PGC; \ c.connect(); print(c)' ``` -Replacing the `5555` (The default guppy port) with whichever port Guppy may be running on. +And for Dorado: -The following tends to be the problem only on Computers which ar not provided by ONT, and have been set up manually. Guppy creates the socket file on which is listens as the `MinKNOW ` User, which doens't allow your User account to read/write to the socket. +```console +python -c 'from pybasecall_client_lib.pyclient import PyBasecallClient as PBC; \ + c = PBC("ipc:///tmp/.guppy/5555", "dna_r9.4.1_450bps_fast.cfg"); \ + c.connect(); print(c)' +``` + +Replacing the `5555` (The default Guppy/Dorado port) with whichever port Guppy/Dorado may be running on. + +The following tends to be the problem only on Computers which ar not provided by ONT, and have been set up manually. Guppy/Dorado creates the socket file on which is listens as the `MinKNOW ` User, which doens't allow your User account to read/write to the socket. To fix this, you can either add yourself to the `minknow` group and give the group write permission , or you can give everyone write permissions to the socket which is a bit less secure (Quick, but maybe try the group thing first). @@ -38,7 +47,7 @@ sudo chmod 775 /tmp/.guppy/5555 Which means any User has all permissions on this file. -Once you have done that if you run the above Python command changing the IPC port to whatever port Guppy is listening on. This is usually found in `/tmp/.guppy`, and can be seen by running `ls /tmp/.guppy` +Once you have done that if you run the above Python command changing the IPC port to whatever port Guppy/Dorado is listening on. This is usually found in `/tmp/.guppy`, and can be seen by running `ls /tmp/.guppy` ```console python -c 'from pyguppy_client_lib.pyclient import PyGuppyClient as PGC; \ diff --git a/docs/questions/py-guppy-client-version.question.md b/docs/questions/py-guppy-client-version.question.md index 2d6ae44b..16ca39a1 100644 --- a/docs/questions/py-guppy-client-version.question.md +++ b/docs/questions/py-guppy-client-version.question.md @@ -4,8 +4,12 @@ alt_titles: - "Error connecting to Guppy" - "LOAD_CONFIG error when connecting to py-guppy-client" - "INVALID_PROTOCOL error when connecting to Guppy" + - "INVALID PROTOCOL" --- +## UPDATE 20/08/2024 +The same all holds true for `Dorado`, although it is necessary to replace `ont-pyguppy-client-lib` with `ont-pybasecall-client-lib` + This is most likely a version mismatch between `ont-pyguppy-client-lib`, the python library that enables readfish to talk to Guppy and the installed version of Guppy. If you open a terminal and run From 369f6a7ba591c6b41c2af609109c72d417fa6cb6 Mon Sep 17 00:00:00 2001 From: Adoni5 Date: Tue, 20 Aug 2024 14:16:51 +0100 Subject: [PATCH 4/7] Change validate caller warning to mention dorado not guppy --- src/readfish/entry_points/validate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/readfish/entry_points/validate.py b/src/readfish/entry_points/validate.py index f98cc0ea..306ab3c1 100644 --- a/src/readfish/entry_points/validate.py +++ b/src/readfish/entry_points/validate.py @@ -83,7 +83,7 @@ def run(parser, args, extras) -> int: except Exception as exc: logger.error("Caller could not be initialised.") logger.error( - "Possible reasons for this include a mismatch between the ont basecaller client and the versions of guppy or dorado you are connecting to." + "Possible reasons for this include a mismatch between the ont basecaller client and the version dorado you are connecting to." ) logger.error( "Additional information is available here: https://looselab.github.io/readfish/FAQ.html#connection-error-bad-reply-could-not-interpret-message-from-server-for-request-load-config-reply-invalid-protocol" From c21194bca061407c359f59009257807f2629bb37 Mon Sep 17 00:00:00 2001 From: Adoni5 Date: Tue, 20 Aug 2024 14:19:54 +0100 Subject: [PATCH 5/7] Change readme warnings to Focus dorado and minknow braking changes more Add link/requiremtn for dorado_basecall_server not guppy_basecall_server --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 34b42a25..df0687aa 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ wrong, let us know so we can add you to the GOTCHA hall of fame! > [!WARNING] Breaking for any version of `MinKNOW <= 6.0.0` +As of `readfish >=2024.3.0` we no longer support guppy. readfish is a Python package that integrates with the [Read Until API](https://github.com/nanoporetech/read_until_api). @@ -28,7 +29,7 @@ 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.** +**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 @@ -132,7 +133,7 @@ conda activate readfish_dev | MinKNOW is transitioning 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 requires an alternate library, `ont-pybasecall-client-lib`.
The listed `ont-pyguppy-client-lib` or `ont-pybasecaller-client-lib` version may not match the version installed on your system. To fix this, Please see this [issue](https://github.com/LooseLab/readfish/issues/221#issuecomment-1381529409), using the appropriate library. | -[ONT's Guppy GPU](https://community.nanoporetech.com/downloads) should be installed and running as a server. +[ONT's Dorado Basecall Server GPU](https://community.nanoporetech.com/downloads) should be installed and running as a server.
Alternatively, install readfish into a python virtual-environment @@ -146,8 +147,8 @@ pip install --upgrade pip # Install our readfish Software pip install readfish[all] -# Install ont_pyguppy_client_lib that matches your guppy server version. E.G. -pip install ont_pyguppy_client_lib==6.3.8 +# Install ont_pybasecall_client that matches your dorado basecall server version. E.G. +pip install ont_pybasecall_client_lib==7.1.2 ```
@@ -562,10 +563,12 @@ And for our Awesome Logo please checkout out [@tim_bassford](https://twitter.com # Changelog ## 2024.3.0 +### This release is breaking for ALL versions of `MinKNOW <= 6` and no longer supports Guppy. + 1. Introducing support for MinKNOW >=6.0.0 and deprecating support for earlier versions. 1. Removing support for legacy guppy base caller and only supporting Dorado in future. -1. Optimising batch sending to the base caller. -1. Changing default accepted read types to receive from minknow. +1. Optimising batch sending to the base caller through the use of `pass_reads` rather than `pass_read` +1. Adding the new strand classifications as used by MinKNOW, including strand2 and short. ## 2024.2.0 1. Add a dorado base-caller which addressed issue [#347](https://github.com/LooseLab/readfish/issues/347) - chiefly in Dorado 7.3.9 ONT have moved to `ont-pybasecall-client-lib`, From b1384fc95071947488bda6a0a69b909f31d620e9 Mon Sep 17 00:00:00 2001 From: Adoni5 Date: Tue, 20 Aug 2024 14:20:14 +0100 Subject: [PATCH 6/7] Rename tests to dorado validation tests --- tests/conftest.py | 2 +- .../README.md | 0 .../fail/001_no_write_socket.txt | 0 .../fail/002_missing_socket.txt | 0 .../fail/003_no_read_socket.txt | 0 .../fail/5555_fail_nr | 0 .../fail/5555_fail_nw | 0 .../pass/001_correct_debug.txt | 0 .../pass/002_correct_no_debug.txt | 0 .../pass/5555_pass | 0 .../fail/001_no_write_socket.toml | 14 -------------- .../fail/002_missing_socket.toml | 14 -------------- .../fail/003_no_read_socket.toml | 14 -------------- tests/validation_test.py | 6 +++--- 14 files changed, 4 insertions(+), 46 deletions(-) rename tests/static/{guppy_validation_test => dorado_validation_test}/README.md (100%) rename tests/static/{guppy_validation_test => dorado_validation_test}/fail/001_no_write_socket.txt (100%) rename tests/static/{guppy_validation_test => dorado_validation_test}/fail/002_missing_socket.txt (100%) rename tests/static/{guppy_validation_test => dorado_validation_test}/fail/003_no_read_socket.txt (100%) rename tests/static/{guppy_validation_test => dorado_validation_test}/fail/5555_fail_nr (100%) rename tests/static/{guppy_validation_test => dorado_validation_test}/fail/5555_fail_nw (100%) rename tests/static/{guppy_validation_test => dorado_validation_test}/pass/001_correct_debug.txt (100%) rename tests/static/{guppy_validation_test => dorado_validation_test}/pass/002_correct_no_debug.txt (100%) rename tests/static/{guppy_validation_test => dorado_validation_test}/pass/5555_pass (100%) delete mode 100644 tests/static/guppy_validation_test/fail/001_no_write_socket.toml delete mode 100644 tests/static/guppy_validation_test/fail/002_missing_socket.toml delete mode 100644 tests/static/guppy_validation_test/fail/003_no_read_socket.toml diff --git a/tests/conftest.py b/tests/conftest.py index 9cf4cddf..474b1326 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -9,7 +9,7 @@ def reset_file_perms(): """ TEST_DIR = Path(__file__).parent.resolve() SEARCH_PATH = Path(TEST_DIR / "static") - nr_socket_path = SEARCH_PATH / "guppy_validation_test" / "fail" / "5555_fail_nr" + nr_socket_path = SEARCH_PATH / "dorado_validation_test" / "fail" / "5555_fail_nr" os.chmod(nr_socket_path, 0o660) diff --git a/tests/static/guppy_validation_test/README.md b/tests/static/dorado_validation_test/README.md similarity index 100% rename from tests/static/guppy_validation_test/README.md rename to tests/static/dorado_validation_test/README.md diff --git a/tests/static/guppy_validation_test/fail/001_no_write_socket.txt b/tests/static/dorado_validation_test/fail/001_no_write_socket.txt similarity index 100% rename from tests/static/guppy_validation_test/fail/001_no_write_socket.txt rename to tests/static/dorado_validation_test/fail/001_no_write_socket.txt diff --git a/tests/static/guppy_validation_test/fail/002_missing_socket.txt b/tests/static/dorado_validation_test/fail/002_missing_socket.txt similarity index 100% rename from tests/static/guppy_validation_test/fail/002_missing_socket.txt rename to tests/static/dorado_validation_test/fail/002_missing_socket.txt diff --git a/tests/static/guppy_validation_test/fail/003_no_read_socket.txt b/tests/static/dorado_validation_test/fail/003_no_read_socket.txt similarity index 100% rename from tests/static/guppy_validation_test/fail/003_no_read_socket.txt rename to tests/static/dorado_validation_test/fail/003_no_read_socket.txt diff --git a/tests/static/guppy_validation_test/fail/5555_fail_nr b/tests/static/dorado_validation_test/fail/5555_fail_nr similarity index 100% rename from tests/static/guppy_validation_test/fail/5555_fail_nr rename to tests/static/dorado_validation_test/fail/5555_fail_nr diff --git a/tests/static/guppy_validation_test/fail/5555_fail_nw b/tests/static/dorado_validation_test/fail/5555_fail_nw similarity index 100% rename from tests/static/guppy_validation_test/fail/5555_fail_nw rename to tests/static/dorado_validation_test/fail/5555_fail_nw diff --git a/tests/static/guppy_validation_test/pass/001_correct_debug.txt b/tests/static/dorado_validation_test/pass/001_correct_debug.txt similarity index 100% rename from tests/static/guppy_validation_test/pass/001_correct_debug.txt rename to tests/static/dorado_validation_test/pass/001_correct_debug.txt diff --git a/tests/static/guppy_validation_test/pass/002_correct_no_debug.txt b/tests/static/dorado_validation_test/pass/002_correct_no_debug.txt similarity index 100% rename from tests/static/guppy_validation_test/pass/002_correct_no_debug.txt rename to tests/static/dorado_validation_test/pass/002_correct_no_debug.txt diff --git a/tests/static/guppy_validation_test/pass/5555_pass b/tests/static/dorado_validation_test/pass/5555_pass similarity index 100% rename from tests/static/guppy_validation_test/pass/5555_pass rename to tests/static/dorado_validation_test/pass/5555_pass diff --git a/tests/static/guppy_validation_test/fail/001_no_write_socket.toml b/tests/static/guppy_validation_test/fail/001_no_write_socket.toml deleted file mode 100644 index 4cf888dd..00000000 --- a/tests/static/guppy_validation_test/fail/001_no_write_socket.toml +++ /dev/null @@ -1,14 +0,0 @@ -[caller_settings.dorado] -address = "ipc://tests/static/guppy_validation_test/fail/5555_fail_nw" -config = "dna_r10.4.1_e8.2_400bps_hac" - -[mapper_settings.no_op] - -[[regions]] -name = "abc" -no_seq = "proceed" -no_map = "proceed" -single_on = "proceed" -single_off = "proceed" -multi_on = "proceed" -multi_off = "proceed" diff --git a/tests/static/guppy_validation_test/fail/002_missing_socket.toml b/tests/static/guppy_validation_test/fail/002_missing_socket.toml deleted file mode 100644 index e21c05f1..00000000 --- a/tests/static/guppy_validation_test/fail/002_missing_socket.toml +++ /dev/null @@ -1,14 +0,0 @@ -[caller_settings.dorado] -address = "ipc://tests/static/guppy_validation_test/fail/5555_not_there" -config = "dna_r10.4.1_e8.2_400bps_hac" - -[mapper_settings.no_op] - -[[regions]] -name = "abc" -no_seq = "proceed" -no_map = "proceed" -single_on = "proceed" -single_off = "proceed" -multi_on = "proceed" -multi_off = "proceed" diff --git a/tests/static/guppy_validation_test/fail/003_no_read_socket.toml b/tests/static/guppy_validation_test/fail/003_no_read_socket.toml deleted file mode 100644 index c7eaf018..00000000 --- a/tests/static/guppy_validation_test/fail/003_no_read_socket.toml +++ /dev/null @@ -1,14 +0,0 @@ -[caller_settings.dorado] -address = "ipc://tests/static/guppy_validation_test/fail/5555_fail_nr" -config = "dna_r10.4.1_e8.2_400bps_hac" - -[mapper_settings.no_op] - -[[regions]] -name = "abc" -no_seq = "proceed" -no_map = "proceed" -single_on = "proceed" -single_off = "proceed" -multi_on = "proceed" -multi_off = "proceed" diff --git a/tests/validation_test.py b/tests/validation_test.py index 1445e61f..2601df3b 100644 --- a/tests/validation_test.py +++ b/tests/validation_test.py @@ -11,14 +11,14 @@ def ch_file_perms(): """ - Change the file permissions on the fake Guppy sockets, if they aren't correct. + Change the file permissions on the fake dorado sockets, if they aren't correct. Most likely this is the case after a fresh clone. Sets the no read socket (5555_fail_nr) to allow no one to read, and the no write socket (5555_fail_nw) to allow no one to write. """ - nr_socket_path = SEARCH_PATH / "guppy_validation_test" / "fail" / "5555_fail_nr" - nw_socket_path = SEARCH_PATH / "guppy_validation_test" / "fail" / "5555_fail_nw" + nr_socket_path = SEARCH_PATH / "dorado_validation_test" / "fail" / "5555_fail_nr" + nw_socket_path = SEARCH_PATH / "dorado_validation_test" / "fail" / "5555_fail_nw" if os.access(nr_socket_path, os.R_OK): os.chmod(nr_socket_path, 0o260) From a6743e5bb9a41eae0322f766d6bc676027531cdd Mon Sep 17 00:00:00 2001 From: Adoni5 Date: Mon, 26 Aug 2024 09:39:04 +0100 Subject: [PATCH 7/7] Add dorado to mappy-test install target --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 765409cc..7f641bb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ readfish = "readfish._cli_base:main" # Development dependencies docs = ["sphinx-copybutton", "furo", "myst-parser", "faqtory"] tests = ["pytest", "coverage[toml]"] -tests-mappy = ["readfish[tests,mappy]"] +tests-mappy = ["readfish[tests,mappy,dorado]"] dev = ["readfish[all,docs,tests]", "pre-commit"] # Running dependencies, this is a little bit clunky but works for now mappy = ["mappy"]