-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenerate_numbers_for_discussion.py
executable file
·69 lines (62 loc) · 1.92 KB
/
generate_numbers_for_discussion.py
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python3
AGNOSTIC_FOLLOWUP = 1000 # weekly reads matching pathogen
TARGETED_FOLLOWUP = 3 # weekly reads matching pathogen
SEQUENCING_COST = 8000 / 1e9 # dollars per read
cols = None
with open("fits_summary.tsv") as inf:
for line in inf:
row = line.strip().split("\t")
if not cols:
cols = row
continue
if row[cols.index("location")] != "Overall":
continue
pathogen = row[cols.index("pathogen")]
study = row[cols.index("study")]
median = float(row[cols.index("50%")])
predictor_type = row[cols.index("predictor_type")]
is_prevalence = {
"prevalence": True,
"incidence": False,
}[predictor_type]
# 1% prevalence or 0.5% weekly incidence
adjusted_relative_abundance = median if is_prevalence else median / 2
print(pathogen, study)
print(" RA1%% %.0e" % median)
print(
" Relative abundance of 1 in %.0e"
% (1 / adjusted_relative_abundance)
)
print(
" Weekly reads to flag for manual followup: %.0e"
% (AGNOSTIC_FOLLOWUP * 1 / adjusted_relative_abundance)
)
print(
" Weekly agnostic cost: $%.0f"
% (
AGNOSTIC_FOLLOWUP
* 1
/ adjusted_relative_abundance
* SEQUENCING_COST
)
)
print(
" Annual agnostic cost: $%.0f"
% (
AGNOSTIC_FOLLOWUP
* 1
/ adjusted_relative_abundance
* SEQUENCING_COST
* 52
)
)
print(
" Annual targeted cost: $%.0f"
% (
TARGETED_FOLLOWUP
* 1
/ adjusted_relative_abundance
* SEQUENCING_COST
* 52
)
)