gwaslab 3.5.0__tar.gz → 3.5.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.

Potentially problematic release.


This version of gwaslab might be problematic. Click here for more details.

Files changed (96) hide show
  1. {gwaslab-3.5.0/src/gwaslab.egg-info → gwaslab-3.5.2}/PKG-INFO +3 -3
  2. {gwaslab-3.5.0 → gwaslab-3.5.2}/README.md +1 -1
  3. {gwaslab-3.5.0 → gwaslab-3.5.2}/pyproject.toml +2 -2
  4. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/__init__.py +1 -0
  5. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/bd_get_hapmap3.py +3 -1
  6. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/g_Sumstats.py +15 -9
  7. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/g_version.py +2 -2
  8. gwaslab-3.5.2/src/gwaslab/io_process_args.py +28 -0
  9. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/qc_fix_sumstats.py +9 -5
  10. gwaslab-3.5.2/src/gwaslab/vis_plot_credible sets.py +0 -0
  11. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_aux_annotate_plot.py +8 -0
  12. gwaslab-3.5.2/src/gwaslab/viz_aux_property.py +2 -0
  13. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_aux_quickfix.py +8 -6
  14. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_aux_save_figure.py +2 -1
  15. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_compare_effect.py +787 -468
  16. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_mqqplot.py +27 -9
  17. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_phe_heatmap.py +1 -1
  18. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_regional2.py +44 -9
  19. gwaslab-3.5.2/src/gwaslab/viz_plot_scatter_with_reg.py +229 -0
  20. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_stackedregional.py +1 -1
  21. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_trumpetplot.py +1 -1
  22. {gwaslab-3.5.0 → gwaslab-3.5.2/src/gwaslab.egg-info}/PKG-INFO +3 -3
  23. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab.egg-info/SOURCES.txt +4 -0
  24. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab.egg-info/requires.txt +1 -1
  25. {gwaslab-3.5.0 → gwaslab-3.5.2}/LICENSE +0 -0
  26. {gwaslab-3.5.0 → gwaslab-3.5.2}/LICENSE_before_v3.4.39 +0 -0
  27. {gwaslab-3.5.0 → gwaslab-3.5.2}/setup.cfg +0 -0
  28. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/bd_common_data.py +0 -0
  29. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/bd_config.py +0 -0
  30. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/bd_download.py +0 -0
  31. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/cache_manager.py +0 -0
  32. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/data/chrx_par/chrx_par_hg19.bed.gz +0 -0
  33. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/data/chrx_par/chrx_par_hg38.bed.gz +0 -0
  34. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/data/formatbook.json +0 -0
  35. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/data/hapmap3_SNPs/hapmap3_db150_hg19.snplist.gz +0 -0
  36. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/data/hapmap3_SNPs/hapmap3_db151_hg38.snplist.gz +0 -0
  37. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/data/high_ld/high_ld_hla_hg19.bed.gz +0 -0
  38. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/data/high_ld/high_ld_hla_hg38.bed.gz +0 -0
  39. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/data/reference.json +0 -0
  40. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/g_Log.py +0 -0
  41. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/g_Phenotypes.py +0 -0
  42. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/g_SumstatsPair.py +0 -0
  43. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/g_SumstatsT.py +0 -0
  44. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/g_Sumstats_summary.py +0 -0
  45. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/g_meta.py +0 -0
  46. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/g_vchange_status.py +0 -0
  47. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/hm_casting.py +0 -0
  48. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/hm_harmonize_sumstats.py +0 -0
  49. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/hm_rsid_to_chrpos.py +0 -0
  50. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/io_preformat_input.py +0 -0
  51. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/io_read_ldsc.py +0 -0
  52. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/io_read_tabular.py +0 -0
  53. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/io_to_formats.py +0 -0
  54. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/io_to_pickle.py +0 -0
  55. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/ldsc_irwls.py +0 -0
  56. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/ldsc_jackknife.py +0 -0
  57. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/ldsc_ldscore.py +0 -0
  58. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/ldsc_parse.py +0 -0
  59. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/ldsc_regressions.py +0 -0
  60. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/ldsc_sumstats.py +0 -0
  61. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/qc_check_datatype.py +0 -0
  62. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/run_script.py +0 -0
  63. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_abf_finemapping.py +0 -0
  64. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_ex_calculate_ldmatrix.py +0 -0
  65. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_ex_calculate_prs.py +0 -0
  66. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_ex_gwascatalog.py +0 -0
  67. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_ex_ldproxyfinder.py +0 -0
  68. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_ex_ldsc.py +0 -0
  69. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_ex_plink_filter.py +0 -0
  70. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_ex_process_h5.py +0 -0
  71. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_ex_process_ref.py +0 -0
  72. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_ex_run_2samplemr.py +0 -0
  73. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_ex_run_clumping.py +0 -0
  74. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_ex_run_coloc.py +0 -0
  75. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_ex_run_susie.py +0 -0
  76. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_in_calculate_gc.py +0 -0
  77. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_in_calculate_power.py +0 -0
  78. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_in_convert_h2.py +0 -0
  79. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_in_correct_winnerscurse.py +0 -0
  80. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_in_fill_data.py +0 -0
  81. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_in_filter_value.py +0 -0
  82. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_in_get_density.py +0 -0
  83. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_in_get_sig.py +0 -0
  84. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_in_meta.py +0 -0
  85. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/util_in_snphwe.py +0 -0
  86. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_aux_chromatin.py +0 -0
  87. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_aux_reposition_text.py +0 -0
  88. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_compare_af.py +0 -0
  89. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_forestplot.py +0 -0
  90. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_miamiplot.py +0 -0
  91. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_miamiplot2.py +0 -0
  92. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_qqplot.py +0 -0
  93. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_regionalplot.py +0 -0
  94. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab/viz_plot_rg_heatmap.py +0 -0
  95. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab.egg-info/dependency_links.txt +0 -0
  96. {gwaslab-3.5.0 → gwaslab-3.5.2}/src/gwaslab.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gwaslab
3
- Version: 3.5.0
3
+ Version: 3.5.2
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/
@@ -20,7 +20,7 @@ Requires-Dist: scipy>=1.12
20
20
  Requires-Dist: pySAM==0.22.1
21
21
  Requires-Dist: Biopython>=1.79
22
22
  Requires-Dist: adjustText<=0.8,>=0.7.3
23
- Requires-Dist: liftover>=1.1.13
23
+ Requires-Dist: liftover<=1.3.1,>=1.1.13
24
24
  Requires-Dist: scikit-allel>=1.3.5
25
25
  Requires-Dist: pyensembl==2.2.3
26
26
  Requires-Dist: gtfparse==1.3.0
@@ -51,7 +51,7 @@ Warning: Known issues of GWASLab are summarized in [https://cloufield.github.io/
51
51
  ### install via pip
52
52
 
53
53
  ```
54
- pip install gwaslab==3.4.46
54
+ pip install gwaslab==3.5.0
55
55
  ```
56
56
 
57
57
  ```python
@@ -23,7 +23,7 @@ Warning: Known issues of GWASLab are summarized in [https://cloufield.github.io/
23
23
  ### install via pip
24
24
 
25
25
  ```
26
- pip install gwaslab==3.4.46
26
+ pip install gwaslab==3.5.0
27
27
  ```
28
28
 
29
29
  ```python
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "gwaslab"
10
- version = "3.5.0"
10
+ version = "3.5.2"
11
11
  authors = [
12
12
  { name="Yunye", email="yunye@gwaslab.com" },
13
13
  ]
@@ -24,7 +24,7 @@ dependencies = [
24
24
  "pySAM==0.22.1",
25
25
  "Biopython>=1.79",
26
26
  "adjustText>=0.7.3, <=0.8",
27
- "liftover>=1.1.13",
27
+ "liftover>=1.1.13, <=1.3.1",
28
28
  "scikit-allel>=1.3.5",
29
29
  "pyensembl==2.2.3",
30
30
  "gtfparse==1.3.0",
@@ -46,3 +46,4 @@ from gwaslab.util_ex_process_h5 import process_vcf_to_hfd5
46
46
  from gwaslab.util_ex_run_susie import _run_susie_rss as run_susie_rss
47
47
  from gwaslab.io_read_tabular import _read_tabular as read_tabular
48
48
  from gwaslab.util_in_meta import meta_analyze
49
+ from gwaslab.viz_plot_scatter_with_reg import scatter
@@ -47,8 +47,10 @@ def gethapmap3(sumstats,rsid="rsID",chrom="CHR", pos="POS", ea="EA", nea="NEA",b
47
47
  #rsid A1 A2 #CHROM POS
48
48
  #rs3094315 G A 1 752566
49
49
 
50
- if rsid in sumstats.columns and how=="inner":
50
+ if rsid in sumstats.columns:
51
+ log.write(" -rsID will be used for matching...", verbose=verbose)
51
52
  output = sumstats.loc[sumstats[rsid].isin(hapmap3_ref["rsid"].values),:].copy()
53
+ log.write(" -Raw input contains "+str(len(output))+" Hapmap3 variants based on rsID...", verbose=verbose)
52
54
  return output
53
55
 
54
56
  elif chrom in sumstats.columns and pos in sumstats.columns:
@@ -389,6 +389,12 @@ class Sumstats():
389
389
  self.data =flipallelestats(self.data,log=self.log,**flipallelestats_args)
390
390
 
391
391
  gc.collect()
392
+
393
+ if (ref_seq is not None or ref_infer is not None) and (ref_rsid_tsv is not None or ref_rsid_vcf is not None):
394
+
395
+ self.data = fixID(self.data, log=self.log, **{"fixid":True, "fixsep":True, "overwrite":True})
396
+
397
+ gc.collect()
392
398
 
393
399
  #####################################################
394
400
  if ref_rsid_tsv is not None:
@@ -790,28 +796,28 @@ class Sumstats():
790
796
 
791
797
 
792
798
  ## LDSC ##############################################################################################
793
- def estimate_h2_by_ldsc(self, build=None, verbose=True, match_allele=True, **kwargs):
799
+ def estimate_h2_by_ldsc(self, build=None, verbose=True, match_allele=True, how="right", **kwargs):
794
800
  if build is None:
795
801
  build = self.meta["gwaslab"]["genome_build"]
796
- insumstats = gethapmap3(self.data.copy(), build=build, verbose=verbose , match_allele=True, how="right" )
802
+ insumstats = gethapmap3(self.data.copy(), build=build, verbose=verbose , match_allele=match_allele, how=how )
797
803
  self.ldsc_h2, self.ldsc_h2_results = _estimate_h2_by_ldsc(insumstats=insumstats, log=self.log, verbose=verbose, **kwargs)
798
804
 
799
- def estimate_rg_by_ldsc(self, build=None, verbose=True, match_allele=True, **kwargs):
805
+ def estimate_rg_by_ldsc(self, build=None, verbose=True, match_allele=True, how="right",**kwargs):
800
806
  if build is None:
801
807
  build = self.meta["gwaslab"]["genome_build"]
802
- insumstats = gethapmap3(self.data.copy(), build=build, verbose=verbose , match_allele=True, how="right" )
808
+ insumstats = gethapmap3(self.data.copy(), build=build, verbose=verbose , match_allele=match_allele, how=how )
803
809
  self.ldsc_rg = _estimate_rg_by_ldsc(insumstats=insumstats, log=self.log, verbose=verbose, **kwargs)
804
810
 
805
- def estimate_h2_cts_by_ldsc(self, build=None, verbose=True, match_allele=True, **kwargs):
811
+ def estimate_h2_cts_by_ldsc(self, build=None, verbose=True, match_allele=True, how="right",**kwargs):
806
812
  if build is None:
807
813
  build = self.meta["gwaslab"]["genome_build"]
808
- insumstats = gethapmap3(self.data.copy(), build=build, verbose=verbose , match_allele=True, how="right" )
814
+ insumstats = gethapmap3(self.data.copy(), build=build, verbose=verbose , match_allele=match_allele, how=how )
809
815
  self.ldsc_h2_cts = _estimate_h2_cts_by_ldsc(insumstats=insumstats, log=self.log, verbose=verbose, **kwargs)
810
816
 
811
- def estimate_partitioned_h2_by_ldsc(self, build=None, verbose=True, match_allele=True, **kwargs):
817
+ def estimate_partitioned_h2_by_ldsc(self, build=None, verbose=True, match_allele=True, how="right",**kwargs):
812
818
  if build is None:
813
819
  build = self.meta["gwaslab"]["genome_build"]
814
- insumstats = gethapmap3(self.data.copy(), build=build, verbose=verbose , match_allele=True, how="right" )
820
+ insumstats = gethapmap3(self.data.copy(), build=build, verbose=verbose , match_allele=match_allele, how=how )
815
821
  self.ldsc_partitioned_h2_summary, self.ldsc_partitioned_h2_results = _estimate_partitioned_h2_by_ldsc(insumstats=insumstats, log=self.log, verbose=verbose, **kwargs)
816
822
  # external ################################################################################################
817
823
 
@@ -833,4 +839,4 @@ class Sumstats():
833
839
  def to_format(self, path, build=None, verbose=True, **kwargs):
834
840
  if build is None:
835
841
  build = self.meta["gwaslab"]["genome_build"]
836
- _to_format(self.data, path, log=self.log, verbose=verbose, meta=self.meta, build=build, **kwargs)
842
+ _to_format(self.data, path, log=self.log, verbose=verbose, meta=self.meta, build=build, **kwargs)
@@ -15,8 +15,8 @@ def _get_version():
15
15
  def gwaslab_info():
16
16
  # version meta information
17
17
  dic={
18
- "version":"3.5.0",
19
- "release_date":"20241029"
18
+ "version":"3.5.2",
19
+ "release_date":"20241203"
20
20
  }
21
21
  return dic
22
22
 
@@ -0,0 +1,28 @@
1
+ import copy
2
+
3
+ def _list_func_args(func):
4
+ return func.__code__.co_varnames
5
+
6
+ def _extract_kwargs(prefix:str, default:dict, kwargs:dict) -> dict:
7
+ # prefix: keyword
8
+ # default: default dict
9
+ # kwargs: all local kwargs + args + kwargs
10
+
11
+ extracted = []
12
+ for key,value in kwargs.items():
13
+ if key=="kwargs" or key=="args":
14
+ for key_nested,value_nested in kwargs[key].items():
15
+ if prefix in key_nested and "arg" in key_nested:
16
+ extracted.append(value_nested)
17
+ else:
18
+ if prefix in key and "arg" in key:
19
+ extracted.append(value)
20
+ merged_arg = _merge_and_sync_dic(extracted, default)
21
+ return merged_arg
22
+
23
+ def _merge_and_sync_dic(list_of_dics:list, default:dict) -> dict:
24
+ temp = copy.copy(default)
25
+ for dic in list_of_dics:
26
+ if isinstance(dic, dict):
27
+ temp.update(dic)
28
+ return temp
@@ -1579,14 +1579,14 @@ def liftover_variant(sumstats,
1579
1579
 
1580
1580
  try:
1581
1581
  if chain is None:
1582
- converter = get_lifter(from_build,to_build,one_based=True)
1582
+ converter = get_lifter("hg{}".format(from_build),"hg{}".format(to_build),one_based=True)
1583
1583
  else:
1584
- converter = ChainFile(chain, one_based=True)
1584
+ converter = ChainFile(chain,target="",query="", one_based=True)
1585
1585
  except:
1586
1586
  if chain is None:
1587
- converter = get_lifter(from_build,to_build)
1587
+ converter = get_lifter("hg{}".format(from_build),"hg{}".format(to_build))
1588
1588
  else:
1589
- converter = ChainFile(chain)
1589
+ converter = ChainFile(chain, target="",query="")
1590
1590
 
1591
1591
  dic= get_number_to_chr(in_chr=False,xymt=["X","Y","M"])
1592
1592
  dic2= get_chr_to_number(out_chr=False)
@@ -1627,11 +1627,15 @@ def parallelizeliftovervariant(sumstats,n_cores=1,chrom="CHR", pos="POS", from_b
1627
1627
  else:
1628
1628
  try:
1629
1629
  chain = get_chain(from_build=from_build, to_build=to_build)
1630
- log.write(" -Creating converter using ChainFile: {}".format(chain), verbose=verbose)
1630
+ if chain is None or chain==False:
1631
+ raise ValueError("")
1632
+ log.write(" -Creating converter using provided ChainFile: {}".format(chain), verbose=verbose)
1631
1633
  except:
1632
1634
  chain = None
1633
1635
  lifter_from_build=from_build
1634
1636
  lifter_to_build=to_build
1637
+ log.write(" -Try creating converter using liftover package", verbose=verbose)
1638
+
1635
1639
  log.write(" -Creating converter : {} -> {}".format(lifter_from_build, lifter_to_build), verbose=verbose)
1636
1640
  # valid chr and pos
1637
1641
  pattern = r"\w\w\w0\w\w\w"
File without changes
@@ -38,6 +38,7 @@ def annotate_single(
38
38
  region,
39
39
  region_anno_bbox_args,
40
40
  skip,
41
+ arrow_kwargs=None,
41
42
  anno_height=1,
42
43
  amode="int",
43
44
  snpid="SNPID",
@@ -48,6 +49,9 @@ def annotate_single(
48
49
  _invert=False,
49
50
  log=Log()
50
51
  ):
52
+ if arrow_kwargs is None:
53
+ arrow_kwargs=dict()
54
+
51
55
  if anno and (to_annotate.empty is not True):
52
56
  #initiate a list for text and a starting position
53
57
  text = []
@@ -223,6 +227,8 @@ def annotate_single(
223
227
  else:
224
228
  arrowargs=dict(arrowstyle='-|>', color='grey', shrinkA=10, linewidth=0.1, relpos=(1,0.5))
225
229
  ################################################################################################################################
230
+ for key,value in arrow_kwargs.items():
231
+ arrowargs[key]=value
226
232
 
227
233
  anno_to_adjust = ax1.annotate(annotation_text,
228
234
  xy=xy,
@@ -293,6 +299,7 @@ def annotate_pair(
293
299
  pos="POS",
294
300
  repel_force=0.02,
295
301
  verbose=True,
302
+ arrow_kwargs=None,
296
303
  log=Log()
297
304
  ):
298
305
  if anno is not None:
@@ -474,6 +481,7 @@ def annotate_pair(
474
481
  arrowargs=dict(arrowstyle='-|>', color='grey', shrinkA=10, linewidth=0.1, relpos=(0,0.5))
475
482
  else:
476
483
  arrowargs=dict(arrowstyle='-|>', color='grey', shrinkA=10, linewidth=0.1, relpos=(1,0.5))
484
+
477
485
 
478
486
  anno_to_adjust = ax.annotate(annotation_text,
479
487
  xy=xy,
@@ -0,0 +1,2 @@
1
+ import matplotlib.pyplot as plt
2
+
@@ -1,6 +1,8 @@
1
1
  import pandas as pd
2
2
  import numpy as np
3
3
  from gwaslab.g_Log import Log
4
+ from matplotlib import ticker
5
+ import matplotlib.pyplot as plt
4
6
  from gwaslab.bd_common_data import get_chr_to_number
5
7
  from gwaslab.bd_common_data import get_number_to_chr
6
8
  from math import ceil
@@ -350,7 +352,7 @@ def _cut(series, mode,cutfactor,cut,skip, ylabels, cut_log, verbose, lines_to_pl
350
352
  #sumstats.loc[sumstats["scaled_P"]>cut,"scaled_P"] = (sumstats.loc[sumstats["scaled_P"]>cut,"scaled_P"]-cut)/cutfactor + cut
351
353
 
352
354
  maxy = (maxticker-cut)/cutfactor + cut
353
-
355
+
354
356
  return series, maxy, maxticker, cut, cutfactor,ylabels,lines_to_plot
355
357
 
356
358
  #def _cut_line(level, mode,cutfactor,cut,skip, ylabels, cut_log, verbose, log):
@@ -379,10 +381,9 @@ def _set_yticklabels(cut,
379
381
  log.write(" -Processing Y tick lables...",verbose=verbose)
380
382
  # if no cut
381
383
  if cut == 0:
382
- ax1.set_ylim(skip, ceil(maxy*1.2) )
383
-
384
+ ax1.set_ylim((skip, ceil(maxy*1.2)) )
384
385
  # if cut
385
- if cut:
386
+ if cut!=0:
386
387
  # add cut line
387
388
 
388
389
  cutline = ax1.axhline(y=cut, linewidth = sc_linewidth,linestyle="--",color=cut_line_color,zorder=1)
@@ -432,14 +433,15 @@ def _set_yticklabels(cut,
432
433
  else:
433
434
  ax1.set_yticks(ticks1+ticks2)
434
435
  ax1.set_yticklabels(tickslabel1+tickslabel2,fontsize=fontsize,family=font_family)
435
- ax1.set_ylim(bottom = skip)
436
436
 
437
437
  if ylabels is not None:
438
438
  ax1.set_yticks(ylabels_converted)
439
439
  ax1.set_yticklabels(ylabels,fontsize=fontsize,family=font_family)
440
440
 
441
+ ylim_top = ax1.get_ylim()[1]
442
+ ax1.set_ybound(lower=skip,upper=ylim_top)
441
443
  ax1.tick_params(axis='y', labelsize=fontsize)
442
-
444
+
443
445
  return ax1
444
446
 
445
447
  def _jagged_y(cut,skip,ax1,mode,mqqratio,jagged_len,jagged_wid, log=Log(), verbose=True):
@@ -51,7 +51,8 @@ def get_default_path(keyword,fmt="png"):
51
51
  "miami":"miami",
52
52
  "esc":"effect_size_comparision",
53
53
  "afc":"allele_frequency_comparision",
54
- "gwheatmap":"genome_wide_heatmap"
54
+ "gwheatmap":"genome_wide_heatmap",
55
+ "scatter":"scatter"
55
56
  }
56
57
  prefix = path_dictionary[keyword]
57
58
  count = 1