genal-python 0.8__tar.gz → 0.9__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-0.8 → genal_python-0.9}/.gitignore +2 -1
- {genal_python-0.8 → genal_python-0.9}/PKG-INFO +34 -21
- {genal_python-0.8 → genal_python-0.9}/README.md +33 -20
- {genal_python-0.8 → genal_python-0.9}/docs/.DS_Store +0 -0
- genal_python-0.9/docs/build/.DS_Store +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/.doctrees/api.doctree +0 -0
- genal_python-0.9/docs/build/.doctrees/environment.pickle +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/.doctrees/index.doctree +0 -0
- genal_python-0.9/docs/build/.doctrees/introduction.doctree +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/genal/Geno.html +3 -3
- {genal_python-0.8 → genal_python-0.9}/docs/build/_sources/index.rst.txt +1 -1
- {genal_python-0.8 → genal_python-0.9}/docs/build/_sources/introduction.rst.txt +16 -8
- {genal_python-0.8 → genal_python-0.9}/docs/build/api.html +1 -1
- {genal_python-0.8 → genal_python-0.9}/docs/build/index.html +1 -1
- {genal_python-0.8 → genal_python-0.9}/docs/build/introduction.html +19 -11
- genal_python-0.9/docs/build/searchindex.js +1 -0
- {genal_python-0.8 → genal_python-0.9}/docs/source/conf.py +1 -1
- {genal_python-0.8 → genal_python-0.9}/docs/source/index.rst +1 -1
- {genal_python-0.8 → genal_python-0.9}/docs/source/introduction.rst +36 -25
- {genal_python-0.8 → genal_python-0.9}/genal/Geno.py +2 -2
- {genal_python-0.8 → genal_python-0.9}/genal/__init__.py +1 -1
- {genal_python-0.8 → genal_python-0.9}/genal/extract_prs.py +33 -11
- {genal_python-0.8 → genal_python-0.9}/genal/geno_tools.py +2 -2
- {genal_python-0.8 → genal_python-0.9}/pyproject.toml +1 -1
- genal_python-0.8/docs/_build/doctrees/api.doctree +0 -0
- genal_python-0.8/docs/_build/doctrees/environment.pickle +0 -0
- genal_python-0.8/docs/_build/doctrees/genal.doctree +0 -0
- genal_python-0.8/docs/_build/doctrees/index.doctree +0 -0
- genal_python-0.8/docs/_build/doctrees/introduction.doctree +0 -0
- genal_python-0.8/docs/_build/doctrees/modules.doctree +0 -0
- genal_python-0.8/docs/_build/doctrees/source/genal.doctree +0 -0
- genal_python-0.8/docs/_build/doctrees/source/modules.doctree +0 -0
- genal_python-0.8/docs/_build/html/.buildinfo +0 -4
- genal_python-0.8/docs/_build/html/_sources/api.rst.txt +0 -24
- genal_python-0.8/docs/_build/html/_sources/index.rst.txt +0 -59
- genal_python-0.8/docs/_build/html/_sources/introduction.rst.txt +0 -505
- genal_python-0.8/docs/_build/html/_sources/modules.rst.txt +0 -7
- genal_python-0.8/docs/_build/html/_sources/source/genal.rst.txt +0 -101
- genal_python-0.8/docs/_build/html/_sources/source/modules.rst.txt +0 -7
- genal_python-0.8/docs/_build/html/_static/_sphinx_javascript_frameworks_compat.js +0 -123
- genal_python-0.8/docs/_build/html/_static/basic.css +0 -925
- genal_python-0.8/docs/_build/html/_static/doctools.js +0 -156
- genal_python-0.8/docs/_build/html/_static/documentation_options.js +0 -13
- genal_python-0.8/docs/_build/html/_static/jquery.js +0 -2
- genal_python-0.8/docs/_build/html/_static/language_data.js +0 -199
- genal_python-0.8/docs/_build/html/_static/searchtools.js +0 -574
- genal_python-0.8/docs/_build/html/api.html +0 -876
- genal_python-0.8/docs/_build/html/genal.html +0 -2039
- genal_python-0.8/docs/_build/html/genindex.html +0 -701
- genal_python-0.8/docs/_build/html/index.html +0 -192
- genal_python-0.8/docs/_build/html/introduction.html +0 -584
- genal_python-0.8/docs/_build/html/modules.html +0 -269
- genal_python-0.8/docs/_build/html/objects.inv +0 -0
- genal_python-0.8/docs/_build/html/py-modindex.html +0 -177
- genal_python-0.8/docs/_build/html/search.html +0 -122
- genal_python-0.8/docs/_build/html/searchindex.js +0 -1
- genal_python-0.8/docs/_build/html/source/genal.html +0 -2060
- genal_python-0.8/docs/_build/html/source/modules.html +0 -259
- genal_python-0.8/docs/build/.doctrees/environment.pickle +0 -0
- genal_python-0.8/docs/build/.doctrees/introduction.doctree +0 -0
- genal_python-0.8/docs/build/_sources/genal.rst.txt +0 -101
- genal_python-0.8/docs/build/_static/css/badge_only.css +0 -1
- genal_python-0.8/docs/build/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/fontawesome-webfont.eot +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/fontawesome-webfont.svg +0 -2671
- genal_python-0.8/docs/build/_static/css/fonts/fontawesome-webfont.ttf +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/fontawesome-webfont.woff +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/lato-bold-italic.woff +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/lato-bold-italic.woff2 +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/lato-bold.woff +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/lato-bold.woff2 +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/lato-normal-italic.woff +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/lato-normal-italic.woff2 +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/lato-normal.woff +0 -0
- genal_python-0.8/docs/build/_static/css/fonts/lato-normal.woff2 +0 -0
- genal_python-0.8/docs/build/_static/css/theme.css +0 -4
- genal_python-0.8/docs/build/_static/file.png +0 -0
- genal_python-0.8/docs/build/_static/js/badge_only.js +0 -1
- genal_python-0.8/docs/build/_static/js/html5shiv-printshiv.min.js +0 -4
- genal_python-0.8/docs/build/_static/js/html5shiv.min.js +0 -4
- genal_python-0.8/docs/build/_static/js/theme.js +0 -1
- genal_python-0.8/docs/build/_static/minus.png +0 -0
- genal_python-0.8/docs/build/_static/plus.png +0 -0
- genal_python-0.8/docs/build/_static/pygments.css +0 -75
- genal_python-0.8/docs/build/_static/sphinx_highlight.js +0 -154
- genal_python-0.8/docs/build/searchindex.js +0 -1
- genal_python-0.8/docs/requirements.txt +0 -14
- {genal_python-0.8 → genal_python-0.9}/.DS_Store +0 -0
- {genal_python-0.8 → genal_python-0.9}/.readthedocs.yaml +0 -0
- {genal_python-0.8 → genal_python-0.9}/LICENSE +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/Makefile +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/.buildinfo +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/.doctrees/genal.doctree +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/.doctrees/modules.doctree +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_images/MR_plot_SBP_AS.png +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/genal/MR.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/genal/MR_tools.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/genal/MRpresso.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/genal/association.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/genal/clump.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/genal/extract_prs.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/genal/geno_tools.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/genal/lift.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/genal/proxy.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/genal/snp_query.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/genal/tools.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_modules/index.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_sources/api.rst.txt +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_sources/genal.rst.txt +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_sources/modules.rst.txt +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_static/basic.css +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/badge_only.css +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/fontawesome-webfont.eot +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/fontawesome-webfont.svg +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/fontawesome-webfont.ttf +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/fontawesome-webfont.woff +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/lato-bold-italic.woff +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/lato-bold-italic.woff2 +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/lato-bold.woff +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/lato-bold.woff2 +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/lato-normal-italic.woff +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/lato-normal-italic.woff2 +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/lato-normal.woff +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/fonts/lato-normal.woff2 +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/css/theme.css +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_static/doctools.js +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_static/documentation_options.js +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/file.png +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/js/badge_only.js +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/js/html5shiv-printshiv.min.js +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/js/html5shiv.min.js +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/js/theme.js +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_static/language_data.js +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/minus.png +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/plus.png +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/pygments.css +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/_static/searchtools.js +0 -0
- {genal_python-0.8/docs/_build/html → genal_python-0.9/docs/build}/_static/sphinx_highlight.js +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/genal.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/genindex.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/modules.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/objects.inv +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/py-modindex.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/build/search.html +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/make.bat +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/source/.DS_Store +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/source/Images/MR_plot_SBP_AS.png +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/source/api.rst +0 -0
- {genal_python-0.8 → genal_python-0.9}/docs/source/modules.rst +0 -0
- {genal_python-0.8 → genal_python-0.9}/genal/MR.py +0 -0
- {genal_python-0.8 → genal_python-0.9}/genal/MR_tools.py +0 -0
- {genal_python-0.8 → genal_python-0.9}/genal/MRpresso.py +0 -0
- {genal_python-0.8 → genal_python-0.9}/genal/association.py +0 -0
- {genal_python-0.8 → genal_python-0.9}/genal/clump.py +0 -0
- {genal_python-0.8 → genal_python-0.9}/genal/constants.py +0 -0
- {genal_python-0.8 → genal_python-0.9}/genal/lift.py +0 -0
- {genal_python-0.8 → genal_python-0.9}/genal/proxy.py +0 -0
- {genal_python-0.8 → genal_python-0.9}/genal/snp_query.py +0 -0
- {genal_python-0.8 → genal_python-0.9}/genal/tools.py +0 -0
- {genal_python-0.8 → genal_python-0.9}/gitignore +0 -0
- {genal_python-0.8 → genal_python-0.9}/readthedocs.yaml +0 -0
- {genal_python-0.8 → genal_python-0.9}/requirements.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: genal-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9
|
|
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.7
|
|
@@ -59,18 +59,27 @@ If you're using genal, please cite the following paper:
|
|
|
59
59
|
**Genal: A Python Toolkit for Genetic Risk Scoring and Mendelian Randomization.** Cyprien A. Rivier, Santiago Clocchiatti-Tuozzo, Shufan Huo, Victor Torres-Lopez, Daniela Renedo, Kevin N. Sheth, Guido J. Falcone, Julian N. Acosta. medRxiv 2024.05.23.24307776; doi: https://doi.org/10.1101/2024.05.23.24307776
|
|
60
60
|
|
|
61
61
|
## Requirements for the genal module <a name="paragraph1"></a>
|
|
62
|
-
***Python 3.
|
|
62
|
+
***Python 3.11 or later***. https://www.python.org/ <br>
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
## Installation and How to use the genal module <a name="paragraph2"></a>
|
|
66
66
|
|
|
67
67
|
### Installation <a name="paragraph2.1"></a>
|
|
68
68
|
|
|
69
|
+
> **Note:**
|
|
70
|
+
>
|
|
71
|
+
> **Optional**: It is recommended to create a new environment to avoid dependencies conflicts. Here, we create a new conda environment called 'genal_env'.
|
|
72
|
+
> ```
|
|
73
|
+
> conda create --name genal_env python=3.11
|
|
74
|
+
> conda activate genal_env
|
|
75
|
+
> ```
|
|
76
|
+
|
|
77
|
+
|
|
69
78
|
Download and install the package with pip:
|
|
70
79
|
```
|
|
71
80
|
pip install genal-python
|
|
72
81
|
```
|
|
73
|
-
And it
|
|
82
|
+
And import it in a python environment with:
|
|
74
83
|
```python
|
|
75
84
|
import genal
|
|
76
85
|
```
|
|
@@ -237,7 +246,7 @@ You can also use a custom reference panel by specifying to the reference_panel a
|
|
|
237
246
|
|
|
238
247
|
### Clumping <a name="paragraph3.3"></a>
|
|
239
248
|
|
|
240
|
-
Clumping is the step at which we select the SNPs that will be used as our genetic instruments in future Polygenic Risk Scores and Mendelian Randomization analyses. The process involves identifying the SNPs that are strongly associated with our trait of interest (systolic blood pressure in this tutorial) and are independent from each other. This second step ensures that selected SNPs are not highly correlated, (i.e., they are not in high linkage disequilibrium). For this step, we again need to use a reference panel.
|
|
249
|
+
Clumping, or C+T: Clumping + Thresholding, is the step at which we select the SNPs that will be used as our genetic instruments in future Polygenic Risk Scores and Mendelian Randomization analyses. The process involves identifying the SNPs that are strongly associated with our trait of interest (systolic blood pressure in this tutorial) and are independent from each other. This second step ensures that selected SNPs are not highly correlated, (i.e., they are not in high linkage disequilibrium). For this step, we again need to use a reference panel.
|
|
241
250
|
|
|
242
251
|
The SNP-data loaded in a `genal.Geno` instance can be clumped using the `genal.Geno.clump` method. It will return another `genal.Geno` instance containing only the clumped data:
|
|
243
252
|
|
|
@@ -309,7 +318,7 @@ The output of the `genal.Geno.prs` method will include how many SNPs were used t
|
|
|
309
318
|
Here, we see that about half of the SNPs were not extracted from the data. In such cases, we may want to try and salvage some of these SNPs by looking for proxies (SNPs in high linkage disequilibrium, i.e. highly correlated SNPs). This can be done by specifying the `proxy = True`. argument:
|
|
310
319
|
|
|
311
320
|
```python
|
|
312
|
-
SBP_clumped.prs(name = "
|
|
321
|
+
SBP_clumped.prs(name = "SBP_prs_proxy" ,path = "Pop_chr$", proxy = True, reference_panel = "eur", r2=0.8, kb=5000, window_snps=5000)
|
|
313
322
|
```
|
|
314
323
|
|
|
315
324
|
and the output is:
|
|
@@ -410,21 +419,25 @@ Genal will print how many SNPs were successfully found and extracted from the ou
|
|
|
410
419
|
1541 SNPs out of 1545 are present in the outcome data.
|
|
411
420
|
(Exposure data, Outcome data, Outcome name) stored in the .MR_data attribute.
|
|
412
421
|
|
|
413
|
-
Here as well you have the option to use proxies for the instruments that are not present in the outcome data:
|
|
414
|
-
|
|
415
|
-
```python
|
|
416
|
-
SBP_clumped.query_outcome(Stroke_geno, proxy = True, reference_panel = "eur", kb = 5000, r2 = 0.6, window_snps = 5000)
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
And genal will print the number of missing instruments which have been proxied:
|
|
420
422
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
423
|
+
> **Note:**
|
|
424
|
+
>Here as well you have the option to use proxies for the instruments that are not present in the outcome data:
|
|
425
|
+
>
|
|
426
|
+
> Here as well you have the option to use proxies for the instruments that are not present in the outcome data:
|
|
427
|
+
>
|
|
428
|
+
> ```python
|
|
429
|
+
> SBP_clumped.query_outcome(Stroke_geno, proxy = True, reference_panel = "eur", kb = 5000, r2 = 0.6, window_snps = 5000)
|
|
430
|
+
> ```
|
|
431
|
+
>
|
|
432
|
+
> And genal will print the number of missing instruments that have been proxied:
|
|
433
|
+
>
|
|
434
|
+
> Outcome data successfully loaded from 'b352e412' geno instance.
|
|
435
|
+
> Identifying the exposure SNPs present in the outcome data...
|
|
436
|
+
> 1541 SNPs out of 1545 are present in the outcome data.
|
|
437
|
+
> Searching proxies for 4 SNPs...
|
|
438
|
+
> Using the EUR reference panel.
|
|
439
|
+
> Found proxies for 4 SNPs.
|
|
440
|
+
> (Exposure data, Outcome data, Outcome name) stored in the .MR_data attribute.
|
|
428
441
|
|
|
429
442
|
After extracting the instruments from the outcome data, the `SBP_clumped` `genal.Geno` instance contains an `MR_data` attribute containing the instruments-exposure and instruments-outcome associations necessary to run MR. Running MR is now as simple as calling the `genal.Geno.MR` method of the SBP_clumped `genal.Geno` instance:
|
|
430
443
|
|
|
@@ -469,7 +482,7 @@ By default, only some MR methods (inverse-variance weighted, weighted median, Si
|
|
|
469
482
|
- `Weighted-mode` for the Weighted mode method
|
|
470
483
|
- `all` to run all the above methods
|
|
471
484
|
|
|
472
|
-
For more fine-tuning, such as settings for the number of boostrapping iterations, please refer to the API.
|
|
485
|
+
For more fine-tuning, such as settings for the number of boostrapping iterations, please refer to the API: [https://genal.readthedocs.io/en/latest/modules.html#id4](MR method).
|
|
473
486
|
|
|
474
487
|
If you want to visualize the obtained MR results, you can use the `genal.Geno.MR_plot` method that will plot each SNP in an `effect_on_exposure x effect_on_outcome` plane as well as lines corresponding to different MR methods:
|
|
475
488
|
|
|
@@ -522,7 +535,7 @@ df_pheno = pd.read_csv("path/to/trait/data")
|
|
|
522
535
|
|
|
523
536
|
> **Note:**
|
|
524
537
|
>
|
|
525
|
-
> One important
|
|
538
|
+
> One important point is to make sure that the IDs of the participants are identical in the phenotypic data and in the genetic data.
|
|
526
539
|
|
|
527
540
|
Then, it is advised to make a copy of the `genal.Geno` instance containing our instruments as we are going to update their coefficients and to avoid any confusion:
|
|
528
541
|
|
|
@@ -35,18 +35,27 @@ If you're using genal, please cite the following paper:
|
|
|
35
35
|
**Genal: A Python Toolkit for Genetic Risk Scoring and Mendelian Randomization.** Cyprien A. Rivier, Santiago Clocchiatti-Tuozzo, Shufan Huo, Victor Torres-Lopez, Daniela Renedo, Kevin N. Sheth, Guido J. Falcone, Julian N. Acosta. medRxiv 2024.05.23.24307776; doi: https://doi.org/10.1101/2024.05.23.24307776
|
|
36
36
|
|
|
37
37
|
## Requirements for the genal module <a name="paragraph1"></a>
|
|
38
|
-
***Python 3.
|
|
38
|
+
***Python 3.11 or later***. https://www.python.org/ <br>
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
## Installation and How to use the genal module <a name="paragraph2"></a>
|
|
42
42
|
|
|
43
43
|
### Installation <a name="paragraph2.1"></a>
|
|
44
44
|
|
|
45
|
+
> **Note:**
|
|
46
|
+
>
|
|
47
|
+
> **Optional**: It is recommended to create a new environment to avoid dependencies conflicts. Here, we create a new conda environment called 'genal_env'.
|
|
48
|
+
> ```
|
|
49
|
+
> conda create --name genal_env python=3.11
|
|
50
|
+
> conda activate genal_env
|
|
51
|
+
> ```
|
|
52
|
+
|
|
53
|
+
|
|
45
54
|
Download and install the package with pip:
|
|
46
55
|
```
|
|
47
56
|
pip install genal-python
|
|
48
57
|
```
|
|
49
|
-
And it
|
|
58
|
+
And import it in a python environment with:
|
|
50
59
|
```python
|
|
51
60
|
import genal
|
|
52
61
|
```
|
|
@@ -213,7 +222,7 @@ You can also use a custom reference panel by specifying to the reference_panel a
|
|
|
213
222
|
|
|
214
223
|
### Clumping <a name="paragraph3.3"></a>
|
|
215
224
|
|
|
216
|
-
Clumping is the step at which we select the SNPs that will be used as our genetic instruments in future Polygenic Risk Scores and Mendelian Randomization analyses. The process involves identifying the SNPs that are strongly associated with our trait of interest (systolic blood pressure in this tutorial) and are independent from each other. This second step ensures that selected SNPs are not highly correlated, (i.e., they are not in high linkage disequilibrium). For this step, we again need to use a reference panel.
|
|
225
|
+
Clumping, or C+T: Clumping + Thresholding, is the step at which we select the SNPs that will be used as our genetic instruments in future Polygenic Risk Scores and Mendelian Randomization analyses. The process involves identifying the SNPs that are strongly associated with our trait of interest (systolic blood pressure in this tutorial) and are independent from each other. This second step ensures that selected SNPs are not highly correlated, (i.e., they are not in high linkage disequilibrium). For this step, we again need to use a reference panel.
|
|
217
226
|
|
|
218
227
|
The SNP-data loaded in a `genal.Geno` instance can be clumped using the `genal.Geno.clump` method. It will return another `genal.Geno` instance containing only the clumped data:
|
|
219
228
|
|
|
@@ -285,7 +294,7 @@ The output of the `genal.Geno.prs` method will include how many SNPs were used t
|
|
|
285
294
|
Here, we see that about half of the SNPs were not extracted from the data. In such cases, we may want to try and salvage some of these SNPs by looking for proxies (SNPs in high linkage disequilibrium, i.e. highly correlated SNPs). This can be done by specifying the `proxy = True`. argument:
|
|
286
295
|
|
|
287
296
|
```python
|
|
288
|
-
SBP_clumped.prs(name = "
|
|
297
|
+
SBP_clumped.prs(name = "SBP_prs_proxy" ,path = "Pop_chr$", proxy = True, reference_panel = "eur", r2=0.8, kb=5000, window_snps=5000)
|
|
289
298
|
```
|
|
290
299
|
|
|
291
300
|
and the output is:
|
|
@@ -386,21 +395,25 @@ Genal will print how many SNPs were successfully found and extracted from the ou
|
|
|
386
395
|
1541 SNPs out of 1545 are present in the outcome data.
|
|
387
396
|
(Exposure data, Outcome data, Outcome name) stored in the .MR_data attribute.
|
|
388
397
|
|
|
389
|
-
Here as well you have the option to use proxies for the instruments that are not present in the outcome data:
|
|
390
|
-
|
|
391
|
-
```python
|
|
392
|
-
SBP_clumped.query_outcome(Stroke_geno, proxy = True, reference_panel = "eur", kb = 5000, r2 = 0.6, window_snps = 5000)
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
And genal will print the number of missing instruments which have been proxied:
|
|
396
398
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
399
|
+
> **Note:**
|
|
400
|
+
>Here as well you have the option to use proxies for the instruments that are not present in the outcome data:
|
|
401
|
+
>
|
|
402
|
+
> Here as well you have the option to use proxies for the instruments that are not present in the outcome data:
|
|
403
|
+
>
|
|
404
|
+
> ```python
|
|
405
|
+
> SBP_clumped.query_outcome(Stroke_geno, proxy = True, reference_panel = "eur", kb = 5000, r2 = 0.6, window_snps = 5000)
|
|
406
|
+
> ```
|
|
407
|
+
>
|
|
408
|
+
> And genal will print the number of missing instruments that have been proxied:
|
|
409
|
+
>
|
|
410
|
+
> Outcome data successfully loaded from 'b352e412' geno instance.
|
|
411
|
+
> Identifying the exposure SNPs present in the outcome data...
|
|
412
|
+
> 1541 SNPs out of 1545 are present in the outcome data.
|
|
413
|
+
> Searching proxies for 4 SNPs...
|
|
414
|
+
> Using the EUR reference panel.
|
|
415
|
+
> Found proxies for 4 SNPs.
|
|
416
|
+
> (Exposure data, Outcome data, Outcome name) stored in the .MR_data attribute.
|
|
404
417
|
|
|
405
418
|
After extracting the instruments from the outcome data, the `SBP_clumped` `genal.Geno` instance contains an `MR_data` attribute containing the instruments-exposure and instruments-outcome associations necessary to run MR. Running MR is now as simple as calling the `genal.Geno.MR` method of the SBP_clumped `genal.Geno` instance:
|
|
406
419
|
|
|
@@ -445,7 +458,7 @@ By default, only some MR methods (inverse-variance weighted, weighted median, Si
|
|
|
445
458
|
- `Weighted-mode` for the Weighted mode method
|
|
446
459
|
- `all` to run all the above methods
|
|
447
460
|
|
|
448
|
-
For more fine-tuning, such as settings for the number of boostrapping iterations, please refer to the API.
|
|
461
|
+
For more fine-tuning, such as settings for the number of boostrapping iterations, please refer to the API: [https://genal.readthedocs.io/en/latest/modules.html#id4](MR method).
|
|
449
462
|
|
|
450
463
|
If you want to visualize the obtained MR results, you can use the `genal.Geno.MR_plot` method that will plot each SNP in an `effect_on_exposure x effect_on_outcome` plane as well as lines corresponding to different MR methods:
|
|
451
464
|
|
|
@@ -498,7 +511,7 @@ df_pheno = pd.read_csv("path/to/trait/data")
|
|
|
498
511
|
|
|
499
512
|
> **Note:**
|
|
500
513
|
>
|
|
501
|
-
> One important
|
|
514
|
+
> One important point is to make sure that the IDs of the participants are identical in the phenotypic data and in the genetic data.
|
|
502
515
|
|
|
503
516
|
Then, it is advised to make a copy of the `genal.Geno` instance containing our instruments as we are going to update their coefficients and to avoid any confusion:
|
|
504
517
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>genal.Geno — genal v0.
|
|
6
|
+
<title>genal.Geno — genal v0.8 documentation</title>
|
|
7
7
|
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
|
8
8
|
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
|
9
9
|
<!--[if lt IE 9]>
|
|
10
10
|
<script src="../../_static/js/html5shiv.min.js"></script>
|
|
11
11
|
<![endif]-->
|
|
12
12
|
|
|
13
|
-
<script src="../../_static/documentation_options.js?v=
|
|
13
|
+
<script src="../../_static/documentation_options.js?v=b326c068"></script>
|
|
14
14
|
<script src="../../_static/doctools.js?v=9a2dae69"></script>
|
|
15
15
|
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
16
16
|
<script src="../../_static/js/theme.js"></script>
|
|
@@ -940,7 +940,7 @@
|
|
|
940
940
|
<span class="n">methods</span><span class="o">=</span><span class="p">[</span>
|
|
941
941
|
<span class="s2">"IVW"</span><span class="p">,</span>
|
|
942
942
|
<span class="s2">"WM"</span><span class="p">,</span>
|
|
943
|
-
<span class="s2">"Simple-
|
|
943
|
+
<span class="s2">"Simple-mode"</span><span class="p">,</span>
|
|
944
944
|
<span class="s2">"Egger"</span><span class="p">,</span>
|
|
945
945
|
<span class="p">],</span>
|
|
946
946
|
<span class="n">exposure_name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
Installation
|
|
3
3
|
============
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
.. note::
|
|
6
|
+
**Optional**: It is recommended to create a new environment to avoid dependencies conflicts. Here, we create a new conda environment called 'genal'.
|
|
7
|
+
|
|
8
|
+
.. code-block:: bash
|
|
9
|
+
|
|
10
|
+
conda create --name genal python=3.11
|
|
11
|
+
conda activate genal
|
|
12
|
+
|
|
13
|
+
The genal package requires Python 3.11. Download and install it with pip:
|
|
6
14
|
|
|
7
15
|
.. code-block:: bash
|
|
8
16
|
|
|
9
|
-
pip install genal
|
|
17
|
+
pip install genal-python
|
|
10
18
|
|
|
11
|
-
And it
|
|
19
|
+
And import it in a python environment with:
|
|
12
20
|
|
|
13
21
|
.. code-block:: python
|
|
14
22
|
|
|
@@ -145,7 +153,7 @@ By default, and depending on the global preprocessing level (``'None'``, ``'Fill
|
|
|
145
153
|
|
|
146
154
|
If you do not wish to run certain steps, or wish to run only certain steps, you can use additional arguments. For more information, please refer to the :meth:`~genal.Geno.preprocess_data` method in the API documentation.
|
|
147
155
|
|
|
148
|
-
In our case, the ``SNP`` column (for SNP identifier - rsid) was missing from our dataframe and has been added based on a 1000 genome reference panel
|
|
156
|
+
In our case, the ``SNP`` column (for SNP identifier - rsid) was missing from our dataframe and has been added based on a 1000 genome reference panel::
|
|
149
157
|
|
|
150
158
|
Using the EUR reference panel.
|
|
151
159
|
The SNP column (rsID) has been created. 197511 (2.787%) SNPs were not found in the reference data and their ID set to CHR:POS:EA.
|
|
@@ -176,7 +184,7 @@ You can also use a custom reference panel by specifying the path to bed/bim/fam
|
|
|
176
184
|
Clumping
|
|
177
185
|
--------
|
|
178
186
|
|
|
179
|
-
Clumping is the step at which we select the SNPs that will be used as our genetic instruments in future Polygenic Risk Scores and Mendelian Randomization analyses. The process involves identifying the SNPs that are strongly associated with our trait of interest (systolic blood pressure in this tutorial) and are independent from each other. This second step ensures that selected SNPs are not highly correlated, (i.e., they are not in high linkage disequilibrium). For this step, we again need to use a reference panel.
|
|
187
|
+
Clumping, or C+T: Clumping + Thresholding, is the step at which we select the SNPs that will be used as our genetic instruments in future Polygenic Risk Scores and Mendelian Randomization analyses. The process involves identifying the SNPs that are strongly associated with our trait of interest (systolic blood pressure in this tutorial) and are independent from each other. This second step ensures that selected SNPs are not highly correlated, (i.e., they are not in high linkage disequilibrium). For this step, we again need to use a reference panel.
|
|
180
188
|
|
|
181
189
|
The SNP-data loaded in a :class:`~genal.Geno` instance can be clumped using the :meth:`~genal.Geno.clump` method. It will return another :class:`~genal.Geno` instance containing only the clumped data:
|
|
182
190
|
|
|
@@ -250,7 +258,7 @@ Here, we see that about half of the SNPs were not extracted from the data. In su
|
|
|
250
258
|
|
|
251
259
|
.. code-block:: python
|
|
252
260
|
|
|
253
|
-
SBP_clumped.prs(name="
|
|
261
|
+
SBP_clumped.prs(name="SBP_prs_proxy", path="Pop_chr$", proxy=True, reference_panel="eur", r2=0.8, kb=5000, window_snps=5000)
|
|
254
262
|
|
|
255
263
|
and the output is::
|
|
256
264
|
|
|
@@ -489,7 +497,7 @@ Let's start by loading phenotypic data:
|
|
|
489
497
|
df_pheno = pd.read_csv("path/to/trait/data")
|
|
490
498
|
|
|
491
499
|
.. note::
|
|
492
|
-
One important
|
|
500
|
+
One important point is to make sure that the IDs of the participants are identical in the phenotypic data and in the genetic data.
|
|
493
501
|
|
|
494
502
|
Then, it is advised to make a copy of the :class:`~genal.Geno` instance containing our instruments as we are going to update their coefficients and to avoid any confusion:
|
|
495
503
|
|
|
@@ -589,7 +597,7 @@ Which will output::
|
|
|
589
597
|
701 (45.37%) SNPs failed to query (not found in GWAS Catalog) and 7 (0.5%) SNPs timed out after 34.33 seconds. You can increase the timeout value with the timeout argument.
|
|
590
598
|
|
|
591
599
|
And the :attr:`~genal.Geno.data` attribute now contains an `ASSOC` column::
|
|
592
|
-
|
|
600
|
+
|
|
593
601
|
EA NEA EAF BETA SE CHR POS SNP ASSOC
|
|
594
602
|
0 A G 0.1784 0.2330 0.0402 10 102075479 rs603424 [eicosanoids measurement, decadienedioic acid (...]
|
|
595
603
|
1 A G 0.0706 -0.3873 0.0626 10 102403682 rs2996303 FAILED_QUERY
|
|
@@ -473,7 +473,7 @@ flipping palindromic SNPs (relevant if action=2). Default is 0.42.</p></li>
|
|
|
473
473
|
|
|
474
474
|
<dl class="py method">
|
|
475
475
|
<dt class="sig sig-object py" id="id1">
|
|
476
|
-
<span class="sig-name descname"><span class="pre">MR_plot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">methods</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">['IVW',</span> <span class="pre">'WM',</span> <span class="pre">'Simple-
|
|
476
|
+
<span class="sig-name descname"><span class="pre">MR_plot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">methods</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">['IVW',</span> <span class="pre">'WM',</span> <span class="pre">'Simple-mode',</span> <span class="pre">'Egger']</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exposure_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outcome_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/genal/Geno.html#Geno.MR_plot"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#id1" title="Link to this definition">¶</a></dt>
|
|
477
477
|
<dd><p>Creates and returns a scatter plot of individual SNP effects with lines representing different Mendelian Randomization (MR) methods. Each MR method specified in the ‘methods’ argument is represented as a line in the plot.</p>
|
|
478
478
|
<dl class="field-list simple">
|
|
479
479
|
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
<p>The module prioritizes user-friendliness and intuitive operation, aiming to reduce the complexity of data analysis for researchers. Despite its focus on simplicity, Genal does not sacrifice the depth of customization or the precision of analysis. Researchers can expect to maintain analytical rigour while benefiting from the streamlined experience.</p>
|
|
90
90
|
<p>Genal draws on concepts from well-established R packages such as TwoSampleMR, MR-Presso, MendelianRandomization, and gwasvcf, adapting their proven methodologies to the Python environment. This approach ensures that users have access to tried and tested techniques with the versatility of Python’s data science tools.</p>
|
|
91
91
|
<p>To install the latest release, type:</p>
|
|
92
|
-
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">genal</span>
|
|
92
|
+
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">genal</span><span class="o">-</span><span class="n">python</span>
|
|
93
93
|
</pre></div>
|
|
94
94
|
</div>
|
|
95
95
|
<section id="contents">
|
|
@@ -88,11 +88,19 @@
|
|
|
88
88
|
|
|
89
89
|
<section id="installation">
|
|
90
90
|
<h1>Installation<a class="headerlink" href="#installation" title="Link to this heading">¶</a></h1>
|
|
91
|
-
<
|
|
92
|
-
<
|
|
91
|
+
<div class="admonition note">
|
|
92
|
+
<p class="admonition-title">Note</p>
|
|
93
|
+
<p><strong>Optional</strong>: It is recommended to create a new environment to avoid dependencies conflicts. Here, we create a new conda environment called ‘genal’.</p>
|
|
94
|
+
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>conda<span class="w"> </span>create<span class="w"> </span>--name<span class="w"> </span>genal<span class="w"> </span><span class="nv">python</span><span class="o">=</span><span class="m">3</span>.11
|
|
95
|
+
conda<span class="w"> </span>activate<span class="w"> </span>genal
|
|
96
|
+
</pre></div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
<p>The genal package requires Python 3.11. Download and install it with pip:</p>
|
|
100
|
+
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>genal-python
|
|
93
101
|
</pre></div>
|
|
94
102
|
</div>
|
|
95
|
-
<p>And it
|
|
103
|
+
<p>And import it in a python environment with:</p>
|
|
96
104
|
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">genal</span>
|
|
97
105
|
</pre></div>
|
|
98
106
|
</div>
|
|
@@ -205,11 +213,11 @@ Once downloaded, the path to the plink 1.9 executable should be set with:</p>
|
|
|
205
213
|
</ul>
|
|
206
214
|
<p>If you do not wish to run certain steps, or wish to run only certain steps, you can use additional arguments. For more information, please refer to the <a class="reference internal" href="modules.html#id0" title="genal.Geno.preprocess_data"><code class="xref py py-meth docutils literal notranslate"><span class="pre">preprocess_data()</span></code></a> method in the API documentation.</p>
|
|
207
215
|
<p>In our case, the <code class="docutils literal notranslate"><span class="pre">SNP</span></code> column (for SNP identifier - rsid) was missing from our dataframe and has been added based on a 1000 genome reference panel:</p>
|
|
208
|
-
<
|
|
209
|
-
<
|
|
210
|
-
The
|
|
211
|
-
|
|
212
|
-
</div
|
|
216
|
+
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Using</span> <span class="n">the</span> <span class="n">EUR</span> <span class="n">reference</span> <span class="n">panel</span><span class="o">.</span>
|
|
217
|
+
<span class="n">The</span> <span class="n">SNP</span> <span class="n">column</span> <span class="p">(</span><span class="n">rsID</span><span class="p">)</span> <span class="n">has</span> <span class="n">been</span> <span class="n">created</span><span class="o">.</span> <span class="mi">197511</span> <span class="p">(</span><span class="mf">2.787</span><span class="o">%</span><span class="p">)</span> <span class="n">SNPs</span> <span class="n">were</span> <span class="ow">not</span> <span class="n">found</span> <span class="ow">in</span> <span class="n">the</span> <span class="n">reference</span> <span class="n">data</span> <span class="ow">and</span> <span class="n">their</span> <span class="n">ID</span> <span class="nb">set</span> <span class="n">to</span> <span class="n">CHR</span><span class="p">:</span><span class="n">POS</span><span class="p">:</span><span class="n">EA</span><span class="o">.</span>
|
|
218
|
+
<span class="n">The</span> <span class="n">BETA</span> <span class="n">column</span> <span class="n">looks</span> <span class="n">like</span> <span class="n">Beta</span> <span class="n">estimates</span><span class="o">.</span> <span class="n">Use</span> <span class="n">effect_column</span><span class="o">=</span><span class="s1">'OR'</span> <span class="k">if</span> <span class="n">it</span> <span class="ow">is</span> <span class="n">a</span> <span class="n">column</span> <span class="n">of</span> <span class="n">Odds</span> <span class="n">Ratios</span><span class="o">.</span>
|
|
219
|
+
</pre></div>
|
|
220
|
+
</div>
|
|
213
221
|
<p>You can always check the data of a <code class="docutils literal notranslate"><span class="pre">genal.Geno</span></code> instance by accessing the <code class="docutils literal notranslate"><span class="pre">data</span></code> attribute:</p>
|
|
214
222
|
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">SBP_Geno</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">head</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
|
|
215
223
|
<span class="go"> EA NEA EAF BETA SE P CHR POS SNP</span>
|
|
@@ -229,7 +237,7 @@ The BETA column looks like Beta estimates. Use effect_column=’OR’ if it is a
|
|
|
229
237
|
</section>
|
|
230
238
|
<section id="clumping">
|
|
231
239
|
<h2>Clumping<a class="headerlink" href="#clumping" title="Link to this heading">¶</a></h2>
|
|
232
|
-
<p>Clumping is the step at which we select the SNPs that will be used as our genetic instruments in future Polygenic Risk Scores and Mendelian Randomization analyses. The process involves identifying the SNPs that are strongly associated with our trait of interest (systolic blood pressure in this tutorial) and are independent from each other. This second step ensures that selected SNPs are not highly correlated, (i.e., they are not in high linkage disequilibrium). For this step, we again need to use a reference panel.</p>
|
|
240
|
+
<p>Clumping, or C+T: Clumping + Thresholding, is the step at which we select the SNPs that will be used as our genetic instruments in future Polygenic Risk Scores and Mendelian Randomization analyses. The process involves identifying the SNPs that are strongly associated with our trait of interest (systolic blood pressure in this tutorial) and are independent from each other. This second step ensures that selected SNPs are not highly correlated, (i.e., they are not in high linkage disequilibrium). For this step, we again need to use a reference panel.</p>
|
|
233
241
|
<p>The SNP-data loaded in a <a class="reference internal" href="modules.html#genal.Geno" title="genal.Geno"><code class="xref py py-class docutils literal notranslate"><span class="pre">Geno</span></code></a> instance can be clumped using the <a class="reference internal" href="modules.html#id1" title="genal.Geno.clump"><code class="xref py py-meth docutils literal notranslate"><span class="pre">clump()</span></code></a> method. It will return another <a class="reference internal" href="modules.html#genal.Geno" title="genal.Geno"><code class="xref py py-class docutils literal notranslate"><span class="pre">Geno</span></code></a> instance containing only the clumped data:</p>
|
|
234
242
|
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">SBP_clumped</span> <span class="o">=</span> <span class="n">SBP_Geno</span><span class="o">.</span><span class="n">clump</span><span class="p">(</span><span class="n">p1</span><span class="o">=</span><span class="mf">5e-8</span><span class="p">,</span> <span class="n">r2</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> <span class="n">kb</span><span class="o">=</span><span class="mi">250</span><span class="p">,</span> <span class="n">reference_panel</span><span class="o">=</span><span class="s2">"eur"</span><span class="p">)</span>
|
|
235
243
|
</pre></div>
|
|
@@ -293,7 +301,7 @@ The output of the <a class="reference internal" href="modules.html#id2" title="g
|
|
|
293
301
|
</pre></div>
|
|
294
302
|
</div>
|
|
295
303
|
<p>Here, we see that about half of the SNPs were not extracted from the data. In such cases, we may want to try and salvage some of these SNPs by looking for proxies (SNPs in high linkage disequilibrium, i.e. highly correlated SNPs). This can be done by specifying the <code class="docutils literal notranslate"><span class="pre">proxy</span> <span class="pre">=</span> <span class="pre">True</span></code> argument:</p>
|
|
296
|
-
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">SBP_clumped</span><span class="o">.</span><span class="n">prs</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s2">"
|
|
304
|
+
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">SBP_clumped</span><span class="o">.</span><span class="n">prs</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s2">"SBP_prs_proxy"</span><span class="p">,</span> <span class="n">path</span><span class="o">=</span><span class="s2">"Pop_chr$"</span><span class="p">,</span> <span class="n">proxy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">reference_panel</span><span class="o">=</span><span class="s2">"eur"</span><span class="p">,</span> <span class="n">r2</span><span class="o">=</span><span class="mf">0.8</span><span class="p">,</span> <span class="n">kb</span><span class="o">=</span><span class="mi">5000</span><span class="p">,</span> <span class="n">window_snps</span><span class="o">=</span><span class="mi">5000</span><span class="p">)</span>
|
|
297
305
|
</pre></div>
|
|
298
306
|
</div>
|
|
299
307
|
<p>and the output is:</p>
|
|
@@ -551,7 +559,7 @@ It can be run using the <a class="reference internal" href="modules.html#id5" ti
|
|
|
551
559
|
</div>
|
|
552
560
|
<div class="admonition note">
|
|
553
561
|
<p class="admonition-title">Note</p>
|
|
554
|
-
<p>One important
|
|
562
|
+
<p>One important point is to make sure that the IDs of the participants are identical in the phenotypic data and in the genetic data.</p>
|
|
555
563
|
</div>
|
|
556
564
|
<p>Then, it is advised to make a copy of the <a class="reference internal" href="modules.html#genal.Geno" title="genal.Geno"><code class="xref py py-class docutils literal notranslate"><span class="pre">Geno</span></code></a> instance containing our instruments as we are going to update their coefficients and to avoid any confusion:</p>
|
|
557
565
|
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">SBP_adjusted</span> <span class="o">=</span> <span class="n">SBP_clumped</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
|