Skip to content

Commit 715e56f

Browse files
committed
ASSEMBLY_MAP MappingProxyType
1 parent e61c3cf commit 715e56f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/anyvlm/utils/types.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Provide helpful type definitions, references, and type-based operations."""
22

33
from enum import Enum, StrEnum
4+
from types import MappingProxyType
45
from typing import Annotated
56

67
from anyvar.utils.liftover_utils import ReferenceAssembly
@@ -54,12 +55,16 @@ class UcscAssemblyBuild(StrEnum):
5455

5556

5657
# Mapping of GRC and UCSC assembly identifiers to their corresponding ReferenceAssembly
57-
ASSEMBLY_MAP = {
58-
GrcAssemblyId.GRCH38: ReferenceAssembly.GRCH38,
59-
UcscAssemblyBuild.HG38: ReferenceAssembly.GRCH38,
60-
GrcAssemblyId.GRCH37: ReferenceAssembly.GRCH37,
61-
UcscAssemblyBuild.HG19: ReferenceAssembly.GRCH37,
62-
}
58+
ASSEMBLY_MAP: MappingProxyType[GrcAssemblyId | UcscAssemblyBuild, ReferenceAssembly] = (
59+
MappingProxyType(
60+
{
61+
GrcAssemblyId.GRCH38: ReferenceAssembly.GRCH38,
62+
UcscAssemblyBuild.HG38: ReferenceAssembly.GRCH38,
63+
GrcAssemblyId.GRCH37: ReferenceAssembly.GRCH37,
64+
UcscAssemblyBuild.HG19: ReferenceAssembly.GRCH37,
65+
}
66+
)
67+
)
6368

6469

6570
NucleotideSequence = Annotated[

0 commit comments

Comments
 (0)