madhavanvenkatesh commited on
Commit
b025e0d
1 Parent(s): a021deb

inheritance issues

Browse files
Files changed (1) hide show
  1. geneformer/mtl/__init__.py +34 -0
geneformer/mtl/__init__.py CHANGED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ruff: noqa: F401
2
+ import warnings
3
+ from pathlib import Path
4
+ import pickle
5
+
6
+ warnings.filterwarnings("ignore", message=".*The 'nopython' keyword.*") # noqa # isort:skip
7
+
8
+
9
+ GENE_MEDIAN_FILE = Path(__file__).parent.parent / "gene_median_dictionary_gc95M.pkl"
10
+ # point to the actual location of the token dictionary
11
+ TOKEN_DICTIONARY_FILE = Path(__file__).parent.parent / "token_dictionary_gc95M.pkl"
12
+ ENSEMBL_DICTIONARY_FILE = Path(__file__).parent.parent / "gene_name_id_dict_gc95M.pkl"
13
+ ENSEMBL_MAPPING_FILE = Path(__file__).parent.parent / "ensembl_mapping_dict_gc95M.pkl"
14
+
15
+ # Load the token dictionary and other necessary files
16
+ with open(TOKEN_DICTIONARY_FILE, 'rb') as f:
17
+ TOKEN_DICTIONARY = pickle.load(f)
18
+
19
+ with open(GENE_MEDIAN_FILE, 'rb') as f:
20
+ GENE_MEDIAN_DICTIONARY = pickle.load(f)
21
+
22
+ with open(ENSEMBL_DICTIONARY_FILE, 'rb') as f:
23
+ ENSEMBL_DICTIONARY = pickle.load(f)
24
+
25
+ with open(ENSEMBL_MAPPING_FILE, 'rb') as f:
26
+ ENSEMBL_MAPPING = pickle.load(f)
27
+
28
+ # Make the loaded objects available to the classes in the mtl module
29
+ __all__ = [
30
+ "TOKEN_DICTIONARY",
31
+ "GENE_MEDIAN_DICTIONARY",
32
+ "ENSEMBL_DICTIONARY",
33
+ "ENSEMBL_MAPPING",
34
+ ]