diff runner.py @ 9:08e987868f0f draft

planemo upload for repository https://github.com/richard-burhans/galaxytools/tree/main/tools/segalign commit 062a761a340e095ea7ef7ed7cd1d3d55b1fdc5c4
author richard-burhans
date Wed, 10 Jul 2024 17:06:45 +0000
parents 150de8a3954a
children ae2cd39594eb
line wrap: on
line diff
--- a/runner.py	Tue Jul 09 17:37:53 2024 +0000
+++ b/runner.py	Wed Jul 10 17:06:45 2024 +0000
@@ -301,17 +301,17 @@
 
     with concurrent.futures.ProcessPoolExecutor(max_workers=num_workers) as executor:
         for i in range(num_workers):
-            executor.submit(diagonal_partition_worker(input_q, output_q, chunk_size, i))
+            executor.submit(diagonal_partition_worker(args, input_q, output_q, chunk_size, i))
 
 
-def diagonal_partition_worker(input_q: queue.Queue[str], output_q: queue.Queue[str], chunk_size: int, instance: int) -> None:
+def diagonal_partition_worker(args: argparse.Namespace, input_q: queue.Queue[str], output_q: queue.Queue[str], chunk_size: int, instance: int) -> None:
     while True:
         line = input_q.get()
         if line == SENTINEL_VALUE:
             input_q.task_done()
             break
 
-        run_args = ["python", "/jetstream2/scratch/rico/job-dir/tool_files/diagonal_partition.py", str(chunk_size)]
+        run_args = ["python", f"{args.tool_directory}/diagonal_partition.py", str(chunk_size)]
         for word in line.split():
             run_args.append(word)
         process = subprocess.run(run_args, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
@@ -380,6 +380,7 @@
         run_args.extend(segalign_args)
         run_args.append("--num_threads")
         run_args.append(str(args.num_cpu))
+        run_args.append("work/")
 
         if args.debug:
             beg: int = time.monotonic_ns()