gwaslab 3.5.6__py3-none-any.whl → 3.5.7__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 gwaslab might be problematic. Click here for more details.
- gwaslab/g_version.py +2 -2
- gwaslab/viz_plot_mqqplot.py +86 -65
- gwaslab/viz_plot_regional2.py +3 -12
- gwaslab/viz_plot_rg_heatmap.py +6 -1
- gwaslab/viz_plot_stackedregional.py +17 -5
- {gwaslab-3.5.6.dist-info → gwaslab-3.5.7.dist-info}/METADATA +2 -2
- {gwaslab-3.5.6.dist-info → gwaslab-3.5.7.dist-info}/RECORD +11 -11
- {gwaslab-3.5.6.dist-info → gwaslab-3.5.7.dist-info}/LICENSE +0 -0
- {gwaslab-3.5.6.dist-info → gwaslab-3.5.7.dist-info}/LICENSE_before_v3.4.39 +0 -0
- {gwaslab-3.5.6.dist-info → gwaslab-3.5.7.dist-info}/WHEEL +0 -0
- {gwaslab-3.5.6.dist-info → gwaslab-3.5.7.dist-info}/top_level.txt +0 -0
gwaslab/g_version.py
CHANGED
gwaslab/viz_plot_mqqplot.py
CHANGED
|
@@ -111,7 +111,7 @@ def mqqplot(insumstats,
|
|
|
111
111
|
region_marker_shapes=None,
|
|
112
112
|
region_legend_marker=True,
|
|
113
113
|
region_ref_alias = None,
|
|
114
|
-
cbar_title='LD
|
|
114
|
+
cbar_title='LD $\mathregular{r^2}$ with variant',
|
|
115
115
|
cbar_fontsize = None,
|
|
116
116
|
cbar_scale=True,
|
|
117
117
|
cbar_font_family = None,
|
|
@@ -205,7 +205,9 @@ def mqqplot(insumstats,
|
|
|
205
205
|
title_pad=1.08,
|
|
206
206
|
title_fontsize=13,
|
|
207
207
|
fontsize = 9,
|
|
208
|
-
font_family=
|
|
208
|
+
font_family=None,
|
|
209
|
+
fontfamily="Arial",
|
|
210
|
+
math_fontfamily="dejavusans",
|
|
209
211
|
anno_fontsize = 9,
|
|
210
212
|
figargs=None,
|
|
211
213
|
fig_args= None,
|
|
@@ -230,6 +232,7 @@ def mqqplot(insumstats,
|
|
|
230
232
|
):
|
|
231
233
|
|
|
232
234
|
# log.writeing meta info #######################################################################################
|
|
235
|
+
|
|
233
236
|
if chr_dict is None:
|
|
234
237
|
chr_dict = get_chr_to_number()
|
|
235
238
|
if xtick_chr_dict is None:
|
|
@@ -289,7 +292,8 @@ def mqqplot(insumstats,
|
|
|
289
292
|
|
|
290
293
|
# 7 colors
|
|
291
294
|
region_ld_colors_m = ["#E51819","#367EB7","green","#F07818","#AD5691","yellow","purple"]
|
|
292
|
-
|
|
295
|
+
if font_family is None:
|
|
296
|
+
font_family = fontfamily
|
|
293
297
|
if region_title_args is None:
|
|
294
298
|
region_title_args = {"size":10}
|
|
295
299
|
if cbar_fontsize is None:
|
|
@@ -305,7 +309,7 @@ def mqqplot(insumstats,
|
|
|
305
309
|
if maf_bin_colors is None:
|
|
306
310
|
maf_bin_colors = ["#f0ad4e","#5cb85c", "#5bc0de","#000042"]
|
|
307
311
|
if save_args is None:
|
|
308
|
-
save_args = {"dpi":
|
|
312
|
+
save_args = {"dpi":600,"facecolor":"none"}
|
|
309
313
|
if highlight is None:
|
|
310
314
|
highlight = list()
|
|
311
315
|
if highlight_anno_args is None:
|
|
@@ -336,22 +340,15 @@ def mqqplot(insumstats,
|
|
|
336
340
|
else:
|
|
337
341
|
_if_quick_qc = False
|
|
338
342
|
|
|
339
|
-
if save is not None:
|
|
340
|
-
if type(save) is not bool:
|
|
341
|
-
if len(save)>3:
|
|
342
|
-
if save[-3:]=="pdf" or save[-3:]=="svg":
|
|
343
|
-
fig_args["dpi"]=72
|
|
344
|
-
scatter_args["rasterized"]=True
|
|
345
|
-
qq_scatter_args["rasterized"]=True
|
|
346
|
-
else:
|
|
347
|
-
fig_args["dpi"] = save_args["dpi"]
|
|
348
|
-
|
|
349
343
|
# configure dpi if saving the plot
|
|
350
|
-
fig_args, scatter_args, qq_scatter_args, save_args = _configure_fig_save_kwargs(
|
|
344
|
+
fig_args, scatter_args, qq_scatter_args, save_args = _configure_fig_save_kwargs(mode=mode,
|
|
345
|
+
save = save,
|
|
351
346
|
fig_args = fig_args,
|
|
352
347
|
scatter_args = scatter_args,
|
|
353
348
|
qq_scatter_args = qq_scatter_args,
|
|
354
|
-
save_args = save_args
|
|
349
|
+
save_args = save_args,
|
|
350
|
+
log=log,
|
|
351
|
+
verbose=verbose)
|
|
355
352
|
|
|
356
353
|
|
|
357
354
|
if len(anno_d) > 0 and arm_offset is None:
|
|
@@ -818,9 +815,7 @@ def mqqplot(insumstats,
|
|
|
818
815
|
region=region,
|
|
819
816
|
vcf_path=vcf_path,
|
|
820
817
|
marker_size=marker_size,
|
|
821
|
-
fontsize=fontsize,
|
|
822
818
|
build=build,
|
|
823
|
-
chrom_df=chrom_df,
|
|
824
819
|
cbar_scale=cbar_scale,
|
|
825
820
|
cbar_fontsize=cbar_fontsize,
|
|
826
821
|
cbar_bbox_to_anchor=cbar_bbox_to_anchor,
|
|
@@ -829,9 +824,7 @@ def mqqplot(insumstats,
|
|
|
829
824
|
cbar_equal_aspect=cbar_equal_aspect,
|
|
830
825
|
cbar_downward_offset =cbar_downward_offset,
|
|
831
826
|
cbar_borderpad=cbar_borderpad,
|
|
832
|
-
xtick_chr_dict=xtick_chr_dict,
|
|
833
827
|
cut_line_color=cut_line_color,
|
|
834
|
-
vcf_chr_dict =vcf_chr_dict,
|
|
835
828
|
gtf_path=gtf_path,
|
|
836
829
|
gtf_chr_dict = gtf_chr_dict,
|
|
837
830
|
gtf_gene_name=gtf_gene_name,
|
|
@@ -849,13 +842,11 @@ def mqqplot(insumstats,
|
|
|
849
842
|
region_grid_line = region_grid_line,
|
|
850
843
|
region_lead_grid = region_lead_grid,
|
|
851
844
|
region_lead_grid_line = region_lead_grid_line,
|
|
852
|
-
region_hspace=region_hspace,
|
|
853
845
|
region_title=region_title,
|
|
854
846
|
region_title_args=region_title_args,
|
|
855
847
|
region_ld_legend = region_ld_legend,
|
|
856
848
|
region_legend_marker=region_legend_marker,
|
|
857
849
|
region_ld_threshold = region_ld_threshold,
|
|
858
|
-
region_ld_colors = region_ld_colors,
|
|
859
850
|
palette = palette,
|
|
860
851
|
region_marker_shapes = region_marker_shapes,
|
|
861
852
|
region_recombination = region_recombination,
|
|
@@ -863,8 +854,6 @@ def mqqplot(insumstats,
|
|
|
863
854
|
region_flank_factor =region_flank_factor,
|
|
864
855
|
track_font_family=track_font_family,
|
|
865
856
|
taf=taf,
|
|
866
|
-
tabix=tabix,
|
|
867
|
-
chrom=chrom,
|
|
868
857
|
pos=pos,
|
|
869
858
|
verbose=verbose,
|
|
870
859
|
log=log
|
|
@@ -923,10 +912,10 @@ def mqqplot(insumstats,
|
|
|
923
912
|
|
|
924
913
|
# Configure X, Y axes #######################################################
|
|
925
914
|
log.write("Start to process figure arts.",verbose=verbose)
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
915
|
+
|
|
916
|
+
ax1, ax3 = _process_xtick(ax1=ax1,
|
|
917
|
+
ax3=ax3,
|
|
918
|
+
mode=mode,
|
|
930
919
|
chrom_df=chrom_df,
|
|
931
920
|
xtick_chr_dict=xtick_chr_dict,
|
|
932
921
|
fontsize = fontsize,
|
|
@@ -950,7 +939,8 @@ def mqqplot(insumstats,
|
|
|
950
939
|
mode=mode,
|
|
951
940
|
bwindowsizekb=bwindowsizekb,
|
|
952
941
|
fontsize=fontsize,
|
|
953
|
-
font_family=font_family,
|
|
942
|
+
font_family=font_family,
|
|
943
|
+
math_fontfamily=math_fontfamily,
|
|
954
944
|
ax4=ax4,
|
|
955
945
|
log=log,
|
|
956
946
|
verbose=verbose)
|
|
@@ -1132,11 +1122,14 @@ def mqqplot(insumstats,
|
|
|
1132
1122
|
|
|
1133
1123
|
##############################################################################################################################################################################
|
|
1134
1124
|
|
|
1135
|
-
def _configure_fig_save_kwargs(
|
|
1125
|
+
def _configure_fig_save_kwargs(mode="m",
|
|
1126
|
+
save=None,
|
|
1136
1127
|
fig_args=None,
|
|
1137
1128
|
scatter_args=None,
|
|
1138
1129
|
qq_scatter_args=None,
|
|
1139
|
-
save_args=None
|
|
1130
|
+
save_args=None,
|
|
1131
|
+
log=Log(),
|
|
1132
|
+
verbose=True):
|
|
1140
1133
|
if fig_args is None:
|
|
1141
1134
|
fig_args = dict()
|
|
1142
1135
|
if scatter_args is None:
|
|
@@ -1152,8 +1145,14 @@ def _configure_fig_save_kwargs(save=None,
|
|
|
1152
1145
|
if save[-3:]=="pdf" or save[-3:]=="svg":
|
|
1153
1146
|
# to save as vectorized plot
|
|
1154
1147
|
fig_args["dpi"]=72
|
|
1155
|
-
|
|
1156
|
-
|
|
1148
|
+
|
|
1149
|
+
if mode!="r":
|
|
1150
|
+
scatter_args["rasterized"]=True
|
|
1151
|
+
qq_scatter_args["rasterized"]=True
|
|
1152
|
+
log.write("Saving as pdf/svg: scatter plot will be rasterized for mqq...", verbose=verbose)
|
|
1153
|
+
else:
|
|
1154
|
+
scatter_args["rasterized"]=False
|
|
1155
|
+
qq_scatter_args["rasterized"]=False
|
|
1157
1156
|
else:
|
|
1158
1157
|
fig_args["dpi"] = save_args["dpi"]
|
|
1159
1158
|
return fig_args, scatter_args, qq_scatter_args, save_args
|
|
@@ -1414,45 +1413,52 @@ def _process_line(ax1, sig_line, suggestive_sig_line, additional_line, lines_to_
|
|
|
1414
1413
|
|
|
1415
1414
|
def _process_cbar(cbar, cbar_fontsize, cbar_font_family, cbar_title, log=Log(),verbose=True):
|
|
1416
1415
|
log.write(" -Processing color bar...",verbose=verbose)
|
|
1417
|
-
|
|
1418
|
-
# for cbar_single in cbar:
|
|
1419
|
-
# cbar_yticklabels = cbar_single.ax.get_yticklabels()
|
|
1420
|
-
# cbar_single.ax.set_yticklabels(cbar_yticklabels, fontsize=cbar_fontsize, family=cbar_font_family )
|
|
1421
|
-
# cbar_single.ax.set_title(cbar_title, fontsize=cbar_fontsize, family=cbar_font_family, loc="center",y=-0.2 )
|
|
1422
|
-
#else:
|
|
1423
|
-
|
|
1416
|
+
|
|
1424
1417
|
cbar_yticklabels = cbar.get_yticklabels()
|
|
1425
|
-
cbar.set_yticklabels(cbar_yticklabels,
|
|
1418
|
+
cbar.set_yticklabels(cbar_yticklabels,
|
|
1419
|
+
fontsize=cbar_fontsize,
|
|
1420
|
+
family=cbar_font_family )
|
|
1426
1421
|
cbar_xticklabels = cbar.get_xticklabels()
|
|
1427
|
-
cbar.set_xticklabels(cbar_xticklabels,
|
|
1422
|
+
cbar.set_xticklabels(cbar_xticklabels,
|
|
1423
|
+
fontsize=cbar_fontsize,
|
|
1424
|
+
family=cbar_font_family )
|
|
1428
1425
|
|
|
1429
|
-
cbar.set_title(cbar_title, fontsize=cbar_fontsize,
|
|
1426
|
+
cbar.set_title(cbar_title, fontsize=cbar_fontsize,
|
|
1427
|
+
family=cbar_font_family,
|
|
1428
|
+
loc="center", y=1.00 )
|
|
1430
1429
|
return cbar
|
|
1431
1430
|
|
|
1432
|
-
def _process_xtick(ax1, chrom_df, xtick_chr_dict, fontsize, font_family, log=Log(),verbose=True):
|
|
1431
|
+
def _process_xtick(ax1, mode, chrom_df, xtick_chr_dict, fontsize, font_family="Arial", ax3=None , log=Log(),verbose=True):
|
|
1432
|
+
|
|
1433
1433
|
log.write(" -Processing X ticks...",verbose=verbose)
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1434
|
+
|
|
1435
|
+
if mode!="r":
|
|
1436
|
+
ax1.set_xticks(chrom_df.astype("float64"))
|
|
1437
|
+
ax1.set_xticklabels(chrom_df.index.astype("Int64").map(xtick_chr_dict),
|
|
1438
|
+
fontsize=fontsize,
|
|
1439
|
+
family=font_family)
|
|
1440
|
+
|
|
1441
|
+
if ax3 is not None:
|
|
1442
|
+
ax3.tick_params(axis='x',
|
|
1443
|
+
labelsize=fontsize,
|
|
1444
|
+
labelfontfamily=font_family)
|
|
1445
|
+
|
|
1446
|
+
return ax1, ax3
|
|
1437
1447
|
|
|
1438
1448
|
def _process_ytick(ax1, fontsize, font_family, ax4, log=Log(),verbose=True):
|
|
1439
1449
|
log.write(" -Processing Y labels...",verbose=verbose)
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
#ax1.set_yticklabels(ax1_yticklabels,fontsize=fontsize,family=font_family)
|
|
1446
|
-
ax1.tick_params(axis='y', labelsize=fontsize,labelfontfamily=font_family)
|
|
1447
|
-
#ax1.set_yticks(ax1_yticks,ax1_yticklabels,fontsize=fontsize,family=font_family)
|
|
1450
|
+
|
|
1451
|
+
ax1.tick_params(axis='y',
|
|
1452
|
+
labelsize=fontsize,
|
|
1453
|
+
labelfontfamily=font_family)
|
|
1454
|
+
|
|
1448
1455
|
if ax4 is not None:
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
#ax4.set_yticks(ax4_yticks,ax4_yticklabels, fontsize=fontsize,family=font_family)
|
|
1456
|
+
ax4.tick_params(axis='y',
|
|
1457
|
+
labelsize=fontsize,
|
|
1458
|
+
labelfontfamily=font_family)
|
|
1453
1459
|
return ax1, ax4
|
|
1454
1460
|
|
|
1455
|
-
def _process_xlabel(region, xlabel, ax1, gtf_path, mode, fontsize, font_family, ax3=None , log=Log(),verbose=True):
|
|
1461
|
+
def _process_xlabel(region, xlabel, ax1, gtf_path, mode, fontsize, font_family="Arial", ax3=None , log=Log(),verbose=True):
|
|
1456
1462
|
log.write(" -Processing X labels...",verbose=verbose)
|
|
1457
1463
|
if region is not None:
|
|
1458
1464
|
if xlabel is None:
|
|
@@ -1467,19 +1473,29 @@ def _process_xlabel(region, xlabel, ax1, gtf_path, mode, fontsize, font_family,
|
|
|
1467
1473
|
ax1.set_xlabel(xlabel,fontsize=fontsize,family=font_family)
|
|
1468
1474
|
return ax1, ax3
|
|
1469
1475
|
|
|
1470
|
-
def _process_ylabel(ylabel, ax1, mode, bwindowsizekb, fontsize, font_family, ax4=None, log=Log(),verbose=True):
|
|
1476
|
+
def _process_ylabel(ylabel, ax1, mode, bwindowsizekb, fontsize, font_family, math_fontfamily, ax4=None, log=Log(),verbose=True):
|
|
1471
1477
|
log.write(" -Processing Y labels...",verbose=verbose)
|
|
1472
1478
|
if "b" in mode:
|
|
1473
1479
|
if ylabel is None:
|
|
1474
1480
|
ylabel ="Density of GWAS \n SNPs within "+str(bwindowsizekb)+" kb"
|
|
1475
|
-
ax1.set_ylabel(ylabel,ha="center",va="bottom",
|
|
1481
|
+
ax1.set_ylabel(ylabel,ha="center",va="bottom",
|
|
1482
|
+
fontsize=fontsize,
|
|
1483
|
+
family=font_family,
|
|
1484
|
+
math_fontfamily=math_fontfamily)
|
|
1476
1485
|
else:
|
|
1477
1486
|
if ylabel is None:
|
|
1478
|
-
ylabel ="
|
|
1479
|
-
ax1.set_ylabel(ylabel,
|
|
1487
|
+
ylabel ="$\mathregular{-log_{10}(P)}$"
|
|
1488
|
+
ax1.set_ylabel(ylabel,
|
|
1489
|
+
fontsize=fontsize,
|
|
1490
|
+
family=font_family,
|
|
1491
|
+
math_fontfamily=math_fontfamily)
|
|
1492
|
+
|
|
1480
1493
|
if ax4 is not None:
|
|
1481
1494
|
ax4_ylabel = ax4.get_ylabel()
|
|
1482
|
-
ax4.set_ylabel(ax4_ylabel,
|
|
1495
|
+
ax4.set_ylabel(ax4_ylabel,
|
|
1496
|
+
fontsize=fontsize,
|
|
1497
|
+
family=font_family,
|
|
1498
|
+
math_fontfamily=math_fontfamily )
|
|
1483
1499
|
return ax1, ax4
|
|
1484
1500
|
|
|
1485
1501
|
def _process_spine(ax1, mode):
|
|
@@ -1494,6 +1510,11 @@ def _process_spine(ax1, mode):
|
|
|
1494
1510
|
|
|
1495
1511
|
|
|
1496
1512
|
def _process_layout(mode, figax, fig_args, mqqratio, region_hspace):
|
|
1513
|
+
#ax1 m / r
|
|
1514
|
+
#ax2 qq
|
|
1515
|
+
#ax3 gene track
|
|
1516
|
+
#ax4 recombination
|
|
1517
|
+
|
|
1497
1518
|
if mode=="qqm":
|
|
1498
1519
|
fig, (ax2, ax1) = plt.subplots(1, 2,gridspec_kw={'width_ratios': [1, mqqratio]},**fig_args)
|
|
1499
1520
|
ax3 = None
|
gwaslab/viz_plot_regional2.py
CHANGED
|
@@ -36,12 +36,8 @@ def _plot_regional(
|
|
|
36
36
|
region,
|
|
37
37
|
vcf_path,
|
|
38
38
|
marker_size,
|
|
39
|
-
fontsize,
|
|
40
39
|
build,
|
|
41
|
-
chrom_df,
|
|
42
|
-
xtick_chr_dict,
|
|
43
40
|
cut_line_color,
|
|
44
|
-
vcf_chr_dict = None,
|
|
45
41
|
gtf_path="default",
|
|
46
42
|
gtf_chr_dict = get_number_to_chr(),
|
|
47
43
|
gtf_gene_name=None,
|
|
@@ -50,7 +46,6 @@ def _plot_regional(
|
|
|
50
46
|
rr_chr_dict = get_number_to_chr(),
|
|
51
47
|
rr_lim = (0,100),
|
|
52
48
|
rr_ylabel = True,
|
|
53
|
-
rr_title=None,
|
|
54
49
|
region_ld_legend=True,
|
|
55
50
|
region_title=None,
|
|
56
51
|
mode="mqq",
|
|
@@ -64,9 +59,7 @@ def _plot_regional(
|
|
|
64
59
|
region_lead_grid = True,
|
|
65
60
|
region_lead_grid_line = {"alpha":0.5,"linewidth" : 2,"linestyle":"--","color":"#FF0000"},
|
|
66
61
|
region_title_args = None,
|
|
67
|
-
region_hspace=0.02,
|
|
68
62
|
region_ld_threshold = [0.2,0.4,0.6,0.8],
|
|
69
|
-
region_ld_colors = ["#E4E4E4","#020080","#86CEF9","#24FF02","#FDA400","#FF0000","#FF0000"],
|
|
70
63
|
region_marker_shapes=None,
|
|
71
64
|
cbar_fontsize=None,
|
|
72
65
|
cbar_scale=False,
|
|
@@ -84,8 +77,6 @@ def _plot_regional(
|
|
|
84
77
|
track_font_family="Arial",
|
|
85
78
|
taf=[4,0,0.95,1,1],
|
|
86
79
|
# track_n, track_n_offset,font_ratio,exon_ratio,text_offset
|
|
87
|
-
tabix=None,
|
|
88
|
-
chrom="CHR",
|
|
89
80
|
pos="POS",
|
|
90
81
|
verbose=True,
|
|
91
82
|
log=Log()
|
|
@@ -225,7 +216,7 @@ def _plot_regional(
|
|
|
225
216
|
if "r" in mode:
|
|
226
217
|
if gtf_path is not None:
|
|
227
218
|
ax3.set_xticks(np.linspace(gene_track_start_i+region[1], gene_track_start_i+region[2], num=region_step))
|
|
228
|
-
ax3.set_xticklabels(region_ticks,rotation=45
|
|
219
|
+
ax3.set_xticklabels(region_ticks,rotation=45)
|
|
229
220
|
|
|
230
221
|
if region_grid==True:
|
|
231
222
|
for i in np.linspace(gene_track_start_i+region[1], gene_track_start_i+region[2], num=region_step):
|
|
@@ -241,7 +232,7 @@ def _plot_regional(
|
|
|
241
232
|
else:
|
|
242
233
|
# set x ticks m plot
|
|
243
234
|
ax1.set_xticks(np.linspace(gene_track_start_i+region[1], gene_track_start_i+region[2], num=region_step))
|
|
244
|
-
ax1.set_xticklabels(region_ticks,rotation=45
|
|
235
|
+
ax1.set_xticklabels(region_ticks,rotation=45)
|
|
245
236
|
|
|
246
237
|
ax1.set_xlim([gene_track_start_i+region[1], gene_track_start_i+region[2]])
|
|
247
238
|
|
|
@@ -498,7 +489,7 @@ def _add_ld_legend(sumstats, ax1, region_ld_threshold, region_ref,region_ref_ind
|
|
|
498
489
|
return ax1, cbar
|
|
499
490
|
|
|
500
491
|
# -############################################################################################################################################################################
|
|
501
|
-
def _plot_recombination_rate(sumstats,pos, region, ax1, rr_path, rr_chr_dict, rr_header_dict, build,rr_lim,rr_ylabel=True):
|
|
492
|
+
def _plot_recombination_rate(sumstats,pos, region, ax1, rr_path, rr_chr_dict, rr_header_dict, build,rr_lim, rr_ylabel=True):
|
|
502
493
|
ax4 = ax1.twinx()
|
|
503
494
|
most_left_snp = sumstats["i"].idxmin()
|
|
504
495
|
|
gwaslab/viz_plot_rg_heatmap.py
CHANGED
|
@@ -37,7 +37,7 @@ def plot_rg(ldscrg,
|
|
|
37
37
|
corrections=None,
|
|
38
38
|
panno_texts=None,
|
|
39
39
|
equal_aspect=True,
|
|
40
|
-
cmap =
|
|
40
|
+
cmap = None,
|
|
41
41
|
full_cell =None,
|
|
42
42
|
log=Log(),
|
|
43
43
|
panno_args=None,
|
|
@@ -57,6 +57,11 @@ def plot_rg(ldscrg,
|
|
|
57
57
|
|
|
58
58
|
log.write("Start to create ldsc genetic correlation heatmap..." ,verbose=verbose)
|
|
59
59
|
# configure arguments
|
|
60
|
+
if cmap is None:
|
|
61
|
+
try: #matplotlib <3.9
|
|
62
|
+
cmap = matplotlib.cm.get_cmap('RdBu')
|
|
63
|
+
except:
|
|
64
|
+
cmap = matplotlib.colormaps.get_cmap('RdBu')
|
|
60
65
|
if fig_args is None:
|
|
61
66
|
fig_args = {"dpi":300}
|
|
62
67
|
if colorbar_args is None:
|
|
@@ -56,7 +56,7 @@ def plot_stacked_mqq( objects,
|
|
|
56
56
|
gtf=None,
|
|
57
57
|
gene_track_height=0.5,
|
|
58
58
|
fig_args=None,
|
|
59
|
-
region_hspace=0.
|
|
59
|
+
region_hspace=0.07,
|
|
60
60
|
subplot_height=4,
|
|
61
61
|
region_lead_grids = None,
|
|
62
62
|
region_lead_grid_line=None,
|
|
@@ -113,10 +113,10 @@ def plot_stacked_mqq( objects,
|
|
|
113
113
|
if region_ld_legends is None:
|
|
114
114
|
region_ld_legends = [0]
|
|
115
115
|
if title_args is None:
|
|
116
|
-
title_args = {"family":
|
|
116
|
+
title_args = {"family":font_family}
|
|
117
117
|
else:
|
|
118
118
|
if "family" not in title_args.keys():
|
|
119
|
-
title_args["family"] =
|
|
119
|
+
title_args["family"] = font_family
|
|
120
120
|
|
|
121
121
|
if save is not None:
|
|
122
122
|
if type(save) is not bool:
|
|
@@ -124,10 +124,17 @@ def plot_stacked_mqq( objects,
|
|
|
124
124
|
if save[-3:]=="pdf" or save[-3:]=="svg":
|
|
125
125
|
log.write(" -Adjusting options for saving as pdf/svg...",verbose=verbose)
|
|
126
126
|
fig_args["dpi"]=72
|
|
127
|
+
|
|
127
128
|
if "scatter_args" not in mqq_args.keys():
|
|
128
129
|
mqq_args["scatter_args"]={"rasterized":True}
|
|
129
130
|
else:
|
|
130
131
|
mqq_args["scatter_args"]["rasterized"] = True
|
|
132
|
+
|
|
133
|
+
if mode=="r":
|
|
134
|
+
if "scatter_args" not in mqq_args.keys():
|
|
135
|
+
mqq_args["scatter_args"]={"rasterized":False}
|
|
136
|
+
else:
|
|
137
|
+
mqq_args["scatter_args"]["rasterized"] = False
|
|
131
138
|
else:
|
|
132
139
|
fig_args["dpi"] = save_args["dpi"]
|
|
133
140
|
# create figure and axes ##################################################################################################################
|
|
@@ -363,10 +370,15 @@ def _add_new_y_label(mode, fig, gene_track_height,n_plot,subplot_height ,fontsiz
|
|
|
363
370
|
gene_track_height_ratio = gene_track_height/(gene_track_height + n_plot*subplot_height)
|
|
364
371
|
ylabel_height = (1 - gene_track_height_ratio)*0.5 + gene_track_height_ratio
|
|
365
372
|
if mode=="r":
|
|
366
|
-
fig.text(0.08, ylabel_height , "
|
|
373
|
+
fig.text(0.08, ylabel_height , "$\mathregular{-log_{10}(P)}$", va='center', rotation='vertical',
|
|
374
|
+
fontsize=fontsize,
|
|
375
|
+
family=font_family)
|
|
376
|
+
|
|
367
377
|
fig.text(0.93, ylabel_height, "Recombination rate(cM/Mb)", va='center', rotation=-90,fontsize=fontsize,family=font_family)
|
|
368
378
|
elif mode=="m":
|
|
369
|
-
fig.text(0.08, ylabel_height , "
|
|
379
|
+
fig.text(0.08, ylabel_height , "$\mathregular{-log_{10}(P)}$", va='center', rotation='vertical',
|
|
380
|
+
fontsize=fontsize,
|
|
381
|
+
family=font_family)
|
|
370
382
|
|
|
371
383
|
def _sort_args(mqq_args, n_plot):
|
|
372
384
|
mqq_args_for_each_plot={i:{} for i in range(n_plot)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: gwaslab
|
|
3
|
-
Version: 3.5.
|
|
3
|
+
Version: 3.5.7
|
|
4
4
|
Summary: A collection of handy tools for GWAS SumStats
|
|
5
5
|
Author-email: Yunye <yunye@gwaslab.com>
|
|
6
6
|
Project-URL: Homepage, https://cloufield.github.io/gwaslab/
|
|
@@ -8,7 +8,7 @@ Project-URL: Github, https://github.com/Cloufield/gwaslab
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: <3.
|
|
11
|
+
Requires-Python: <3.13,>=3.9
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
License-File: LICENSE_before_v3.4.39
|
|
@@ -14,7 +14,7 @@ gwaslab/g_Sumstats_summary.py,sha256=FECvvFXJVKaCX5dggBvvk9YvJ6AbdbcLfjltysX7wEE
|
|
|
14
14
|
gwaslab/g_headers.py,sha256=Q37MZgc2G1bMzzJX94Kq6GoRYJyfUxQX50CvyIerXww,6524
|
|
15
15
|
gwaslab/g_meta.py,sha256=Orj8WhFvbylDmaAp9Px_GRUoyEBVML8MLa9829sNM0o,2588
|
|
16
16
|
gwaslab/g_vchange_status.py,sha256=w3zsYYOcCaI3PTeboonvkQjudzUAfVIgATzRdiPViZs,1939
|
|
17
|
-
gwaslab/g_version.py,sha256=
|
|
17
|
+
gwaslab/g_version.py,sha256=AdCrtpOcYXhFe4LFCH2xi4r0VT1oQG7Coqhyl842u8w,1889
|
|
18
18
|
gwaslab/hm_casting.py,sha256=FqP4EQl83Q2OKLw004OgLIvUH795TVCGwziLk5jsHqY,11368
|
|
19
19
|
gwaslab/hm_harmonize_sumstats.py,sha256=ymM33bwOOkLteiLXUuSSzURudgCrkVMTR7wUwXf1jQs,84381
|
|
20
20
|
gwaslab/hm_rsid_to_chrpos.py,sha256=ODWREO0jPN0RAfNzL5fRzSRANfhiksOvUVPuEsFZQqA,6552
|
|
@@ -71,14 +71,14 @@ gwaslab/viz_plot_effect.py,sha256=7p3YnGcgIG0ajwQSNCiHlmX9BvEeClwvQ-DhPe5LzSI,97
|
|
|
71
71
|
gwaslab/viz_plot_forestplot.py,sha256=xgOnefh737CgdQxu5naVyRNBX1NQXPFKzf51fbh6afs,6771
|
|
72
72
|
gwaslab/viz_plot_miamiplot.py,sha256=rCFEp7VNuVqeBBG3WRkmFAtFklbF79BvIQQYiSY70VY,31238
|
|
73
73
|
gwaslab/viz_plot_miamiplot2.py,sha256=tr3vRq6NLmoVoOSYbUkvXMHRONLLrvqjkRYN1iSX5-I,16214
|
|
74
|
-
gwaslab/viz_plot_mqqplot.py,sha256=
|
|
74
|
+
gwaslab/viz_plot_mqqplot.py,sha256=VIlAFL0lq4nEzqMh17I9d9u6HjCX3Jku69XHwIm1Fmw,69836
|
|
75
75
|
gwaslab/viz_plot_phe_heatmap.py,sha256=qoXVeFTIm-n8IinNbDdPFVBSz2yGCGK6QzTstXv6aj4,9532
|
|
76
76
|
gwaslab/viz_plot_qqplot.py,sha256=psQgVpP29686CEZkzQz0iRbApzqy7aE3GGiBcazVvNw,7247
|
|
77
|
-
gwaslab/viz_plot_regional2.py,sha256=
|
|
77
|
+
gwaslab/viz_plot_regional2.py,sha256=EcLHhdWMj3YPtN-YOkXG9W6qf-lktTFlRMFRRQvY9kA,43106
|
|
78
78
|
gwaslab/viz_plot_regionalplot.py,sha256=8u-5-yfy-UaXhaxVVz3Y5k2kBAoqzczUw1hyyD450iI,37983
|
|
79
|
-
gwaslab/viz_plot_rg_heatmap.py,sha256=
|
|
79
|
+
gwaslab/viz_plot_rg_heatmap.py,sha256=z-G4gxK5-H_e13jV8RQnNzXPrKSQ0c7q41-KpMrA-cs,13861
|
|
80
80
|
gwaslab/viz_plot_scatter_with_reg.py,sha256=PmUZDQl2q4Dme3HLPXEwf_TrMjwJADA-uFXNDBWUEa4,8333
|
|
81
|
-
gwaslab/viz_plot_stackedregional.py,sha256=
|
|
81
|
+
gwaslab/viz_plot_stackedregional.py,sha256=gt-pj4c4AMgmlNgOCKlpCWJN1iU_Z5NYljITRc-OyI4,19032
|
|
82
82
|
gwaslab/viz_plot_trumpetplot.py,sha256=y4sAFjzMaSLuWrdr9_ao-wPYCK5DlP2ykiqulWsoN_k,42680
|
|
83
83
|
gwaslab/data/formatbook.json,sha256=N2nJs80HH98Rsu9FxaSvIQO9J5yIV97WEtAKjRqYwiY,38207
|
|
84
84
|
gwaslab/data/reference.json,sha256=IrjwFnXjrpVUp3zYfcYClpibJE9Y-94gtrC1Aw8sXxg,12332
|
|
@@ -88,9 +88,9 @@ gwaslab/data/hapmap3_SNPs/hapmap3_db150_hg19.snplist.gz,sha256=qD9RsC5S2h6l-OdpW
|
|
|
88
88
|
gwaslab/data/hapmap3_SNPs/hapmap3_db151_hg38.snplist.gz,sha256=Y8ZT2FIAhbhlgCJdE9qQVAiwnV_fcsPt72usBa7RSBM,10225828
|
|
89
89
|
gwaslab/data/high_ld/high_ld_hla_hg19.bed.gz,sha256=R7IkssKu0L4WwkU9SrS84xCMdrkkKL0gnTNO_OKbG0Y,219
|
|
90
90
|
gwaslab/data/high_ld/high_ld_hla_hg38.bed.gz,sha256=76CIU0pibDJ72Y6UY-TbIKE9gEPwTELAaIbCXyjm80Q,470
|
|
91
|
-
gwaslab-3.5.
|
|
92
|
-
gwaslab-3.5.
|
|
93
|
-
gwaslab-3.5.
|
|
94
|
-
gwaslab-3.5.
|
|
95
|
-
gwaslab-3.5.
|
|
96
|
-
gwaslab-3.5.
|
|
91
|
+
gwaslab-3.5.7.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
92
|
+
gwaslab-3.5.7.dist-info/LICENSE_before_v3.4.39,sha256=GhLOU_1UDEKeOacYhsRN_m9u-eIuVTazSndZPeNcTZA,1066
|
|
93
|
+
gwaslab-3.5.7.dist-info/METADATA,sha256=QKvLYkpRCauJ2uiVpd7xfO_w9DEKg4qsM_CiSRfcUkQ,7750
|
|
94
|
+
gwaslab-3.5.7.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
95
|
+
gwaslab-3.5.7.dist-info/top_level.txt,sha256=PyY6hWtrALpv2MAN3kjkIAzJNmmBTH5a2risz9KwH08,8
|
|
96
|
+
gwaslab-3.5.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|