From 532d8e9cd7becf691970b3a7d9e9c618404aaf73 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Wed, 4 Oct 2017 15:44:48 +0200 Subject: [PATCH] obi import: small efficiency improvement when dealing with NA values --- python/obitools3/commands/import.pyx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/obitools3/commands/import.pyx b/python/obitools3/commands/import.pyx index 7443149..470cfcf 100644 --- a/python/obitools3/commands/import.pyx +++ b/python/obitools3/commands/import.pyx @@ -79,6 +79,7 @@ def run(config): cdef list old_elements_names cdef list new_elements_names cdef ProgressBar pb + cdef bytes NA_value global obi_errno @@ -102,6 +103,8 @@ def run(config): iseq = input[1] + NA_value = config['obi']['nastring'] + get_quality = False NUC_SEQS_view = False if isinstance(output[1], View) : @@ -141,9 +144,9 @@ def run(config): if tag != b"ID" and tag != b"DEFINITION" and tag != b"NUC_SEQ" and tag != b"QUALITY" : # TODO hmmm... value = seq[tag] - + # Check NA value - if value == config['obi']['nastring'] : + if value == NA_value : value = None if tag not in dcols :