Commit 2a6a112d by Celine Mercier

obi import: fixed writing quality in views when appropriate (but still

not a satisfying solution)
parent c437931a
...@@ -128,16 +128,12 @@ def run(config): ...@@ -128,16 +128,12 @@ def run(config):
NUC_SEQS_view = True NUC_SEQS_view = True
else: else:
raise NotImplementedError() raise NotImplementedError()
get_quality = config["obi"]["noquality"]
# Save basic columns in variables for optimization # Save basic columns in variables for optimization
if NUC_SEQS_view : if NUC_SEQS_view :
id_col = view[b"ID"] # TODO use macros or globals for column names id_col = view[b"ID"] # TODO use macros or globals for column names
def_col = view[b"DEFINITION"] def_col = view[b"DEFINITION"]
seq_col = view[b"NUC_SEQ"] seq_col = view[b"NUC_SEQ"]
if get_quality:
qual_col = view[b"QUALITY"]
dcols = {} dcols = {}
...@@ -150,7 +146,13 @@ def run(config): ...@@ -150,7 +146,13 @@ def run(config):
id_col[i] = entry.id id_col[i] = entry.id
def_col[i] = entry.definition def_col[i] = entry.definition
seq_col[i] = entry.seq seq_col[i] = entry.seq
if get_quality : # Check if there is a sequencing quality associated by checking the first entry # TODO haven't found a more robust solution yet
if i == 0:
get_quality = b"QUALITY" in entry
if get_quality:
Column.new_column(view, b"QUALITY", OBI_QUAL)
qual_col = view[b"QUALITY"]
if get_quality:
qual_col[i] = entry.quality qual_col[i] = entry.quality
for tag in entry : for tag in entry :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment