genal-python 1.4.9__tar.gz → 1.5.0__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.
- {genal_python-1.4.9 → genal_python-1.5.0}/PKG-INFO +1 -1
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/requirements.txt +1 -1
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/Geno.py +3 -1
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/__init__.py +1 -1
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/geno_tools.py +5 -6
- {genal_python-1.4.9 → genal_python-1.5.0}/pyproject.toml +1 -1
- {genal_python-1.4.9 → genal_python-1.5.0}/.DS_Store +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/.gitignore +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/.readthedocs.yaml +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/Genal_flowchart.png +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/LICENSE +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/README.md +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/.DS_Store +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/Makefile +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/make.bat +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/.DS_Store +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/Images/Genal_flowchart.png +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/Images/MR_plot_SBP_AS.png +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/Images/genal_logo.png +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/api.md +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/concepts.md +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/conf.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/faq.md +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/index.md +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/introduction.md +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/methods.md +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/setup.md +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/docs/source/workflows.md +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/MR.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/MR_tools.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/MRpresso.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/association.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/clump.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/colocalization.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/constants.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/extract_prs.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/genes.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/lift.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/proxy.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/snp_query.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal/tools.py +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/genal_logo.png +0 -0
- {genal_python-1.4.9 → genal_python-1.5.0}/gitignore +0 -0
|
@@ -92,6 +92,7 @@ class Geno:
|
|
|
92
92
|
P="P",
|
|
93
93
|
EAF="EAF",
|
|
94
94
|
keep_columns=True,
|
|
95
|
+
F="F",
|
|
95
96
|
):
|
|
96
97
|
"""
|
|
97
98
|
Initializes the Geno object used to store and transform Single Nucleotide Polymorphisms (SNP) data.
|
|
@@ -108,6 +109,7 @@ class Geno:
|
|
|
108
109
|
P (str, optional): Column name for p-value. Defaults to "P".
|
|
109
110
|
EAF (str, optional): Column name for effect allele frequency. Defaults to "EAF".
|
|
110
111
|
keep_columns (bool, optional): Determines if non-main columns should be kept. Defaults to True.
|
|
112
|
+
F (str, optional): Column name for F-statistic. Defaults to "F".
|
|
111
113
|
|
|
112
114
|
Attributes:
|
|
113
115
|
name (str): Randomly generated ID for the Geno object.
|
|
@@ -136,7 +138,7 @@ class Geno:
|
|
|
136
138
|
|
|
137
139
|
# Standardize column names based on provided parameters +/- delete other columns
|
|
138
140
|
data = adjust_column_names(
|
|
139
|
-
data, CHR, POS, SNP, EA, NEA, BETA, SE, P, EAF, keep_columns
|
|
141
|
+
data, CHR, POS, SNP, EA, NEA, BETA, SE, P, EAF, keep_columns, F
|
|
140
142
|
)
|
|
141
143
|
|
|
142
144
|
# Set object attributes
|
|
@@ -141,7 +141,6 @@ def fill_fstatistic(data, overwrite=False):
|
|
|
141
141
|
# Primary route: FSTAT = (BETA / SE)² when BETA and SE are available (SE=0 produces inf)
|
|
142
142
|
beta_se_computable = pd.Series([False] * nrows, index=data.index)
|
|
143
143
|
if "BETA" in data.columns and "SE" in data.columns:
|
|
144
|
-
method = "BETA/SE"
|
|
145
144
|
beta_se_computable = (
|
|
146
145
|
rows_to_compute &
|
|
147
146
|
data["BETA"].notna() &
|
|
@@ -157,7 +156,6 @@ def fill_fstatistic(data, overwrite=False):
|
|
|
157
156
|
# Fallback route: FSTAT = χ²_isf(P, df=1) for remaining rows where P is present
|
|
158
157
|
# Allow P=0 (produces inf for extremely significant variants)
|
|
159
158
|
if "P" in data.columns:
|
|
160
|
-
method = "P-values"
|
|
161
159
|
p_fallback_computable = (
|
|
162
160
|
rows_to_compute &
|
|
163
161
|
~beta_se_computable &
|
|
@@ -174,19 +172,19 @@ def fill_fstatistic(data, overwrite=False):
|
|
|
174
172
|
# Logging
|
|
175
173
|
if column_created:
|
|
176
174
|
print(
|
|
177
|
-
f"The FSTAT (F-statistic) column has been created
|
|
175
|
+
f"The FSTAT (F-statistic) column has been created. "
|
|
178
176
|
f"{n_assigned}({n_assigned/nrows*100:.3f}%) values computed."
|
|
179
177
|
)
|
|
180
178
|
elif overwrite:
|
|
181
179
|
print(
|
|
182
|
-
f"The FSTAT (F-statistic) column has been re-created
|
|
180
|
+
f"The FSTAT (F-statistic) column has been re-created. "
|
|
183
181
|
f"{n_assigned}({n_assigned/nrows*100:.3f}%) values computed."
|
|
184
182
|
)
|
|
185
183
|
else:
|
|
186
184
|
if n_assigned > 0:
|
|
187
185
|
print(
|
|
188
186
|
f"The FSTAT (F-statistic) column: {n_assigned}({n_assigned/nrows*100:.3f}%)"
|
|
189
|
-
f"missing values have been filled
|
|
187
|
+
f"missing values have been filled."
|
|
190
188
|
)
|
|
191
189
|
|
|
192
190
|
return
|
|
@@ -402,7 +400,7 @@ def check_int_column(data, int_col):
|
|
|
402
400
|
)
|
|
403
401
|
return
|
|
404
402
|
|
|
405
|
-
def adjust_column_names(data, CHR, POS, SNP, EA, NEA, BETA, SE, P, EAF, keep_columns):
|
|
403
|
+
def adjust_column_names(data, CHR, POS, SNP, EA, NEA, BETA, SE, P, EAF, keep_columns, F):
|
|
406
404
|
"""
|
|
407
405
|
Rename columns to the standard names making sure that there are no duplicated names.
|
|
408
406
|
Delete other columns if keep_columns=False, keep them if True.
|
|
@@ -422,6 +420,7 @@ def adjust_column_names(data, CHR, POS, SNP, EA, NEA, BETA, SE, P, EAF, keep_col
|
|
|
422
420
|
SE: "SE",
|
|
423
421
|
P: "P",
|
|
424
422
|
EAF: "EAF",
|
|
423
|
+
F: "F",
|
|
425
424
|
}
|
|
426
425
|
for key, value in rename_dict.items():
|
|
427
426
|
if key != value and key not in data.columns:
|
|
@@ -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.
|
|
7
|
+
version = "1.5.0"
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|