Closed JudoWill closed 3 years ago
Running the extract_run_statistics.py
hangs indefinitely but list_sequencing_positions.py
runs fine. I'm not sure if that means anything.
Hi @JudoWill,
For your first issue, you need to connect to a sequencing position once creating the manager position.
Please see: https://github.com/nanoporetech/minknow_api/blob/master/python/examples/list_sequencing_positions.py, where the code first connects to the manager, then enumerates positions and connects to a position:
# Find which positions we are going to start protocol on:
positions = list(manager.flow_cell_positions())
filtered_positions = list(filter(lambda pos: pos.name == args.position, positions))
# Find the position we were asked to interrogate:
if not filtered_positions:
print(
"Failed to find position %s in available positions '%s'"
% (args.position, ", ".join([p.name for p in positions]))
)
sys.exit(1)
# Connect to the grpc port for the position:
connection = filtered_positions[0].connect()
you can then use the connection
object to call protocol API:
connection.protocol.stop_protocol()
Additionally, I would recommend you stop the protocol, not the acquisition as the protocol script will be confused if its acquisition period ends randomly.
Thanks for the reply. It wasn't as clear that I need to use the Manager
to create the connections. And thanks for clearing up that its the protocol
that I want to stop and not the acquisition
. I'm still wrapping my head around the class structure.
I'm trying to make some automation around stopping the protocol when we have "enough" sequence. Which often happens in the middle of the night when nobody is watching. Thanks for the help!
Hello, I'm trying to stop a run using the api and I'm having some trouble.
I'm trying:
Which gets me an error:
Am I doing something wrong in my code, do I not have something setup on the machine correctly, or something else?
Thanks for the help!