Flip major / minor alleles to reference / alternative

Is there a method that aligns the variant calls to a reference (using the ref. genome fasta or dbSNP)?

I don’t fully understand your question, but it sounds like you want to load the sequence data and then, perhaps, look at the base-pair context of a locus. You can load sequence data into Hail with add_sequence and then you can ask for the base-pair context of a locus. e.g.

import hail as hl
rg = hl.get_reference('GRCh37')
rg.add_sequence('gs://hail-common/references/human_g1k_v37.fasta.gz')
mt = hl.balding_nichols_model(3, 10, 10)
mt = mt.key_rows_by(locus = hl.locus(mt.locus.contig,
                                     mt.locus.position + 1_000_000)) 
mt = mt.annotate_rows(context = mt.locus.sequence_context(before=5))
mt.context.show()

thank you

1 Like