Dear Hail team,
Given a genomic region, is it possible to output a genotype matrix (M individuals by N SNPs, in which the values are minor allele counts (0, 1, 2)) with hail 0.2?
Thank you very much!
Best regards,
Wei
Dear Hail team,
Given a genomic region, is it possible to output a genotype matrix (M individuals by N SNPs, in which the values are minor allele counts (0, 1, 2)) with hail 0.2?
Thank you very much!
Best regards,
Wei
Hi Wei,
Try the following:
mt = hl.import_vcf('src/test/resources/sample.vcf')
mt = hl.filter_intervals(mt, [hl.parse_locus_interval('20:10620000-10650000')])
mt = mt.select_entries(GT = mt.GT.n_alt_alleles())
mt.make_table(separator='').export('/tmp/foo.txt')
You can change the interval(s) and files as necessary.