Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hail] if an MT is string-column-keyed, use said strings in show #6405

Merged
merged 1 commit into from Jun 20, 2019

Conversation

@danking
Copy link
Collaborator

commented Jun 19, 2019

Previously the below would display 0.GT | 1.GT (simply the index in the entries array).

In [2]: import hail as hl  
   ...: mt = hl.balding_nichols_model(3, 100, 100) 
   ...: mt = mt.key_cols_by(sample_id = 'sample-' + hl.str(mt.sample_idx)) 
   ...: mt.show(n_rows=10, n_cols=10)                                                                                                                                                                               
2019-06-19 16:20:33 Hail: INFO: balding_nichols_model: generating genotypes for 3 populations, 100 samples, and 100 variants...
+---------------+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
| locus         | alleles    | sample-0.GT | sample-1.GT | sample-2.GT | sample-3.GT | sample-4.GT | sample-5.GT | sample-6.GT | sample-7.GT | sample-8.GT | sample-9.GT |
+---------------+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
| locus<GRCh37> | array<str> | call        | call        | call        | call        | call        | call        | call        | call        | call        | call        |
+---------------+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
| 1:1           | ["A","C"]  | 0/0         | 0/0         | 0/1         | 1/1         | 0/1         | 0/0         | 0/1         | 0/1         | 0/1         | 0/1         |
| 1:2           | ["A","C"]  | 1/1         | 0/1         | 0/0         | 0/1         | 1/1         | 1/1         | 0/1         | 1/1         | 0/0         | 1/1         |
| 1:3           | ["A","C"]  | 1/1         | 0/1         | 0/0         | 1/1         | 0/0         | 1/1         | 1/1         | 0/1         | 0/0         | 1/1         |
| 1:4           | ["A","C"]  | 0/0         | 0/1         | 0/0         | 1/1         | 0/1         | 0/0         | 0/1         | 0/0         | 0/0         | 0/1         |
| 1:5           | ["A","C"]  | 0/1         | 0/0         | 0/0         | 0/0         | 0/1         | 0/0         | 0/1         | 0/1         | 0/0         | 1/1         |
| 1:6           | ["A","C"]  | 0/0         | 1/1         | 1/1         | 0/1         | 0/1         | 1/1         | 0/1         | 0/1         | 1/1         | 1/1         |
| 1:7           | ["A","C"]  | 0/0         | 0/1         | 1/1         | 0/1         | 0/1         | 0/1         | 0/0         | 0/1         | 0/0         | 0/1         |
| 1:8           | ["A","C"]  | 0/1         | 0/1         | 1/1         | 1/1         | 0/1         | 0/1         | 1/1         | 1/1         | 0/1         | 0/1         |
| 1:9           | ["A","C"]  | 0/0         | 0/1         | 1/1         | 1/1         | 1/1         | 0/1         | 1/1         | 1/1         | 1/1         | 1/1         |
| 1:10          | ["A","C"]  | 0/1         | 0/1         | 0/1         | 0/0         | 0/1         | 0/0         | 0/1         | 0/1         | 0/0         | 0/1         |
+---------------+------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
showing top 10 rows
showing the first 10 of 100 columns

In [3]:  
@patrick-schultz
Copy link
Collaborator

left a comment

awesome

@danking danking merged commit 58de923 into hail-is:master Jun 20, 2019

1 check passed

ci-test success
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.