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

minknow_api.examples.manage_simulated_devices does not enable adding a Flongle #61

Open
patbohn opened this issue Nov 23, 2023 · 1 comment

Comments

@patbohn
Copy link

patbohn commented Nov 23, 2023

Hi,

First, I want to thank you for having this powerful API Open Source. It enables so many cool use cases! However, we realized that while it would be possible to replay previously recorded batch files from MinIon flow cells by addition of a simulated MinIon, there is currently no implementation to add a Flongle Adapter, and so batch files from Flongle sequencing runs cannot be replayed without having a real Minion + Flongle adapter plugged into the computer. Specifically, when attempting to replay a Flongle batch file on a Minion position, the error in the bream log is:

[bream4.toolkit.procedure_components.command.phase_management: 186] - 2023-11-23 11:06:14,919 -    ERROR - 
Traceback (most recent call last):
  File "C:\Program Files\OxfordNanopore\MinKNOW\conf\package\sequencing\sequencing.py", line 581, in <module>
    sys.exit(main(config=args.config))
  File "C:\Program Files\OxfordNanopore\MinKNOW\conf\package\sequencing\sequencing.py", line 515, in main
    setup_playback(device, settings["simulation"])
  File "C:\Program Files\OxfordNanopore\MinKNOW\ont-python\lib\site-packages\bream4\utility\simulation.py", line 49, in setup_playback
    device.connection.device.set_calibration(
  File "C:\Program Files\OxfordNanopore\MinKNOW\ont-python\lib\site-packages\minknow_api\device_service.py", line 610, in set_calibration
    return run_with_retry(self._stub.set_calibration,
  File "C:\Program Files\OxfordNanopore\MinKNOW\ont-python\lib\site-packages\minknow_api\device_service.py", line 97, in run_with_retry
    result = MessageWrapper(method(message, timeout=timeout), unwraps=unwraps)
  File "C:\Program Files\OxfordNanopore\MinKNOW\ont-python\lib\site-packages\grpc\_channel.py", line 946, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "C:\Program Files\OxfordNanopore\MinKNOW\ont-python\lib\site-packages\grpc\_channel.py", line 849, in _end_unary_response_blocking
    raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.INVALID_ARGUMENT
	details = "last_channel must be 512"

Could you add the ability to add a simulated Flongle position?

Thank you in advance!

@patbohn
Copy link
Author

patbohn commented Nov 5, 2024

For anyone who really wants to be able to replay Flongle data, the workaround I have been using is patching Minknow itself. In particular, inserting this code here to MinKNOW\ont-python\Lib\site-packages\bream4\utility\simulation.py at line 34.

    if len(calibration) < len(device.get_channel_list()):
        device.logger.info("Replaying Flongle data. Adding empty calibrations.")
        for channel in device.get_channel_list():
            if channel not in calibration:
                calibration[channel] = (0, 2048)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant