From 9c85d2f0410494a9b71d9905fad2f9e4efe30ed7 Mon Sep 17 00:00:00 2001 From: akikuno Date: Mon, 8 Jul 2024 15:46:30 +0900 Subject: [PATCH] Resolve the B023 Function definition does not bind loop variable `alignment_lengths` issue. --- src/DAJIN2/core/preprocess/midsv_caller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DAJIN2/core/preprocess/midsv_caller.py b/src/DAJIN2/core/preprocess/midsv_caller.py index c83b2be..efcd75a 100644 --- a/src/DAJIN2/core/preprocess/midsv_caller.py +++ b/src/DAJIN2/core/preprocess/midsv_caller.py @@ -60,7 +60,7 @@ def extract_best_preset(preset_cigar_by_qname: dict[str, dict[str, str]]) -> dic continue # Define a custom key function to prioritize map-ont - def custom_key(key: str) -> tuple[int, bool]: + def custom_key(key: str, alignment_lengths=alignment_lengths) -> tuple[int, bool]: return (alignment_lengths[key], key == "map-ont") max_key = max(alignment_lengths, key=custom_key)