Skip to content

Commit b8fe1bb

Browse files
Dom LaetschDom Laetsch
authored andcommitted
Fixed output of BtLog.progress()
1 parent 4207c0f commit b8fe1bb

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/BtIO.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def readBam(infile, set_of_blobs):
118118
base_cov_dict[seq_name] = base_cov_dict.get(seq_name, 0) + base_cov
119119
read_cov_dict[seq_name] = read_cov_dict.get(seq_name, 0) + 1
120120
BtLog.progress(parsed_reads, progress_unit, reads_total)
121-
#BtLog.progress(reads_total, progress_unit, reads_total)
121+
BtLog.progress(reads_total, progress_unit, reads_total)
122122
if not int(reads_mapped) == int(parsed_reads):
123123
print warn_d['3'] % (reads_mapped, parsed_reads)
124124
return base_cov_dict, reads_total, parsed_reads, read_cov_dict

lib/BtLog.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ def error(message, *argv):
2020
exit(1)
2121

2222
def progress(iteration, steps, max_value):
23-
if int(iteration) % int(steps) == 0:
23+
if int(iteration == max_value):
2424
sys.stdout.write('\r')
25-
print "[PROGRESS]\t: %d%%" % (float(int(iteration)/int(max_value)*100)),
26-
sys.stdout.flush()
27-
# if int(iteration == max_value):
28-
# sys.stdout.write('\r')
29-
# print "[PROGRESS]\t: %d%%" % (100)
25+
print "[PROGRESS]\t: %d%%" % (100)
26+
else:
27+
if int(iteration) % int(steps) == 0:
28+
sys.stdout.write('\r')
29+
print "[PROGRESS]\t: %d%%" % (float(int(iteration)/int(max_value)*100)),
30+
sys.stdout.flush()
3031

3132
error_d = {
3233
'0' : '[ERROR:0]\t: File %s does not exist.',

0 commit comments

Comments
 (0)