-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbenchmark.py
More file actions
55 lines (36 loc) · 1.18 KB
/
benchmark.py
File metadata and controls
55 lines (36 loc) · 1.18 KB
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
from argnorm.lib import get_aro_mapping_table
import argnorm.lib
import pandas as pd
import os
CURATION_ROOT = argnorm.lib._ROOT + '/data/manual_curation'
dbs = ['argannot', 'resfinder', 'resfinderfg', 'ncbi', 'deeparg', 'megares', 'sarg']
def count_num_args():
output = {}
for db in dbs:
mapping_table = get_aro_mapping_table(db)
output.update({db: mapping_table.shape[0]})
return output
print(count_num_args())
def get_num_manual_curation():
output = {}
for file in os.listdir(CURATION_ROOT):
df = pd.read_csv(os.path.join(CURATION_ROOT, file), sep='\t')
output.update({file: df.shape[0]})
return output
print(get_num_manual_curation())
def get_num_unmapped_args():
output = {}
for db in dbs:
mapping_table = get_aro_mapping_table(db)
count = mapping_table['ARO'].isnull().sum()
output.update({db: count})
return output
print(get_num_manual_curation())
def get_num_unique_args():
output = {}
for db in dbs:
mapping_table = get_aro_mapping_table(db)
count = len(set(mapping_table['ARO']))
output.update({db: count})
return output
print(get_num_unique_args())