-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
33 lines (29 loc) · 833 Bytes
/
utils.py
File metadata and controls
33 lines (29 loc) · 833 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
from pool import tasks, hash_redis
import CellPLoc
import DeepTMHMM
import JPred
import IPC2
class TaskInvalidError(Exception):
pass
def task_submit(task: str, md5_hash: str, *args):
if task == "CellPLoc":
tasks.get_CellPLoc.apply_async([md5_hash])
elif task == "DeepTMHMM":
tasks.get_DeepTMHMM.apply_async([md5_hash])
elif task == "JPred":
tasks.get_JPred.apply_async([md5_hash])
elif task == "IPC2":
tasks.get_IPC2.apply_async([md5_hash])
else:
raise TaskInvalidError
def get_db_from_task(task: str):
if task == "CellPLoc":
return CellPLoc.redis
elif task == "DeepTMHMM":
return DeepTMHMM.redis
elif task == "JPred":
return JPred.redis
elif task == "IPC2":
return IPC2.redis
else:
raise TaskInvalidError