Christina Theodoris
commited on
Commit
·
f26136d
1
Parent(s):
4364d31
update V1 token dict usage to self attr
Browse files
geneformer/emb_extractor.py
CHANGED
|
@@ -531,8 +531,8 @@ class EmbExtractor:
|
|
| 531 |
|
| 532 |
# load token dictionary (Ensembl IDs:token)
|
| 533 |
if self.token_dictionary_file is None:
|
| 534 |
-
token_dictionary_file = TOKEN_DICTIONARY_FILE
|
| 535 |
-
with open(token_dictionary_file, "rb") as f:
|
| 536 |
self.gene_token_dict = pickle.load(f)
|
| 537 |
|
| 538 |
self.token_gene_dict = {v: k for k, v in self.gene_token_dict.items()}
|
|
|
|
| 531 |
|
| 532 |
# load token dictionary (Ensembl IDs:token)
|
| 533 |
if self.token_dictionary_file is None:
|
| 534 |
+
self.token_dictionary_file = TOKEN_DICTIONARY_FILE
|
| 535 |
+
with open(self.token_dictionary_file, "rb") as f:
|
| 536 |
self.gene_token_dict = pickle.load(f)
|
| 537 |
|
| 538 |
self.token_gene_dict = {v: k for k, v in self.gene_token_dict.items()}
|
geneformer/in_silico_perturber.py
CHANGED
|
@@ -251,8 +251,8 @@ class InSilicoPerturber:
|
|
| 251 |
|
| 252 |
# load token dictionary (Ensembl IDs:token)
|
| 253 |
if self.token_dictionary_file is None:
|
| 254 |
-
token_dictionary_file = TOKEN_DICTIONARY_FILE
|
| 255 |
-
with open(token_dictionary_file, "rb") as f:
|
| 256 |
self.gene_token_dict = pickle.load(f)
|
| 257 |
self.token_gene_dict = {v: k for k, v in self.gene_token_dict.items()}
|
| 258 |
|
|
|
|
| 251 |
|
| 252 |
# load token dictionary (Ensembl IDs:token)
|
| 253 |
if self.token_dictionary_file is None:
|
| 254 |
+
self.token_dictionary_file = TOKEN_DICTIONARY_FILE
|
| 255 |
+
with open(self.token_dictionary_file, "rb") as f:
|
| 256 |
self.gene_token_dict = pickle.load(f)
|
| 257 |
self.token_gene_dict = {v: k for k, v in self.gene_token_dict.items()}
|
| 258 |
|