-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinference_types.py
More file actions
85 lines (62 loc) · 1.93 KB
/
Copy pathinference_types.py
File metadata and controls
85 lines (62 loc) · 1.93 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
82
83
84
85
from dataclasses import dataclass
from typing import List, Optional, Sequence, Union
import torch
TargetType = Union[int, Sequence[int], None]
TaskType = str
@dataclass
class RfamCondition:
label: Optional[int] = None
func_cond: Optional[Union[str, List[str]]] = None
@dataclass
class ProteinCondition:
targets: Optional[List[int]] = None
func_cond: Optional[Union[str, List[str]]] = None
seq_cond: Optional[torch.Tensor] = None
@dataclass
class DiseaseCondition:
label: Optional[int] = None
func_cond: Optional[Union[str, List[str]]] = None
@dataclass
class TextCondition:
func_cond: Optional[Union[str, List[str]]] = None
@dataclass
class SSCondition:
secondary_structure: Optional[str] = None
icshape: Optional[str] = None
seq_cond: Optional[torch.Tensor] = None
@dataclass
class TSCondition:
seq_cond: Optional[torch.Tensor] = None
reference_sequence: Optional[str] = None
pdb_path: Optional[str] = None
@dataclass
class CAS13Condition:
target_before: Optional[str] = None
target_at_guide: Optional[str] = None
target_after: Optional[str] = None
guide_seq: Optional[str] = None
@dataclass
class ConditionBundle:
rfam: RfamCondition
proteins: ProteinCondition
disease: DiseaseCondition
text: TextCondition
ss: SSCondition
ts: TSCondition
cas13: CAS13Condition
@dataclass
class GuidanceConfig:
guidance_scale: float = 1.0
update_all: bool = True
use_gumbel: bool = False
update_by_guide: bool = False
argmax: bool = False
use_best: bool = True
constrain_logits: bool = False
GUIDE_LENGTH = 28
TARGET_CONTEXT_LENGTH = 20
TARGET_WINDOW_LENGTH = 28
GUIDE_PADDING_LENGTH = 20
TARGET_SEQUENCE_LENGTH = TARGET_CONTEXT_LENGTH + TARGET_WINDOW_LENGTH + TARGET_CONTEXT_LENGTH
GUIDE_EXTENDED_LENGTH = GUIDE_PADDING_LENGTH + GUIDE_LENGTH + GUIDE_PADDING_LENGTH
MODEL_SEQUENCE_LENGTH = TARGET_SEQUENCE_LENGTH + GUIDE_EXTENDED_LENGTH