geney 1.4.28__py2.py3-none-any.whl → 1.4.30__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/utils/splicing_utils.py +13 -5
- geney/utils/utils.py +4 -0
- {geney-1.4.28.dist-info → geney-1.4.30.dist-info}/METADATA +1 -1
- {geney-1.4.28.dist-info → geney-1.4.30.dist-info}/RECORD +6 -6
- {geney-1.4.28.dist-info → geney-1.4.30.dist-info}/WHEEL +0 -0
- {geney-1.4.28.dist-info → geney-1.4.30.dist-info}/top_level.txt +0 -0
geney/utils/splicing_utils.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# __all__ = ['run_splicing_engine', 'adjoin_splicing_outcomes', 'process_epistasis']
|
|
2
2
|
|
|
3
3
|
import pandas as pd
|
|
4
|
-
from typing import List, Tuple
|
|
4
|
+
from typing import List, Tuple, Optional
|
|
5
5
|
|
|
6
|
-
def run_splicing_engine(seq: str, engine: str = 'spliceai') -> Tuple[List[float], List[float]]:
|
|
6
|
+
# def run_splicing_engine(seq: Optional[str] = None, engine: str = 'spliceai') -> Tuple[List[float], List[float]]:
|
|
7
|
+
def run_splicing_engine(seq: Optional[str] = None, engine: str = 'spliceai') -> Tuple[List[float], List[float]]:
|
|
7
8
|
"""
|
|
8
9
|
Run the specified splicing engine to predict splice site probabilities on a sequence.
|
|
9
10
|
|
|
@@ -17,12 +18,19 @@ def run_splicing_engine(seq: str, engine: str = 'spliceai') -> Tuple[List[float]
|
|
|
17
18
|
Raises:
|
|
18
19
|
ValueError: If the engine is not implemented.
|
|
19
20
|
"""
|
|
21
|
+
|
|
22
|
+
if seq is None:
|
|
23
|
+
from geney.utils.utils import generate_random_sequence
|
|
24
|
+
seq = generate_random_sequence(15_000)
|
|
25
|
+
|
|
20
26
|
match engine:
|
|
21
27
|
case 'spliceai':
|
|
22
|
-
from geney.utils.spliceai_utils import sai_predict_probs, sai_models
|
|
28
|
+
# from geney.utils.spliceai_utils import sai_predict_probs, sai_models
|
|
29
|
+
# acceptor_probs, donor_probs = sai_predict_probs(seq, models=sai_models)
|
|
30
|
+
|
|
23
31
|
from geney.utils.spliceai_pytorch_utils import sai_predict_probs, model
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
acceptor_probs, donor_probs = sai_predict_probs(seq, model=model)
|
|
33
|
+
|
|
26
34
|
case 'pangolin':
|
|
27
35
|
from geney.utils.pangolin_utils import pangolin_predict_probs, pang_models
|
|
28
36
|
# print(seq)
|
geney/utils/utils.py
CHANGED
|
@@ -6,6 +6,7 @@ import json
|
|
|
6
6
|
# from pathlib import Path
|
|
7
7
|
from bisect import bisect_left
|
|
8
8
|
import hashlib
|
|
9
|
+
import random
|
|
9
10
|
|
|
10
11
|
# def is_monotonic(A):
|
|
11
12
|
# x, y = [], []
|
|
@@ -60,6 +61,9 @@ def is_monotonic(A):
|
|
|
60
61
|
return all(x <= y for x, y in zip(A, A[1:])) or all(x >= y for x, y in zip(A, A[1:]))
|
|
61
62
|
|
|
62
63
|
|
|
64
|
+
def generate_random_sequence(length: int) -> str:
|
|
65
|
+
"""Generates a random DNA sequence of given length (A, C, G, T)."""
|
|
66
|
+
return ''.join(random.choices('ACGT', k=length))
|
|
63
67
|
|
|
64
68
|
def generate_random_nucleotide_sequences(num_sequences, min_len=3, max_len=10):
|
|
65
69
|
"""
|
|
@@ -45,9 +45,9 @@ geney/utils/mutation_utils.py,sha256=r-pHr56gEa5kh_DPX8MjFY3ZfYaOtyo4CUfJ5ZHlXPw
|
|
|
45
45
|
geney/utils/pangolin_utils.py,sha256=JQSPbWxdzqGFYfWQktkfLMaMSGR28eGQhNzO7MLMe5M,6162
|
|
46
46
|
geney/utils/spliceai_pytorch_utils.py,sha256=PfMgaoG6ftWfqKZKc_JNqj5wqQRUR2B-4YF22-zNh1M,2079
|
|
47
47
|
geney/utils/spliceai_utils.py,sha256=VtrIbjyQxk_3lw86eWjftRYyal9OzxArJ0GV5u_ymTg,2721
|
|
48
|
-
geney/utils/splicing_utils.py,sha256=
|
|
49
|
-
geney/utils/utils.py,sha256=
|
|
50
|
-
geney-1.4.
|
|
51
|
-
geney-1.4.
|
|
52
|
-
geney-1.4.
|
|
53
|
-
geney-1.4.
|
|
48
|
+
geney/utils/splicing_utils.py,sha256=Hn7conjcEb3Qc5MTN2DvnlZVxgn3U_IKqOAkGuIik6g,21052
|
|
49
|
+
geney/utils/utils.py,sha256=GXqlatNhix1akt3fburNzIwhiW9ZdCQSt2vmU80neyA,2370
|
|
50
|
+
geney-1.4.30.dist-info/METADATA,sha256=_DIWzuIrV5xrRCN8VNgctibosZNMXMEVIRsX7d24WNc,990
|
|
51
|
+
geney-1.4.30.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
|
|
52
|
+
geney-1.4.30.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
|
|
53
|
+
geney-1.4.30.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|