-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_pipeline.py
More file actions
81 lines (63 loc) · 1.73 KB
/
run_pipeline.py
File metadata and controls
81 lines (63 loc) · 1.73 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"""
CLI - main running script (entry point)
"""
import argparse
from pathlib import Path
from src.config import GENGRU_PATH, CTT_PATH, DIST_DATA_PATH, OUTPUT_PATH, FOLDER_SIGNATURE, DROP_COLS, DEVICE
from src.generators.architectures.architectures import GenRNN
from src.acp_maker import ACPmaker
def main(args):
# loading arguments
run_id = args.id
n_batches = args.nbatch
to_mutate = args.mutate
device = args.device
# running pipeline
acp_maker = ACPmaker(GENGRU_PATH, CTT_PATH, DIST_DATA_PATH, device)
output_folder = OUTPUT_PATH / FOLDER_SIGNATURE.replace('XX',str(run_id))
acp_maker.run_pipeline(n_batches, output_folder, DROP_COLS ,to_mutate)
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'--id',
type=int,
default=69,
help="identification number of the run"
)
parser.add_argument(
'--nbatch',
type=int,
default=100,
help="how many batches of peptides to generate"
)
parser.add_argument(
'--mutate',
type=str,
default=None,
help="aa sequence to mutate"
)
parser.add_argument(
'--device',
type=str,
choices=['cpu', 'cuda', 'mps'],
default=DEVICE,
help="device for computation"
)
### custom model selection ###
parser.add_argument(
'--model_ctt',
type=Path,
default=CTT_PATH,
help="path to classification model"
)
parser.add_argument(
'--model_gen',
type=Path,
default=GENGRU_PATH,
help="path to generative model"
)
args = parser.parse_args()
return args
if __name__ == '__main__':
args = parse_args()
main(args)