From 153e3ac858d1e0b3d1a478787b8469ccc08cacf8 Mon Sep 17 00:00:00 2001 From: Leandro Ishi Date: Mon, 3 Apr 2023 14:43:00 +0100 Subject: [PATCH] Fix COBS filtering not properly taken into account and Minimap instances created even for 0 queries --- Snakefile | 1 + scripts/batch_align.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Snakefile b/Snakefile index 0e4afc9..774adce 100644 --- a/Snakefile +++ b/Snakefile @@ -325,6 +325,7 @@ rule decompress_cobs: cobs_index=f"{decompression_dir}/{{batch}}.cobs_classic", input: xz=f"{cobs_dir}/{{batch}}.cobs_classic.xz", + decompressed_indexes_sizes="data/decompressed_indexes_sizes.txt", resources: max_io_heavy_threads=1, params: diff --git a/scripts/batch_align.py b/scripts/batch_align.py index 09d65d3..4330b93 100755 --- a/scripts/batch_align.py +++ b/scripts/batch_align.py @@ -162,7 +162,9 @@ def load_qdicts(query_fn, accession_fn): # batch accession filtering on & not in this batch pass - # STEP 3: Ensure everything get converted to standard dicts + # STEP 3: Filter rname_to_qnames to references that have at least one COBS match + rname_to_qnames = {k: v for k, v in rname_to_qnames.items() if len(v) > 0} + logging.info(f"Query dictionaries loaded") return qname_to_qfa, rname_to_qnames