geney 1.3.60__py2.py3-none-any.whl → 1.3.62__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/SeqMats.py CHANGED
@@ -358,6 +358,7 @@ class SeqMat:
358
358
  return SeqMat(ref_seqmat)
359
359
 
360
360
  def orf_seqmat(self, tis_index):
361
+ stop_index = None
361
362
  if tis_index not in self.indices:
362
363
  return SeqMat.from_seq({'seq': ''})
363
364
 
@@ -367,21 +368,17 @@ class SeqMat:
367
368
  # temp = temp[:, temp[0, :] != 5]
368
369
  # temp = SeqMat(temp) # .drop_indices()
369
370
  # raw_seq = temp.seq # Extract the raw sequence
370
- pattern = re.compile(r"(?:[NACGT]{3})*?(TAA|TAG|TGA)")
371
- match = pattern.match(raw_seq.seq)
372
- print(match)
373
- # match = [(m.group(), m.start()+1) for m in re.finditer(r"(?:[NACGT]{3})*?(TAA|TAG|TGA)", raw_seq.seq)]# if
374
- # # (m.start()+1) % 3 == 0]
375
-
376
- # print(match)
377
- if len(match) > 0:
378
- stop_index = match[0][-1] #.end()
379
- else:
371
+ pattern = re.compile(r"TAA|TAG|TGA")
372
+ matches = pattern.finditer(raw_seq.seq) # Use finditer to get all matches
373
+ for m in matches:
374
+ if m.start() % 3 == 0:
375
+ stop_index = m.start()
376
+ break
377
+
378
+ if stop_index is None:
380
379
  stop_index = len(raw_seq) - (len(raw_seq) % 3)
381
380
 
382
- end_index = stop_index
383
- # assert (end_index+1) % 3 == 0, f"{end_index} is not a multiple of 3"
384
- return SeqMat(raw_seq.seqmat[:, :end_index])
381
+ return SeqMat(raw_seq.seqmat[:, :stop_index])
385
382
 
386
383
  def translate(self, tis_index):
387
384
  """
geney/oncosplice.py CHANGED
@@ -369,6 +369,7 @@ def oncosplice(mut_id, splicing_threshold=0.5, protein_coding=True, cons_require
369
369
  splicing_db.store_mutation_data(engine=splicing_engine, mut_id=mut_id, gene=gene.gene_name, transcript_id=reference_transcript.transcript_id, data=missplicing.missplicing)
370
370
 
371
371
  alternative_splicing_paths = develop_aberrant_splicing(reference_transcript, missplicing.missplicing)
372
+ print("iterating through new boundaries...")
372
373
  for i, new_boundaries in enumerate(alternative_splicing_paths):
373
374
  mutated_transcript.acceptors = new_boundaries['acceptors']
374
375
  mutated_transcript.donors = new_boundaries['donors']
@@ -413,6 +414,7 @@ def oncosplice(mut_id, splicing_threshold=0.5, protein_coding=True, cons_require
413
414
  results.append(report)
414
415
 
415
416
  if len(results) == 0:
417
+ print("Nothing...")
416
418
  return None
417
419
 
418
420
  return pd.DataFrame(results)[
geney/utils.py CHANGED
@@ -78,3 +78,24 @@ def is_monotonic(A):
78
78
  # return rev_compl
79
79
  #
80
80
 
81
+
82
+ def generate_random_nucleotide_sequences(num_sequences, min_len=3, max_len=10):
83
+ """
84
+ Generate random sequences of nucleotides.
85
+
86
+ Parameters:
87
+ num_sequences (int): Number of sequences to generate.
88
+ sequence_length (int): Length of each sequence.
89
+
90
+ Returns:
91
+ list: A list of random nucleotide sequences.
92
+ """
93
+ import random
94
+ nucleotides = ['A', 'C', 'G', 'T']
95
+ lengths = list(range(min_len, max_len))
96
+ sequences = [
97
+ ''.join(random.choices(nucleotides, k=random.choice(lengths)))
98
+ for _ in range(num_sequences)
99
+ ]
100
+ return sequences
101
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geney
3
- Version: 1.3.60
3
+ Version: 1.3.62
4
4
  Summary: A Python package for gene expression modeling.
5
5
  Home-page: https://github.com/nicolaslynn/geney
6
6
  Author: Nicolas Lynn
@@ -1,6 +1,6 @@
1
1
  geney/Fasta_segment.py,sha256=99HxNGNh_MfdVW6hhtlb1vOn7eSmT7oFoEfHDFMxG8w,11275
2
2
  geney/Gene.py,sha256=nMWJjoQaiVFm2iRjoiq7ghZqnXtW0tJDcq2S0AyOIvY,6883
3
- geney/SeqMats.py,sha256=DwEq_452FsF-zrr2nE1MMSTfKf54931yJERfXq0Ak7k,19460
3
+ geney/SeqMats.py,sha256=ksS1JW3vDj-CRBpcy-K28UFZSfJaMuc-JNNM26T09us,19259
4
4
  geney/Transcript.py,sha256=CpfxYkuCwFILozrtLuiWnlr1mRnMKn4o84HVJislgYs,14499
5
5
  geney/__init__.py,sha256=eBdDl42N6UhcYeZDjOnv199Z88fI5_8Y6xW8447OKXM,755
6
6
  geney/_mutation_utils.py,sha256=dHssUsnii_mf-wuRoMmF13UlD7k3ml_VwQMItTYnXpU,1132
@@ -11,7 +11,7 @@ geney/graphic_utils.py,sha256=oMsBpB9YeEn96gGpKh4MmtagJffWZbk-xPrIwHvkFhA,11016
11
11
  geney/gtex_utils.py,sha256=asL2lHyU5KsbWpV096vkf1Ka7hSo_RRfZqw7p5nERmE,1919
12
12
  geney/immune_utils.py,sha256=ZRni5ttrhpYBnmNr0d0ZatIbNPYs4nmQuoUO00SpsS4,5271
13
13
  geney/mutation_utils.py,sha256=C_kv2MB_L8LlhX3W2ooXjJ3uDoJ8zX1WeDtZKoBZJkI,1547
14
- geney/oncosplice.py,sha256=9_Eo5fL68CosTj6yTfh3UjCXHprhzqHFRL21WRicMRs,24704
14
+ geney/oncosplice.py,sha256=YyoJEBY8yKsaKGFXmH_nJRfzb6gBfuMq9lV89H3A9D0,24785
15
15
  geney/pangolin_utils.py,sha256=9jdBXlOcRaUdfi-UpUxHA0AkTMZkUF-Lt7HVZ1nEm3s,2973
16
16
  geney/power_utils.py,sha256=MehZFUdkJ2EFUot709yPEDxSkXmH5XevMebX2HD768A,7330
17
17
  geney/seqmat_utils.py,sha256=wzb3PX5it5bpIFQvcxyzlxfhoJTbHHbsjg0rzh05iVs,19753
@@ -20,12 +20,12 @@ geney/splicing_utils.py,sha256=GDSuuy8kWBh2_4UDwqjclF9gKnnCoLc_neOEsSrNWQM,38512
20
20
  geney/survival_utils.py,sha256=KnAzEviMuXh6SnVXId9PgsFLSbgkduTvYoIthxN7FPA,6886
21
21
  geney/tcga_utils.py,sha256=D_BNHm-D_K408dlcJm3hzH2c6QNFjQsKvUcOPiQRk7g,17612
22
22
  geney/tis_utils.py,sha256=la0CZroaKe5RgAyFd4Bf_DqQncklWgAY2823xVst98o,7813
23
- geney/utils.py,sha256=EsKvBM-Nz2a3_4ZAhF4Dxd4PwT7_6YYKpxEN4LLgg10,2174
23
+ geney/utils.py,sha256=KBdwNIywo7INVEQEsuIXauEJobvReE9TXAi5qqXanSI,2775
24
24
  geney/translation_initiation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  geney/translation_initiation/tis_utils.py,sha256=AF3siFjuQH-Rs44EV-80zHdbxRMvN4woLFSHroWIETc,4448
26
26
  geney/translation_initiation/resources/kozak_pssm.json,sha256=pcd0Olziutq-6H3mFWDCD9cujQ_AlZO-iiOvBl82hqE,1165
27
27
  geney/translation_initiation/resources/tis_regressor_model.joblib,sha256=IXb4DUDhJ5rBDKcqMk9zE3ECTZZcdj7Jixz3KpoZ7OA,2592025
28
- geney-1.3.60.dist-info/METADATA,sha256=9RdNxrkkxfNmokUDoatZq-ALXfGVcfyXXR5bEFI0_Ck,990
29
- geney-1.3.60.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
30
- geney-1.3.60.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
31
- geney-1.3.60.dist-info/RECORD,,
28
+ geney-1.3.62.dist-info/METADATA,sha256=JaEKHBPqwIUagmuVLomjmNJhs0vF_pT3bK6z7gsPGRc,990
29
+ geney-1.3.62.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
30
+ geney-1.3.62.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
31
+ geney-1.3.62.dist-info/RECORD,,
File without changes