Skip to content

Commit 2e702cf

Browse files
Check bustools version when using extract_all_unmapped flag
1 parent 50e2a48 commit 2e702cf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kb_python/extract.py

+7
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@ def extract(
316316
"t2g_path must be provided if mm flag is not provided, target_type is 'gene' (and extract_all_fast and extract_all_unmapped are False), OR extract_all is True"
317317
)
318318

319+
# extract_all_unmapped requires bustools version > 0.43.2 since previous versions have a bug in the output fastq format that changes the sequence headers
320+
bustools_version_tuple = get_bustools_version()
321+
if extract_all_unmapped and not (0, 43, 2) < bustools_version_tuple:
322+
raise ValueError(
323+
f"extract_all_unmapped requires bustools version > 0.43.2. You are currently using bustools version {'.'.join(str(i) for i in bustools_version_tuple)}."
324+
)
325+
319326
make_directory(out_dir)
320327

321328
fastq = stream_fastqs([fastq], temp_dir=temp_dir)

0 commit comments

Comments
 (0)