Skip to content

Commit

Permalink
add macOS detection for queues and fix read_splitting params
Browse files Browse the repository at this point in the history
  • Loading branch information
Psy-Fer committed Aug 16, 2024
1 parent 767bf8b commit a619c1d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/basecaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,26 @@ def start_guppy_server_and_client(args, server_args):
params = {}

if args.moves_out:
if args.above_7412_flag:
if args.above_7412:
params["move_enabled"] = True
else:
params["move_and_trace_enabled"] = True

if args.call_mods:
if args.above_7412_flag:
if args.above_7412:
params["move_enabled"] = True
else:
params["move_and_trace_enabled"] = True

if args.do_read_splitting:
if args.do_read_splitting and not args.above_7310:
params["do_read_splitting"] = True
params["min_score_read_splitting"] = args.min_score_read_splitting

if args.detect_adapter and not args.above_7412_flag:
if args.detect_adapter and not args.above_7412:
params["detect_adapter"] = True
params["min_score_adapter"] = args.min_score_adapter

if args.detect_mid_strand_adapter and not args.above_7412_flag:
if args.detect_mid_strand_adapter and not args.above_7412:
params["detect_mid_strand_adapter"] = True

if args.trim_adapters:
Expand All @@ -73,15 +73,15 @@ def start_guppy_server_and_client(args, server_args):
params["barcode_kits"] = args.barcode_kits
params["enable_trim_barcodes"] = args.enable_trim_barcodes
params["require_barcodes_both_ends"] = args.require_barcodes_both_ends
if not args.above_7412_flag:
if not args.above_7412:
params["min_score_barcode_front"] = args.min_score_barcode_front
params["min_score_barcode_rear"] = args.min_score_barcode_rear
params["min_score_barcode_mid"] = args.min_score_barcode_mid
# docs are a bit wonky on this, enable_trim_barcodes vs barcode_trimming_enabled
params["detect_mid_strand_barcodes"] = args.detect_mid_strand_barcodes

if args.duplex:
if args.above_7412_flag:
if args.above_7412:
params["pair_by_channel"] = True
else:
raise RuntimeError("Duplex calling not avilable for versions lower than dorado-server 7.4.12")
Expand Down
13 changes: 11 additions & 2 deletions src/buttery_eel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys
import os
import multiprocessing as mp
import platform

try:
import pybasecall_client_lib
Expand Down Expand Up @@ -90,6 +91,7 @@ def main():
# add super sneaky hidden flags the user can't interact with but makes global sharing easier
extra_args = argparse.Namespace(
above_7310=above_7310_flag, # is the version >= 7.3.* where the name and inputs change?
above_7412=above_7412_flag,
)

# now merge them. This will all get printed into the arg print below which also helps with troubleshooting
Expand Down Expand Up @@ -234,8 +236,15 @@ def main():
print()

mp.set_start_method('spawn')
input_queue = mp.JoinableQueue()
result_queue = mp.JoinableQueue()

if platform.system() == "Darwin":
im = mp.Manager()
rm = mp.Manager()
input_queue = im.JoinableQueue()
result_queue = rm.JoinableQueue()
else:
input_queue = mp.JoinableQueue()
result_queue = mp.JoinableQueue()

processes = []

Expand Down

0 comments on commit a619c1d

Please sign in to comment.