Skip to content

Commit 0d30f2e

Browse files
Dom LaetschDom Laetsch
authored andcommitted
Fix to BtPlot.write_stats()
Output now tab delimited
1 parent 45c1fcc commit 0d30f2e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/BtPlot.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,13 @@ def write_stats(self):
215215
with open(out_f, 'w') as fh:
216216
for cov_lib in sorted(self.cov_libs):
217217
fh.write("# %s - %s\n" % (self.out_f, cov_lib))
218-
fh.write("{:<10}\t{:>10}{:>10}\t{:>10}\t{:<10}\t{:<10}\t{:<10}\t{:<5}\t{:<5}\t{:<10}\t{:<10}\t{:<10}\t{:<10}\n".format('Group', 'colour', 'count', 'visible (%)', 'span', 'visible(%)', 'n50', 'GC', 'GC (std)', 'cov_mean', 'cov_std', 'read map', 'read map (%)'))
218+
fh.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % ('Group', 'colour', 'count', 'visible (%)', 'span', 'visible(%)', 'n50', 'GC', 'GC (std)', 'cov_mean', 'cov_std', 'read map', 'read map (%)'))
219219
for stat in stats:
220-
fh.write("{:<10}\t{:>10}{:>10}\t{:>10}\t{:<10}\t{:<10}\t{:<10}\t{:<5}\t{:<5}\t{:<10}\t{:<10}\t{:<10}\t{:<10}\n".format(\
220+
fh.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (\
221221
stat['name'], stat['colour'], stat['count_total'], stat['count_visible_perc'], stat['span_total'], \
222222
stat['span_visible_perc'], stat['n50'], stat['gc_mean'], stat['gc_std'], stat['cov_mean'][cov_lib], \
223223
stat['cov_std'][cov_lib], stat['reads_mapped'][cov_lib], stat['reads_mapped_perc'][cov_lib]))
224-
# for d in table_data:
225-
# fh.write("{:>10}\t{:>10}\t{:>10}\t{:>10}\t{:<10}\t{:<10}\t{:<10}\n".format(d['count_total'], d['count_visible_perc'], d['span_total'], d['span_visible_perc'], d['name'], d['label'], d['colour'] ))
224+
226225

227226
def compute_stats(self):
228227
stats = {}

0 commit comments

Comments
 (0)