StringEpression

I have exported a StringExpression array into table format but all the variables which that array contains are coming in a single column, i want to know how can i split those values into different columns because i cant use them in this fashion??

image

In the picture locus and alleles are separated by “;” but after it i have VEP which is in StringEpression and that is what i want to use but can not.

Thanks.

What’s the schema of the table? ht.describe()?

I think you don’t want to use export. Instead of exporting an expression, try using write to write out the table or matrix table that the expression comes from. If you have a matrix table row expression and you don’t want to write out the genotypes you can use:

rows = mt.rows()
rows.select(... expression ...).write(...)

write stores data in a Hail-friendly format so it’s faster and preserves the data types when you read it. export generates text so it’s slower and loses data type information.

This is a csv file. My mt was not converting into table, thats why i just saved my mt as a csv file.

I tried to write mt into a table but faced the following error; VCFParseError: invalid INFO key

That error will occur on any usage of the matrix table – it needs to be resolved. I think the easiest thing is to preprocess your VCF to remove the problematic properties.