From 4fe8342743d5af38473d9353cfb6a76049e2bf7f Mon Sep 17 00:00:00 2001 From: Mark Chen Date: Wed, 7 Feb 2024 00:43:41 -0500 Subject: [PATCH] fix: `VariantMapper` of `AssemblyMapper._norm` is configurated differently `AssemblyMapper._norm` is a `Normalizer` object. `Normalizer` has a field `vm` of `VariantMapper` class. In the current code, when initialize an `AssemblyMapper` object with the argument set to a different value from `global_config`, the `vm` will be created using `global_config`. The fix passes a `VariantMapper` object initialized using the same arguments as `AssemblyMapper` object. --- src/hgvs/assemblymapper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hgvs/assemblymapper.py b/src/hgvs/assemblymapper.py index dcc5e0a6..64766bb3 100644 --- a/src/hgvs/assemblymapper.py +++ b/src/hgvs/assemblymapper.py @@ -88,8 +88,11 @@ def __init__( self.in_par_assume = in_par_assume self._norm = None if self.normalize: + vm = VariantMapper(hdp=hdp, replace_reference=replace_reference, + prevalidation_level=prevalidation_level, + add_gene_symbol=add_gene_symbol) self._norm = hgvs.normalizer.Normalizer( - hdp, alt_aln_method=alt_aln_method, validate=False + hdp, alt_aln_method=alt_aln_method, validate=False, variantmapper=vm ) self._assembly_map = { k: v for k, v in hdp.get_assembly_map(self.assembly_name).items() if k.startswith("NC_")