geney 1.4.31__py2.py3-none-any.whl → 1.4.32__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/SeqMats.py +26 -12
- geney/utils/splicing_utils.py +1 -1
- {geney-1.4.31.dist-info → geney-1.4.32.dist-info}/METADATA +1 -1
- {geney-1.4.31.dist-info → geney-1.4.32.dist-info}/RECORD +6 -6
- {geney-1.4.31.dist-info → geney-1.4.32.dist-info}/WHEEL +0 -0
- {geney-1.4.31.dist-info → geney-1.4.32.dist-info}/top_level.txt +0 -0
geney/utils/SeqMats.py
CHANGED
|
@@ -215,6 +215,8 @@ class SeqMat:
|
|
|
215
215
|
# else:
|
|
216
216
|
# raise ValueError(f"Unsupported mutation {pos}:{ref}:{alt}.")
|
|
217
217
|
# Bucket mutations
|
|
218
|
+
|
|
219
|
+
|
|
218
220
|
subs, ins, dels = [], [], []
|
|
219
221
|
for p, r, a in mutations:
|
|
220
222
|
# left-normalize
|
|
@@ -286,18 +288,30 @@ class SeqMat:
|
|
|
286
288
|
self.notes['total_mutations'] = self.notes.get('total_mutations', 0) + applied_mutations
|
|
287
289
|
return self
|
|
288
290
|
|
|
289
|
-
def complement(self) -> SeqMat:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
291
|
+
# def complement(self) -> SeqMat:
|
|
292
|
+
# comp = {b'A': b'T', b'T': b'A', b'C': b'G', b'G': b'C', b'-': b'-'}
|
|
293
|
+
# nts = np.array([comp[x] for x in self.seq_array['nt']], dtype='S1')
|
|
294
|
+
# new = self.clone()
|
|
295
|
+
# new.seq_array['nt'] = nts
|
|
296
|
+
# return new
|
|
297
|
+
#
|
|
298
|
+
# def reverse_complement(self) -> SeqMat:
|
|
299
|
+
# new = self.complement().clone()
|
|
300
|
+
# new.seq_array = new.seq_array[::-1].copy()
|
|
301
|
+
# new.rev = not self.rev
|
|
302
|
+
# return new
|
|
303
|
+
def complement(self) -> "SeqMat":
|
|
304
|
+
comp_dict = {b"A": b"T", b"T": b"A", b"C": b"G", b"G": b"C", b"-": b"-", b"N": b"N"}
|
|
305
|
+
comp_seq = np.array([comp_dict[nt] for nt in self.seq_array["nt"]], dtype="S1")
|
|
306
|
+
new_instance = self.clone()
|
|
307
|
+
new_instance.seq_array["nt"] = comp_seq
|
|
308
|
+
return new_instance
|
|
295
309
|
|
|
296
|
-
def reverse_complement(self) -> SeqMat:
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
return
|
|
310
|
+
def reverse_complement(self) -> "SeqMat":
|
|
311
|
+
rev_comp_seq = self.complement().seq_array[::-1]
|
|
312
|
+
self.seq_array = rev_comp_seq.copy()
|
|
313
|
+
self.rev = not self.rev
|
|
314
|
+
return self
|
|
301
315
|
|
|
302
316
|
def __getitem__(self, key: Union[int, slice]) -> np.ndarray:
|
|
303
317
|
coords = self.seq_array['index']
|
|
@@ -424,7 +438,7 @@ class SeqMat:
|
|
|
424
438
|
|
|
425
439
|
# Run the splicing prediction engine (function assumed to be defined externally)
|
|
426
440
|
from .splicing_utils import run_splicing_engine
|
|
427
|
-
donor_probs, acceptor_probs = run_splicing_engine(seq, engine)
|
|
441
|
+
donor_probs, acceptor_probs = run_splicing_engine(seq=seq, splicing_engine=engine)
|
|
428
442
|
# Trim off the fixed flanks before returning results.
|
|
429
443
|
seq = seq[5000:-5000]
|
|
430
444
|
indices = indices[5000:-5000]
|
geney/utils/splicing_utils.py
CHANGED
|
@@ -27,7 +27,7 @@ def run_splicing_engine(seq: Optional[str] = None, engine: str = 'spliceai') ->
|
|
|
27
27
|
from geney.utils.spliceai_utils import sai_predict_probs, sai_models
|
|
28
28
|
acceptor_probs, donor_probs = sai_predict_probs(seq, models=sai_models)
|
|
29
29
|
|
|
30
|
-
case '
|
|
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
33
|
|
|
@@ -37,7 +37,7 @@ geney/translation_initiation/tis_utils.py,sha256=AF3siFjuQH-Rs44EV-80zHdbxRMvN4w
|
|
|
37
37
|
geney/translation_initiation/resources/kozak_pssm.json,sha256=pcd0Olziutq-6H3mFWDCD9cujQ_AlZO-iiOvBl82hqE,1165
|
|
38
38
|
geney/translation_initiation/resources/tis_regressor_model.joblib,sha256=IXb4DUDhJ5rBDKcqMk9zE3ECTZZcdj7Jixz3KpoZ7OA,2592025
|
|
39
39
|
geney/utils/Fasta_segment.py,sha256=weB5NJ65P0XiyAJCiCHx4T9sHC1pWLpuQeOy0B85gyg,11364
|
|
40
|
-
geney/utils/SeqMats.py,sha256
|
|
40
|
+
geney/utils/SeqMats.py,sha256=-eoSKJFZR5OelhjXVkTIJbqYgp2xoWvgo8KWfKIBkRk,18197
|
|
41
41
|
geney/utils/SeqMatsOld.py,sha256=syRU5DAuTh3xUfGW_qP9wlcBO5pHsG_y5PlrfXTIxUY,18502
|
|
42
42
|
geney/utils/TranscriptLibrary.py,sha256=W1hv4Y8wRlmwTs3iFdn4_IqS-2suVDzZe4fwti2KbR4,2076
|
|
43
43
|
geney/utils/__init__.py,sha256=-nJ-DMx1JzP-ZCe_QuQCeM0ZYIT_16jxoXDhUaO_4Oc,714
|
|
@@ -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=wwBoT2utKZjjaWAUo11mSoympVK1vkNxAxcJvXAh8SM,2792
|
|
47
47
|
geney/utils/spliceai_utils.py,sha256=VtrIbjyQxk_3lw86eWjftRYyal9OzxArJ0GV5u_ymTg,2721
|
|
48
|
-
geney/utils/splicing_utils.py,sha256=
|
|
48
|
+
geney/utils/splicing_utils.py,sha256=Z0Z645fJhFnszpIueeMNaa-NMRLFFyJoRBR_yFbzrN0,20965
|
|
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.32.dist-info/METADATA,sha256=SLfl8T6fgOlpb2Plf1iJxcaD-IXjclU4ZFcD3SWZTbM,990
|
|
51
|
+
geney-1.4.32.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
|
|
52
|
+
geney-1.4.32.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
|
|
53
|
+
geney-1.4.32.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|