nanoporetech / minknow_api

Protobuf and gRPC specifications for the MinKNOW API
Other
51 stars 12 forks source link

Read Until update? #11

Closed daniloimparato closed 3 years ago

daniloimparato commented 3 years ago

Hello @RDokos & team!

I couldn't find anything related to the new adaptive sampling feature in this repo. Any plans to release it? I assume there's already an internal updated version of this repo with it. My team and I need it a lot!

I understand read until development was carried out in the read_until_api repo. However, I am not sure if this is still the case. From using the MinKNOW GUI it seems reasonable there would be a way to start a read until protocol from the minkow_api.

Could you either confirm these assumptions or point me in the right direction? I'm trying to start multiple adaptive sampling runs programatically.

Thanks!

cjw85 commented 3 years ago

The API that you have linked to is still current. It is separate largely for historical reasons.

daniloimparato commented 3 years ago

Hi @cjw85! Thanks for the quick response.

It still wasn't clear to me how one could start a MinKNOW-native adaptive sampling run with the minknow_api. However, I think I may have found something just now.

I'm guessing that an adaptive sampling run can be started just by fiddling with this section at the bottom of the sequencing TOML file: image

I might as well update this issue with whatever I come up with in the following days.

0x55555555 commented 3 years ago

Hello,

You can find the full read until api where you suggest: https://github.com/nanoporetech/read_until_api. The project is also hosted on pypi here: https://pypi.org/project/read-until/.

The read until protocol is a standard minknow protocol, and can be started with the start_protocol API here: https://github.com/nanoporetech/minknow_api/blob/master/python/examples/start_protocol.py

But will require some custom arguments to start - these are not currently documented in the source, but can be started by passing extra arguments to the start_protocol example:

--read_until filter_type='enrich' reference_files=['/data/my-alignment-file'] bed_file='/data/bed_file.bed' first_channel=1 last_channel=512

I will ensure we get better support for programatically starting read until runs in a future release

Thanks,

0x55555555 commented 3 years ago

As you mention - you can also directly change the toml files - this will also enable read until.

daniloimparato commented 3 years ago

Hi @jorj1988! This is precisely what I was after. Many thanks!

daniloimparato commented 3 years ago

Hi @jorj1988 & @cjw85!

Unfortunately neither method worked for me 😔

Running the start_protocol.py script with a custom TOML did not reflect any changes made to the Read Until section.

Running it with the extra arguments you suggested did not work either, because an error pops up:

start_protocol.py: error: unrecognized arguments: --read_until

I can see that the --read_until argument is passed on to protocol_selector.py in runs started from the MinKNOW GUI, which (I guess) ultimately spawns a read_until_script.py process.

Curiously enough, we have faced a very similar issue when starting Read Until from the GUI before upgrading Ubuntu (see this comment https://community.nanoporetech.com/posts/minknow-19-10-3-release-fo#comment_30981).

I'm guessing it is a bug in argparse or something similar.

I was wondering if any of you guys could lend me a hand with this.

Thanks!