uniq: improved progress bar of second browsing
This commit is contained in:
@ -419,12 +419,12 @@ cdef uniq_sequences(View_NUC_SEQS view, View_NUC_SEQS o_view, ProgressBar pb, di
|
|||||||
print("")
|
print("")
|
||||||
logger("info", "Second browsing through the input")
|
logger("info", "Second browsing through the input")
|
||||||
# Initialize the progress bar
|
# Initialize the progress bar
|
||||||
pb = ProgressBar(len(uniques), seconde=5)
|
pb = ProgressBar(len(view), seconde=5)
|
||||||
o_idx = 0
|
o_idx = 0
|
||||||
|
total_treated = 0
|
||||||
|
|
||||||
for unique_id in uniques :
|
for unique_id in uniques :
|
||||||
PyErr_CheckSignals()
|
PyErr_CheckSignals()
|
||||||
pb(o_idx)
|
|
||||||
|
|
||||||
merged_sequences = uniques[unique_id]
|
merged_sequences = uniques[unique_id]
|
||||||
|
|
||||||
@ -453,6 +453,7 @@ cdef uniq_sequences(View_NUC_SEQS view, View_NUC_SEQS o_view, ProgressBar pb, di
|
|||||||
merged_dict[mkey] = {}
|
merged_dict[mkey] = {}
|
||||||
|
|
||||||
for i_idx in merged_sequences:
|
for i_idx in merged_sequences:
|
||||||
|
pb(total_treated)
|
||||||
|
|
||||||
i_id = i_id_col[i_idx]
|
i_id = i_id_col[i_idx]
|
||||||
i_seq = view[i_idx]
|
i_seq = view[i_idx]
|
||||||
@ -505,6 +506,8 @@ cdef uniq_sequences(View_NUC_SEQS view, View_NUC_SEQS o_view, ProgressBar pb, di
|
|||||||
and key not in merged_dict :
|
and key not in merged_dict :
|
||||||
o_seq[key] = None
|
o_seq[key] = None
|
||||||
|
|
||||||
|
total_treated += 1
|
||||||
|
|
||||||
# Write merged dicts
|
# Write merged dicts
|
||||||
for mkey in merged_dict:
|
for mkey in merged_dict:
|
||||||
if mkey in str_merged_cols:
|
if mkey in str_merged_cols:
|
||||||
@ -526,7 +529,7 @@ cdef uniq_sequences(View_NUC_SEQS view, View_NUC_SEQS o_view, ProgressBar pb, di
|
|||||||
o_count_col[o_idx] = o_count
|
o_count_col[o_idx] = o_count
|
||||||
o_idx += 1
|
o_idx += 1
|
||||||
|
|
||||||
pb(len(uniques), force=True)
|
pb(len(view), force=True)
|
||||||
|
|
||||||
# Deletes quality columns if there is one because the matching between sequence and quality will be broken (quality set to NA when sequence not)
|
# Deletes quality columns 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:
|
if QUALITY_COLUMN in view:
|
||||||
|
Reference in New Issue
Block a user