From 50827d1f753472d4b3bead4e295c41c8c17e5221 Mon Sep 17 00:00:00 2001 From: Omar Valenzuela <51972068+valenzuelaomar@users.noreply.github.com> Date: Fri, 25 Aug 2023 21:57:45 -0700 Subject: [PATCH] Fix Benchmarking 'NoneType' object is not subscriptable error (#289) --- .../benchmark/benchmark_helpers/benchmark_helpers/harvest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/workflows/benchmark/benchmark_helpers/benchmark_helpers/harvest.py b/workflows/benchmark/benchmark_helpers/benchmark_helpers/harvest.py index 257e0530e..9b7e21c67 100644 --- a/workflows/benchmark/benchmark_helpers/benchmark_helpers/harvest.py +++ b/workflows/benchmark/benchmark_helpers/benchmark_helpers/harvest.py @@ -59,6 +59,9 @@ def load_contig_lengths(contig_fasta): lines = cleanup.enter_context(open(contig_fasta)) cur = None for line in lines: + if "ASSEMBLY FAILED" in line: + return {} + if line.startswith(">"): if cur is not None: lengths[cur[0]] = cur[1]