PyOVERCAST 1.0.0__tar.gz → 1.0.2__tar.gz
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.
- {pyovercast-1.0.0 → pyovercast-1.0.2}/PKG-INFO +12 -9
- {pyovercast-1.0.0 → pyovercast-1.0.2}/PyOVERCAST/predict.py +159 -14
- {pyovercast-1.0.0 → pyovercast-1.0.2}/PyOVERCAST.egg-info/PKG-INFO +12 -9
- {pyovercast-1.0.0 → pyovercast-1.0.2}/PyOVERCAST.egg-info/requires.txt +8 -5
- {pyovercast-1.0.0 → pyovercast-1.0.2}/README.md +3 -3
- {pyovercast-1.0.0 → pyovercast-1.0.2}/pyproject.toml +9 -6
- {pyovercast-1.0.0 → pyovercast-1.0.2}/LICENSE +0 -0
- {pyovercast-1.0.0 → pyovercast-1.0.2}/PyOVERCAST/__init__.py +0 -0
- {pyovercast-1.0.0 → pyovercast-1.0.2}/PyOVERCAST/clinks.py +0 -0
- {pyovercast-1.0.0 → pyovercast-1.0.2}/PyOVERCAST.egg-info/SOURCES.txt +0 -0
- {pyovercast-1.0.0 → pyovercast-1.0.2}/PyOVERCAST.egg-info/dependency_links.txt +0 -0
- {pyovercast-1.0.0 → pyovercast-1.0.2}/PyOVERCAST.egg-info/entry_points.txt +0 -0
- {pyovercast-1.0.0 → pyovercast-1.0.2}/PyOVERCAST.egg-info/top_level.txt +0 -0
- {pyovercast-1.0.0 → pyovercast-1.0.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyOVERCAST
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: A Python package for mining key transcription factors from transcriptome data.
|
|
5
5
|
Author-email: Tinghua Huang <thua45@126.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,19 +17,22 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
17
17
|
Requires-Python: >=3.11
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: numpy
|
|
20
|
+
Requires-Dist: numpy>=1.26; sys_platform == "darwin"
|
|
21
21
|
Requires-Dist: numpy>=2.0; sys_platform == "win32"
|
|
22
22
|
Requires-Dist: numpy>=2.0; sys_platform == "linux"
|
|
23
|
-
Requires-Dist: pandas
|
|
23
|
+
Requires-Dist: pandas>=3.0; sys_platform == "darwin"
|
|
24
24
|
Requires-Dist: pandas>=3.0; sys_platform == "win32"
|
|
25
25
|
Requires-Dist: pandas>=3.0; sys_platform == "linux"
|
|
26
|
-
Requires-Dist: statsmodels
|
|
26
|
+
Requires-Dist: statsmodels>=0.14; sys_platform == "darwin"
|
|
27
27
|
Requires-Dist: statsmodels>=0.14; sys_platform == "win32"
|
|
28
28
|
Requires-Dist: statsmodels>=0.14; sys_platform == "linux"
|
|
29
|
-
Requires-Dist:
|
|
29
|
+
Requires-Dist: scipy>=1.16; sys_platform == "darwin"
|
|
30
|
+
Requires-Dist: scipy>=1.16; sys_platform == "win32"
|
|
31
|
+
Requires-Dist: scipy>=1.16; sys_platform == "linux"
|
|
32
|
+
Requires-Dist: seaborn>=0.13; sys_platform == "darwin"
|
|
30
33
|
Requires-Dist: seaborn>=0.13; sys_platform == "win32"
|
|
31
34
|
Requires-Dist: seaborn>=0.13; sys_platform == "linux"
|
|
32
|
-
Requires-Dist: matplotlib
|
|
35
|
+
Requires-Dist: matplotlib>=3.11; sys_platform == "darwin"
|
|
33
36
|
Requires-Dist: matplotlib>=3.11; sys_platform == "win32"
|
|
34
37
|
Requires-Dist: matplotlib>=3.11; sys_platform == "linux"
|
|
35
38
|
Provides-Extra: dev
|
|
@@ -45,7 +48,7 @@ A Python package for mining key transcription factors from transcriptome data.
|
|
|
45
48
|
## Installation
|
|
46
49
|
|
|
47
50
|
```bash
|
|
48
|
-
pip install numpy pandas statsmodels seaborn matplotlib PyOVERCAST
|
|
51
|
+
pip install numpy pandas statsmodels scipy seaborn matplotlib PyOVERCAST
|
|
49
52
|
```
|
|
50
53
|
|
|
51
54
|
## Usage
|
|
@@ -73,10 +76,10 @@ if __name__ == '__main__':
|
|
|
73
76
|
result = predict.olcr(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8', 'human_jaspar_CLink_wtcoor_1w_0.8'], list_file='./PyOVERCAST_data/input_deg-list.txt', win=30, thread_n=16)
|
|
74
77
|
|
|
75
78
|
# or predict one DEG-list with bootstrap
|
|
76
|
-
result = predict.olcr_bootstrap(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8', 'human_jaspar_CLink_wtcoor_1w_0.8'], list_file='./
|
|
79
|
+
result = predict.olcr_bootstrap(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8', 'human_jaspar_CLink_wtcoor_1w_0.8'], list_file='./OVERCAST_data/input_deg-list.txt', win=30, bs_n=1000, thread_n=32)
|
|
77
80
|
|
|
78
81
|
# save result to text file
|
|
79
|
-
result.to_csv('output.txt', sep='\t', index=False, encoding='utf-8
|
|
82
|
+
result.to_csv('output.txt', sep='\t', index=False, encoding='utf-8')
|
|
80
83
|
|
|
81
84
|
# plot OLC matrix
|
|
82
85
|
predict.plot_olc(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8', 'human_jaspar_CLink_wtcoor_1w_0.8'], list_file='./PyOVERCAST_data/input_deg-list.txt', tf='MA0844.2_XBP1', win=30)
|
|
@@ -14,6 +14,8 @@ plt.rcParams['axes.unicode_minus'] = False # 解决负号显示问题
|
|
|
14
14
|
import multiprocessing as mp
|
|
15
15
|
import seaborn as sns
|
|
16
16
|
|
|
17
|
+
from scipy import stats
|
|
18
|
+
|
|
17
19
|
overcast_data_dir = './OVERCAST_data'
|
|
18
20
|
|
|
19
21
|
def read_tfbs_file(file, tfbs):
|
|
@@ -150,6 +152,114 @@ def compute_dtci_core(df, x_col='x', y_col='y', z_col='z',
|
|
|
150
152
|
|
|
151
153
|
return DTCI, beta_hat, R2_adj, p_values[3], model.resid
|
|
152
154
|
|
|
155
|
+
def fitting_gaussian_dist(observations):
|
|
156
|
+
fig, ax = plt.subplots(figsize=(10, 6))
|
|
157
|
+
|
|
158
|
+
# 直方图
|
|
159
|
+
ax.hist(observations, bins=25, density=True, alpha=0.6, color='#4A90D9',
|
|
160
|
+
edgecolor='white', label='obsvs hist')
|
|
161
|
+
|
|
162
|
+
# 目标观测值
|
|
163
|
+
x_target = 0.01
|
|
164
|
+
|
|
165
|
+
# 拟合的高斯分布曲线
|
|
166
|
+
mu_mle = np.mean(observations)
|
|
167
|
+
sigma_mle = np.std(observations, ddof=1) # 无偏标准差
|
|
168
|
+
|
|
169
|
+
x_range = np.linspace(observations.min(), observations.max(), 500)
|
|
170
|
+
cdf_value = stats.norm.pdf(x_target, loc=mu_mle, scale=sigma_mle)
|
|
171
|
+
pdf_fitted = stats.norm.pdf(x_range, loc=mu_mle, scale=sigma_mle)
|
|
172
|
+
ax.plot(x_range, pdf_fitted, 'r-', linewidth=2.5, label=f'fitting Gaussian N({mu_mle:.2f}, {sigma_mle:.2f}^2)')
|
|
173
|
+
|
|
174
|
+
# 标记目标观测值
|
|
175
|
+
ax.axvline(x=x_target, color='#E74C3C', linestyle='--', linewidth=2, label=f'target values x = {x_target}')
|
|
176
|
+
|
|
177
|
+
# 填充CDF区域(x_target左侧)
|
|
178
|
+
x_fill = np.linspace(x_range.min(), x_target, 200)
|
|
179
|
+
pdf_fill = stats.norm.pdf(x_fill, loc=mu_mle, scale=sigma_mle)
|
|
180
|
+
ax.fill_between(x_fill, pdf_fill, alpha=0.3, color='#E74C3C', label=f'CDF = {cdf_value:.4f}')
|
|
181
|
+
|
|
182
|
+
'''
|
|
183
|
+
# 标注
|
|
184
|
+
ax.annotate(f'F({x_target}) = {cdf_value:.4f}\n≈ {cdf_value*100:.1f}%',
|
|
185
|
+
xy=(x_target, stats.norm.pdf(x_target, mu_mle, sigma_mle)),
|
|
186
|
+
xytext=(x_target + 8, 0.035),
|
|
187
|
+
fontsize=12, color='#E74C3C',
|
|
188
|
+
arrowprops=dict(arrowstyle='->', color='#E74C3C', lw=1.5),
|
|
189
|
+
bbox=dict(boxstyle='round,pad=0.3', facecolor='#FFE5E5', edgecolor='#E74C3C'))
|
|
190
|
+
'''
|
|
191
|
+
|
|
192
|
+
ax.set_xlabel('observes', fontsize=12)
|
|
193
|
+
ax.set_ylabel('density function', fontsize=12)
|
|
194
|
+
ax.set_title('Gaussian fitting and CDFs', fontsize=14, fontweight='bold')
|
|
195
|
+
ax.legend(loc='upper left', fontsize=10)
|
|
196
|
+
ax.grid(True, alpha=0.3)
|
|
197
|
+
|
|
198
|
+
plt.tight_layout()
|
|
199
|
+
plt.savefig('gaussian_fitting_cdf.png', dpi=150, bbox_inches='tight')
|
|
200
|
+
plt.show()
|
|
201
|
+
|
|
202
|
+
def fitting_gamma_dist(observations, x_target):
|
|
203
|
+
# ========== 1. 你的观测值(替换成你自己的数据) ==========
|
|
204
|
+
# 伽玛分布要求数据为正数
|
|
205
|
+
#observations = np.array([2.5, 3.1, 4.8, 5.2, 3.9, 6.1, 4.5, 5.8, 3.3, 4.0, 5.5, 4.2, 6.5, 3.7, 5.0, 4.6, 5.3, 3.2, 4.9, 5.1])
|
|
206
|
+
observations = observations[observations > 0]
|
|
207
|
+
|
|
208
|
+
# 目标观测值(必须 > 0)
|
|
209
|
+
#x_target = 5.0
|
|
210
|
+
|
|
211
|
+
# ========== 2. 拟合伽玛分布 ==========
|
|
212
|
+
# gamma.fit 返回 (shape, loc, scale)
|
|
213
|
+
# print(observations.min(), observations.max())
|
|
214
|
+
shape, loc, scale = stats.gamma.fit(observations, floc=0) # floc=0 固定位置参数为0(标准两参数伽玛)
|
|
215
|
+
|
|
216
|
+
'''
|
|
217
|
+
print(f"样本量: {len(observations)}")
|
|
218
|
+
print(f"拟合的伽玛分布参数:")
|
|
219
|
+
print(f" 形状参数 (α/k) = {shape:.4f}")
|
|
220
|
+
print(f" 尺度参数 (θ) = {scale:.4f}")
|
|
221
|
+
print(f" 位置参数 (loc) = {loc:.4f}")
|
|
222
|
+
'''
|
|
223
|
+
|
|
224
|
+
# 均值和方差的理论值
|
|
225
|
+
mean_gamma = shape * scale
|
|
226
|
+
var_gamma = shape * scale**2
|
|
227
|
+
# print(f"\n理论均值: {mean_gamma:.4f} (样本均值: {np.mean(observations):.4f})")
|
|
228
|
+
# print(f"理论方差: {var_gamma:.4f} (样本方差: {np.var(observations, ddof=1):.4f})")
|
|
229
|
+
|
|
230
|
+
# ========== 3. 计算 CDF ==========
|
|
231
|
+
cdf_value = stats.gamma.cdf(x_target, a=shape, loc=loc, scale=scale)
|
|
232
|
+
# print(f"\n观测值 x = {x_target} 的 CDF:")
|
|
233
|
+
# print(f" F({x_target}) = P(X ≤ {x_target}) = {cdf_value:.6f}")
|
|
234
|
+
# print(f" 即约有 {cdf_value*100:.2f}% 的数据小于或等于 {x_target}")
|
|
235
|
+
|
|
236
|
+
'''
|
|
237
|
+
# ========== 4. 可视化 ==========
|
|
238
|
+
plt.figure(figsize=(10, 5))
|
|
239
|
+
|
|
240
|
+
# 直方图
|
|
241
|
+
plt.hist(observations, bins=12, density=True, alpha=0.6, color='steelblue',
|
|
242
|
+
edgecolor='white', label='观测值直方图')
|
|
243
|
+
|
|
244
|
+
# 拟合的伽玛分布曲线
|
|
245
|
+
x = np.linspace(observations.min(), observations.max(), 500)
|
|
246
|
+
pdf_fitted = stats.gamma.pdf(x, a=shape, loc=loc, scale=scale)
|
|
247
|
+
plt.plot(x, pdf_fitted, 'r-', lw=2.5,
|
|
248
|
+
label=f'拟合伽玛 Γ({shape:.2f}, {scale:.2f})')
|
|
249
|
+
|
|
250
|
+
# 标记目标值
|
|
251
|
+
plt.axvline(x_target, color='crimson', linestyle='--', lw=2,
|
|
252
|
+
label=f'目标值 x = {x_target}')
|
|
253
|
+
|
|
254
|
+
# 填充 CDF 区域(目标值左侧)
|
|
255
|
+
x_fill = np.linspace(0.01, x_target, 200)
|
|
256
|
+
pdf_fill = stats.gamma.pdf(x_fill, a=shape, loc=loc, scale=scale)
|
|
257
|
+
plt.fill_between(x_fill, pdf_fill, alpha=0.3, color='crimson',
|
|
258
|
+
label=f'CDF = {cdf_value:.4f}')
|
|
259
|
+
plt.show()
|
|
260
|
+
'''
|
|
261
|
+
return cdf_value
|
|
262
|
+
|
|
153
263
|
def bootstrap_parametric_h0(df, n_bootstrap=2000, random_state=42):
|
|
154
264
|
"""
|
|
155
265
|
参数化Bootstrap:在H0(无对角线趋势,即beta3=0)下生成数据
|
|
@@ -191,9 +301,11 @@ def bootstrap_parametric_h0(df, n_bootstrap=2000, random_state=42):
|
|
|
191
301
|
pass
|
|
192
302
|
|
|
193
303
|
dtci_null = np.array(dtci_null)
|
|
304
|
+
#fitting_gaussian_dist(dtci_null)
|
|
305
|
+
p_value = 1.0 - fitting_gamma_dist(dtci_null, dtci_obs)
|
|
194
306
|
|
|
195
307
|
# 步骤5:计算p值 (H1: DTCI > 0)
|
|
196
|
-
p_value = np.mean(dtci_null >= dtci_obs)
|
|
308
|
+
# p_value = np.mean(dtci_null >= dtci_obs)
|
|
197
309
|
|
|
198
310
|
return {
|
|
199
311
|
'method': '参数化Bootstrap (H0: beta3=0)',
|
|
@@ -374,7 +486,7 @@ def plot_fit3D_plot(df1, df2, win):
|
|
|
374
486
|
# df = Z_to_frame(rrho_df.to_numpy())
|
|
375
487
|
plot_3D_surface(rrho_df.to_numpy())
|
|
376
488
|
|
|
377
|
-
def rrho_coor_bs(df1, df2, win):
|
|
489
|
+
def rrho_coor_bs(df1, df2, win, bs_n):
|
|
378
490
|
gene_col1 = df1.columns[0]
|
|
379
491
|
score_col1 = df1.columns[1]
|
|
380
492
|
df1 = df1.sort_values(score_col1, ascending=False)
|
|
@@ -400,7 +512,7 @@ def rrho_coor_bs(df1, df2, win):
|
|
|
400
512
|
|
|
401
513
|
#beta_xy, pval_xy = td_coor(rrho_df.to_numpy())
|
|
402
514
|
df = Z_to_frame(rrho_df.to_numpy())
|
|
403
|
-
dtci_res = bootstrap_parametric_h0(df)
|
|
515
|
+
dtci_res = bootstrap_parametric_h0(df, n_bootstrap=bs_n)
|
|
404
516
|
beta_xy = dtci_res['beta3']
|
|
405
517
|
pval_xy = dtci_res['dtci_pval']
|
|
406
518
|
DTCI = dtci_res['dtci_obs']
|
|
@@ -422,17 +534,15 @@ def thread_one(tfbs_array, deg_list, win, shared_list, nn, lock):
|
|
|
422
534
|
nn[1] += 1
|
|
423
535
|
print(str(nn[1]) + ' / ' + str(nn[0]))
|
|
424
536
|
|
|
425
|
-
def thread_one_bs(tfbs_array, deg_list, win, shared_list, nn, lock):
|
|
537
|
+
def thread_one_bs(tfbs_array, deg_list, win, bs_n, shared_list, nn, lock):
|
|
426
538
|
tf_n = len(tfbs_array)
|
|
427
539
|
epsilon = 1e-15 # 常用值
|
|
428
540
|
for i in range(tf_n):
|
|
429
541
|
# fin_n += 1
|
|
430
|
-
beta_xy, pval_xy, DTCI, bs_pval = rrho_coor_bs(deg_list, tfbs_array[i][1], win)
|
|
431
|
-
|
|
432
|
-
#if math.isnan(score):
|
|
433
|
-
# score = 0
|
|
542
|
+
beta_xy, pval_xy, DTCI, bs_pval = rrho_coor_bs(deg_list, tfbs_array[i][1], win, bs_n)
|
|
543
|
+
rank_score = (DTCI * (-1.0 * math.log10(bs_pval + 1E-25) / 25)) ** 0.5
|
|
434
544
|
with lock:
|
|
435
|
-
shared_list.append([tfbs_array[i][0], beta_xy, pval_xy, DTCI, bs_pval])
|
|
545
|
+
shared_list.append([tfbs_array[i][0], beta_xy, pval_xy, DTCI, bs_pval, rank_score])
|
|
436
546
|
nn[1] += 1
|
|
437
547
|
print(str(nn[1]) + ' / ' + str(nn[0]))
|
|
438
548
|
|
|
@@ -504,7 +614,7 @@ def olcr(set_names=None, list_file=None, win=30, thread_n=16, data_dir=None):
|
|
|
504
614
|
|
|
505
615
|
return df
|
|
506
616
|
|
|
507
|
-
def olcr_bootstrap(set_names=None, list_file=None, win=30, thread_n=16, data_dir=None):
|
|
617
|
+
def olcr_bootstrap(set_names=None, list_file=None, win=30, thread_n=16, bs_n=2000, data_dir=None):
|
|
508
618
|
if data_dir == None:
|
|
509
619
|
data_dir = overcast_data_dir
|
|
510
620
|
if not (os.path.exists(data_dir) and os.path.isdir(data_dir)):
|
|
@@ -534,7 +644,7 @@ def olcr_bootstrap(set_names=None, list_file=None, win=30, thread_n=16, data_dir
|
|
|
534
644
|
tfbs_array_splits = split_into_n_even(tfbs_array, thread_n)
|
|
535
645
|
task_args = []
|
|
536
646
|
for ti in range(thread_n):
|
|
537
|
-
task_args.append((tfbs_array_splits[ti], deg_list, win, shared_list, nn, lock))
|
|
647
|
+
task_args.append((tfbs_array_splits[ti], deg_list, win, bs_n, shared_list, nn, lock))
|
|
538
648
|
|
|
539
649
|
# 创建进程池
|
|
540
650
|
with mp.Pool(processes=thread_n) as pool:
|
|
@@ -547,18 +657,53 @@ def olcr_bootstrap(set_names=None, list_file=None, win=30, thread_n=16, data_dir
|
|
|
547
657
|
# 打印结果
|
|
548
658
|
print("time consumed:", elapsed)
|
|
549
659
|
|
|
550
|
-
sorted_results = sorted(shared_list, key=lambda x: (x[-1], -x[-2]), reverse=False) # lambda x: (x[4], -x[1]), reverse=False
|
|
660
|
+
#sorted_results = sorted(shared_list, key=lambda x: (x[-1], -x[-2]), reverse=False) # lambda x: (x[4], -x[1]), reverse=False
|
|
661
|
+
sorted_results = sorted(shared_list, key=lambda x: x[-1], reverse=True) # lambda x: (x[4], -x[1]), reverse=False
|
|
551
662
|
results = []
|
|
552
663
|
ln = len(sorted_results)
|
|
553
664
|
for li in range(len(sorted_results)):
|
|
554
665
|
ratio = (li + 1) / ln
|
|
555
|
-
rline = sorted_results[li] + [
|
|
666
|
+
rline = sorted_results[li] + [ratio]
|
|
556
667
|
results.append(rline)
|
|
557
|
-
col_names = ['TF_motif', 'Beta3', 'Beta3_Pvalue', 'DTCI', 'DTCI_Pvalue', '
|
|
668
|
+
col_names = ['TF_motif', 'Beta3', 'Beta3_Pvalue', 'DTCI', 'DTCI_Pvalue', 'Rank_Score', 'Rank / N']
|
|
558
669
|
df = pd.DataFrame(results, columns=col_names)
|
|
559
670
|
|
|
560
671
|
return df
|
|
561
672
|
|
|
673
|
+
def olcr_bootstrap_1cpu(set_names=None, list_file=None, win=30, thread_n=16, bs_n=2000, data_dir=None):
|
|
674
|
+
if data_dir == None:
|
|
675
|
+
data_dir = overcast_data_dir
|
|
676
|
+
if not (os.path.exists(data_dir) and os.path.isdir(data_dir)):
|
|
677
|
+
print("OVERCAST_data folder can not found!")
|
|
678
|
+
exit(1)
|
|
679
|
+
sets_files = []
|
|
680
|
+
for set1 in set_names:
|
|
681
|
+
sets_file = data_dir + '/TF-target_sets/' + set1 + '.txt'
|
|
682
|
+
if not os.path.exists(sets_file):
|
|
683
|
+
print(sets_file, 'not exist!')
|
|
684
|
+
exit(1)
|
|
685
|
+
else:
|
|
686
|
+
sets_files.append(sets_file)
|
|
687
|
+
degl_file = list_file
|
|
688
|
+
if not os.path.exists(degl_file):
|
|
689
|
+
print(degl_file, 'not exist!')
|
|
690
|
+
exit(1)
|
|
691
|
+
|
|
692
|
+
tfbs_array = read_gene_sets(sets_files)
|
|
693
|
+
deg_list = read_DEG_list(degl_file)
|
|
694
|
+
|
|
695
|
+
tf_n = len(tfbs_array)
|
|
696
|
+
epsilon = 1e-15 # 常用值
|
|
697
|
+
nn = [tf_n, 0]
|
|
698
|
+
for i in range(tf_n):
|
|
699
|
+
# fin_n += 1
|
|
700
|
+
beta_xy, pval_xy, DTCI, bs_pval = rrho_coor_bs(deg_list, tfbs_array[i][1], win, bs_n)
|
|
701
|
+
#score = math.pow(abs(beta_xy), 1.0) * math.log10(pval_xy + epsilon) * -1.0
|
|
702
|
+
#if math.isnan(score):
|
|
703
|
+
# score = 0
|
|
704
|
+
nn[1] += 1
|
|
705
|
+
print(str(nn[1]) + ' / ' + str(nn[0]))
|
|
706
|
+
|
|
562
707
|
def plot_olc(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8'], list_file='input_deg-list.txt', tf='NFKB1_HUMAN.H11MO.1.B', win=30, data_dir=None):
|
|
563
708
|
if data_dir == None:
|
|
564
709
|
data_dir = overcast_data_dir
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyOVERCAST
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: A Python package for mining key transcription factors from transcriptome data.
|
|
5
5
|
Author-email: Tinghua Huang <thua45@126.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,19 +17,22 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
17
17
|
Requires-Python: >=3.11
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: numpy
|
|
20
|
+
Requires-Dist: numpy>=1.26; sys_platform == "darwin"
|
|
21
21
|
Requires-Dist: numpy>=2.0; sys_platform == "win32"
|
|
22
22
|
Requires-Dist: numpy>=2.0; sys_platform == "linux"
|
|
23
|
-
Requires-Dist: pandas
|
|
23
|
+
Requires-Dist: pandas>=3.0; sys_platform == "darwin"
|
|
24
24
|
Requires-Dist: pandas>=3.0; sys_platform == "win32"
|
|
25
25
|
Requires-Dist: pandas>=3.0; sys_platform == "linux"
|
|
26
|
-
Requires-Dist: statsmodels
|
|
26
|
+
Requires-Dist: statsmodels>=0.14; sys_platform == "darwin"
|
|
27
27
|
Requires-Dist: statsmodels>=0.14; sys_platform == "win32"
|
|
28
28
|
Requires-Dist: statsmodels>=0.14; sys_platform == "linux"
|
|
29
|
-
Requires-Dist:
|
|
29
|
+
Requires-Dist: scipy>=1.16; sys_platform == "darwin"
|
|
30
|
+
Requires-Dist: scipy>=1.16; sys_platform == "win32"
|
|
31
|
+
Requires-Dist: scipy>=1.16; sys_platform == "linux"
|
|
32
|
+
Requires-Dist: seaborn>=0.13; sys_platform == "darwin"
|
|
30
33
|
Requires-Dist: seaborn>=0.13; sys_platform == "win32"
|
|
31
34
|
Requires-Dist: seaborn>=0.13; sys_platform == "linux"
|
|
32
|
-
Requires-Dist: matplotlib
|
|
35
|
+
Requires-Dist: matplotlib>=3.11; sys_platform == "darwin"
|
|
33
36
|
Requires-Dist: matplotlib>=3.11; sys_platform == "win32"
|
|
34
37
|
Requires-Dist: matplotlib>=3.11; sys_platform == "linux"
|
|
35
38
|
Provides-Extra: dev
|
|
@@ -45,7 +48,7 @@ A Python package for mining key transcription factors from transcriptome data.
|
|
|
45
48
|
## Installation
|
|
46
49
|
|
|
47
50
|
```bash
|
|
48
|
-
pip install numpy pandas statsmodels seaborn matplotlib PyOVERCAST
|
|
51
|
+
pip install numpy pandas statsmodels scipy seaborn matplotlib PyOVERCAST
|
|
49
52
|
```
|
|
50
53
|
|
|
51
54
|
## Usage
|
|
@@ -73,10 +76,10 @@ if __name__ == '__main__':
|
|
|
73
76
|
result = predict.olcr(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8', 'human_jaspar_CLink_wtcoor_1w_0.8'], list_file='./PyOVERCAST_data/input_deg-list.txt', win=30, thread_n=16)
|
|
74
77
|
|
|
75
78
|
# or predict one DEG-list with bootstrap
|
|
76
|
-
result = predict.olcr_bootstrap(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8', 'human_jaspar_CLink_wtcoor_1w_0.8'], list_file='./
|
|
79
|
+
result = predict.olcr_bootstrap(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8', 'human_jaspar_CLink_wtcoor_1w_0.8'], list_file='./OVERCAST_data/input_deg-list.txt', win=30, bs_n=1000, thread_n=32)
|
|
77
80
|
|
|
78
81
|
# save result to text file
|
|
79
|
-
result.to_csv('output.txt', sep='\t', index=False, encoding='utf-8
|
|
82
|
+
result.to_csv('output.txt', sep='\t', index=False, encoding='utf-8')
|
|
80
83
|
|
|
81
84
|
# plot OLC matrix
|
|
82
85
|
predict.plot_olc(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8', 'human_jaspar_CLink_wtcoor_1w_0.8'], list_file='./PyOVERCAST_data/input_deg-list.txt', tf='MA0844.2_XBP1', win=30)
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
[:sys_platform == "darwin"]
|
|
3
|
-
numpy
|
|
4
|
-
pandas
|
|
5
|
-
statsmodels
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
numpy>=1.26
|
|
4
|
+
pandas>=3.0
|
|
5
|
+
statsmodels>=0.14
|
|
6
|
+
scipy>=1.16
|
|
7
|
+
seaborn>=0.13
|
|
8
|
+
matplotlib>=3.11
|
|
8
9
|
|
|
9
10
|
[:sys_platform == "linux"]
|
|
10
11
|
numpy>=2.0
|
|
11
12
|
pandas>=3.0
|
|
12
13
|
statsmodels>=0.14
|
|
14
|
+
scipy>=1.16
|
|
13
15
|
seaborn>=0.13
|
|
14
16
|
matplotlib>=3.11
|
|
15
17
|
|
|
@@ -17,6 +19,7 @@ matplotlib>=3.11
|
|
|
17
19
|
numpy>=2.0
|
|
18
20
|
pandas>=3.0
|
|
19
21
|
statsmodels>=0.14
|
|
22
|
+
scipy>=1.16
|
|
20
23
|
seaborn>=0.13
|
|
21
24
|
matplotlib>=3.11
|
|
22
25
|
|
|
@@ -5,7 +5,7 @@ A Python package for mining key transcription factors from transcriptome data.
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
pip install numpy pandas statsmodels seaborn matplotlib PyOVERCAST
|
|
8
|
+
pip install numpy pandas statsmodels scipy seaborn matplotlib PyOVERCAST
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
@@ -33,10 +33,10 @@ if __name__ == '__main__':
|
|
|
33
33
|
result = predict.olcr(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8', 'human_jaspar_CLink_wtcoor_1w_0.8'], list_file='./PyOVERCAST_data/input_deg-list.txt', win=30, thread_n=16)
|
|
34
34
|
|
|
35
35
|
# or predict one DEG-list with bootstrap
|
|
36
|
-
result = predict.olcr_bootstrap(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8', 'human_jaspar_CLink_wtcoor_1w_0.8'], list_file='./
|
|
36
|
+
result = predict.olcr_bootstrap(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8', 'human_jaspar_CLink_wtcoor_1w_0.8'], list_file='./OVERCAST_data/input_deg-list.txt', win=30, bs_n=1000, thread_n=32)
|
|
37
37
|
|
|
38
38
|
# save result to text file
|
|
39
|
-
result.to_csv('output.txt', sep='\t', index=False, encoding='utf-8
|
|
39
|
+
result.to_csv('output.txt', sep='\t', index=False, encoding='utf-8')
|
|
40
40
|
|
|
41
41
|
# plot OLC matrix
|
|
42
42
|
predict.plot_olc(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8', 'human_jaspar_CLink_wtcoor_1w_0.8'], list_file='./PyOVERCAST_data/input_deg-list.txt', tf='MA0844.2_XBP1', win=30)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "PyOVERCAST"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.2"
|
|
8
8
|
license = "MIT" # SPDX expression
|
|
9
9
|
description = "A Python package for mining key transcription factors from transcriptome data."
|
|
10
10
|
readme = "README.md"
|
|
@@ -21,19 +21,22 @@ classifiers = [
|
|
|
21
21
|
"Programming Language :: Python :: 3.13",
|
|
22
22
|
]
|
|
23
23
|
dependencies = [
|
|
24
|
-
"numpy
|
|
24
|
+
"numpy>=1.26; sys_platform == 'darwin'",
|
|
25
25
|
"numpy>=2.0; sys_platform == 'win32'",
|
|
26
26
|
"numpy>=2.0; sys_platform == 'linux'",
|
|
27
|
-
"pandas
|
|
27
|
+
"pandas>=3.0; sys_platform == 'darwin'",
|
|
28
28
|
"pandas>=3.0; sys_platform == 'win32'",
|
|
29
29
|
"pandas>=3.0; sys_platform == 'linux'",
|
|
30
|
-
"statsmodels
|
|
30
|
+
"statsmodels>=0.14; sys_platform == 'darwin'",
|
|
31
31
|
"statsmodels>=0.14; sys_platform == 'win32'",
|
|
32
32
|
"statsmodels>=0.14; sys_platform == 'linux'",
|
|
33
|
-
"
|
|
33
|
+
"scipy>=1.16; sys_platform == 'darwin'",
|
|
34
|
+
"scipy>=1.16; sys_platform == 'win32'",
|
|
35
|
+
"scipy>=1.16; sys_platform == 'linux'",
|
|
36
|
+
"seaborn>=0.13; sys_platform == 'darwin'",
|
|
34
37
|
"seaborn>=0.13; sys_platform == 'win32'",
|
|
35
38
|
"seaborn>=0.13; sys_platform == 'linux'",
|
|
36
|
-
"matplotlib
|
|
39
|
+
"matplotlib>=3.11; sys_platform == 'darwin'",
|
|
37
40
|
"matplotlib>=3.11; sys_platform == 'win32'",
|
|
38
41
|
"matplotlib>=3.11; sys_platform == 'linux'",
|
|
39
42
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|