Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dorado plugin #344

Merged
merged 19 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,11 @@ And for our Awesome Logo please checkout out [@tim_bassford](https://twitter.com
<!-- start-changelog -->
# Changelog
## Unreleased changes
1. Change the default `unblock_duration` on the `Analysis` class to use `DEFAULT_UNBLOCK` value defined in `_cli_args.py`. Change type on the Argparser for `--unblock-duration` to float. (#313)
1. Change the default `unblock_duration` on the `Analysis` class to use `DEFAULT_UNBLOCK` value defined in `_cli_args.py`. Change type on the Argparser for `--unblock-duration` to float. [(#313)](/~https://github.com/LooseLab/readfish/pull/313)
1. Fix to handling minimap2 indexes with multiple "." in the filename [(#330)](/~https://github.com/LooseLab/readfish/pull/330/)
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` [(#343)](/~https://github.com/LooseLab/readfish/pull/344)
## 2023.1.1
1. Fix Readme Logo link 🥳 (#296)
1. Fix bug where we had accidentally started requiring barcoded TOMLs to specify a region. Thanks to @jamesemery for catching this. (#299)
1. Correctly handle overriding a decision in internal statistics tracking. (#299)
2. Fix bug where we had accidentally started requiring barcoded TOMLs to specify a region. Thanks to @jamesemery for catching this. (#299)
3. Correctly handle overriding a decision in internal statistics tracking. (#299)
<!-- end-changelog -->
2 changes: 1 addition & 1 deletion docs/developers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ conda env create -f docs/development.yml

## Readfish versioning
Readfish uses [calver](https://calver.org/) for versioning. Specifically the format should be
`YYYY.MINOR.MICRO.Modifier`, where `MINOR` is the feature addiiton, `MICRO` is any hotfix/bugfix, and `Modifier` is the modifier (e.g. `rc` for release candidate, `dev` for development, empty for stable).
`YYYY.MINOR.MICRO.Modifier`, where `MINOR` is the feature addition, `MICRO` is any hotfix/bugfix, and `Modifier` is the modifier (e.g. `rc` for release candidate, `dev` for development, empty for stable).

## Changelog

Expand Down
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ dev = ["readfish[all,docs,tests]", "pre-commit"]
mappy = ["mappy"]
mappy-rs = ["mappy-rs >= 0.0.6"]
guppy = ["ont_pyguppy_client_lib"]
all = ["readfish[mappy,mappy-rs,guppy]"]
dorado = ["ont-pybasecall-client-lib"]
all = ["readfish[mappy,mappy-rs,guppy,dorado]"]

[project.urls]
Documentation = "https://looselab.github.io/readfish"
Expand Down Expand Up @@ -83,3 +84,10 @@ markers = [
"alignment: marks tests which rely on loading or using Mappy or Mappy-rs aligners, used to test with both. (deselect with '-m \"not slow\", select with '-k alignment')",
]
addopts = ["-ra", "--doctest-modules", "--ignore=src/readfish/read_until/base.py"]

[tool.coverage.report]
omit = [
"src/readfish/plugins/dorado.py",
"src/readfish/_read_until_client.py",
"src/readfish/plugins/guppy.py",
]
3 changes: 2 additions & 1 deletion src/readfish/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""__about__.py
Version of the read until software
"""
__version__ = "2023.1.1"

__version__ = "2024.0.0"
1 change: 1 addition & 0 deletions src/readfish/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def load_module(self, override=False):
"""
builtins = {
"guppy": "guppy",
"dorado": "dorado",
"mappy": "mappy",
"mappy_rs": "mappy_rs",
"no_op": "_no_op",
Expand Down
1 change: 1 addition & 0 deletions src/readfish/entry_points/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
readfish stats --toml tests/static/stats_test/yeast_summary_test.toml --fastq-directory tests/static/stats_test/ --html summary_adaptive

"""

from __future__ import annotations
import argparse
from pathlib import Path
Expand Down
5 changes: 4 additions & 1 deletion src/readfish/entry_points/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@


"""

# Core imports
from __future__ import annotations
import argparse
Expand Down Expand Up @@ -171,16 +172,18 @@ def __init__(
self.break_reads_after_seconds = (
self.client.connection.analysis_configuration.get_analysis_configuration().read_detection.break_reads_after_seconds.value
)
self.sample_rate = self.client.connection.device.get_sample_rate().sample_rate
self.logger.info("Run Configuration Received")
self.logger.info(f"run_id={self.run_information.run_id}")
self.logger.info(f"break_reads_after_seconds={self.break_reads_after_seconds}")
self.logger.info(f"sample_rate={self.sample_rate}")
# Create our statistics tracker
self.loop_statistics = ReadfishStatistics(
read_log_name, self.break_reads_after_seconds
)
logger.info("Initialising Caller")
self.caller: CallerABC = self.conf.caller_settings.load_object(
"Caller", run_information=self.run_information
"Caller", run_information=self.run_information, sample_rate=self.sample_rate
)
logger.info("Caller initialised")
caller_description = self.caller.describe()
Expand Down
1 change: 1 addition & 0 deletions src/readfish/entry_points/unblock_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

readfish unblock-all --device X3 --experiment-name "test unblock all"
"""

from tempfile import NamedTemporaryFile

from readfish._cli_args import DEVICE_BASE_ARGS
Expand Down
299 changes: 299 additions & 0 deletions src/readfish/plugins/dorado.py

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions src/readfish/plugins/guppy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Extension of pyguppy Caller that maintains a connection to the basecaller
"""

from __future__ import annotations
import logging
import os
Expand All @@ -13,8 +14,12 @@
import numpy as np
import numpy.typing as npt
from minknow_api.protocol_pb2 import ProtocolRunInfo
from pyguppy_client_lib.helper_functions import package_read
from pyguppy_client_lib.pyclient import PyGuppyClient

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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[caller_settings.guppy]
[caller_settings.dorado]
address = "ipc://tests/static/guppy_validation_test/fail/5555_fail_nw"
config = "dna_r10.4.1_e8.2_400bps_hac"

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
The user account running readfish doesn't appear to have permissions to write to the guppy base-caller socket. Please check permissions on ipc://tests/static/guppy_validation_test/fail/5555_fail_nw. See /~https://github.com/LooseLab/readfish/issues/221#issuecomment-1375673490 for more information.
The user account running readfish doesn't appear to have permissions to write to the dorado base-caller socket. Please check permissions on ipc://tests/static/guppy_validation_test/fail/5555_fail_nw. See /~https://github.com/LooseLab/readfish/issues/221#issuecomment-1375673490 for more information.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[caller_settings.guppy]
[caller_settings.dorado]
address = "ipc://tests/static/guppy_validation_test/fail/5555_not_there"
config = "dna_r10.4.1_e8.2_400bps_hac"

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
The provided guppy base-caller socket address doesn't appear to exist. Please check your Guppy Settings. ipc://tests/static/guppy_validation_test/fail/5555_not_there
The provided dorado base-caller socket address doesn't appear to exist. Please check your dorado Settings. ipc://tests/static/guppy_validation_test/fail/5555_not_there
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[caller_settings.guppy]
[caller_settings.dorado]
address = "ipc://tests/static/guppy_validation_test/fail/5555_fail_nr"
config = "dna_r10.4.1_e8.2_400bps_hac"

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
The user account running readfish doesn't appear to have permissions to read the guppy base-caller socket. Please check permissions on ipc://tests/static/guppy_validation_test/fail/5555_fail_nr. See /~https://github.com/LooseLab/readfish/issues/221#issuecomment-1375673490 for more information.
The user account running readfish doesn't appear to have permissions to read the dorado base-caller socket. Please check permissions on ipc://tests/static/guppy_validation_test/fail/5555_fail_nr. See /~https://github.com/LooseLab/readfish/issues/221#issuecomment-1375673490 for more information.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[caller_settings.guppy]
[caller_settings.dorado]
host = "127.0.0.1"

[mapper_settings.mappy]
Expand Down
Loading