Skip to content

Commit a7eb33a

Browse files
committed
updated summarize script to Python3
1 parent c563174 commit a7eb33a

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

summarize-results

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1-
#!/usr/bin/python
1+
##!/usr/bin/python3
2+
3+
# Copyright 2016-2021, André Müller <[email protected]>
4+
#
5+
# This file is part of the MetaCache taxonomic sequence classification tool.
6+
#
7+
# MetaCache is free software: you can redistribute it and/or modify
8+
# it under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation, either version 3 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# MetaCache is distributed in the hope that it will be useful,
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with MetaCache. If not, see <http://www.gnu.org/licenses/>.
219

320
import glob
421
import re
522
import sys
623

724
if len(sys.argv) < 3:
8-
print "usage: " + sys.argv[0] + " <input file pattern> <rank>"
25+
print("summarize classification results with ground truth")
26+
print("usage: " + sys.argv[0] + " <input file pattern> <rank>")
927
exit()
1028

1129
inpattern = sys.argv[1]
@@ -37,9 +55,9 @@ for fname in fnames:
3755
if pad > 6:
3856
pad = pad - 6
3957

40-
print "Results on rank " + rank + ":"
41-
print "filename" + (" " * pad) \
42-
+ sep + "uncl" + sep + "clas" + sep + "prec" + sep + "sens"
58+
print("Results on rank " + rank + ":")
59+
print("filename" + (" " * pad) \
60+
+ sep + "uncl" + sep + "clas" + sep + "prec" + sep + "sens")
4361

4462

4563
for fname in fnames:
@@ -95,11 +113,11 @@ for fname in fnames:
95113
if not parse_rank(line, sens):
96114
section = 7
97115

98-
# print str(section) + " -> " + line
116+
# print(str(section) + " -> " + line)
99117

100118
if section > 5:
101-
print fname + " " \
119+
print(fname + " " \
102120
+ sep + str(round(float(uncl),2)) \
103121
+ sep + str(round(float(clas[rank]),2)) \
104122
+ sep + str(round(float(prec[rank]),2)) \
105-
+ sep + str(round(float(sens[rank]),2))
123+
+ sep + str(round(float(sens[rank]),2)))

0 commit comments

Comments
 (0)