Hey, I have a problem when running impute_sex. Can you help me on this ?
Here is what I get as output:
---------------------------------------------------------------------------
ExpressionException Traceback (most recent call last)
~/anaconda3/envs/hail/lib/python3.7/site-packages/hail/expr/expressions/expression_typecheck.py in check(self, x, caller, param)
76 try:
---> 77 return self.coerce(to_expr(x))
78 except ExpressionException as e:
~/anaconda3/envs/hail/lib/python3.7/site-packages/hail/expr/expressions/base_expression.py in to_expr(e, dtype)
206 return e
--> 207 return cast_expr(e, dtype)
208
~/anaconda3/envs/hail/lib/python3.7/site-packages/hail/expr/expressions/base_expression.py in cast_expr(e, dtype)
211 if not dtype:
--> 212 dtype = impute_type(e)
213 x = _to_expr(e, dtype)
~/anaconda3/envs/hail/lib/python3.7/site-packages/hail/expr/expressions/base_expression.py in impute_type(x)
157 if len(x) == 0:
--> 158 raise ExpressionException("Cannot impute type of empty list. Use 'hl.empty_array' to create an empty array.")
159 ts = {impute_type(element) for element in x}
ExpressionException: Cannot impute type of empty list. Use 'hl.empty_array' to create an empty array.
The above exception was the direct cause of the following exception:
TypecheckFailure Traceback (most recent call last)
~/anaconda3/envs/hail/lib/python3.7/site-packages/hail/typecheck/check.py in check_all(f, args, kwargs, checks, is_method)
540 arg = args[i]
--> 541 args_.append(checker.check(arg, name, arg_name))
542 # passed as keyword
~/anaconda3/envs/hail/lib/python3.7/site-packages/hail/expr/expressions/expression_typecheck.py in check(self, x, caller, param)
78 except ExpressionException as e:
---> 79 raise TypecheckFailure from e
80
TypecheckFailure:
The above exception was the direct cause of the following exception:
TypeError Traceback (most recent call last)
<ipython-input-381-6636ce6405c8> in <module>
----> 1 imputed_sex = hl.impute_sex(mt.GT)
<decorator-gen-1558> in impute_sex(call, aaf_threshold, include_par, female_threshold, male_threshold, aaf)
~/anaconda3/envs/hail/lib/python3.7/site-packages/hail/typecheck/check.py in wrapper(__original_func, *args, **kwargs)
612 def wrapper(__original_func, *args, **kwargs):
613 args_, kwargs_ = check_all(__original_func, args, kwargs, checkers, is_method=is_method)
--> 614 return __original_func(*args_, **kwargs_)
615
616 return wrapper
~/anaconda3/envs/hail/lib/python3.7/site-packages/hail/methods/statgen.py in impute_sex(call, aaf_threshold, include_par, female_threshold, male_threshold, aaf)
146 rg = mt.locus.dtype.reference_genome
147 mt = hl.filter_intervals(mt,
--> 148 hl.map(lambda x_contig: hl.parse_locus_interval(x_contig, rg), rg.x_contigs),
149 keep=True)
150 if not include_par:
<decorator-gen-934> in map(f, collection)
~/anaconda3/envs/hail/lib/python3.7/site-packages/hail/typecheck/check.py in wrapper(__original_func, *args, **kwargs)
611 @decorator
612 def wrapper(__original_func, *args, **kwargs):
--> 613 args_, kwargs_ = check_all(__original_func, args, kwargs, checkers, is_method=is_method)
614 return __original_func(*args_, **kwargs_)
615
~/anaconda3/envs/hail/lib/python3.7/site-packages/hail/typecheck/check.py in check_all(f, args, kwargs, checks, is_method)
565 expected=checker.expects(),
566 found=checker.format(arg)
--> 567 )) from e
568 elif param.kind == param.VAR_POSITIONAL:
569 # consume the rest of the positional arguments
TypeError: map: parameter 'collection': expected expression of type set<any> or array<any> or ndarray<any>, found list: []