gwaslab 3.6.5__py3-none-any.whl → 3.6.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/__init__.py +57 -47
- gwaslab/{bd_common_data.py → bd/bd_common_data.py} +10 -9
- gwaslab/bd/bd_config.py +28 -0
- gwaslab/{bd_download.py → bd/bd_download.py} +1 -1
- gwaslab/{bd_get_hapmap3.py → bd/bd_get_hapmap3.py} +9 -6
- gwaslab/bd/bd_path_manager.py +110 -0
- gwaslab/data/formatbook.json +805 -9
- gwaslab/{ldsc_irwls.py → extension/ldsc/ldsc_irwls.py} +1 -1
- gwaslab/{ldsc_regressions.py → extension/ldsc/ldsc_regressions.py} +2 -2
- gwaslab/{ldsc_sumstats.py → extension/ldsc/ldsc_sumstats.py} +2 -2
- gwaslab/{prscs_mcmc_gtb.py → extension/prscs/prscs_mcmc_gtb.py} +1 -1
- gwaslab/g_Sumstats.py +130 -96
- gwaslab/g_SumstatsMulti.py +69 -40
- gwaslab/g_SumstatsPair.py +54 -37
- gwaslab/g_SumstatsSet.py +88 -81
- gwaslab/g_SumstatsT.py +6 -6
- gwaslab/g_Sumstats_polars.py +84 -84
- gwaslab/g_meta_update.py +1 -1
- gwaslab/g_vchange_status.py +4 -4
- gwaslab/g_version.py +2 -2
- gwaslab/{hm_casting.py → hm/hm_casting.py} +4 -4
- gwaslab/{hm_casting_polars.py → hm/hm_casting_polars.py} +4 -4
- gwaslab/hm/hm_harmonize_sumstats.py +1635 -0
- gwaslab/hm_harmonize_sumstats.py +3 -8
- gwaslab/{io_load_ld.py → io/io_load_ld.py} +16 -13
- gwaslab/{io_preformat_input.py → io/io_preformat_input.py} +152 -73
- gwaslab/{io_preformat_input_polars.py → io/io_preformat_input_polars.py} +7 -7
- gwaslab/{io_read_pipcs.py → io/io_read_pipcs.py} +6 -5
- gwaslab/{io_read_tabular.py → io/io_read_tabular.py} +2 -2
- gwaslab/{io_to_formats.py → io/io_to_formats.py} +13 -9
- gwaslab/{io_to_pickle.py → io/io_to_pickle.py} +16 -1
- gwaslab/{qc_check_datatype_polars.py → qc/qc_check_datatype_polars.py} +2 -2
- gwaslab/{qc_fix_sumstats.py → qc/qc_fix_sumstats.py} +60 -33
- gwaslab/{qc_fix_sumstats_polars.py → qc/qc_fix_sumstats_polars.py} +15 -11
- gwaslab/{util_abf_finemapping.py → util/util_abf_finemapping.py} +2 -2
- gwaslab/{util_ex_calculate_ldmatrix.py → util/util_ex_calculate_ldmatrix.py} +18 -8
- gwaslab/{util_ex_calculate_prs.py → util/util_ex_calculate_prs.py} +2 -2
- gwaslab/{util_ex_ldproxyfinder.py → util/util_ex_ldproxyfinder.py} +6 -6
- gwaslab/{util_ex_ldsc.py → util/util_ex_ldsc.py} +18 -13
- gwaslab/{util_ex_match_ldmatrix.py → util/util_ex_match_ldmatrix.py} +8 -7
- gwaslab/util/util_ex_phewwas.py +117 -0
- gwaslab/{util_ex_process_h5.py → util/util_ex_process_h5.py} +2 -2
- gwaslab/{util_ex_process_ref.py → util/util_ex_process_ref.py} +2 -2
- gwaslab/{util_ex_run_2samplemr.py → util/util_ex_run_2samplemr.py} +18 -7
- gwaslab/{util_ex_run_ccgwas.py → util/util_ex_run_ccgwas.py} +4 -4
- gwaslab/{util_ex_run_clumping.py → util/util_ex_run_clumping.py} +28 -13
- gwaslab/{util_ex_run_coloc.py → util/util_ex_run_coloc.py} +22 -10
- gwaslab/{util_ex_run_hyprcoloc.py → util/util_ex_run_hyprcoloc.py} +4 -4
- gwaslab/{util_ex_run_magma.py → util/util_ex_run_magma.py} +21 -11
- gwaslab/{util_ex_run_mesusie.py → util/util_ex_run_mesusie.py} +3 -3
- gwaslab/{util_ex_run_mtag.py → util/util_ex_run_mtag.py} +50 -18
- gwaslab/{util_ex_run_prscs.py → util/util_ex_run_prscs.py} +3 -3
- gwaslab/{util_ex_run_scdrs.py → util/util_ex_run_scdrs.py} +10 -4
- gwaslab/{util_ex_run_susie.py → util/util_ex_run_susie.py} +49 -26
- gwaslab/{util_in_fill_data.py → util/util_in_fill_data.py} +1 -1
- gwaslab/{util_in_filter_value.py → util/util_in_filter_value.py} +18 -11
- gwaslab/{util_in_get_sig.py → util/util_in_get_sig.py} +15 -13
- gwaslab/{util_in_meta.py → util/util_in_meta.py} +1 -1
- gwaslab/{util_in_meta_polars.py → util/util_in_meta_polars.py} +1 -1
- gwaslab/{viz_aux_annotate_plot.py → viz/viz_aux_annotate_plot.py} +1 -1
- gwaslab/{viz_aux_quickfix.py → viz/viz_aux_quickfix.py} +2 -2
- gwaslab/{viz_plot_compare_af.py → viz/viz_plot_compare_af.py} +1 -1
- gwaslab/{viz_plot_compare_effect.py → viz/viz_plot_compare_effect.py} +16 -8
- gwaslab/{viz_plot_credible_sets.py → viz/viz_plot_credible_sets.py} +6 -6
- gwaslab/{viz_plot_effect.py → viz/viz_plot_effect.py} +37 -69
- gwaslab/{viz_plot_miamiplot.py → viz/viz_plot_miamiplot.py} +28 -20
- gwaslab/{viz_plot_miamiplot2.py → viz/viz_plot_miamiplot2.py} +27 -22
- gwaslab/{viz_plot_mqqplot.py → viz/viz_plot_mqqplot.py} +48 -38
- gwaslab/{viz_plot_phe_heatmap.py → viz/viz_plot_phe_heatmap.py} +18 -15
- gwaslab/{viz_plot_qqplot.py → viz/viz_plot_qqplot.py} +4 -2
- gwaslab/{viz_plot_regional2.py → viz/viz_plot_regional2.py} +11 -9
- gwaslab/{viz_plot_regionalplot.py → viz/viz_plot_regionalplot.py} +5 -4
- gwaslab/{viz_plot_rg_heatmap.py → viz/viz_plot_rg_heatmap.py} +1 -1
- gwaslab/{viz_plot_scatter_with_reg.py → viz/viz_plot_scatter_with_reg.py} +10 -7
- gwaslab/{viz_plot_stackedregional.py → viz/viz_plot_stackedregional.py} +67 -33
- gwaslab/{viz_plot_trumpetplot.py → viz/viz_plot_trumpetplot.py} +11 -9
- {gwaslab-3.6.5.dist-info → gwaslab-3.6.7.dist-info}/METADATA +1 -1
- gwaslab-3.6.7.dist-info/RECORD +123 -0
- gwaslab/bd_config.py +0 -18
- gwaslab-3.6.5.dist-info/RECORD +0 -120
- /gwaslab/{ldsc_jackknife.py → extension/ldsc/ldsc_jackknife.py} +0 -0
- /gwaslab/{ldsc_ldscore.py → extension/ldsc/ldsc_ldscore.py} +0 -0
- /gwaslab/{ldsc_parse.py → extension/ldsc/ldsc_parse.py} +0 -0
- /gwaslab/{prscs_gigrnd.py → extension/prscs/prscs_gigrnd.py} +0 -0
- /gwaslab/{prscs_parse_genet.py → extension/prscs/prscs_parse_genet.py} +0 -0
- /gwaslab/{hm_rsid_to_chrpos.py → hm/hm_rsid_to_chrpos.py} +0 -0
- /gwaslab/{io_process_args.py → io/io_process_args.py} +0 -0
- /gwaslab/{io_read_ldsc.py → io/io_read_ldsc.py} +0 -0
- /gwaslab/{qc_build.py → qc/qc_build.py} +0 -0
- /gwaslab/{qc_check_datatype.py → qc/qc_check_datatype.py} +0 -0
- /gwaslab/{util_ex_gwascatalog.py → util/util_ex_gwascatalog.py} +0 -0
- /gwaslab/{util_ex_infer_ancestry.py → util/util_ex_infer_ancestry.py} +0 -0
- /gwaslab/{util_ex_plink_filter.py → util/util_ex_plink_filter.py} +0 -0
- /gwaslab/{util_in_calculate_gc.py → util/util_in_calculate_gc.py} +0 -0
- /gwaslab/{util_in_calculate_power.py → util/util_in_calculate_power.py} +0 -0
- /gwaslab/{util_in_convert_h2.py → util/util_in_convert_h2.py} +0 -0
- /gwaslab/{util_in_correct_winnerscurse.py → util/util_in_correct_winnerscurse.py} +0 -0
- /gwaslab/{util_in_estimate_ess.py → util/util_in_estimate_ess.py} +0 -0
- /gwaslab/{util_in_get_density.py → util/util_in_get_density.py} +0 -0
- /gwaslab/{util_in_merge.py → util/util_in_merge.py} +0 -0
- /gwaslab/{util_in_snphwe.py → util/util_in_snphwe.py} +0 -0
- /gwaslab/{viz_aux_chromatin.py → viz/viz_aux_chromatin.py} +0 -0
- /gwaslab/{viz_aux_property.py → viz/viz_aux_property.py} +0 -0
- /gwaslab/{viz_aux_reposition_text.py → viz/viz_aux_reposition_text.py} +0 -0
- /gwaslab/{viz_aux_save_figure.py → viz/viz_aux_save_figure.py} +0 -0
- /gwaslab/{viz_plot_forestplot.py → viz/viz_plot_forestplot.py} +0 -0
- {gwaslab-3.6.5.dist-info → gwaslab-3.6.7.dist-info}/WHEEL +0 -0
- {gwaslab-3.6.5.dist-info → gwaslab-3.6.7.dist-info}/licenses/LICENSE +0 -0
- {gwaslab-3.6.5.dist-info → gwaslab-3.6.7.dist-info}/licenses/LICENSE_before_v3.4.39 +0 -0
- {gwaslab-3.6.5.dist-info → gwaslab-3.6.7.dist-info}/top_level.txt +0 -0
|
@@ -5,20 +5,22 @@ import gc
|
|
|
5
5
|
from pyensembl import EnsemblRelease
|
|
6
6
|
from pyensembl import Genome
|
|
7
7
|
from os import path
|
|
8
|
-
from gwaslab.util_in_fill_data import fill_p
|
|
9
8
|
from gwaslab.g_Log import Log
|
|
10
|
-
|
|
11
|
-
from gwaslab.bd_common_data import
|
|
12
|
-
from gwaslab.bd_common_data import
|
|
13
|
-
from gwaslab.bd_common_data import
|
|
14
|
-
from gwaslab.bd_common_data import
|
|
15
|
-
from gwaslab.
|
|
16
|
-
from gwaslab.
|
|
17
|
-
|
|
18
|
-
from gwaslab.qc_fix_sumstats import
|
|
19
|
-
from gwaslab.qc_fix_sumstats import
|
|
20
|
-
from gwaslab.
|
|
21
|
-
from gwaslab.
|
|
9
|
+
|
|
10
|
+
from gwaslab.bd.bd_common_data import get_chr_to_number
|
|
11
|
+
from gwaslab.bd.bd_common_data import get_number_to_chr
|
|
12
|
+
from gwaslab.bd.bd_common_data import get_chr_to_NC
|
|
13
|
+
from gwaslab.bd.bd_common_data import gtf_to_protein_coding
|
|
14
|
+
from gwaslab.bd.bd_common_data import gtf_to_all_gene
|
|
15
|
+
from gwaslab.bd.bd_download import check_and_download
|
|
16
|
+
|
|
17
|
+
from gwaslab.qc.qc_fix_sumstats import check_dataframe_shape
|
|
18
|
+
from gwaslab.qc.qc_fix_sumstats import start_to
|
|
19
|
+
from gwaslab.qc.qc_fix_sumstats import finished
|
|
20
|
+
from gwaslab.qc.qc_build import _check_build
|
|
21
|
+
from gwaslab.util.util_in_correct_winnerscurse import wc_correct
|
|
22
|
+
from gwaslab.util.util_ex_gwascatalog import gwascatalog_trait
|
|
23
|
+
from gwaslab.util.util_in_fill_data import fill_p
|
|
22
24
|
# getsig
|
|
23
25
|
# closest_gene
|
|
24
26
|
# annogene
|
|
@@ -4,7 +4,7 @@ import numpy as np
|
|
|
4
4
|
from scipy.stats.distributions import chi2
|
|
5
5
|
from scipy.stats import norm
|
|
6
6
|
from gwaslab.g_Log import Log
|
|
7
|
-
from gwaslab.io_to_pickle import load_data_from_pickle
|
|
7
|
+
from gwaslab.io.io_to_pickle import load_data_from_pickle
|
|
8
8
|
from gwaslab.g_Sumstats import Sumstats
|
|
9
9
|
import gc
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import numpy as np
|
|
|
4
4
|
from scipy.stats.distributions import chi2
|
|
5
5
|
from scipy.stats import norm
|
|
6
6
|
from gwaslab.g_Log import Log
|
|
7
|
-
from gwaslab.io_to_pickle import load_data_from_pickle
|
|
7
|
+
from gwaslab.io.io_to_pickle import load_data_from_pickle
|
|
8
8
|
from gwaslab.g_Sumstats import Sumstats
|
|
9
9
|
import polars as pl
|
|
10
10
|
########################################################################################################################################################################################################################################################################################################################################################
|
|
@@ -9,7 +9,7 @@ from scipy import stats
|
|
|
9
9
|
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
|
|
10
10
|
from adjustText import adjust_text
|
|
11
11
|
from gwaslab.g_Log import Log
|
|
12
|
-
from gwaslab.viz_aux_reposition_text import adjust_text_position
|
|
12
|
+
from gwaslab.viz.viz_aux_reposition_text import adjust_text_position
|
|
13
13
|
from pandas.api.types import is_string_dtype
|
|
14
14
|
|
|
15
15
|
# single mqqplot
|
|
@@ -3,8 +3,8 @@ import numpy as np
|
|
|
3
3
|
from gwaslab.g_Log import Log
|
|
4
4
|
from matplotlib import ticker
|
|
5
5
|
import matplotlib.pyplot as plt
|
|
6
|
-
from gwaslab.bd_common_data import get_chr_to_number
|
|
7
|
-
from gwaslab.bd_common_data import get_number_to_chr
|
|
6
|
+
from gwaslab.bd.bd_common_data import get_chr_to_number
|
|
7
|
+
from gwaslab.bd.bd_common_data import get_number_to_chr
|
|
8
8
|
from math import ceil
|
|
9
9
|
|
|
10
10
|
def _quick_fix(sumstats, chr_dict=get_chr_to_number(), scaled=False, chrom="CHR", pos="POS", p="P", mlog10p="MLOG10P",log=Log(), verbose=True):
|
|
@@ -4,7 +4,7 @@ import matplotlib.pyplot as plt
|
|
|
4
4
|
import scipy.stats as ss
|
|
5
5
|
import seaborn as sns
|
|
6
6
|
from gwaslab.g_Log import Log
|
|
7
|
-
from gwaslab.viz_aux_save_figure import save_figure
|
|
7
|
+
from gwaslab.viz.viz_aux_save_figure import save_figure
|
|
8
8
|
|
|
9
9
|
################################################################################################################################
|
|
10
10
|
def plotdaf(sumstats,
|
|
@@ -8,15 +8,18 @@ import math
|
|
|
8
8
|
import scipy.stats as ss
|
|
9
9
|
from matplotlib.patches import Rectangle
|
|
10
10
|
from adjustText import adjust_text
|
|
11
|
-
from gwaslab.viz_aux_save_figure import save_figure
|
|
12
|
-
from gwaslab.util_in_get_sig import getsig
|
|
13
|
-
from gwaslab.util_in_get_sig import annogene
|
|
14
11
|
from gwaslab.g_Log import Log
|
|
15
|
-
from gwaslab.util_in_correct_winnerscurse import wc_correct
|
|
16
|
-
from gwaslab.util_in_correct_winnerscurse import wc_correct_test
|
|
17
12
|
from gwaslab.g_Sumstats import Sumstats
|
|
18
|
-
|
|
19
|
-
from gwaslab.
|
|
13
|
+
|
|
14
|
+
from gwaslab.viz.viz_aux_save_figure import save_figure
|
|
15
|
+
|
|
16
|
+
from gwaslab.util.util_in_get_sig import getsig
|
|
17
|
+
from gwaslab.util.util_in_get_sig import annogene
|
|
18
|
+
from gwaslab.util.util_in_correct_winnerscurse import wc_correct
|
|
19
|
+
from gwaslab.util.util_in_correct_winnerscurse import wc_correct_test
|
|
20
|
+
|
|
21
|
+
from gwaslab.io.io_process_args import _merge_and_sync_dic
|
|
22
|
+
from gwaslab.io.io_process_args import _extract_kwargs
|
|
20
23
|
#20220422
|
|
21
24
|
def compare_effect(path1,
|
|
22
25
|
path2,
|
|
@@ -91,13 +94,17 @@ def compare_effect(path1,
|
|
|
91
94
|
exponent = math.floor(math.log10(sig_level))
|
|
92
95
|
mantissa = sig_level / 10**exponent
|
|
93
96
|
|
|
94
|
-
legend_title = '$\mathregular{ P < {} x 10^{{{}}}}$ in:'.format(mantissa, exponent)
|
|
97
|
+
legend_title = '$\mathregular{{ P < {} x 10^{{{}}} }}$ in:'.format(mantissa, exponent)
|
|
95
98
|
|
|
99
|
+
# what method to use for correction
|
|
96
100
|
if is_q_mc=="fdr" or is_q_mc=="bon":
|
|
97
101
|
is_q = True
|
|
102
|
+
|
|
103
|
+
# if heterogeneity test
|
|
98
104
|
if is_q == True:
|
|
99
105
|
if is_q_mc not in [False,"fdr","bon","non"]:
|
|
100
106
|
raise ValueError('Please select either "fdr" or "bon" or "non"/False for is_q_mc.')
|
|
107
|
+
|
|
101
108
|
if save_args is None:
|
|
102
109
|
save_args = {"dpi":300,"facecolor":"white"}
|
|
103
110
|
if reg_box is None:
|
|
@@ -985,6 +992,7 @@ def test_q(df,beta1,se1,beta2,se2,q_level=0.05,is_q_mc=False, log=Log(), verbose
|
|
|
985
992
|
log.write(" -Bonferroni correction applied...", verbose=verbose)
|
|
986
993
|
df[rawpq] = df[pq]
|
|
987
994
|
df[pq] = df[pq] * len(df[pq])
|
|
995
|
+
# P value upper bound -> 1
|
|
988
996
|
df.loc[df[pq]>1,pq] = 1
|
|
989
997
|
|
|
990
998
|
df.loc[df[pq]<q_level,"Edge_color"]="black"
|
|
@@ -3,12 +3,12 @@ import matplotlib.pyplot as plt
|
|
|
3
3
|
import pandas as pd
|
|
4
4
|
import seaborn as sns
|
|
5
5
|
from gwaslab.g_Log import Log
|
|
6
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_i_with_rank
|
|
7
|
-
from gwaslab.viz_plot_mqqplot import _process_xtick
|
|
8
|
-
from gwaslab.viz_plot_mqqplot import _process_xlabel
|
|
9
|
-
from gwaslab.bd_common_data import get_number_to_chr
|
|
10
|
-
from gwaslab.util_in_filter_value import _filter_region
|
|
11
|
-
from gwaslab.io_process_args import _extract_kwargs
|
|
6
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_i_with_rank
|
|
7
|
+
from gwaslab.viz.viz_plot_mqqplot import _process_xtick
|
|
8
|
+
from gwaslab.viz.viz_plot_mqqplot import _process_xlabel
|
|
9
|
+
from gwaslab.bd.bd_common_data import get_number_to_chr
|
|
10
|
+
from gwaslab.util.util_in_filter_value import _filter_region
|
|
11
|
+
from gwaslab.io.io_process_args import _extract_kwargs
|
|
12
12
|
import copy
|
|
13
13
|
|
|
14
14
|
def _plot_cs(pipcs_raw,
|
|
@@ -1,62 +1,8 @@
|
|
|
1
1
|
import pandas as pd
|
|
2
2
|
import matplotlib.pyplot as plt
|
|
3
|
-
|
|
4
|
-
import matplotlib.patches as patches
|
|
5
|
-
import seaborn as sns
|
|
6
|
-
import numpy as np
|
|
7
|
-
import scipy as sp
|
|
8
|
-
import copy
|
|
9
|
-
from math import ceil
|
|
10
|
-
from shutil import which
|
|
11
|
-
from pyensembl import EnsemblRelease
|
|
12
|
-
from allel import GenotypeArray
|
|
13
|
-
from allel import read_vcf
|
|
14
|
-
from allel import rogers_huff_r_between
|
|
15
|
-
import matplotlib as mpl
|
|
16
|
-
from scipy import stats
|
|
17
|
-
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
|
|
18
|
-
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
|
|
19
|
-
from matplotlib.ticker import MaxNLocator
|
|
20
|
-
import gc as garbage_collect
|
|
21
|
-
from adjustText import adjust_text
|
|
22
|
-
from gwaslab.viz_aux_reposition_text import adjust_text_position
|
|
23
|
-
from gwaslab.viz_aux_annotate_plot import annotate_single
|
|
24
|
-
from gwaslab.viz_plot_qqplot import _plot_qq
|
|
25
|
-
from gwaslab.hm_harmonize_sumstats import auto_check_vcf_chr_dict
|
|
26
|
-
from gwaslab.viz_plot_regional2 import _plot_regional
|
|
27
|
-
from gwaslab.viz_plot_regional2 import process_vcf
|
|
28
|
-
from gwaslab.viz_plot_regional2 import _get_lead_id
|
|
29
|
-
from gwaslab.viz_aux_quickfix import _get_largenumber
|
|
30
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_p_value
|
|
31
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_pos
|
|
32
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_chr
|
|
33
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_eaf
|
|
34
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_mlog10p
|
|
35
|
-
from gwaslab.viz_aux_quickfix import _quick_add_tchrpos
|
|
36
|
-
from gwaslab.viz_aux_quickfix import _quick_merge_sumstats
|
|
37
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_i
|
|
38
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_i_with_rank
|
|
39
|
-
from gwaslab.viz_aux_quickfix import _quick_extract_snp_in_region
|
|
40
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_highlight_hue_pair
|
|
41
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_marker_relative_size
|
|
42
|
-
from gwaslab.viz_aux_quickfix import _cut
|
|
43
|
-
from gwaslab.viz_aux_quickfix import _set_yticklabels
|
|
44
|
-
from gwaslab.viz_aux_quickfix import _jagged_y
|
|
45
|
-
from gwaslab.viz_aux_save_figure import save_figure
|
|
3
|
+
from gwaslab.viz.viz_aux_save_figure import save_figure
|
|
46
4
|
from gwaslab.g_Log import Log
|
|
47
|
-
from gwaslab.
|
|
48
|
-
from gwaslab.util_in_get_sig import getsig
|
|
49
|
-
from gwaslab.util_in_get_sig import annogene
|
|
50
|
-
from gwaslab.bd_common_data import get_chr_to_number
|
|
51
|
-
from gwaslab.bd_common_data import get_number_to_chr
|
|
52
|
-
from gwaslab.bd_common_data import get_recombination_rate
|
|
53
|
-
from gwaslab.bd_common_data import get_gtf
|
|
54
|
-
from gwaslab.util_in_filter_value import _filter_region
|
|
55
|
-
from gwaslab.g_version import _get_version
|
|
56
|
-
from matplotlib.colors import ListedColormap
|
|
57
|
-
from matplotlib.colors import LinearSegmentedColormap
|
|
58
|
-
from matplotlib.colors import to_hex
|
|
59
|
-
from gwaslab.io_process_args import _extract_kwargs
|
|
5
|
+
from gwaslab.io.io_process_args import _extract_kwargs
|
|
60
6
|
|
|
61
7
|
def _plot_effect(to_plot,
|
|
62
8
|
y=None,
|
|
@@ -82,15 +28,19 @@ def _plot_effect(to_plot,
|
|
|
82
28
|
effect_label=None,
|
|
83
29
|
eaf_label=None,
|
|
84
30
|
snpr2_label=None,
|
|
31
|
+
xlim_eaf=None,
|
|
32
|
+
xlim_snpr2 = None,
|
|
85
33
|
log=Log(),
|
|
86
34
|
verbose=True,
|
|
87
35
|
legend_mode=1,
|
|
88
36
|
ncol=2,
|
|
37
|
+
gap=1,
|
|
89
38
|
fontsize=12,
|
|
90
39
|
font_family="Arial",
|
|
91
40
|
size=None,
|
|
92
41
|
hue=None,
|
|
93
42
|
style=None,
|
|
43
|
+
sort_args=None,
|
|
94
44
|
**args):
|
|
95
45
|
|
|
96
46
|
if err_args is None:
|
|
@@ -108,7 +58,8 @@ def _plot_effect(to_plot,
|
|
|
108
58
|
fig_args={"figsize":(8,8),"dpi":300}
|
|
109
59
|
if scatter_args is None:
|
|
110
60
|
scatter_args={"s":20}
|
|
111
|
-
|
|
61
|
+
if sort_args is None:
|
|
62
|
+
sort_args={}
|
|
112
63
|
|
|
113
64
|
legend_titles=[]
|
|
114
65
|
if hue is not None:
|
|
@@ -142,17 +93,24 @@ def _plot_effect(to_plot,
|
|
|
142
93
|
if y_sort is None:
|
|
143
94
|
y_sort = ["CHR","POS","STUDY"]
|
|
144
95
|
|
|
145
|
-
to_plot = to_plot.sort_values(by=y_sort)
|
|
96
|
+
#to_plot = to_plot.sort_values(by=y_sort)
|
|
146
97
|
|
|
147
98
|
if group is None:
|
|
148
|
-
group = ["CHR","POS"]
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
to_plot['_VAR_GROUP'] = to_plot.groupby(group).ngroup() + 1
|
|
99
|
+
group = ["CHR","POS"] + y_sort
|
|
100
|
+
|
|
101
|
+
sort_columns= group + y_sort
|
|
153
102
|
|
|
154
|
-
to_plot
|
|
155
|
-
|
|
103
|
+
to_plot = to_plot.sort_values(by=sort_columns,**sort_args)
|
|
104
|
+
|
|
105
|
+
# calculate cum sum
|
|
106
|
+
cum_sizes = to_plot.groupby(group).size()
|
|
107
|
+
cum_sizes = cum_sizes + gap
|
|
108
|
+
cum_sizes = cum_sizes.cumsum()
|
|
109
|
+
|
|
110
|
+
# create index for y axis
|
|
111
|
+
to_plot['_GROUP_CUMSUM'] = to_plot.set_index(group).index.map(cum_sizes)
|
|
112
|
+
to_plot['_VAR_INDEX'] = to_plot.groupby(group).cumcount()
|
|
113
|
+
to_plot["_VAR_INDEX"]= to_plot['_GROUP_CUMSUM'] - to_plot['_VAR_INDEX']
|
|
156
114
|
|
|
157
115
|
y="_VAR_INDEX"
|
|
158
116
|
|
|
@@ -171,15 +129,15 @@ def _plot_effect(to_plot,
|
|
|
171
129
|
fig,ax1 = plt.subplots(ncols=ncols, **fig_args)
|
|
172
130
|
elif ncols==2:
|
|
173
131
|
if eaf_panel==True:
|
|
174
|
-
fig,axes = plt.subplots(ncols=ncols, dpi=400,sharey=True)
|
|
132
|
+
fig,axes = plt.subplots(ncols=ncols, dpi=400,sharey=True, **fig_args)
|
|
175
133
|
ax1=axes[0]
|
|
176
134
|
ax2=axes[1]
|
|
177
135
|
else:
|
|
178
|
-
fig,axes = plt.subplots(ncols=ncols, dpi=400,sharey=True)
|
|
136
|
+
fig,axes = plt.subplots(ncols=ncols, dpi=400,sharey=True, **fig_args)
|
|
179
137
|
ax1=axes[0]
|
|
180
138
|
ax3=axes[1]
|
|
181
139
|
else:
|
|
182
|
-
fig,axes = plt.subplots(ncols=ncols, dpi=400,sharey=True)
|
|
140
|
+
fig,axes = plt.subplots(ncols=ncols, dpi=400,sharey=True, **fig_args)
|
|
183
141
|
ax1=axes[0]
|
|
184
142
|
ax2=axes[1]
|
|
185
143
|
ax3=axes[2]
|
|
@@ -192,6 +150,7 @@ def _plot_effect(to_plot,
|
|
|
192
150
|
ax1.axvline(x=0,linestyle="dashed",c="grey")
|
|
193
151
|
ax1.set_yticks(to_plot[y], labels = to_plot[y_name], fontsize=fontsize, family=font_family)
|
|
194
152
|
ax1.set_ylabel(ylabel, fontsize=fontsize, family=font_family)
|
|
153
|
+
ax1.set_xlabel(x, fontsize=fontsize, family=font_family)
|
|
195
154
|
|
|
196
155
|
if title is not None:
|
|
197
156
|
ax1.set_title(title,fontsize=fontsize, family=font_family)
|
|
@@ -199,11 +158,14 @@ def _plot_effect(to_plot,
|
|
|
199
158
|
if eaf_panel==True:
|
|
200
159
|
ax2.barh(y=to_plot[y], width=to_plot[eaf], zorder=100, **eaf_args)
|
|
201
160
|
ax2.set_xlabel(eaf, fontsize=fontsize, family=font_family)
|
|
161
|
+
if xlim_eaf is not None:
|
|
162
|
+
ax3.set_xlim(xlim_eaf)
|
|
202
163
|
|
|
203
164
|
if snpvar_panel==True:
|
|
204
165
|
ax3.barh(y=to_plot[y], width=to_plot[snpr2], zorder=100,**snpr2_args)
|
|
205
166
|
ax3.set_xlabel(snpr2, fontsize=fontsize, family=font_family)
|
|
206
|
-
|
|
167
|
+
if xlim_snpr2 is not None:
|
|
168
|
+
ax3.set_xlim(xlim_snpr2)
|
|
207
169
|
#try:
|
|
208
170
|
if legend_mode==1:
|
|
209
171
|
#if ncols==1:
|
|
@@ -273,6 +235,12 @@ def _plot_effect(to_plot,
|
|
|
273
235
|
# for legend_row in legend_rows[:-1]:
|
|
274
236
|
# ax1.add_artist(legend_row)
|
|
275
237
|
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
ax1.tick_params(axis='x',
|
|
241
|
+
labelsize=fontsize,
|
|
242
|
+
labelfontfamily=font_family)
|
|
243
|
+
|
|
276
244
|
if effect_label is not None:
|
|
277
245
|
ax1.set_xlabel(effect_label, fontsize=fontsize, family=font_family)
|
|
278
246
|
ax1.tick_params(axis='x',
|
|
@@ -14,32 +14,40 @@ from scipy import stats
|
|
|
14
14
|
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
|
|
15
15
|
import gc as garbage_collect
|
|
16
16
|
from adjustText import adjust_text
|
|
17
|
+
|
|
18
|
+
from gwaslab.g_Sumstats import Sumstats
|
|
17
19
|
from gwaslab.g_Log import Log
|
|
18
|
-
|
|
19
|
-
from gwaslab.util_in_get_sig import
|
|
20
|
-
from gwaslab.
|
|
21
|
-
|
|
22
|
-
from gwaslab.bd_common_data import
|
|
23
|
-
from gwaslab.bd_common_data import
|
|
24
|
-
from gwaslab.
|
|
25
|
-
from gwaslab.
|
|
20
|
+
|
|
21
|
+
from gwaslab.util.util_in_get_sig import getsig
|
|
22
|
+
from gwaslab.util.util_in_get_sig import annogene
|
|
23
|
+
|
|
24
|
+
from gwaslab.bd.bd_common_data import get_chr_to_number
|
|
25
|
+
from gwaslab.bd.bd_common_data import get_number_to_chr
|
|
26
|
+
from gwaslab.bd.bd_common_data import get_recombination_rate
|
|
27
|
+
from gwaslab.bd.bd_common_data import get_gtf
|
|
28
|
+
|
|
29
|
+
|
|
26
30
|
#from gwaslab.quickfix import _quick_fix_p
|
|
27
31
|
#from gwaslab.quickfix import _quick_fix_mlog10p
|
|
28
32
|
#from gwaslab.quickfix import _quick_fix_chr
|
|
29
33
|
#from gwaslab.quickfix import _quick_fix_pos
|
|
30
34
|
#from gwaslab.quickfix import _quick_fix_eaf
|
|
31
|
-
from gwaslab.
|
|
32
|
-
from gwaslab.viz_aux_quickfix import
|
|
33
|
-
from gwaslab.viz_aux_quickfix import
|
|
34
|
-
from gwaslab.viz_aux_quickfix import
|
|
35
|
-
from gwaslab.viz_aux_quickfix import
|
|
36
|
-
from gwaslab.viz_aux_quickfix import
|
|
37
|
-
from gwaslab.viz_aux_quickfix import
|
|
38
|
-
from gwaslab.
|
|
39
|
-
from gwaslab.
|
|
40
|
-
from gwaslab.
|
|
41
|
-
from gwaslab.
|
|
42
|
-
|
|
35
|
+
from gwaslab.viz.viz_aux_reposition_text import adjust_text_position
|
|
36
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_fix
|
|
37
|
+
from gwaslab.viz.viz_aux_quickfix import _get_largenumber
|
|
38
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_add_tchrpos
|
|
39
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_merge_sumstats
|
|
40
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_i
|
|
41
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_extract_snp_in_region
|
|
42
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_highlight_hue_pair
|
|
43
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_marker_relative_size
|
|
44
|
+
from gwaslab.viz.viz_aux_annotate_plot import annotate_pair
|
|
45
|
+
from gwaslab.viz.viz_aux_save_figure import save_figure
|
|
46
|
+
|
|
47
|
+
from gwaslab.io.io_to_pickle import load_pickle
|
|
48
|
+
from gwaslab.io.io_to_pickle import load_data_from_pickle
|
|
49
|
+
|
|
50
|
+
|
|
43
51
|
|
|
44
52
|
def plot_miami(
|
|
45
53
|
path1,
|
|
@@ -14,30 +14,35 @@ from scipy import stats
|
|
|
14
14
|
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
|
|
15
15
|
import gc as garbage_collect
|
|
16
16
|
from adjustText import adjust_text
|
|
17
|
+
|
|
17
18
|
from gwaslab.g_Log import Log
|
|
18
|
-
from gwaslab.util_in_get_sig import getsig
|
|
19
|
-
from gwaslab.util_in_get_sig import annogene
|
|
20
|
-
from gwaslab.bd_common_data import get_chr_to_number
|
|
21
|
-
from gwaslab.bd_common_data import get_number_to_chr
|
|
22
|
-
from gwaslab.bd_common_data import get_recombination_rate
|
|
23
|
-
from gwaslab.bd_common_data import get_gtf
|
|
24
|
-
from gwaslab.viz_aux_reposition_text import adjust_text_position
|
|
25
|
-
from gwaslab.viz_aux_quickfix import _quick_fix
|
|
26
|
-
from gwaslab.viz_aux_quickfix import _get_largenumber
|
|
27
|
-
from gwaslab.viz_aux_quickfix import _quick_add_tchrpos
|
|
28
|
-
from gwaslab.viz_aux_quickfix import _quick_merge_sumstats
|
|
29
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_i
|
|
30
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_i_with_rank
|
|
31
|
-
from gwaslab.viz_aux_quickfix import _quick_extract_snp_in_region
|
|
32
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_highlight_hue_pair
|
|
33
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_marker_relative_size
|
|
34
|
-
from gwaslab.viz_aux_annotate_plot import annotate_pair
|
|
35
|
-
from gwaslab.io_to_pickle import load_pickle
|
|
36
|
-
from gwaslab.io_to_pickle import load_data_from_pickle
|
|
37
|
-
from gwaslab.g_Sumstats import Sumstats
|
|
38
|
-
from gwaslab.viz_aux_save_figure import save_figure
|
|
39
|
-
from gwaslab.viz_plot_mqqplot import mqqplot
|
|
40
19
|
from gwaslab.g_version import _get_version
|
|
20
|
+
from gwaslab.g_Sumstats import Sumstats
|
|
21
|
+
|
|
22
|
+
from gwaslab.util.util_in_get_sig import getsig
|
|
23
|
+
from gwaslab.util.util_in_get_sig import annogene
|
|
24
|
+
|
|
25
|
+
from gwaslab.bd.bd_common_data import get_chr_to_number
|
|
26
|
+
from gwaslab.bd.bd_common_data import get_number_to_chr
|
|
27
|
+
from gwaslab.bd.bd_common_data import get_recombination_rate
|
|
28
|
+
from gwaslab.bd.bd_common_data import get_gtf
|
|
29
|
+
|
|
30
|
+
from gwaslab.viz.viz_aux_reposition_text import adjust_text_position
|
|
31
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_fix
|
|
32
|
+
from gwaslab.viz.viz_aux_quickfix import _get_largenumber
|
|
33
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_add_tchrpos
|
|
34
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_merge_sumstats
|
|
35
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_i
|
|
36
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_i_with_rank
|
|
37
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_extract_snp_in_region
|
|
38
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_highlight_hue_pair
|
|
39
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_marker_relative_size
|
|
40
|
+
from gwaslab.viz.viz_aux_annotate_plot import annotate_pair
|
|
41
|
+
from gwaslab.viz.viz_aux_save_figure import save_figure
|
|
42
|
+
from gwaslab.viz.viz_plot_mqqplot import mqqplot
|
|
43
|
+
|
|
44
|
+
from gwaslab.io.io_to_pickle import load_pickle
|
|
45
|
+
from gwaslab.io.io_to_pickle import load_data_from_pickle
|
|
41
46
|
|
|
42
47
|
def plot_miami2(
|
|
43
48
|
path1=None,
|
|
@@ -2,6 +2,10 @@ import pandas as pd
|
|
|
2
2
|
import matplotlib.pyplot as plt
|
|
3
3
|
import matplotlib.ticker as ticker
|
|
4
4
|
import matplotlib.patches as patches
|
|
5
|
+
from matplotlib.colors import ListedColormap
|
|
6
|
+
from matplotlib.colors import LinearSegmentedColormap
|
|
7
|
+
from matplotlib.colors import to_hex
|
|
8
|
+
|
|
5
9
|
import seaborn as sns
|
|
6
10
|
import numpy as np
|
|
7
11
|
import scipy as sp
|
|
@@ -19,46 +23,52 @@ from mpl_toolkits.axes_grid1.inset_locator import mark_inset
|
|
|
19
23
|
from matplotlib.ticker import MaxNLocator
|
|
20
24
|
import gc as garbage_collect
|
|
21
25
|
from adjustText import adjust_text
|
|
22
|
-
|
|
23
|
-
from gwaslab.viz_aux_annotate_plot import annotate_single
|
|
24
|
-
from gwaslab.viz_plot_qqplot import _plot_qq
|
|
25
|
-
from gwaslab.hm_harmonize_sumstats import auto_check_vcf_chr_dict
|
|
26
|
-
from gwaslab.viz_plot_regional2 import _plot_regional
|
|
27
|
-
from gwaslab.viz_plot_regional2 import process_vcf
|
|
28
|
-
from gwaslab.io_load_ld import process_ld
|
|
29
|
-
from gwaslab.viz_plot_regional2 import _get_lead_id
|
|
30
|
-
from gwaslab.viz_aux_quickfix import _get_largenumber
|
|
31
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_p_value
|
|
32
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_pos
|
|
33
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_chr
|
|
34
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_eaf
|
|
35
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_mlog10p
|
|
36
|
-
from gwaslab.viz_aux_quickfix import _quick_add_tchrpos
|
|
37
|
-
from gwaslab.viz_aux_quickfix import _quick_merge_sumstats
|
|
38
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_i
|
|
39
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_i_with_rank
|
|
40
|
-
from gwaslab.viz_aux_quickfix import _quick_extract_snp_in_region
|
|
41
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_highlight_hue_pair
|
|
42
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_marker_relative_size
|
|
43
|
-
from gwaslab.viz_aux_quickfix import _cut
|
|
44
|
-
from gwaslab.viz_aux_quickfix import _set_yticklabels
|
|
45
|
-
from gwaslab.viz_aux_quickfix import _jagged_y
|
|
46
|
-
from gwaslab.io_process_args import _update_args
|
|
47
|
-
from gwaslab.io_process_args import _update_arg
|
|
48
|
-
from gwaslab.viz_aux_save_figure import save_figure
|
|
26
|
+
|
|
49
27
|
from gwaslab.g_Log import Log
|
|
50
|
-
from gwaslab.util_in_calculate_gc import lambdaGC
|
|
51
|
-
from gwaslab.util_in_get_sig import getsig
|
|
52
|
-
from gwaslab.util_in_get_sig import annogene
|
|
53
|
-
from gwaslab.bd_common_data import get_chr_to_number
|
|
54
|
-
from gwaslab.bd_common_data import get_number_to_chr
|
|
55
|
-
from gwaslab.bd_common_data import get_recombination_rate
|
|
56
|
-
from gwaslab.bd_common_data import get_gtf
|
|
57
|
-
from gwaslab.util_in_filter_value import _filter_region
|
|
58
28
|
from gwaslab.g_version import _get_version
|
|
59
|
-
|
|
60
|
-
from
|
|
61
|
-
|
|
29
|
+
|
|
30
|
+
from gwaslab.hm.hm_harmonize_sumstats import auto_check_vcf_chr_dict
|
|
31
|
+
|
|
32
|
+
from gwaslab.viz.viz_aux_reposition_text import adjust_text_position
|
|
33
|
+
from gwaslab.viz.viz_aux_annotate_plot import annotate_single
|
|
34
|
+
from gwaslab.viz.viz_plot_qqplot import _plot_qq
|
|
35
|
+
from gwaslab.viz.viz_plot_regional2 import _plot_regional
|
|
36
|
+
from gwaslab.viz.viz_plot_regional2 import process_vcf
|
|
37
|
+
from gwaslab.viz.viz_plot_regional2 import _get_lead_id
|
|
38
|
+
from gwaslab.viz.viz_aux_quickfix import _get_largenumber
|
|
39
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_fix_p_value
|
|
40
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_fix_pos
|
|
41
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_fix_chr
|
|
42
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_fix_eaf
|
|
43
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_fix_mlog10p
|
|
44
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_add_tchrpos
|
|
45
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_merge_sumstats
|
|
46
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_i
|
|
47
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_i_with_rank
|
|
48
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_extract_snp_in_region
|
|
49
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_highlight_hue_pair
|
|
50
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_marker_relative_size
|
|
51
|
+
from gwaslab.viz.viz_aux_quickfix import _cut
|
|
52
|
+
from gwaslab.viz.viz_aux_quickfix import _set_yticklabels
|
|
53
|
+
from gwaslab.viz.viz_aux_quickfix import _jagged_y
|
|
54
|
+
from gwaslab.viz.viz_aux_save_figure import save_figure
|
|
55
|
+
|
|
56
|
+
from gwaslab.io.io_load_ld import process_ld
|
|
57
|
+
from gwaslab.io.io_process_args import _update_args
|
|
58
|
+
from gwaslab.io.io_process_args import _update_arg
|
|
59
|
+
|
|
60
|
+
from gwaslab.util.util_in_filter_value import _filter_region
|
|
61
|
+
from gwaslab.util.util_in_calculate_gc import lambdaGC
|
|
62
|
+
from gwaslab.util.util_in_get_sig import getsig
|
|
63
|
+
from gwaslab.util.util_in_get_sig import annogene
|
|
64
|
+
|
|
65
|
+
from gwaslab.bd.bd_common_data import get_chr_to_number
|
|
66
|
+
from gwaslab.bd.bd_common_data import get_number_to_chr
|
|
67
|
+
from gwaslab.bd.bd_common_data import get_recombination_rate
|
|
68
|
+
from gwaslab.bd.bd_common_data import get_gtf
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
62
72
|
# 20230202 ######################################################################################################
|
|
63
73
|
|
|
64
74
|
def mqqplot(insumstats,
|
|
@@ -3,24 +3,27 @@ import matplotlib.pyplot as plt
|
|
|
3
3
|
import seaborn as sns
|
|
4
4
|
import numpy as np
|
|
5
5
|
import scipy as sp
|
|
6
|
-
from gwaslab.viz_aux_quickfix import _quick_assign_i_with_rank
|
|
7
|
-
from gwaslab.viz_aux_quickfix import _get_largenumber
|
|
8
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_p_value
|
|
9
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_pos
|
|
10
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_chr
|
|
11
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_eaf
|
|
12
|
-
from gwaslab.viz_aux_quickfix import _quick_fix_mlog10p
|
|
13
|
-
from gwaslab.viz_aux_quickfix import _dropna_in_cols
|
|
14
|
-
from gwaslab.viz_plot_mqqplot import _process_p_value
|
|
15
|
-
from gwaslab.viz_plot_mqqplot import _configure_fig_save_kwargs
|
|
16
|
-
from gwaslab.viz_plot_mqqplot import mqqplot
|
|
17
|
-
from gwaslab.viz_aux_save_figure import save_figure
|
|
18
|
-
from gwaslab.g_Log import Log
|
|
19
6
|
import copy
|
|
20
|
-
from gwaslab.
|
|
21
|
-
from gwaslab.bd_common_data import get_number_to_chr
|
|
7
|
+
from gwaslab.g_Log import Log
|
|
22
8
|
from gwaslab.g_version import _get_version
|
|
23
9
|
|
|
10
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_assign_i_with_rank
|
|
11
|
+
from gwaslab.viz.viz_aux_quickfix import _get_largenumber
|
|
12
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_fix_p_value
|
|
13
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_fix_pos
|
|
14
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_fix_chr
|
|
15
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_fix_eaf
|
|
16
|
+
from gwaslab.viz.viz_aux_quickfix import _quick_fix_mlog10p
|
|
17
|
+
from gwaslab.viz.viz_aux_quickfix import _dropna_in_cols
|
|
18
|
+
from gwaslab.viz.viz_plot_mqqplot import _process_p_value
|
|
19
|
+
from gwaslab.viz.viz_plot_mqqplot import _configure_fig_save_kwargs
|
|
20
|
+
from gwaslab.viz.viz_plot_mqqplot import mqqplot
|
|
21
|
+
from gwaslab.viz.viz_aux_save_figure import save_figure
|
|
22
|
+
|
|
23
|
+
from gwaslab.bd.bd_common_data import get_chr_to_number
|
|
24
|
+
from gwaslab.bd.bd_common_data import get_number_to_chr
|
|
25
|
+
|
|
26
|
+
|
|
24
27
|
def _gwheatmap(
|
|
25
28
|
insumstats,
|
|
26
29
|
chrom="CHR",
|
|
@@ -4,9 +4,11 @@ import seaborn as sns
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
import scipy as sp
|
|
6
6
|
from math import ceil
|
|
7
|
-
from gwaslab.viz_aux_quickfix import _set_yticklabels
|
|
8
7
|
from gwaslab.g_Log import Log
|
|
9
|
-
|
|
8
|
+
|
|
9
|
+
from gwaslab.viz.viz_aux_quickfix import _set_yticklabels
|
|
10
|
+
from gwaslab.util.util_in_calculate_gc import lambdaGC
|
|
11
|
+
|
|
10
12
|
# qq plot module for mqqplot
|
|
11
13
|
def _plot_qq(
|
|
12
14
|
sumstats,
|
|
@@ -2,6 +2,11 @@ import pandas as pd
|
|
|
2
2
|
import matplotlib.pyplot as plt
|
|
3
3
|
import matplotlib.ticker as ticker
|
|
4
4
|
import matplotlib.patches as patches
|
|
5
|
+
from matplotlib.colors import ListedColormap
|
|
6
|
+
from matplotlib.colors import LinearSegmentedColormap
|
|
7
|
+
import matplotlib.colors
|
|
8
|
+
from matplotlib.colors import Normalize
|
|
9
|
+
from matplotlib.patches import Rectangle
|
|
5
10
|
import seaborn as sns
|
|
6
11
|
import numpy as np
|
|
7
12
|
import copy
|
|
@@ -17,16 +22,13 @@ from mpl_toolkits.axes_grid1.inset_locator import inset_axes
|
|
|
17
22
|
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
|
|
18
23
|
from adjustText import adjust_text
|
|
19
24
|
from gtfparse import read_gtf
|
|
25
|
+
|
|
20
26
|
from gwaslab.g_Log import Log
|
|
21
|
-
from gwaslab.bd_common_data import get_chr_to_number
|
|
22
|
-
from gwaslab.bd_common_data import get_number_to_chr
|
|
23
|
-
from gwaslab.bd_common_data import get_recombination_rate
|
|
24
|
-
from gwaslab.bd_common_data import get_gtf
|
|
25
|
-
|
|
26
|
-
from matplotlib.colors import LinearSegmentedColormap
|
|
27
|
-
import matplotlib.colors
|
|
28
|
-
from matplotlib.colors import Normalize
|
|
29
|
-
from matplotlib.patches import Rectangle
|
|
27
|
+
from gwaslab.bd.bd_common_data import get_chr_to_number
|
|
28
|
+
from gwaslab.bd.bd_common_data import get_number_to_chr
|
|
29
|
+
from gwaslab.bd.bd_common_data import get_recombination_rate
|
|
30
|
+
from gwaslab.bd.bd_common_data import get_gtf
|
|
31
|
+
|
|
30
32
|
|
|
31
33
|
def _plot_regional(
|
|
32
34
|
sumstats,
|