def test_hg19_to_hg38(hgvs_wrapper): vars38 = [ 'chr13:g.32316477:AAG>A', 'chr17:g.43079204:A>C', 'chr17:g.43053755:G>A', 'chr17:g.43125273:T>C', None ] # outside transcript boundaries vars37 = [ 'chr13:g.32890614:AAG>A', 'chr17:g.41231221:A>C', 'chr17:g.41205772:G>A', 'chr17:g.41277290:T>C', 'chr17:g.41279883:GAC>G' ] for (v37, v38) in zip(vars37, vars38): v37_obj = VCFVariant.from_str(v37).to_hgvs_obj( hgvs_wrapper.contig_maps[hgvs_utils.HgvsWrapper.GRCh37_Assem]) if v38: v38_obj = VCFVariant.from_hgvs_obj( hgvs_wrapper.hg19_to_hg38(v37_obj)) assert VCFVariant.from_str(v38) == v38_obj else: with pytest.raises(ValueError): hgvs_wrapper.hg19_to_hg38(v37_obj)
def hgvs_variant(hgvs_wrapper): return (VCFVariant.from_str('chr13:g.32316477:AAG>A').to_hgvs_obj( hgvs_wrapper.contig_maps[hgvs_utils.HgvsWrapper.GRCh38_Assem]))