diff --git a/python/obitools3/commands/uniq.pyx b/python/obitools3/commands/uniq.pyx index 851a5bd..28c7a61 100644 --- a/python/obitools3/commands/uniq.pyx +++ b/python/obitools3/commands/uniq.pyx @@ -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)