ngsfilter: made more robust and practical to use with empty tags

This commit is contained in:
Celine Mercier
2019-11-29 15:21:08 +01:00
parent 8bc249b2f4
commit 53f18316b0
3 changed files with 52 additions and 40 deletions

3
python/obitools3/parsers/ngsfilter.pyx Executable file → Normal file
View File

@ -57,6 +57,9 @@ def ngsfilterIterator(lineiterator,
split_line = line.split()
tags = split_line.pop(2)
tags = tags.split(b":")
for t_idx in range(2):
if tags[t_idx]==b"-" or tags[t_idx]==b"None" or tags[t_idx]==b"":
tags[t_idx] = nastring
if len(tags) == 1: # Forward and reverse tags are the same
tags.append(tags[0])
split_line.insert(2, tags[0])