From 52eaee45681f5a8b6f695f81c15447d5955b691a Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 1 Dec 2021 15:50:33 +0100 Subject: [PATCH] Discard reports without overrepresented sequences --- parser.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parser.py b/parser.py index 25e45c7..328c3a5 100644 --- a/parser.py +++ b/parser.py @@ -14,8 +14,9 @@ def extract_adapters(files) -> Tuple[Series, List]: all_adapters = DataFrame() for entry in files: tables = read_html(entry) - adapter_sequences = tables[1].Sequence - all_adapters = all_adapters.append(adapter_sequences) + if len(tables) > 1: + adapter_sequences = tables[1].Sequence + all_adapters = all_adapters.append(adapter_sequences) processed_adapters = preprocess_dataframe(all_adapters) stats = [ processed_adapters.str.len().mean(),