PyOVERCAST 1.0.14__tar.gz → 1.0.16__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyOVERCAST
3
- Version: 1.0.14
3
+ Version: 1.0.16
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
@@ -382,7 +382,9 @@ def plot_rrho(rrho_df, out_file=None, title="RRLO Matrix (Overlaps)", cmap="magm
382
382
  if out_file:
383
383
  plt.savefig(out_file + '.pdf', dpi=300, bbox_inches="tight")
384
384
  plt.savefig(out_file + '.svg', dpi=300, bbox_inches="tight")
385
- plt.show()
385
+ plt.close()
386
+ else:
387
+ plt.show()
386
388
 
387
389
  def plot_olc_plot(df1, df2, win):
388
390
  gene_col1 = df1.columns[0]
@@ -466,7 +468,9 @@ def plot_3D_surface(heatmap_a, out_file=None):
466
468
  if out_file:
467
469
  plt.savefig(out_file + '.pdf', dpi=300, bbox_inches="tight")
468
470
  plt.savefig(out_file + '.svg', dpi=300, bbox_inches="tight")
469
- plt.show()
471
+ plt.close()
472
+ else:
473
+ plt.show()
470
474
 
471
475
  def plot_fit3D_plot(df1, df2, win):
472
476
  gene_col1 = df1.columns[0]
@@ -912,11 +916,14 @@ def plot_contour_graph(rrho_df, out_file=None):
912
916
  ax.set_title('Contour Graph of RRLO Matrix')
913
917
  # ax.set_aspect('equal')
914
918
  plt.tight_layout()
915
- #plt.savefig('contour_graph_invF.png', dpi=150)
916
- plt.show()
919
+ if out_file != None:
920
+ plt.savefig(out_file, dpi=150)
921
+ plt.close()
922
+ else:
923
+ plt.show()
917
924
 
918
925
 
919
- def plot_contour_plot(df1, df2, win):
926
+ def plot_contour_plot(df1, df2, win, out_file=None):
920
927
  gene_col1 = df1.columns[0]
921
928
  score_col1 = df1.columns[1]
922
929
  df1 = df1.sort_values(score_col1, ascending=False)
@@ -943,9 +950,9 @@ def plot_contour_plot(df1, df2, win):
943
950
 
944
951
  #beta_xy, pval_xy = td_coor(rrho_df.to_numpy())
945
952
  # df = Z_to_frame(rrho_df.to_numpy())
946
- plot_contour_graph(rrho_df)
953
+ plot_contour_graph(rrho_df, out_file=out_file)
947
954
 
948
- def plot_contour(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):
955
+ def plot_contour(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, out_file=None):
949
956
  if data_dir == None:
950
957
  data_dir = overcast_data_dir
951
958
  if not (os.path.exists(data_dir) and os.path.isdir(data_dir)):
@@ -971,10 +978,10 @@ def plot_contour(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8'], list_file='in
971
978
  epsilon = 1e-15 # 常用值
972
979
  for i in range(tf_n):
973
980
  if tfbs_array[i][0] == tf:
974
- plot_contour_plot(deg_list, tfbs_array[i][1], win)
981
+ plot_contour_plot(deg_list, tfbs_array[i][1], win, out_file=out_file)
975
982
  break
976
983
 
977
- def plot_contour_permutation(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):
984
+ def plot_contour_permutation(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, out_file=None):
978
985
  if data_dir == None:
979
986
  data_dir = overcast_data_dir
980
987
  if not (os.path.exists(data_dir) and os.path.isdir(data_dir)):
@@ -1001,7 +1008,7 @@ def plot_contour_permutation(set_names=['human_hocomoco_CLink_wtcoor_1w_0.8'], l
1001
1008
  for i in range(tf_n):
1002
1009
  if tfbs_array[i][0] == tf:
1003
1010
  gene_set_pt, gene_list_pt = permutation(tfbs_array[i][1], deg_list)
1004
- plot_contour_plot(gene_list_pt, gene_set_pt, win)
1011
+ plot_contour_plot(gene_list_pt, gene_set_pt, win, out_file=out_file)
1005
1012
  # plot_contour_plot(deg_list, tfbs_array[i][1], win)
1006
1013
  break
1007
1014
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyOVERCAST
3
- Version: 1.0.14
3
+ Version: 1.0.16
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "PyOVERCAST"
7
- version = "1.0.14"
7
+ version = "1.0.16"
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"
File without changes
File without changes
File without changes