From 656d710e261dc077d852f370e3fb2ebc2187ca4b Mon Sep 17 00:00:00 2001 From: kedhammar Date: Thu, 30 May 2024 15:11:07 +0000 Subject: [PATCH] bugfix --- anglerfish/demux/adaptor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/anglerfish/demux/adaptor.py b/anglerfish/demux/adaptor.py index 21b6a06..041c729 100644 --- a/anglerfish/demux/adaptor.py +++ b/anglerfish/demux/adaptor.py @@ -149,7 +149,12 @@ def __init__(self, sequence_token: str, name: str, index_seq: str | None): self.len_before_index = None self.len_after_index = None - self.len_total = len(self.get_mask(insert_Ns=True)) if self.index_seq else None + if ( + self.has_index is True and self.index_seq is not None + ) or self.has_index is False: + self.len_total = len(self.get_mask(insert_Ns=True)) + else: + self.len_total = None self.len_constant = len(self.get_mask(insert_Ns=False)) def get_mask(self, insert_Ns: bool = True) -> str: