@@ -27,26 +27,46 @@ def __init__(self):
27
27
)
28
28
29
29
30
- class UnsupportedRegexError (UnsupportedFilteringFeatureError ):
31
- issue = "174"
32
- feature = "Regular expressions"
30
+ class UnsupportedMissingDataError (UnsupportedFilteringFeatureError ):
31
+ issue = "163"
32
+ feature = "Missing data"
33
+
34
+
35
+ class UnsupportedFilterFieldError (UnsupportedFilteringFeatureError ):
36
+ issue = "164"
37
+ feature = "FILTER field"
38
+
39
+
40
+ class UnsupportedGenotypeValuesError (UnsupportedFilteringFeatureError ):
41
+ issue = "165"
42
+ feature = "Genotype values"
33
43
34
44
35
45
class UnsupportedArraySubscriptError (UnsupportedFilteringFeatureError ):
36
46
issue = "167"
37
47
feature = "Array subscripts"
38
48
39
49
40
- class UnsupportedStringsError (UnsupportedFilteringFeatureError ):
41
- issue = "189 "
42
- feature = "String values temporarily removed "
50
+ class UnsupportedRegexError (UnsupportedFilteringFeatureError ):
51
+ issue = "174 "
52
+ feature = "Regular expressions "
43
53
44
54
45
55
class UnsupportedFileReferenceError (UnsupportedFilteringFeatureError ):
46
56
issue = "175"
47
57
feature = "File references"
48
58
49
59
60
+ class UnsupportedChromFieldError (UnsupportedFilteringFeatureError ):
61
+ issue = "178"
62
+ feature = "CHROM field"
63
+
64
+
65
+ class UnsupportedStringsError (UnsupportedFilteringFeatureError ):
66
+ issue = "189"
67
+ feature = "String values temporarily removed"
68
+
69
+
50
70
class UnsupportedFunctionsError (UnsupportedFilteringFeatureError ):
51
71
issue = "190"
52
72
feature = "Function evaluation"
@@ -89,7 +109,11 @@ class Number(Constant):
89
109
90
110
class String (Constant ):
91
111
def __init__ (self , tokens ):
92
- raise UnsupportedStringsError ()
112
+ super ().__init__ (tokens )
113
+ if self .tokens == "." :
114
+ raise UnsupportedMissingDataError ()
115
+ else :
116
+ raise UnsupportedStringsError ()
93
117
94
118
95
119
class FileReference (Constant ):
@@ -104,8 +128,15 @@ def __init__(self, tokens):
104
128
105
129
class Identifier (EvaluationNode ):
106
130
def __init__ (self , mapper , tokens ):
107
- self .field_name = mapper (tokens [0 ])
108
- logger .debug (f"Mapped { tokens [0 ]} to { self .field_name } " )
131
+ token = tokens [0 ]
132
+ if token == "CHROM" :
133
+ raise UnsupportedChromFieldError ()
134
+ elif token == "FILTER" :
135
+ raise UnsupportedFilterFieldError ()
136
+ elif token == "GT" :
137
+ raise UnsupportedGenotypeValuesError ()
138
+ self .field_name = mapper (token )
139
+ logger .debug (f"Mapped { token } to { self .field_name } " )
109
140
110
141
def eval (self , data ):
111
142
value = np .asarray (data [self .field_name ])
0 commit comments