genal-python 1.4.2__tar.gz → 1.4.4__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 (110) hide show
  1. {genal_python-1.4.2 → genal_python-1.4.4}/.DS_Store +0 -0
  2. {genal_python-1.4.2 → genal_python-1.4.4}/PKG-INFO +1 -1
  3. {genal_python-1.4.2 → genal_python-1.4.4}/genal/Geno.py +16 -13
  4. {genal_python-1.4.2 → genal_python-1.4.4}/genal/__init__.py +1 -1
  5. {genal_python-1.4.2 → genal_python-1.4.4}/genal/extract_prs.py +10 -7
  6. {genal_python-1.4.2 → genal_python-1.4.4}/genal/genes.py +1 -1
  7. {genal_python-1.4.2 → genal_python-1.4.4}/genal/lift.py +0 -3
  8. {genal_python-1.4.2 → genal_python-1.4.4}/pyproject.toml +1 -1
  9. {genal_python-1.4.2 → genal_python-1.4.4}/.gitignore +0 -0
  10. {genal_python-1.4.2 → genal_python-1.4.4}/.readthedocs.yaml +0 -0
  11. {genal_python-1.4.2 → genal_python-1.4.4}/Genal_flowchart.png +0 -0
  12. {genal_python-1.4.2 → genal_python-1.4.4}/LICENSE +0 -0
  13. {genal_python-1.4.2 → genal_python-1.4.4}/README.md +0 -0
  14. {genal_python-1.4.2 → genal_python-1.4.4}/docs/.DS_Store +0 -0
  15. {genal_python-1.4.2 → genal_python-1.4.4}/docs/Makefile +0 -0
  16. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/.DS_Store +0 -0
  17. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/.buildinfo +0 -0
  18. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/.doctrees/api.doctree +0 -0
  19. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/.doctrees/environment.pickle +0 -0
  20. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/.doctrees/genal.doctree +0 -0
  21. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/.doctrees/index.doctree +0 -0
  22. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/.doctrees/introduction.doctree +0 -0
  23. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/.doctrees/modules.doctree +0 -0
  24. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_images/MR_plot_SBP_AS.png +0 -0
  25. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/genal/Geno.html +0 -0
  26. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/genal/MR.html +0 -0
  27. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/genal/MR_tools.html +0 -0
  28. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/genal/MRpresso.html +0 -0
  29. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/genal/association.html +0 -0
  30. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/genal/clump.html +0 -0
  31. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/genal/extract_prs.html +0 -0
  32. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/genal/geno_tools.html +0 -0
  33. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/genal/lift.html +0 -0
  34. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/genal/proxy.html +0 -0
  35. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/genal/snp_query.html +0 -0
  36. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/genal/tools.html +0 -0
  37. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_modules/index.html +0 -0
  38. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_sources/api.rst.txt +0 -0
  39. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_sources/genal.rst.txt +0 -0
  40. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_sources/index.rst.txt +0 -0
  41. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_sources/introduction.rst.txt +0 -0
  42. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_sources/modules.rst.txt +0 -0
  43. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/basic.css +0 -0
  44. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/badge_only.css +0 -0
  45. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
  46. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
  47. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
  48. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
  49. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/fontawesome-webfont.eot +0 -0
  50. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/fontawesome-webfont.svg +0 -0
  51. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/fontawesome-webfont.ttf +0 -0
  52. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/fontawesome-webfont.woff +0 -0
  53. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
  54. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/lato-bold-italic.woff +0 -0
  55. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/lato-bold-italic.woff2 +0 -0
  56. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/lato-bold.woff +0 -0
  57. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/lato-bold.woff2 +0 -0
  58. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/lato-normal-italic.woff +0 -0
  59. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/lato-normal-italic.woff2 +0 -0
  60. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/lato-normal.woff +0 -0
  61. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/fonts/lato-normal.woff2 +0 -0
  62. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/css/theme.css +0 -0
  63. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/doctools.js +0 -0
  64. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/documentation_options.js +0 -0
  65. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/file.png +0 -0
  66. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/js/badge_only.js +0 -0
  67. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/js/html5shiv-printshiv.min.js +0 -0
  68. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/js/html5shiv.min.js +0 -0
  69. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/js/theme.js +0 -0
  70. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/language_data.js +0 -0
  71. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/minus.png +0 -0
  72. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/plus.png +0 -0
  73. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/pygments.css +0 -0
  74. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/searchtools.js +0 -0
  75. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/_static/sphinx_highlight.js +0 -0
  76. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/api.html +0 -0
  77. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/genal.html +0 -0
  78. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/genindex.html +0 -0
  79. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/index.html +0 -0
  80. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/introduction.html +0 -0
  81. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/modules.html +0 -0
  82. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/objects.inv +0 -0
  83. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/py-modindex.html +0 -0
  84. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/search.html +0 -0
  85. {genal_python-1.4.2 → genal_python-1.4.4}/docs/build/searchindex.js +0 -0
  86. {genal_python-1.4.2 → genal_python-1.4.4}/docs/make.bat +0 -0
  87. {genal_python-1.4.2 → genal_python-1.4.4}/docs/requirements.txt +0 -0
  88. {genal_python-1.4.2 → genal_python-1.4.4}/docs/source/.DS_Store +0 -0
  89. {genal_python-1.4.2 → genal_python-1.4.4}/docs/source/Images/Genal_flowchart.png +0 -0
  90. {genal_python-1.4.2 → genal_python-1.4.4}/docs/source/Images/MR_plot_SBP_AS.png +0 -0
  91. {genal_python-1.4.2 → genal_python-1.4.4}/docs/source/Images/genal_logo.png +0 -0
  92. {genal_python-1.4.2 → genal_python-1.4.4}/docs/source/api.rst +0 -0
  93. {genal_python-1.4.2 → genal_python-1.4.4}/docs/source/conf.py +0 -0
  94. {genal_python-1.4.2 → genal_python-1.4.4}/docs/source/index.rst +0 -0
  95. {genal_python-1.4.2 → genal_python-1.4.4}/docs/source/introduction.rst +0 -0
  96. {genal_python-1.4.2 → genal_python-1.4.4}/docs/source/modules.rst +0 -0
  97. {genal_python-1.4.2 → genal_python-1.4.4}/genal/MR.py +0 -0
  98. {genal_python-1.4.2 → genal_python-1.4.4}/genal/MR_tools.py +0 -0
  99. {genal_python-1.4.2 → genal_python-1.4.4}/genal/MRpresso.py +0 -0
  100. {genal_python-1.4.2 → genal_python-1.4.4}/genal/association.py +0 -0
  101. {genal_python-1.4.2 → genal_python-1.4.4}/genal/clump.py +0 -0
  102. {genal_python-1.4.2 → genal_python-1.4.4}/genal/colocalization.py +0 -0
  103. {genal_python-1.4.2 → genal_python-1.4.4}/genal/constants.py +0 -0
  104. {genal_python-1.4.2 → genal_python-1.4.4}/genal/geno_tools.py +0 -0
  105. {genal_python-1.4.2 → genal_python-1.4.4}/genal/proxy.py +0 -0
  106. {genal_python-1.4.2 → genal_python-1.4.4}/genal/snp_query.py +0 -0
  107. {genal_python-1.4.2 → genal_python-1.4.4}/genal/tools.py +0 -0
  108. {genal_python-1.4.2 → genal_python-1.4.4}/genal_logo.png +0 -0
  109. {genal_python-1.4.2 → genal_python-1.4.4}/gitignore +0 -0
  110. {genal_python-1.4.2 → genal_python-1.4.4}/readthedocs.yaml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: genal-python
3
- Version: 1.4.2
3
+ Version: 1.4.4
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
@@ -536,7 +536,7 @@ class Geno:
536
536
  # Renaming to avoid conflicts with previous extraction
537
537
  self.name = str(uuid.uuid4())[:8]
538
538
  # Extract SNPs using the provided path and SNP list
539
- _ = extract_snps_func(snp_list, self.name, path)
539
+ _ = extract_snps_func(snp_list, self.name, path, self.ram, self.cpus)
540
540
 
541
541
  return
542
542
 
@@ -696,7 +696,7 @@ class Geno:
696
696
  # Renaming to avoid conflicts with previous extraction
697
697
  self.name = str(uuid.uuid4())[:8]
698
698
  # Compute PRS
699
- prs_data = prs_func(data_prs, weighted, path, ram=self.ram, name=self.name)
699
+ prs_data = prs_func(data_prs, weighted, path, ram=self.ram, cpus=self.cpus, name=self.name)
700
700
 
701
701
  # Save the computed PRS data as a CSV file
702
702
  name = self.name if not name else name
@@ -791,7 +791,7 @@ class Geno:
791
791
  # Renaming to avoid conflicts with previous extraction
792
792
  self.name = str(uuid.uuid4())[:8]
793
793
  # Extract SNPs using the provided path and SNP list
794
- path = extract_snps_func(snp_list, self.name, path)
794
+ path = extract_snps_func(snp_list, self.name, path, self.ram, self.cpus)
795
795
  if path == "FAILED":
796
796
  raise ValueError("No SNPs were extracted from the genetic data and the association test can't be run.")
797
797
 
@@ -1240,7 +1240,7 @@ class Geno:
1240
1240
 
1241
1241
  return mod_table, GlobalTest, OutlierTest, BiasTest
1242
1242
 
1243
- def filter_by_gene(self, gene_id, id_type="symbol", window_size=1000000, build="37", replace=False):
1243
+ def filter_by_gene(self, gene, id_type="symbol", window_size=1000000, build="37", replace=False):
1244
1244
  """
1245
1245
  Filter the data to include only variants that are within a specified distance of a specific gene.
1246
1246
 
@@ -1255,7 +1255,7 @@ class Geno:
1255
1255
  - "UCSC": UCSC gene ID (e.g., "uc001hbu.2")
1256
1256
  - "Vega": Vega gene ID (e.g., "OTTHUMG00000019505")
1257
1257
  Default is "symbol".
1258
- window_size (int, optional): Size of the window around the gene in base pairs. Default is 1,000,000 (1Mb).
1258
+ window_size (int, optional): Size of the window around the gene in base pairs. Default is 1,000,000 (1Mb), meaning that the window will include variants within 500kb on each side of the gene.
1259
1259
  build (str, optional): Genome build of the data. Default is "37".
1260
1260
  replace (bool, optional): If True, replace the existing data attribute with the filtered data. Default is True.
1261
1261
  Returns:
@@ -1285,7 +1285,7 @@ class Geno:
1285
1285
  check_int_column(self.data, "POS")
1286
1286
  self.checks["POS"] = True
1287
1287
 
1288
- filtered = filter_by_gene_func(self.data, gene_id, id_type, window_size, build)
1288
+ filtered = filter_by_gene_func(self.data, gene, id_type, window_size, build)
1289
1289
 
1290
1290
  if replace:
1291
1291
  self.data = filtered
@@ -1507,7 +1507,7 @@ class Geno:
1507
1507
  self.data = self.data.groupby(by=["SNP"]).first().reset_index(drop=False)
1508
1508
  return
1509
1509
 
1510
- def copy(self, data):
1510
+ def copy(self, data=None):
1511
1511
  """
1512
1512
  Create another Geno instance with the updated data attribute.
1513
1513
  The relevant attributes are copied as well (checks, phenotype, reference_panel, reference_panel_name).
@@ -1516,6 +1516,8 @@ class Geno:
1516
1516
  Returns:
1517
1517
  Geno: A deep copy of the instance.
1518
1518
  """
1519
+ if data is None:
1520
+ data = self.data
1519
1521
  Geno_copy = Geno(data, keep_columns=True)
1520
1522
  Geno_copy.checks = self.checks.copy()
1521
1523
  if hasattr(self, "phenotype"):
@@ -1539,7 +1541,7 @@ class Geno:
1539
1541
  save_data(self.data, name=self.name, path=path, fmt=fmt, sep=sep, header=header)
1540
1542
  return
1541
1543
 
1542
- def standardize_betas(self, outcome_sd=None, n_samples=None, replace=False):
1544
+ def standardize_betas(self, outcome_sd=None, n_samples=None, replace=True):
1543
1545
  """
1544
1546
  Standardizes the BETA and SE columns of the Geno object's data.
1545
1547
 
@@ -1555,7 +1557,7 @@ class Geno:
1555
1557
  This is used to estimate the outcome's standard deviation if `outcome_sd`
1556
1558
  is not provided. `EAF` and `SE` columns must be present in the data.
1557
1559
  Defaults to None.
1558
- replace (bool, optional): If True, updates the data attribute in place. Default is False.
1560
+ replace (bool, optional): If True (default), updates the data attribute in place. If False, operates on a copy.
1559
1561
 
1560
1562
  Returns:
1561
1563
  pd.DataFrame: Data after being standardized.
@@ -1566,7 +1568,7 @@ class Geno:
1566
1568
  ValueError: If `n_samples` is provided, but 'EAF' or 'SE' columns
1567
1569
  are missing from the data.
1568
1570
  """
1569
- print("Warning: Standardization is valid only for quantitative phenotypes.")
1571
+ print("Warning: Standardizing estimates for binary traits will make the MR results not interpretable as odds ratios.")
1570
1572
  if outcome_sd is not None:
1571
1573
  sd = outcome_sd
1572
1574
  elif n_samples is not None:
@@ -1585,6 +1587,7 @@ class Geno:
1585
1587
 
1586
1588
  sd_outcome_estimates = np.sqrt(var_outcome_estimates)
1587
1589
  sd = np.median(sd_outcome_estimates)
1590
+ print(f"Estimated the trait standard deviation from EAF and SE columns: {sd:.4f}.")
1588
1591
 
1589
1592
  else:
1590
1593
  raise ValueError("Either `outcome_sd` or `n_samples` must be provided to standardize betas.")
@@ -1603,7 +1606,7 @@ class Geno:
1603
1606
  data['SE'] = data['SE'] / sd
1604
1607
  return data
1605
1608
 
1606
- def update_eaf(self, reference_panel="EUR_37", replace=False, fill=True):
1609
+ def update_eaf(self, reference_panel="EUR_37", replace=True, fill=True):
1607
1610
  """
1608
1611
  Update or create the EAF (Effect Allele Frequency) column using a reference panel.
1609
1612
 
@@ -1616,8 +1619,8 @@ class Geno:
1616
1619
  Can be a standard name (e.g., "EUR_37", "AFR_38") or a path to a
1617
1620
  custom PLINK fileset (bed/bim/fam or pgen/pvar/psam).
1618
1621
  Defaults to "EUR_37".
1619
- replace (bool, optional): If True, modifies the instance's `data` attribute
1620
- in place. If False (default), operates on a copy.
1622
+ replace (bool, optional): If True (default), modifies the instance's `data` attribute
1623
+ in place. If False, operates on a copy.
1621
1624
  fill (bool, optional): If `True` (default), existing `EAF` values for SNPs not
1622
1625
  found in the reference panel will be preserved. If `False`, `EAF` values
1623
1626
  for unmatched SNPs will be set to `NaN`.
@@ -5,7 +5,7 @@ from .geno_tools import Combine_Geno
5
5
  from .genes import filter_by_gene_func
6
6
  from .constants import CONFIG_DIR
7
7
 
8
- __version__ = "1.4.2"
8
+ __version__ = "1.4.4"
9
9
 
10
10
  config_path = os.path.join(CONFIG_DIR, "config.json")
11
11
 
@@ -10,7 +10,7 @@ from .tools import check_bfiles, check_pfiles, setup_genetic_path, get_plink_pat
10
10
  ### PRS functions
11
11
  ### ____________________
12
12
 
13
- def prs_func(data, weighted=True, path=None, ram=10000, name=None):
13
+ def prs_func(data, weighted=True, path=None, ram=20000, cpus=4, name=None):
14
14
  """
15
15
  Compute a PRS (Polygenic Risk Score) using provided SNP-level data. Corresponds to the :meth:`Geno.prs` method
16
16
  """
@@ -22,7 +22,7 @@ def prs_func(data, weighted=True, path=None, ram=10000, name=None):
22
22
  name = str(uuid.uuid4())[:8]
23
23
 
24
24
  # Call extract_snps
25
- extracted_path = extract_snps_func(data.SNP, name, path)
25
+ extracted_path = extract_snps_func(data.SNP, name, path, ram=ram, cpus=cpus)
26
26
 
27
27
  if extracted_path == "FAILED":
28
28
  raise ValueError("No SNPs were extracted from the genetic data and the PRS can't be computed.")
@@ -47,7 +47,7 @@ def prs_func(data, weighted=True, path=None, ram=10000, name=None):
47
47
  data.to_csv(data_path, sep="\t", index=False, header=True)
48
48
 
49
49
  # We can use --pfile since extract_snps now creates pgen files
50
- plink_command = f"{get_plink_path()} --memory {ram} --pfile {extracted_path} \
50
+ plink_command = f"{get_plink_path()} --memory {ram} --pfile {extracted_path} --threads {cpus} \
51
51
  --score {data_path} 1 2 3 header --out {output_path} --allow-no-sex"
52
52
 
53
53
  # Check for empty dataframe
@@ -98,7 +98,7 @@ def prs_func(data, weighted=True, path=None, ram=10000, name=None):
98
98
 
99
99
  # We are currently excluding all multiallelic variants by forcing first on all duplicates.
100
100
  # Could be improved by keeping the relevant version of the multiallelic SNPs based on allele matching
101
- def extract_snps_func(snp_list, name=None, path=None):
101
+ def extract_snps_func(snp_list, name=None, path=None, ram=20000, cpus=4):
102
102
  """
103
103
  Extracts a list of SNPs from the given path. This function corresponds to the following Geno method: :meth:`Geno.extract_snps`.
104
104
 
@@ -137,8 +137,11 @@ def extract_snps_func(snp_list, name=None, path=None):
137
137
 
138
138
  output_path = os.path.join("tmp_GENAL", f"{name}_allchr")
139
139
  if filetype_split == "split":
140
+ ram_estimate_per_cpu = nrow/(1.5*10**2)
141
+ n_cpus = max(1, int(ram // ram_estimate_per_cpu))
142
+ workers = min(n_cpus, cpus)
140
143
  merge_command, bedlist_path = extract_snps_from_split_data(
141
- name, path, output_path, snp_list_path, filetype
144
+ name, path, output_path, snp_list_path, filetype, workers=workers
142
145
  )
143
146
  handle_multiallelic_variants(name, merge_command, bedlist_path)
144
147
  else:
@@ -219,7 +222,7 @@ def create_bedlist(bedlist_path, output_name, not_found):
219
222
  return found
220
223
 
221
224
 
222
- def extract_snps_from_split_data(name, path, output_path, snp_list_path, filetype):
225
+ def extract_snps_from_split_data(name, path, output_path, snp_list_path, filetype, workers=4):
223
226
  """Extract SNPs from data split by chromosome."""
224
227
  print("Extracting SNPs for each chromosome...")
225
228
  num_tasks = 22
@@ -230,7 +233,7 @@ def extract_snps_from_split_data(name, path, output_path, snp_list_path, filetyp
230
233
  snp_list_path=snp_list_path,
231
234
  filetype=filetype
232
235
  ) # Wrapper function
233
- with ProcessPoolExecutor() as executor:
236
+ with ProcessPoolExecutor(max_workers=workers) as executor:
234
237
  not_found = list(
235
238
  executor.map(partial_extract_command_parallel, range(1, num_tasks + 1))
236
239
  )
@@ -77,7 +77,7 @@ def filter_by_gene_func(data, gene_identifier, id_type="symbol", window_size=100
77
77
  print(f"Warning: Multiple entries found for {id_type}='{gene_identifier}'. Using the first entry.")
78
78
  gene_data = gene_data.iloc[0,:]
79
79
 
80
- print(f"Filtering variants within {window_size}bp window based on genome build {build} around gene: {', '.join(f'{col}: {gene_data[col]}' for col in valid_id_types)}")
80
+ print(f"Filtering variants within {window_size}bp window (+/- {window_size/2}bp on each side) based on genome build {build} around gene: {', '.join(f'{col}: {gene_data[col]}' for col in valid_id_types)}")
81
81
 
82
82
  # Extract gene location information
83
83
  chrom = gene_data['CHR']
@@ -44,9 +44,6 @@ def lift_data(
44
44
  Notes:
45
45
  Function for the :meth:`Geno.lift` method.
46
46
  """
47
- # Generate a default name if none is provided
48
- if name is None:
49
- name = str(uuid.uuid4())[:8]
50
47
 
51
48
  # Prepare chain file and get its path
52
49
  chain_path = prepare_chain_file(chain_file, start, end)
@@ -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.4.2"
7
+ version = "1.4.4"
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