geney 1.2.56__py2.py3-none-any.whl → 1.2.58__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.
geney/pangolin_utils.py CHANGED
@@ -46,10 +46,12 @@ def pang_one_hot_encode(seq):
46
46
 
47
47
 
48
48
 
49
- def pangolin_predict_probs(true_seq, models):
49
+ def pangolin_predict_probs(true_seq, models, just_ss=False):
50
50
  # print(f"Running pangolin on: {true_seq}")
51
- model_nums = [0, 2, 4, 6]
52
- model_nums = [0, 1, 2, 3, 4, 5, 6]
51
+ if just_ss:
52
+ model_nums = [0, 2, 4, 6]
53
+ else:
54
+ model_nums = [0, 1, 2, 3, 4, 5, 6, 7]
53
55
  INDEX_MAP = {0: 1, 1: 2, 2: 4, 3: 5, 4: 7, 5: 8, 6: 10, 7: 11}
54
56
 
55
57
  seq = true_seq
geney/spliceai_utils.py CHANGED
@@ -2,7 +2,7 @@
2
2
  #### SpliceAI Modules
3
3
  from keras.models import load_model
4
4
  from pkg_resources import resource_filename
5
- from spliceai.utils import one_hot_encode
5
+ # from spliceai.utils import one_hot_encode
6
6
  import numpy as np
7
7
  import tensorflow as tf
8
8
 
@@ -12,14 +12,28 @@ if tf.config.list_physical_devices('GPU'):
12
12
  else:
13
13
  print("Running on CPU.")
14
14
 
15
- tf.config.threading.set_intra_op_parallelism_threads(1)
16
- tf.config.threading.set_inter_op_parallelism_threads(1)
15
+ # tf.config.threading.set_intra_op_parallelism_threads(1)
16
+ # tf.config.threading.set_inter_op_parallelism_threads(1)
17
17
 
18
18
  sai_paths = ('models/spliceai{}.h5'.format(x) for x in range(1, 6))
19
19
  sai_models = [load_model(resource_filename('spliceai', x)) for x in sai_paths]
20
20
 
21
21
 
22
22
 
23
+ def one_hot_encode(seq):
24
+
25
+ map = np.asarray([[0, 0, 0, 0],
26
+ [1, 0, 0, 0],
27
+ [0, 1, 0, 0],
28
+ [0, 0, 1, 0],
29
+ [0, 0, 0, 1]])
30
+
31
+ seq = seq.upper().replace('A', '\x01').replace('C', '\x02')
32
+ seq = seq.replace('G', '\x03').replace('T', '\x04').replace('N', '\x00')
33
+
34
+ return map[np.fromstring(seq, np.int8) % 5]
35
+
36
+
23
37
  def sai_predict_probs(seq: str, models: list) -> list:
24
38
  '''
25
39
  Predicts the donor and acceptor junction probability of each
geney/splicing_utils.py CHANGED
@@ -145,7 +145,7 @@ def find_ss_changes(ref_dct, mut_dct, known_splice_sites, threshold=0.5):
145
145
  return discovered_pos, deleted_pos
146
146
 
147
147
 
148
- def find_transcript_missplicing(transcript, mutations, context=5000, window=2500, threshold=0.5, engine='spliceai'):
148
+ def find_transcript_missplicing(transcript, mutations, context=5000, window=2500, threshold=0.5, engine='spliceai', just_ss=False):
149
149
  from functools import reduce
150
150
  ref = transcript.pre_mrna
151
151
  var = reduce(lambda acc, mutation: acc + mutation, mutations, ref)
@@ -182,8 +182,8 @@ def find_transcript_missplicing(transcript, mutations, context=5000, window=2500
182
182
 
183
183
  elif engine == 'pangolin':
184
184
  from .pangolin_utils import pangolin_predict_probs, pang_models
185
- ref_seq_donor_probs, ref_seq_acceptor_probs = pangolin_predict_probs(ref_seq, models=pang_models)
186
- mut_seq_donor_probs, mut_seq_acceptor_probs = pangolin_predict_probs(var_seq, models=pang_models)
185
+ ref_seq_donor_probs, ref_seq_acceptor_probs = pangolin_predict_probs(ref_seq, models=pang_models, just_ss=just_ss)
186
+ mut_seq_donor_probs, mut_seq_acceptor_probs = pangolin_predict_probs(var_seq, models=pang_models, just_ss=just_ss)
187
187
 
188
188
  else:
189
189
  raise ValueError(f"{engine} not implemented")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geney
3
- Version: 1.2.56
3
+ Version: 1.2.58
4
4
  Summary: A Python package for gene expression modeling.
5
5
  Home-page: https://github.com/nicolaslynn/geney
6
6
  Author: Nicolas Lynn
@@ -7,11 +7,11 @@ geney/gtex_utils.py,sha256=asL2lHyU5KsbWpV096vkf1Ka7hSo_RRfZqw7p5nERmE,1919
7
7
  geney/immune_utils.py,sha256=ZRni5ttrhpYBnmNr0d0ZatIbNPYs4nmQuoUO00SpsS4,5271
8
8
  geney/mutation_utils.py,sha256=C_kv2MB_L8LlhX3W2ooXjJ3uDoJ8zX1WeDtZKoBZJkI,1547
9
9
  geney/oncosplice.py,sha256=eWgY2Lcj894UBFnIVhbxiVz5oqASHg-Ot1wFbjlJbI8,21857
10
- geney/pangolin_utils.py,sha256=NJEdY43L_2lielY1hZOjlak0baHqXTa1ITrvx8Tkg5o,2878
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
14
- geney/splicing_utils.py,sha256=t0vE5KTAdYOYJLa9wjaSJ1jqiHhsDxZs64OxrgR-Sqc,16811
13
+ geney/spliceai_utils.py,sha256=WsHa0rfszTWc3Syp_an9FgJFYUvR-2vL9mZ3rVFMqb0,2275
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
17
17
  geney/tis_utils.py,sha256=2makfGfVlDFVIbxzXE85AY9jmAjcNmxyIAxjvkRA5LY,7396
@@ -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.56.dist-info/METADATA,sha256=tHCFJyD9OKjk7GnQToKesLQZyzy0dtO9oBsr0Bjz6rI,948
24
- geney-1.2.56.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
25
- geney-1.2.56.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
26
- geney-1.2.56.dist-info/RECORD,,
23
+ geney-1.2.58.dist-info/METADATA,sha256=2JzM2cheIg-hbdz2hy_46ltky6-VTn4qZCj0ZCNOSn0,948
24
+ geney-1.2.58.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
25
+ geney-1.2.58.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
26
+ geney-1.2.58.dist-info/RECORD,,
File without changes