Skip to content

Commit

Permalink
fix: VariantMapper of AssemblyMapper._norm is configurated differ…
Browse files Browse the repository at this point in the history
…ently

`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.
  • Loading branch information
markgene authored Feb 7, 2024
1 parent fd427da commit 4fe8342
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hgvs/assemblymapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_")
Expand Down

0 comments on commit 4fe8342

Please sign in to comment.