-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcontammix_results.py
More file actions
34 lines (30 loc) · 894 Bytes
/
contammix_results.py
File metadata and controls
34 lines (30 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import sys
key = sys.argv[1]
filename = sys.argv[2]
inferred_error_rate = float('nan')
map_authentic = float('nan')
lower = float('nan')
upper = float('nan')
gelman_diagnostic = float('nan')
gelman_diagnostic_upper = float('nan')
try:
f = open(filename)
line = f.readline()
fields = line.split('\t')
inferred_error_rate = float(fields[0])
map_authentic = float(fields[1])
lower = float(fields[2])
upper = float(fields[3])
gelman_diagnostic = float(fields[4])
gelman_diagnostic_upper = float(fields[5])
f.close()
except:
pass
finally:
print('%s\t%s\t%f\t%s\t%f\t%s\t%f\t%s\t%f\t%s\t%f' % (key, 'contamination_contammix', map_authentic,
'contamination_contammix_lower', lower,
'contamination_contammix_upper', upper,
'contamination_contammix_gelman', gelman_diagnostic,
'contamination_contammix_inferred_error', inferred_error_rate,
)
)