geney 1.2.57__py2.py3-none-any.whl → 1.2.59__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of geney might be problematic. Click here for more details.

geney/spliceai_utils.py CHANGED
@@ -1,10 +1,12 @@
1
1
 
2
2
  #### SpliceAI Modules
3
3
  from keras.models import load_model
4
- from pkg_resources import resource_filename
5
- from spliceai.utils import one_hot_encode
4
+ # from pkg_resources import resource_filename
5
+ from importlib import resources
6
+ # from spliceai.utils import one_hot_encode
6
7
  import numpy as np
7
8
  import tensorflow as tf
9
+ import sys
8
10
 
9
11
  # Check if GPU is available
10
12
  if tf.config.list_physical_devices('GPU'):
@@ -12,12 +14,35 @@ if tf.config.list_physical_devices('GPU'):
12
14
  else:
13
15
  print("Running on CPU.")
14
16
 
15
- tf.config.threading.set_intra_op_parallelism_threads(1)
16
- tf.config.threading.set_inter_op_parallelism_threads(1)
17
+ # tf.config.threading.set_intra_op_parallelism_threads(1)
18
+ # tf.config.threading.set_inter_op_parallelism_threads(1)
17
19
 
18
- sai_paths = ('models/spliceai{}.h5'.format(x) for x in range(1, 6))
19
- sai_models = [load_model(resource_filename('spliceai', x)) for x in sai_paths]
20
+ if sys.platform == 'darwin':
21
+ sai_paths = ('models/spliceai{}.h5'.format(x) for x in range(1, 6))
22
+ # sai_models = [load_model(resource_filename('spliceai', x)) for x in sai_paths]
23
+ sai_models = [load_model(resources.files('spliceai').joinpath(f)) for f in sai_paths]
24
+ else:
25
+ sai_paths = ['/tamir2/nicolaslynn/home/miniconda3/lib/python3.10/site-packages/spliceai/models/spliceai1.h5',
26
+ '/tamir2/nicolaslynn/home/miniconda3/lib/python3.10/site-packages/spliceai/models/spliceai2.h5',
27
+ '/tamir2/nicolaslynn/home/miniconda3/lib/python3.10/site-packages/spliceai/models/spliceai3.h5',
28
+ '/tamir2/nicolaslynn/home/miniconda3/lib/python3.10/site-packages/spliceai/models/spliceai4.h5',
29
+ '/tamir2/nicolaslynn/home/miniconda3/lib/python3.10/site-packages/spliceai/models/spliceai5.h5']
30
+
31
+ sai_models = [load_model(f) for f in sai_paths]
32
+
33
+
34
+ def one_hot_encode(seq):
35
+
36
+ map = np.asarray([[0, 0, 0, 0],
37
+ [1, 0, 0, 0],
38
+ [0, 1, 0, 0],
39
+ [0, 0, 1, 0],
40
+ [0, 0, 0, 1]])
41
+
42
+ seq = seq.upper().replace('A', '\x01').replace('C', '\x02')
43
+ seq = seq.replace('G', '\x03').replace('T', '\x04').replace('N', '\x00')
20
44
 
45
+ return map[np.fromstring(seq, np.int8) % 5]
21
46
 
22
47
 
23
48
  def sai_predict_probs(seq: str, models: list) -> list:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geney
3
- Version: 1.2.57
3
+ Version: 1.2.59
4
4
  Summary: A Python package for gene expression modeling.
5
5
  Home-page: https://github.com/nicolaslynn/geney
6
6
  Author: Nicolas Lynn
@@ -10,7 +10,7 @@ geney/oncosplice.py,sha256=eWgY2Lcj894UBFnIVhbxiVz5oqASHg-Ot1wFbjlJbI8,21857
10
10
  geney/pangolin_utils.py,sha256=HvXfdLhHWTDXNmYtc8K3p64iTvDtsBq6-Jml5tpg7JI,2930
11
11
  geney/power_utils.py,sha256=MehZFUdkJ2EFUot709yPEDxSkXmH5XevMebX2HD768A,7330
12
12
  geney/seqmat_utils.py,sha256=2cRXT_Ox4IdzCM8x3H2HexxFZzjo5WHs0HZiUQv8fBM,18347
13
- geney/spliceai_utils.py,sha256=21_TaiLW3faRuPegMgsVvIf1G1a03penZSiydQ-hOTA,1869
13
+ geney/spliceai_utils.py,sha256=PFIhTK8Ihrj-cv5tgRN0UFPYEmC4uxtqXSP9bBLnZRM,3077
14
14
  geney/splicing_utils.py,sha256=34xdarFpTHsHZkhi7VrHby9DaIBZ2xCLqPMrTmasEgE,16860
15
15
  geney/survival_utils.py,sha256=KnAzEviMuXh6SnVXId9PgsFLSbgkduTvYoIthxN7FPA,6886
16
16
  geney/tcga_utils.py,sha256=D_BNHm-D_K408dlcJm3hzH2c6QNFjQsKvUcOPiQRk7g,17612
@@ -20,7 +20,7 @@ geney/translation_initiation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
20
20
  geney/translation_initiation/tis_utils.py,sha256=AF3siFjuQH-Rs44EV-80zHdbxRMvN4woLFSHroWIETc,4448
21
21
  geney/translation_initiation/resources/kozak_pssm.json,sha256=pcd0Olziutq-6H3mFWDCD9cujQ_AlZO-iiOvBl82hqE,1165
22
22
  geney/translation_initiation/resources/tis_regressor_model.joblib,sha256=IXb4DUDhJ5rBDKcqMk9zE3ECTZZcdj7Jixz3KpoZ7OA,2592025
23
- geney-1.2.57.dist-info/METADATA,sha256=UFirGNGhFN_aJnqSO8WHagJCmEfKoHdfRZojLfKymsE,948
24
- geney-1.2.57.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
25
- geney-1.2.57.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
26
- geney-1.2.57.dist-info/RECORD,,
23
+ geney-1.2.59.dist-info/METADATA,sha256=fiwDiB2jrpokLcoAhC6YQ2OQyY6RBdJSjhQx_T99lXo,948
24
+ geney-1.2.59.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
25
+ geney-1.2.59.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
26
+ geney-1.2.59.dist-info/RECORD,,
File without changes