-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_toxclf.py
More file actions
55 lines (41 loc) · 1.15 KB
/
run_toxclf.py
File metadata and controls
55 lines (41 loc) · 1.15 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
import argparse
from pathlib import Path
import pandas as pd
from src.config import OUTPUT_PATH, CTT_PATH, DEVICE
from src.filters.f_cytotox import CytotoxicityFilter
def main(args):
input_csv = args.input
output_csv = args.output
device = args.device
# load input DF
df = pd.read_csv(input_csv,index_col=False)
# run classification
clf = CytotoxicityFilter(CTT_PATH, device)
results_df = clf.filter_sequences(df)
print(f'\n\n saving results to: {str(output_csv)}')
results_df.to_csv(output_csv,index=False)
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'--input',
type=Path,
help="path to input CSV file"
)
parser.add_argument(
'--output',
type=Path,
default= OUTPUT_PATH / 'predictions.csv',
help="path to output CSV file"
)
parser.add_argument(
'--device',
type=str,
choices=['cpu', 'cuda', 'mps'],
default=DEVICE,
help="device for computation"
)
args = parser.parse_args()
return args
if __name__ == '__main__':
args = parse_args()
main(args)