genal-python 1.2__tar.gz → 1.2.1__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.
Files changed (108) hide show
  1. {genal_python-1.2 → genal_python-1.2.1}/PKG-INFO +1 -1
  2. {genal_python-1.2 → genal_python-1.2.1}/genal/MRpresso.py +3 -5
  3. {genal_python-1.2 → genal_python-1.2.1}/genal/__init__.py +1 -1
  4. {genal_python-1.2 → genal_python-1.2.1}/genal/geno_tools.py +5 -5
  5. {genal_python-1.2 → genal_python-1.2.1}/pyproject.toml +1 -1
  6. {genal_python-1.2 → genal_python-1.2.1}/.DS_Store +0 -0
  7. {genal_python-1.2 → genal_python-1.2.1}/.gitignore +0 -0
  8. {genal_python-1.2 → genal_python-1.2.1}/.readthedocs.yaml +0 -0
  9. {genal_python-1.2 → genal_python-1.2.1}/Genal_flowchart.png +0 -0
  10. {genal_python-1.2 → genal_python-1.2.1}/LICENSE +0 -0
  11. {genal_python-1.2 → genal_python-1.2.1}/README.md +0 -0
  12. {genal_python-1.2 → genal_python-1.2.1}/docs/.DS_Store +0 -0
  13. {genal_python-1.2 → genal_python-1.2.1}/docs/Makefile +0 -0
  14. {genal_python-1.2 → genal_python-1.2.1}/docs/build/.DS_Store +0 -0
  15. {genal_python-1.2 → genal_python-1.2.1}/docs/build/.buildinfo +0 -0
  16. {genal_python-1.2 → genal_python-1.2.1}/docs/build/.doctrees/api.doctree +0 -0
  17. {genal_python-1.2 → genal_python-1.2.1}/docs/build/.doctrees/environment.pickle +0 -0
  18. {genal_python-1.2 → genal_python-1.2.1}/docs/build/.doctrees/genal.doctree +0 -0
  19. {genal_python-1.2 → genal_python-1.2.1}/docs/build/.doctrees/index.doctree +0 -0
  20. {genal_python-1.2 → genal_python-1.2.1}/docs/build/.doctrees/introduction.doctree +0 -0
  21. {genal_python-1.2 → genal_python-1.2.1}/docs/build/.doctrees/modules.doctree +0 -0
  22. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_images/MR_plot_SBP_AS.png +0 -0
  23. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/genal/Geno.html +0 -0
  24. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/genal/MR.html +0 -0
  25. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/genal/MR_tools.html +0 -0
  26. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/genal/MRpresso.html +0 -0
  27. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/genal/association.html +0 -0
  28. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/genal/clump.html +0 -0
  29. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/genal/extract_prs.html +0 -0
  30. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/genal/geno_tools.html +0 -0
  31. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/genal/lift.html +0 -0
  32. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/genal/proxy.html +0 -0
  33. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/genal/snp_query.html +0 -0
  34. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/genal/tools.html +0 -0
  35. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_modules/index.html +0 -0
  36. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_sources/api.rst.txt +0 -0
  37. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_sources/genal.rst.txt +0 -0
  38. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_sources/index.rst.txt +0 -0
  39. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_sources/introduction.rst.txt +0 -0
  40. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_sources/modules.rst.txt +0 -0
  41. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/basic.css +0 -0
  42. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/badge_only.css +0 -0
  43. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
  44. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
  45. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
  46. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
  47. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/fontawesome-webfont.eot +0 -0
  48. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/fontawesome-webfont.svg +0 -0
  49. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/fontawesome-webfont.ttf +0 -0
  50. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/fontawesome-webfont.woff +0 -0
  51. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
  52. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/lato-bold-italic.woff +0 -0
  53. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/lato-bold-italic.woff2 +0 -0
  54. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/lato-bold.woff +0 -0
  55. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/lato-bold.woff2 +0 -0
  56. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/lato-normal-italic.woff +0 -0
  57. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/lato-normal-italic.woff2 +0 -0
  58. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/lato-normal.woff +0 -0
  59. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/fonts/lato-normal.woff2 +0 -0
  60. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/css/theme.css +0 -0
  61. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/doctools.js +0 -0
  62. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/documentation_options.js +0 -0
  63. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/file.png +0 -0
  64. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/js/badge_only.js +0 -0
  65. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/js/html5shiv-printshiv.min.js +0 -0
  66. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/js/html5shiv.min.js +0 -0
  67. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/js/theme.js +0 -0
  68. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/language_data.js +0 -0
  69. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/minus.png +0 -0
  70. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/plus.png +0 -0
  71. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/pygments.css +0 -0
  72. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/searchtools.js +0 -0
  73. {genal_python-1.2 → genal_python-1.2.1}/docs/build/_static/sphinx_highlight.js +0 -0
  74. {genal_python-1.2 → genal_python-1.2.1}/docs/build/api.html +0 -0
  75. {genal_python-1.2 → genal_python-1.2.1}/docs/build/genal.html +0 -0
  76. {genal_python-1.2 → genal_python-1.2.1}/docs/build/genindex.html +0 -0
  77. {genal_python-1.2 → genal_python-1.2.1}/docs/build/index.html +0 -0
  78. {genal_python-1.2 → genal_python-1.2.1}/docs/build/introduction.html +0 -0
  79. {genal_python-1.2 → genal_python-1.2.1}/docs/build/modules.html +0 -0
  80. {genal_python-1.2 → genal_python-1.2.1}/docs/build/objects.inv +0 -0
  81. {genal_python-1.2 → genal_python-1.2.1}/docs/build/py-modindex.html +0 -0
  82. {genal_python-1.2 → genal_python-1.2.1}/docs/build/search.html +0 -0
  83. {genal_python-1.2 → genal_python-1.2.1}/docs/build/searchindex.js +0 -0
  84. {genal_python-1.2 → genal_python-1.2.1}/docs/make.bat +0 -0
  85. {genal_python-1.2 → genal_python-1.2.1}/docs/requirements.txt +0 -0
  86. {genal_python-1.2 → genal_python-1.2.1}/docs/source/.DS_Store +0 -0
  87. {genal_python-1.2 → genal_python-1.2.1}/docs/source/Images/Genal_flowchart.png +0 -0
  88. {genal_python-1.2 → genal_python-1.2.1}/docs/source/Images/MR_plot_SBP_AS.png +0 -0
  89. {genal_python-1.2 → genal_python-1.2.1}/docs/source/Images/genal_logo.png +0 -0
  90. {genal_python-1.2 → genal_python-1.2.1}/docs/source/api.rst +0 -0
  91. {genal_python-1.2 → genal_python-1.2.1}/docs/source/conf.py +0 -0
  92. {genal_python-1.2 → genal_python-1.2.1}/docs/source/index.rst +0 -0
  93. {genal_python-1.2 → genal_python-1.2.1}/docs/source/introduction.rst +0 -0
  94. {genal_python-1.2 → genal_python-1.2.1}/docs/source/modules.rst +0 -0
  95. {genal_python-1.2 → genal_python-1.2.1}/genal/Geno.py +0 -0
  96. {genal_python-1.2 → genal_python-1.2.1}/genal/MR.py +0 -0
  97. {genal_python-1.2 → genal_python-1.2.1}/genal/MR_tools.py +0 -0
  98. {genal_python-1.2 → genal_python-1.2.1}/genal/association.py +0 -0
  99. {genal_python-1.2 → genal_python-1.2.1}/genal/clump.py +0 -0
  100. {genal_python-1.2 → genal_python-1.2.1}/genal/constants.py +0 -0
  101. {genal_python-1.2 → genal_python-1.2.1}/genal/extract_prs.py +0 -0
  102. {genal_python-1.2 → genal_python-1.2.1}/genal/lift.py +0 -0
  103. {genal_python-1.2 → genal_python-1.2.1}/genal/proxy.py +0 -0
  104. {genal_python-1.2 → genal_python-1.2.1}/genal/snp_query.py +0 -0
  105. {genal_python-1.2 → genal_python-1.2.1}/genal/tools.py +0 -0
  106. {genal_python-1.2 → genal_python-1.2.1}/genal_logo.png +0 -0
  107. {genal_python-1.2 → genal_python-1.2.1}/gitignore +0 -0
  108. {genal_python-1.2 → genal_python-1.2.1}/readthedocs.yaml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: genal-python
3
- Version: 1.2
3
+ Version: 1.2.1
4
4
  Summary: A python toolkit for polygenic risk scoring and mendelian randomization.
5
5
  Author-email: Cyprien Rivier <riviercyprien@gmail.com>
6
6
  Requires-Python: >=3.8
@@ -77,13 +77,11 @@ def mr_presso(
77
77
  Random_data_o = np.vstack([r[2] for r in results])
78
78
 
79
79
  global_p = np.sum([r > RSSobs[0] for r in RSSexp]) / n_iterations
80
- global_p_str = (
81
- global_p if global_p > 1 / n_iterations else f"< {1/n_iterations:.1e}"
82
- )
80
+
83
81
  if outlier_test:
84
- GlobalTest = {"RSSobs": RSSobs[0], "global_test_p": global_p_str}
82
+ GlobalTest = {"RSSobs": RSSobs[0], "global_test_p": global_p}
85
83
  else:
86
- GlobalTest = {"RSSobs": RSSobs, "global_test_p": global_p_str}
84
+ GlobalTest = {"RSSobs": RSSobs, "global_test_p": global_p}
87
85
 
88
86
  # 3- Computing the single IV outlier test
89
87
  if global_p < significance_p and outlier_test:
@@ -4,7 +4,7 @@ from .tools import default_config, write_config, set_plink, install_plink, delet
4
4
  from .geno_tools import Combine_Geno
5
5
  from .constants import CONFIG_DIR
6
6
 
7
- __version__ = "1.2"
7
+ __version__ = "1.2.1"
8
8
 
9
9
  config_path = os.path.join(CONFIG_DIR, "config.json")
10
10
 
@@ -181,8 +181,8 @@ def fill_coordinates_func(data, reference_panel_df):
181
181
  data.drop(columns=["CHR", "POS"], inplace=True, errors="ignore")
182
182
  data = data.merge(reference_panel_df[["CHR", "POS", "SNP"]], on="SNP", how="left")
183
183
  n_missing = data["CHR"].isna().sum()
184
- data["CHR"] = data["CHR"].astype("Int32")
185
- data["POS"] = data["POS"].astype("Int32")
184
+ data["CHR"] = data["CHR"].astype("Int64")
185
+ data["POS"] = data["POS"].astype("Int64")
186
186
  print(
187
187
  f"The coordinates columns (CHR for chromosome and POS for position) have been created. {n_missing}({n_missing/data.shape[0]*100:.3f}%) SNPs were not found in the reference data and their values set to nan."
188
188
  )
@@ -239,15 +239,15 @@ def fill_snpids_func(data, reference_panel_df):
239
239
 
240
240
 
241
241
  def check_int_column(data, int_col):
242
- """Set the type of the int_col column to Int32 and non-numeric values to NA."""
242
+ """Set the type of the int_col column to Int64 and non-numeric values to NA."""
243
243
  nrows = data.shape[0]
244
244
  # Remove any non-digit characters, convert to numeric, setting non-numeric to NaN
245
245
  data[int_col] = pd.to_numeric(
246
246
  data[int_col].astype(str).str.replace(r'[^\d]', '', regex=True),
247
247
  errors='coerce'
248
248
  )
249
- # Convert to Int32 which handles NaN values
250
- data[int_col] = data[int_col].astype('Int32')
249
+ # Convert to Int64 which handles NaN values, using round() first to handle floats
250
+ data[int_col] = data[int_col].round().astype('Int64')
251
251
  n_nan = data[int_col].isna().sum()
252
252
  if n_nan > 0:
253
253
  print(
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
4
4
 
5
5
  [project]
6
6
  name = "genal-python" # Updated name for PyPI
7
- version = "1.2"
7
+ version = "1.2.1"
8
8
  authors = [{name = "Cyprien Rivier", email = "riviercyprien@gmail.com"}]
9
9
  description = "A python toolkit for polygenic risk scoring and mendelian randomization."
10
10
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes