Skip to content

Commit f10bbfb

Browse files
Mike LeeMike Lee
authored andcommitted
adding commas to bit-summarize-assembly when printing to terminal
1 parent e2daa7c commit f10bbfb

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
- minor improvements to efficiency
2121
- `bit-get-cov-stats`
2222
- now also reports median percent id of mapped reads per ref and per contig (when provided an input bam file)
23+
- `bit-summarize-assembly`
24+
- adds commas when printing stats to terminal for readability
2325

2426
---
2527

bit/cli/summarize_assembly.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,17 @@ def summarize_assemblies(input_assemblies, output_tsv=False, transpose_output_ts
8080
df.to_csv(output_tsv, sep="\t", header=False, na_rep = "NA")
8181

8282
else:
83+
display_df = df.copy()
84+
for idx in display_df.index:
85+
if idx in ("Assembly", "GC content"):
86+
continue
87+
for col in display_df.columns:
88+
val = display_df.at[idx, col]
89+
if pd.notna(val):
90+
display_df.at[idx, col] = f"{int(val):,}"
91+
8392
print("")
84-
print(df.to_string(header=False))
93+
print(display_df.to_string(header=False))
8594
print("")
8695

8796

0 commit comments

Comments
 (0)