geney 1.2.46__py2.py3-none-any.whl → 1.2.47__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/survival_utils.py CHANGED
@@ -64,7 +64,7 @@ class SurvivalAnalysis:
64
64
  df[col].nunique() > 1]] # and df[col].value_counts(normalize=True).min() >= 0.01]]
65
65
  return df
66
66
 
67
- def kaplan_meier_analysis(self, df, control_label='CV', target_label='Epistasis', feature='group', plot=False, time_cap=False):
67
+ def kaplan_meier_analysis(self, df, control_label='CV', target_label='Epistasis', feature='group', plot=False, time_cap=False, ax=None):
68
68
  # Can only be performed on features with two unique values
69
69
  cap_time = df.groupby(feature).duration.max().min()
70
70
  # df['duration'] = df['duration'].clip(upper=cap_time)
@@ -88,7 +88,7 @@ class SurvivalAnalysis:
88
88
  auc_vals.append(auc)
89
89
  if plot:
90
90
  if count == 0:
91
- ax = kmf.plot_survival_function(ci_show=True, color="#2430e0", lw=2)
91
+ kmf.plot_survival_function(ax=ax, ci_show=True, color="#2430e0", lw=2)
92
92
  else:
93
93
  kmf.plot_survival_function(ax=ax, ci_show=True, color="#e60215", lw=2)
94
94
  count += 1
@@ -96,14 +96,16 @@ class SurvivalAnalysis:
96
96
  p_value = self.log_rank(df[df[feature] == 1], df[df[feature] == 0])
97
97
 
98
98
  if plot:
99
- ax.text(0.5, 0.85, rf'$Survival p{{v}}$: {p_value:.4f}', transform=ax.transAxes, fontsize=9,
99
+ ax.text(0.5, 0.85, rf'Survival $p{{v}}$: {p_value:.3e}', transform=ax.transAxes, fontsize=10,
100
100
  horizontalalignment='center')
101
101
  # Grid and spines
102
102
  ax.grid(True, which="major", linestyle="--", linewidth=0.5, color="grey", alpha=0.7)
103
103
  ax.spines['top'].set_visible(False)
104
104
  ax.spines['right'].set_visible(False)
105
- ax.tick_params(axis="both", which="major", labelsize=12)
106
- ax.legend(fontsize=12, frameon=False, loc='upper right')
105
+ ax.tick_params(axis="both", which="major", labelsize=10)
106
+ legend = ax.legend(fontsize=12, loc='upper right', frameon=True)
107
+ legend.get_frame().set_facecolor('white') # Set the background color to white
108
+ legend.get_frame().set_edgecolor('black') # Set the edge color to black
107
109
  plt.xlabel('Time (years)')
108
110
  plt.ylabel('Survival Probability')
109
111
  if time_cap:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: geney
3
- Version: 1.2.46
3
+ Version: 1.2.47
4
4
  Summary: A Python package for gene expression modeling.
5
5
  Home-page: https://github.com/nicolaslynn/geney
6
6
  Author: Nicolas Lynn
@@ -12,7 +12,7 @@ geney/power_utils.py,sha256=MehZFUdkJ2EFUot709yPEDxSkXmH5XevMebX2HD768A,7330
12
12
  geney/seqmat_utils.py,sha256=YV5DFLbfjXLIswPGvqK1-eEfwn9TUby0b2kewdGAKws,18372
13
13
  geney/spliceai_utils.py,sha256=gIGPC8u3J15A7EQrk2Elho5PbF9MmUUNopGGH-eEV8s,1873
14
14
  geney/splicing_utils.py,sha256=lGBNknnAdKhcJ3MqPQ5c9oz_NKcL2lcFAr78StjKa6o,16151
15
- geney/survival_utils.py,sha256=usBLTwGnFzYOcl70p3lwM4SEfy1KG-UVyx-dDmXTQWY,6196
15
+ geney/survival_utils.py,sha256=S66tKOMwGSSFXb-2MYg8ZEuyDV64942VB4eFcXRFQas,6392
16
16
  geney/tcga_utils.py,sha256=D_BNHm-D_K408dlcJm3hzH2c6QNFjQsKvUcOPiQRk7g,17612
17
17
  geney/tis_utils.py,sha256=vA2ci4gNfwwQZlCjPpO5ehvL2NRVeM7lHI_VyfT-_10,8049
18
18
  geney/utils.py,sha256=EsKvBM-Nz2a3_4ZAhF4Dxd4PwT7_6YYKpxEN4LLgg10,2174
@@ -20,7 +20,7 @@ geney/translation_initiation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
20
20
  geney/translation_initiation/tis_utils.py,sha256=AF3siFjuQH-Rs44EV-80zHdbxRMvN4woLFSHroWIETc,4448
21
21
  geney/translation_initiation/resources/kozak_pssm.json,sha256=pcd0Olziutq-6H3mFWDCD9cujQ_AlZO-iiOvBl82hqE,1165
22
22
  geney/translation_initiation/resources/tis_regressor_model.joblib,sha256=IXb4DUDhJ5rBDKcqMk9zE3ECTZZcdj7Jixz3KpoZ7OA,2592025
23
- geney-1.2.46.dist-info/METADATA,sha256=-MelhppfvYVO4W_1hwKuToXWF-SEubjyQLuGJ_DuxeQ,948
24
- geney-1.2.46.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
25
- geney-1.2.46.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
26
- geney-1.2.46.dist-info/RECORD,,
23
+ geney-1.2.47.dist-info/METADATA,sha256=fdtNRwV6GwITCTn1O3J0ytlq1wNYda0_sGJdMiNuZU4,948
24
+ geney-1.2.47.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
25
+ geney-1.2.47.dist-info/top_level.txt,sha256=O-FuNUMb5fn9dhZ-dYCgF0aZtfi1EslMstnzhc5IIVo,6
26
+ geney-1.2.47.dist-info/RECORD,,
File without changes