From 8dc9dd165362d8553be049d1e5bca7e651c46b32 Mon Sep 17 00:00:00 2001 From: Vitaliy Mysak Date: Mon, 5 Jun 2023 16:30:41 -0700 Subject: [PATCH] do not run blast unless required --- intact/intact.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/intact/intact.py b/intact/intact.py index fb47641..3344659 100644 --- a/intact/intact.py +++ b/intact/intact.py @@ -739,6 +739,12 @@ def iterate_sequences(input_file): for sequence in SeqIO.parse(in_handle, "fasta"): yield sequence + +def iterate_empty_lists(): + while True: + yield [] + + def intact( working_dir, input_file, subtype, @@ -788,7 +794,7 @@ def intact( working_dir, rre_locus = [st.convert_from_hxb2_to_subtype(x, subtype) for x in hxb2_rre_locus] reference = st.subtype_sequence(subtype) - blast_it = blast_iterate(subtype, input_file) + blast_it = blast_iterate(subtype, input_file) if check_internal_inversion or check_nonhiv or check_scramble else iterate_empty_lists() blast_rows = [] for sequence in iterate_sequences(input_file):