LooseLab / readfish

CLI tool for flexible and fast adaptive sampling on ONT sequencers
https://looselab.github.io/readfish/
GNU General Public License v3.0
169 stars 33 forks source link

reads not unblocking as expected #372

Closed shair89 closed 1 month ago

shair89 commented 1 month ago

Hi,

I am running with readfish/minknow6-compatibility alongside Minknow 6.0.8 on a MinION Mk1B.

Everything appears to be working and unblock-all works exactly as expected with a nice peak ~400bp.

However when using readfish targets I get no rejected reads on the Minknow histogram despite the TOML file validating OK and it producing both a log file and a tsv file containing reads which have the decision "unblock". It is also able to output the live.fq and live.paf for the "rejected reads" which look correct - I have double checked and control = false in the TOML and --dry-run = false on the command line. It seems like the unblock decisions are not being fed back to MinKnow?

I have tried with a few different targets options in the TOML file, all with the same result.

command: readfish targets --device MNXXXX --log-file readfish_logs.log --toml readfish.toml --experiment-name "test"

TOML:

[caller_settings.dorado]
config = "dna_r10.4.1_e8.2_400bps_5khz_fast"
address = "ipc:///tmp/.guppy/5555"

# Aligner Configuration
[mapper_settings.mappy_rs]
fn_idx_in = "chm13v2.0.mmi"
n_threads = 10

[[regions]]
name = "Targets"
control = false
min_chunks = 1 # minimum number of chunks before a decision can be made
max_chunks = 4 # maximum number of chunks to use in decision making - after this perform the above_max_chunks action
targets = "chr21" # the important line - setting targets as a path to a bed file, either relative or absolute.
single_on = "stop_receiving"  # Action to take if there is one mapping on target.
multi_on = "stop_receiving"   # Action to take if there is more than one mapping, with at least one target.
single_off = "unblock"        # Action to take if there is one mapping and it is off target
multi_off = "unblock"         # Action to take if there are multiple mappings, where all are off target.
no_seq = "proceed"            # Action to take if no sequence data.
no_map = "proceed"            # Action to take if no alignments returned.
above_max_chunks = "unblock"  # Action to take if above max_chunks.
below_min_chunks = "proceed"  # Action to take if below min_chunks.

Example of log as it's "working":

2024-08-09 15:33:04,903 readfish.targets 0020R/0.2400s; Avg: 0027R/0.2473s; Seq:429; Unb:1,017; Pro:260; Slow batches (>0.80s): 0/61
2024-08-09 15:33:05,322 readfish.targets 0024R/0.2551s; Avg: 0027R/0.2474s; Seq:429; Unb:1,037; Pro:264; Slow batches (>0.80s): 0/62

Hopefully I'm doing something simple wrong but any advice would be appreciated!

Thanks, Steven

github-actions[bot] commented 1 month ago

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

mattloose commented 1 month ago

Hmm - this is a little concerning - you are correct that it looks as though it is working, but if you are not seeing unblocked reads in the minKNOW GUI something is wrong.

Are you running on a bulk file or a live run?

We will do some more testing here - our minknow 6.0 branch isn't technically live yet but it should work!

mattloose commented 1 month ago

Just as a sanity check - if you are running playback - could you try:

targets = ["chr21"]

and not:

targets = "chr21"
shair89 commented 1 month ago

I have tried it on a playback bulk file and on a live sequencing run - both with the same results unfortunately!

I've tried changing the targets (including pointing to a BED file) and it hasn't changed the outcome.

Very confused as the basecalling and mapping does seem to be working behind the scenes - just doesn't then reject the reads it should be.

mattloose commented 1 month ago

OK - my apologies for the issues.

Would you be able to share the log file from the run with us?

shair89 commented 1 month ago

From a very short test run of a few minutes - readfish_targets.log

mattloose commented 1 month ago

OK - we think we've identified a bug - will push a fix but please don't try running again on this branch till this is fixed.

Adoni5 commented 1 month ago

Hi @shair89 - this is fixed in main, and we will do a release to PyPI this week.