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

Guppy Server Connection Error #195

Closed 12032345 closed 2 years ago

12032345 commented 2 years ago

Hi, dear author,

I had a guppy connection error to run readfish on gridion. I tried the solutions mentioned in these issue170,issue190 and changing the host in the TOML file to the guppy IPC address, but it doesn't seem to work. It get stunk when running readfish:

targets --device X1 --experiment-name "RU Test" --toml balf.toml --log-file balf_test.log
2022-05-01 11:40:21,979 ru.ru_gen /home/grid/miniconda3/envs/readfish/bin/readfish targets --device X1 --experiment-name RU Test --toml balf.toml --log-file balf_test.log
2022-05-01 11:40:21,979 ru.ru_gen batch_size=512
2022-05-01 11:40:21,979 ru.ru_gen cache_size=512
2022-05-01 11:40:21,979 ru.ru_gen channels=[1, 512]
2022-05-01 11:40:21,980 ru.ru_gen chunk_log=None
2022-05-01 11:40:21,980 ru.ru_gen command=targets
2022-05-01 11:40:21,980 ru.ru_gen device=X1
2022-05-01 11:40:21,980 ru.ru_gen dry_run=False
2022-05-01 11:40:21,980 ru.ru_gen experiment_name=RU Test
2022-05-01 11:40:21,980 ru.ru_gen func=<function run at 0x7f7f20cd1a60>
2022-05-01 11:40:21,980 ru.ru_gen host=127.0.0.1
2022-05-01 11:40:21,980 ru.ru_gen log_file=balf_test.log
2022-05-01 11:40:21,980 ru.ru_gen log_format=%(asctime)s %(name)s %(message)s
2022-05-01 11:40:21,980 ru.ru_gen log_level=info
2022-05-01 11:40:21,980 ru.ru_gen paf_log=None
2022-05-01 11:40:21,980 ru.ru_gen port=None
2022-05-01 11:40:21,980 ru.ru_gen run_time=172800
2022-05-01 11:40:21,980 ru.ru_gen throttle=0.4
2022-05-01 11:40:21,980 ru.ru_gen toml=balf.toml
2022-05-01 11:40:21,980 ru.ru_gen unblock_duration=0.1
2022-05-01 11:40:21,980 ru.ru_gen workers=1
2022-05-01 11:40:22,532 ru.ru_gen Initialising minimap2 mapper
2022-05-01 11:40:24,648 ru.ru_gen Mapper initialised
2022-05-01 11:40:24,723 ru.ru_gen This experiment has 1 region on the flowcell
2022-05-01 11:40:24,724 ru.ru_gen Using reference: /home/grid/readfish_files/balf_0414.mmi
2022-05-01 11:40:26,319 ru.ru_gen Region 'test' (control=False) has 25069 contigs of which 25069 are in the reference. There are 50138 targets (including +/- strand) representing 99.82% of the reference. Reads will be unblocked when classed as single_on or multi_on; sequenced when classed as single_off or multi_off; and polled for more data when classed as no_map or no_seq.

The software version is:

readfish:0.0.9a3 guppy:5.1.13 MinKNOW:21.11.7 MinKNOW core:4.5.4

The TOML file is:

[caller_settings]
config_name = "dna_r9.4.1_450bps_fast"
host = "ipc://"
port = 5555

[conditions]
reference = "/home/grid/readfish_files/balf_0414.mmi"

[conditions.0]
name = "test"
control = false
min_chunks = 0
max_chunks = inf
targets = "/home/grid/readfish_files/classified_human_id"
single_on = "unblock"
multi_on = "unblock"
single_off = "stop_receiving"
multi_off = "stop_receiving"
no_seq = "proceed"
no_map = "proceed"

When I try:

opt/ont/guppy/bin/guppy_basecall_server --config /opt/ont/guppy/data/dna_r9.4.1_450bps_fast.cfg --log_path ./ --port 5555

The result is:

log path:            ./
chunk size:          2000
chunks per runner:   160
max queued reads:    2000
num basecallers:     1
num socket threads:  2
max returned events: 50000
cpu mode:             ON
threads per caller:  4

Config loaded:
config file:               /opt/ont/guppy/data/dna_r9.4.1_450bps_fast.cfg
model file:                /opt/ont/guppy/data/template_r9.4.1_450bps_fast.jsn
model version id           2021-05-17_dna_r9.4.1_minion_96_29d8704b
adapter scaler model file: None

Starting server on port: ipc://5555

And when I try running:

python -c 'from pyguppy_client_lib.pyclient import PyGuppyClient as PGC; \
           c = PGC("ipc://5555", "dna_r9.4.1_450bps_fast.cfg"); \
c.connect(); print(c)

An error like "Connection error: Connection attempt timed out: result.timed_out" occurred.

This also seems to be due to the problem that guppy cannot connect. How to solve this problem on gridion?

Eager to get your help! Thanks in advance!!

best, Sophie

alexomics commented 2 years ago

Hi Sophie, with your readfish environment activated could you run:

pip show ont-pyguppy-client-lib

If the version number for the installed pyguppy client matches your installed Guppy version then you may need to run the server in a different directory. Typically we choose /tmp/ though the $HOME directory may also work.

12032345 commented 2 years ago

Hi Alex,

Thank you very much for your kind reply.

I checked that the version number of pyguppy client and the version of Guppy do match (5.1.13).

I don't quite understand what you mean by running the server in a different directory. In fact, we never additionally ran guppy on GridION when we used previous versions of readfish, it seems to call guppy directly on GridION. Nonetheless, I tried running the following command while running readfish:

(readfish) grid@GXB01352:/tmp$ /opt/ont/guppy/bin/guppy_basecall_server --config /opt/ont/guppy/data/dna_r9.4.1_450bps_fast.cfg --log_path /home/grid/ --port 5555
ONT Guppy basecall server software version 5.1.13+b292f4d, client-server API version 10.0.0
log path:            /home/grid/
chunk size:          2000
chunks per runner:   160
max queued reads:    2000
num basecallers:     1
num socket threads:  2
max returned events: 50000
cpu mode:             ON
threads per caller:  4

Config loaded:
config file:               /opt/ont/guppy/data/dna_r9.4.1_450bps_fast.cfg
model file:                /opt/ont/guppy/data/template_r9.4.1_450bps_fast.jsn
model version id           2021-05-17_dna_r9.4.1_minion_96_29d8704b
adapter scaler model file: None

Starting server on port: ipc://5555

but the guppy error persists:

[guppy/error] basecall_service::BasecallClient::worker_loop: Connection error. [timed_out] Timeout waiting for reply to request: LOAD_CONFIG

In addition, when I installed ont-pyguppy-client-libont-pyguppy-client-lib, the following error occurred. Could this be the cause of this error?

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pyguppyclient 0.1.0 requires ont-pyguppy-client-lib==5.0.7, but you have ont-pyguppy-client-lib 5.1.13 which is incompatible.
Successfully installed ont-pyguppy-client-lib-5.1.13

Looking forward to your reply.

Sophie

alexomics commented 2 years ago

If you are running base calling using the GridION's builtin Guppy server the connection parameters should be:

[caller_settings]
config_name = "dna_r9.4.1_450bps_fast"
host = "ipc:///tmp/.guppy"
port = 5555

If you want to run Guppy with the socket at a specific location use:

guppy_basecall_server --config dna_r9.4.1_450bps_fast.cfg --log_path . --port /tmp/guppy/5556

You can then provide the parameters:

[caller_settings]
config_name = "dna_r9.4.1_450bps_fast"
host = "ipc:///tmp/guppy"
port = 5556
12032345 commented 2 years ago

I changed the host and it's now running smoothly, thanks a lot ! !