I have a file in the long format, that is
condition1.txt
GENE SAMPLE VALUE
A S1 10.6
B S2 20.3
That I would like to load into a HAIL Matrix Table where the GENE would be the row field, the SAMPLE the column field and the value an entry field.
with this structure:
----------------------------------------
Global fields:
None
----------------------------------------
Column fields:
'SAMPLE': str
----------------------------------------
Row fields:
'GENE': str
----------------------------------------
Entry fields:
'condition1': float64
----------------------------------------
Column key: ['SAMPLE']
Row key: ['GENE']
----------------------------------------
Is there a way to import this into a HAIL MT?
Also, how would i name or rename the entry field and column field during import?
The docs don’t seem to have info on it (Hail | Import / Export) although I could use the mt.rename() function I think, but seems something you want to do at import.
In addition, is it possible to add an new entry into an exisiting MT?
So, if I had an additional file
condition2.txt
GENE SAMPLE VALUE
A S1 6.2
B S2 8.1
Could I get it to load as an additional entries so I would have
----------------------------------------
Global fields:
None
----------------------------------------
Column fields:
'SAMPLE': str
----------------------------------------
Row fields:
'GENE': str
----------------------------------------
Entry fields:
'condition1': float64
'condition2': float64
----------------------------------------
Column key: ['SAMPLE']
Row key: ['GENE']
----------------------------------------
Thanks!