geney 1.4.34__py2.py3-none-any.whl → 1.4.36__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/pipelines.py +10 -0
- geney/utils/spliceai_pytorch_utils.py +4 -2
- geney/utils/spliceai_utils.py +1 -1
- geney/utils/splicing_utils.py +2 -2
- {geney-1.4.34.dist-info → geney-1.4.36.dist-info}/METADATA +2 -1
- {geney-1.4.34.dist-info → geney-1.4.36.dist-info}/RECORD +8 -8
- {geney-1.4.34.dist-info → geney-1.4.36.dist-info}/WHEEL +0 -0
- {geney-1.4.34.dist-info → geney-1.4.36.dist-info}/top_level.txt +0 -0
geney/pipelines.py
CHANGED
|
@@ -9,6 +9,16 @@ from .Oncosplice import Oncosplice
|
|
|
9
9
|
from .utils.TranscriptLibrary import TranscriptLibrary
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
def splicing_analysis(mut_id, transcript_id=None, splicing_engine='spliceai'):
|
|
13
|
+
m = MutationalEvent(mut_id)
|
|
14
|
+
assert m.compatible(), 'Mutations in event are incompatible'
|
|
15
|
+
reference_transcript = Gene.from_file(
|
|
16
|
+
m.gene).transcript(transcript_id).generate_pre_mrna().generate_mature_mrna().generate_protein()
|
|
17
|
+
tl = TranscriptLibrary(reference_transcript, m)
|
|
18
|
+
splicing_results = tl.predict_splicing(m.position, engine=splicing_engine, inplace=True).get_event_columns('event')
|
|
19
|
+
ss = SpliceSimulator(splicing_results, tl.event, feature='event', max_distance=100_000_000)
|
|
20
|
+
return ss
|
|
21
|
+
|
|
12
22
|
def max_splicing_delta(mut_id, transcript_id=None, splicing_engine='spliceai'):
|
|
13
23
|
m = MutationalEvent(mut_id)
|
|
14
24
|
assert m.compatible(), 'Mutations in event are incompatible'
|
|
@@ -65,12 +65,14 @@ def sai_predict_probs(seq: str, model) -> list:
|
|
|
65
65
|
is the donor probability. These probabilities corresponds to the
|
|
66
66
|
middel <L NTs> NTs of the input seq.
|
|
67
67
|
'''
|
|
68
|
-
x = one_hot_encode(seq)[None, :, :].transpose(1, 2) # shape: [1, 4, L]
|
|
68
|
+
x = one_hot_encode(seq)[None, :, :].transpose(1, 2).to(device) # shape: [1, 4, L]
|
|
69
|
+
# print(x.shape)
|
|
69
70
|
y = model(x)
|
|
71
|
+
# print(y.shape)
|
|
70
72
|
probs = torch.softmax(y, dim=1) # shape: [1, 3, L]
|
|
71
73
|
acceptor_probs = probs[0, :, 1] # [L]
|
|
72
74
|
donor_probs = probs[0, :, 2] # [L]
|
|
73
|
-
return acceptor_probs.tolist(), donor_probs.tolist()
|
|
75
|
+
return acceptor_probs.tolist() + [0], donor_probs.tolist() + [0]
|
|
74
76
|
|
|
75
77
|
|
|
76
78
|
def run_spliceai_seq(seq, indices, threshold=0):
|
geney/utils/spliceai_utils.py
CHANGED
|
@@ -26,7 +26,7 @@ if sys.platform == 'darwin':
|
|
|
26
26
|
model_filenames = [f"models/spliceai{i}.h5" for i in range(1, 6)]
|
|
27
27
|
model_paths = [resources.files('spliceai').joinpath(f) for f in model_filenames]
|
|
28
28
|
else:
|
|
29
|
-
model_paths = [f"/tamir2/nicolaslynn/
|
|
29
|
+
model_paths = [f"/tamir2/nicolaslynn/tools/SpliceAI/spliceai/models/spliceai{i}.h5"
|
|
30
30
|
for i in range(1, 6)]
|
|
31
31
|
|
|
32
32
|
# Load models onto correct device
|
geney/utils/splicing_utils.py
CHANGED
|
@@ -20,7 +20,7 @@ def run_splicing_engine(seq: Optional[str] = None, engine: str = 'spliceai') ->
|
|
|
20
20
|
|
|
21
21
|
if seq is None:
|
|
22
22
|
from geney.utils.utils import generate_random_sequence
|
|
23
|
-
seq = generate_random_sequence(
|
|
23
|
+
seq = generate_random_sequence(15_001)
|
|
24
24
|
|
|
25
25
|
match engine:
|
|
26
26
|
case 'spliceai':
|
|
@@ -30,12 +30,12 @@ def run_splicing_engine(seq: Optional[str] = None, engine: str = 'spliceai') ->
|
|
|
30
30
|
case 'spliceai-pytorch':
|
|
31
31
|
from geney.utils.spliceai_pytorch_utils import sai_predict_probs, model
|
|
32
32
|
acceptor_probs, donor_probs = sai_predict_probs(seq, model=model)
|
|
33
|
-
print(len(acceptor_probs), len(donor_probs), donor_probs)
|
|
34
33
|
|
|
35
34
|
case 'pangolin':
|
|
36
35
|
from geney.utils.pangolin_utils import pangolin_predict_probs, pang_models
|
|
37
36
|
# print(seq)
|
|
38
37
|
donor_probs, acceptor_probs = pangolin_predict_probs(seq, models=pang_models)
|
|
38
|
+
|
|
39
39
|
case _:
|
|
40
40
|
raise ValueError(f"Engine '{engine}' not implemented")
|
|
41
41
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: geney
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.36
|
|
4
4
|
Summary: A Python package for gene expression modeling.
|
|
5
5
|
Home-page: https://github.com/nicolaslynn/geney
|
|
6
6
|
Author: Nicolas Lynn
|
|
@@ -31,4 +31,5 @@ Requires-Dist: pyfastx
|
|
|
31
31
|
Requires-Dist: tensorflow
|
|
32
32
|
Requires-Dist: keras
|
|
33
33
|
Requires-Dist: redis
|
|
34
|
+
Requires-Dist: seaborn
|
|
34
35
|
|
|
@@ -23,7 +23,7 @@ geney/gtex_utils.py,sha256=asL2lHyU5KsbWpV096vkf1Ka7hSo_RRfZqw7p5nERmE,1919
|
|
|
23
23
|
geney/immune_utils.py,sha256=b-8dRcCti7xsU7RG3op18lkSnAD8dp_BymGaR-hbNcI,5272
|
|
24
24
|
geney/mutation_utils.py,sha256=C_kv2MB_L8LlhX3W2ooXjJ3uDoJ8zX1WeDtZKoBZJkI,1547
|
|
25
25
|
geney/pangolin_utils.py,sha256=9jdBXlOcRaUdfi-UpUxHA0AkTMZkUF-Lt7HVZ1nEm3s,2973
|
|
26
|
-
geney/pipelines.py,sha256=
|
|
26
|
+
geney/pipelines.py,sha256=uYauL2Oy7aPYiwkjpWSMSNDIdNLUPoMgoKh78JD1sBk,3709
|
|
27
27
|
geney/power_utils.py,sha256=orOhsr9vkQ-Y4nD1zHj_MmR2J3uYiUsiklqVy-5T-2M,7331
|
|
28
28
|
geney/seqmat_utils.py,sha256=wzb3PX5it5bpIFQvcxyzlxfhoJTbHHbsjg0rzh05iVs,19753
|
|
29
29
|
geney/spliceai_utils.py,sha256=nyBnLdYs1rB-duA9lfJYM9Q2xNlvZA3I_sCJ1z5WjFw,3294
|
|
@@ -43,11 +43,11 @@ geney/utils/TranscriptLibrary.py,sha256=W1hv4Y8wRlmwTs3iFdn4_IqS-2suVDzZe4fwti2K
|
|
|
43
43
|
geney/utils/__init__.py,sha256=-nJ-DMx1JzP-ZCe_QuQCeM0ZYIT_16jxoXDhUaO_4Oc,714
|
|
44
44
|
geney/utils/mutation_utils.py,sha256=r-pHr56gEa5kh_DPX8MjFY3ZfYaOtyo4CUfJ5ZHlXPw,3243
|
|
45
45
|
geney/utils/pangolin_utils.py,sha256=JQSPbWxdzqGFYfWQktkfLMaMSGR28eGQhNzO7MLMe5M,6162
|
|
46
|
-
geney/utils/spliceai_pytorch_utils.py,sha256=
|
|
47
|
-
geney/utils/spliceai_utils.py,sha256=
|
|
48
|
-
geney/utils/splicing_utils.py,sha256=
|
|
46
|
+
geney/utils/spliceai_pytorch_utils.py,sha256=oFKX00mUiaHNJ2qyivQfgzbouz57N3p1Q7uNrMmjtdk,2857
|
|
47
|
+
geney/utils/spliceai_utils.py,sha256=8CBMCo13vRaj-E3h0eZkjiRmRpYI9po4_42O43vKaME,2691
|
|
48
|
+
geney/utils/splicing_utils.py,sha256=JpUmuuzlzVZUI_zzaIwa03Xv-NGXzR6jlOmDAbNTYzc,20966
|
|
49
49
|
geney/utils/utils.py,sha256=GXqlatNhix1akt3fburNzIwhiW9ZdCQSt2vmU80neyA,2370
|
|
50
|
-
geney-1.4.
|
|
51
|
-
geney-1.4.
|
|
52
|
-
geney-1.4.
|
|
53
|
-
geney-1.4.
|
|
50
|
+
geney-1.4.36.dist-info/METADATA,sha256=5UEnYWM74boaWda13s82U6Xpk_h0lzDbKqA86zNPTOI,1013
|
|
51
|
+
geney-1.4.36.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
|
|
52
|
+
geney-1.4.36.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
|
|
53
|
+
geney-1.4.36.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|