Skip to content

Commit bd66cc2

Browse files
author
Jon Palmer
committed
updates to some stat generation
1 parent 1e09ba7 commit bd66cc2

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

buscolite/__main__.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,19 @@ def main():
2626
verbosity=3,
2727
)
2828
logger.info(
29-
"Analysis complete:\n single-copy={}\n fragmented={}\n duplicated={}\n total={}".format(
29+
"Assembly completeness:\n complete={:} [{:.2%}]\n single-copy={:} [{:.2%}]\n fragmented={:} [{:.2%}]\n duplicated={:} [{:.2%}]\n missing={:} [{:.2%}]\n total={:} [{:.2%}]".format(
30+
stats["single-copy"] + stats["duplicated"],
31+
((stats["single-copy"] + stats["duplicated"]) / float(stats["total"])),
3032
stats["single-copy"],
33+
(stats["single-copy"] / float(stats["total"])),
3134
stats["fragmented"],
35+
(stats["fragmented"] / float(stats["total"])),
3236
stats["duplicated"],
37+
(stats["duplicated"] / float(stats["total"])),
38+
stats["missing"],
39+
(stats["missing"] / float(stats["total"])),
3340
stats["total"],
41+
(stats["total"] / float(stats["total"])),
3442
)
3543
)
3644
# write gff if genome mode

buscolite/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
VERSION = (0, 5, 0)
1+
VERSION = (0, 5, 1)
22

33
__version__ = ".".join(map(str, VERSION))

buscolite/busco.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,14 @@ def runbusco(
458458
for b in CutOffs.keys():
459459
if b not in b_results:
460460
missing.append(b)
461-
stats = {"total": 0, "single-copy": 0, "fragmented": 0, "duplicated": 0}
461+
stats = {
462+
"total": len(CutOffs),
463+
"single-copy": 0,
464+
"fragmented": 0,
465+
"duplicated": 0,
466+
"missing": len(missing),
467+
}
462468
for k, v in natsorted(b_results.items()):
463-
stats["total"] += 1
464469
if len(v) > 1: # duplicates
465470
for i, x in enumerate(
466471
sorted(v, key=lambda y: y["bitscore"], reverse=True)

0 commit comments

Comments
 (0)