geney 1.2.58__py2.py3-none-any.whl → 1.2.60__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/pangolin_utils.py CHANGED
@@ -52,6 +52,7 @@ def pangolin_predict_probs(true_seq, models, just_ss=False):
52
52
  model_nums = [0, 2, 4, 6]
53
53
  else:
54
54
  model_nums = [0, 1, 2, 3, 4, 5, 6, 7]
55
+
55
56
  INDEX_MAP = {0: 1, 1: 2, 2: 4, 3: 5, 4: 7, 5: 8, 6: 10, 7: 11}
56
57
 
57
58
  seq = true_seq
geney/seqmat_utils.py CHANGED
@@ -3,7 +3,7 @@ import numpy as np
3
3
  import copy
4
4
  from Bio.Seq import Seq
5
5
 
6
- NT_ALPHABET = ['A', 'T', 'G', 'C']
6
+ NT_ALPHABET = ['A', 'T', 'G', 'C', 'N']
7
7
 
8
8
 
9
9
  '''
@@ -119,7 +119,6 @@ class SeqMat:
119
119
 
120
120
  @property
121
121
  def seq(self):
122
-
123
122
  return ''.join(self.vectorized_map_v2c(self.seqmat[self.ROW_SEQ, :])).replace('-', '')
124
123
 
125
124
  @property
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
4
+ # from pkg_resources import resource_filename
5
+ from importlib import resources
5
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'):
@@ -15,9 +17,18 @@ else:
15
17
  # tf.config.threading.set_intra_op_parallelism_threads(1)
16
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']
20
30
 
31
+ sai_models = [load_model(f) for f in sai_paths]
21
32
 
22
33
 
23
34
  def one_hot_encode(seq):
geney/splicing_utils.py CHANGED
@@ -358,3 +358,40 @@ def missplicing(mut_id, splicing_threshold=0.5, primary_transcript=True, organis
358
358
 
359
359
  return results
360
360
 
361
+
362
+ import sqlite3
363
+ import json
364
+
365
+ def get_or_compute_splicing(tool, gene, mutation_id, transcript_id, force_recompute=False):
366
+ conn = sqlite3.connect(os.path.join(tool_parameters['splicing_db'], 'mutation_data.db'))
367
+ cursor = conn.cursor()
368
+ # Create table if it doesn't exist
369
+ cursor.execute('''CREATE TABLE IF NOT EXISTS mutations (
370
+ tool TEXT,
371
+ gene TEXT,
372
+ mutation_id TEXT,
373
+ transcript_id TEXT,
374
+ data TEXT,
375
+ PRIMARY KEY (tool, gene, mutation_id, transcript_id)
376
+ )''')
377
+
378
+ # Look up entry
379
+ cursor.execute('SELECT data FROM mutations WHERE tool=? AND gene=? AND mutation_id=? AND transcript_id=?',
380
+ (tool, gene, mutation_id, transcript_id))
381
+ row = cursor.fetchone()
382
+
383
+ # If entry is found and force_recompute is False, return data
384
+ if row and not force_recompute:
385
+ return json.loads(row[0])
386
+
387
+ # Otherwise, compute the dictionary
388
+ computed_data = find_transcript_missplicing(tool, mutation_id, transcript_id) # Replace with actual function
389
+
390
+ # Store in the database
391
+ data_json = json.dumps(computed_data)
392
+ cursor.execute('REPLACE INTO mutations (tool, mutation_id, transcript_id, data) VALUES (?, ?, ?, ?)',
393
+ (tool, mutation_id, transcript_id, data_json))
394
+ conn.commit()
395
+ conn.close()
396
+
397
+ return computed_data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geney
3
- Version: 1.2.58
3
+ Version: 1.2.60
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=HvXfdLhHWTDXNmYtc8K3p64iTvDtsBq6-Jml5tpg7JI,2930
10
+ geney/pangolin_utils.py,sha256=Hsq9Y_GLFHGqEDn25_VdD7YKUYxpjMlynj0z-B_LezE,2931
11
11
  geney/power_utils.py,sha256=MehZFUdkJ2EFUot709yPEDxSkXmH5XevMebX2HD768A,7330
12
- geney/seqmat_utils.py,sha256=2cRXT_Ox4IdzCM8x3H2HexxFZzjo5WHs0HZiUQv8fBM,18347
13
- geney/spliceai_utils.py,sha256=WsHa0rfszTWc3Syp_an9FgJFYUvR-2vL9mZ3rVFMqb0,2275
14
- geney/splicing_utils.py,sha256=34xdarFpTHsHZkhi7VrHby9DaIBZ2xCLqPMrTmasEgE,16860
12
+ geney/seqmat_utils.py,sha256=hIikPuybVdZ3ZU9WlaTs6ON7U0AVQv5Kya4CXhKIt-s,18351
13
+ geney/spliceai_utils.py,sha256=PFIhTK8Ihrj-cv5tgRN0UFPYEmC4uxtqXSP9bBLnZRM,3077
14
+ geney/splicing_utils.py,sha256=I_YKc5O0djYY5VgDqBb0JFYogPEUyH6n9B_IngAw33Y,18321
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.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,,
23
+ geney-1.2.60.dist-info/METADATA,sha256=hot8OpcKUrw3KWJcUS8NtgHvggVmM9CSNteWAinAVls,948
24
+ geney-1.2.60.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
25
+ geney-1.2.60.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
26
+ geney-1.2.60.dist-info/RECORD,,
File without changes