Fixed three bugs in obi uniq

This commit is contained in:
Celine Mercier
2018-04-04 15:50:10 +02:00
parent 6825fc13ab
commit 1f4e82e6f6

View File

@ -243,7 +243,8 @@ cdef uniq_sequences(View_NUC_SEQS view, View_NUC_SEQS o_view, ProgressBar pb, li
# Keep columns that are going to be used a lot in variables
i_seq_col = view[NUC_SEQUENCE_COLUMN]
i_id_col = view[ID_COLUMN]
i_taxid_col = view[b"taxid"]
if b"taxid" in view:
i_taxid_col = view[b"taxid"]
if b"taxid_dist" in view:
i_taxid_dist_col = view[b"taxid_dist"]
@ -380,8 +381,7 @@ cdef uniq_sequences(View_NUC_SEQS view, View_NUC_SEQS o_view, ProgressBar pb, li
if mergeIds:
o_merged_col[o_idx] = [view[idx].id for idx in merged_sequences]
if COUNT_COLUMN not in o_seq or o_seq[COUNT_COLUMN] is None:
o_seq[COUNT_COLUMN] = 1
o_seq[COUNT_COLUMN] = 0
if b"taxid_dist" in u_seq and i_taxid_dist_col[u_idx] is not None:
taxid_dist_dict = i_taxid_dist_col[u_idx]
@ -460,7 +460,11 @@ cdef uniq_sequences(View_NUC_SEQS view, View_NUC_SEQS o_view, ProgressBar pb, li
o_seq[key] = None
o_idx += 1
# Deletes quality column if there is one because the matching between sequence and quality will be broken (quality set to NA when sequence not)
if QUALITY_COLUMN in view:
o_view.delete_column(QUALITY_COLUMN)
if taxonomy is not None:
logger("info", "Merging taxonomy classification")
merge_taxonomy_classification(o_view, taxonomy)