Trying to extract sample ID from a VCF file imported as a matrix table. I did so by accessing the column key,
vcf_mt = hl.import_vcf(‘./test.vcf’)
sample = vcf_mt.s
I want to use hl.eval()
on the above variable sample
but it errors out.
>>> sample
<StringExpression of type str>
>>>
>>> sample.show()
+---------+
| s |
+---------+
| str |
+---------+
| "test" |
+---------+
>>>
>>> hl.eval(sample)
hail.expr.expressions.base_expression.ExpressionException: scope violation: 'eval' expects an expression indexed by []
Found indices ['column'], with unexpected indices ['column']. Invalid fields:
's' (indices ['column'])
I understand the variable sample
has an index, but how do I evaluate this StringExpression?
I’m basically trying to parse the sample ID from the matrix table.
Faizal