geney 1.3.71__py2.py3-none-any.whl → 1.3.73__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/splicing_utils.py CHANGED
@@ -540,7 +540,12 @@ def process_pairwise_epistasis_explicit(mid, engine='spliceai'):
540
540
  lower_pos, upper_pos = int(parts[2]), int(parts[6])
541
541
 
542
542
  # Load gene and its transcript (as pre-mRNA)
543
- g = Gene.from_file(parts[0]).transcript().generate_pre_mrna()
543
+ g = Gene.from_file(parts[0]).transcript()
544
+
545
+ if g is not None:
546
+ g.generate_pre_mrna()
547
+ else:
548
+ return pd.DataFrame()
544
549
 
545
550
  # If gene is on the reverse strand, swap positions and set factor to -1.
546
551
  if g.rev:
@@ -597,8 +602,18 @@ def process_pairwise_epistasis_explicit(mid, engine='spliceai'):
597
602
  ).round(2)
598
603
 
599
604
  # Drop columns that do not vary (only one unique value).
600
- acceptors_df = acceptors_df.loc[:, acceptors_df.nunique() > 1]
601
- donors_df = donors_df.loc[:, donors_df.nunique() > 1]
605
+ # acceptors_df = acceptors_df.loc[:, acceptors_df.nunique() > 1]
606
+ # donors_df = donors_df.loc[:, donors_df.nunique() > 1]
607
+ if (acceptors_df.nunique() > 1).any():
608
+ acceptors_df = acceptors_df.loc[:, acceptors_df.nunique() > 1]
609
+ else:
610
+ acceptors_df = acceptors_df.iloc[:, [0]]
611
+
612
+ # For donors_df:
613
+ if (donors_df.nunique() > 1).any():
614
+ donors_df = donors_df.loc[:, donors_df.nunique() > 1]
615
+ else:
616
+ donors_df = donors_df.iloc[:, [0]]
602
617
 
603
618
  # Further filter acceptors: keep only columns where the value in the second row is < 0.1.
604
619
  # (Assumes that the second row (iloc[1]) represents a specific measure you wish to threshold.)
@@ -607,13 +622,7 @@ def process_pairwise_epistasis_explicit(mid, engine='spliceai'):
607
622
  def add_features_and_filter(df):
608
623
  if df.shape[1] == 0:
609
624
  return df # Nothing to process if no columns remain.
610
- # Compute the residual:
611
- # (row 3 - row 0) minus ( (row 1 - row 0) + (row 2 - row 0) )
612
625
  df.loc['residual'] = (df.iloc[3] - df.iloc[0]) - ((df.iloc[1] - df.iloc[0]) + (df.iloc[2] - df.iloc[0]))
613
- # Keep only columns where the absolute residual exceeds 0.1.
614
- # df = df.loc[:, df.loc['residual'].abs() > 0.1]
615
- # if df.shape[1] == 0:
616
- # return df
617
626
  # Compute deviations relative to the baseline (row 0)
618
627
  df.loc['deviation1'] = df.iloc[1] - df.iloc[0]
619
628
  df.loc['deviation2'] = df.iloc[2] - df.iloc[0]
@@ -631,31 +640,7 @@ def process_pairwise_epistasis_explicit(mid, engine='spliceai'):
631
640
  acceptors_df.loc['site_type', :] = 1
632
641
 
633
642
  df = pd.concat([acceptors_df, donors_df], axis=1)
634
- #
635
- # if df.shape[1] == 0:
636
- # return df
637
- #
638
- # mask = df.apply(
639
- # lambda col: (
640
- # (abs(col['residual']) > 0.1) and
641
- # (abs(col['deviation1'] + col['deviation2']) < 0.1)
642
- # ),
643
- # axis=0
644
- # )
645
- #
646
- # df.loc['synergistic'] = 0
647
- # df.loc['synergistic', mask] = 1
648
- #
649
- # mask = df.apply(
650
- # lambda col: (
651
- # (abs(col['residual']) > 0.1) and
652
- # (abs(col['total_deviation']) <= 0.25)
653
- # ),
654
- # axis=0
655
- # )
656
- #
657
- # df.loc['antagonistic'] = 0
658
- # df.loc['antagonistic', mask] = 1
643
+
659
644
  df.loc['mut_id'] = mid
660
645
  df.loc['engine'] = engine
661
646
  df.loc['site'] = df.columns
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geney
3
- Version: 1.3.71
3
+ Version: 1.3.73
4
4
  Summary: A Python package for gene expression modeling.
5
5
  Home-page: https://github.com/nicolaslynn/geney
6
6
  Author: Nicolas Lynn
@@ -16,7 +16,7 @@ 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
18
18
  geney/spliceai_utils.py,sha256=tVY0T6F6l3fNoaktpn7Kq0oH5ZM0ThFYt9nPi_lfakw,3077
19
- geney/splicing_utils.py,sha256=-4Xd7durnm3362IYn_7RO7dOZkPRadWZcRZgvTF2Thg,47786
19
+ geney/splicing_utils.py,sha256=mAiZXBzb0IzZ_O0CIhxR36q8H9xqPXJOUk2fU1UTqc8,47313
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
@@ -25,7 +25,7 @@ geney/translation_initiation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
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.71.dist-info/METADATA,sha256=qwuLQNso5Kv8Xs23-90MykN695SOLmAkMbpaco1FbhM,990
29
- geney-1.3.71.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
30
- geney-1.3.71.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
31
- geney-1.3.71.dist-info/RECORD,,
28
+ geney-1.3.73.dist-info/METADATA,sha256=zBDPXEkIQIf58meB91wGEvGGPfe1rlR7-XZX9toMKdM,990
29
+ geney-1.3.73.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
30
+ geney-1.3.73.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
31
+ geney-1.3.73.dist-info/RECORD,,
File without changes