gpsea 0.2.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.
Files changed (97) hide show
  1. gpsea-0.2.0/LICENSE +21 -0
  2. gpsea-0.2.0/MANIFEST.in +2 -0
  3. gpsea-0.2.0/PKG-INFO +112 -0
  4. gpsea-0.2.0/README.md +50 -0
  5. gpsea-0.2.0/pyproject.toml +67 -0
  6. gpsea-0.2.0/setup.cfg +4 -0
  7. gpsea-0.2.0/src/gpsea/__init__.py +5 -0
  8. gpsea-0.2.0/src/gpsea/analysis/__init__.py +15 -0
  9. gpsea-0.2.0/src/gpsea/analysis/_api.py +472 -0
  10. gpsea-0.2.0/src/gpsea/analysis/_config.py +373 -0
  11. gpsea-0.2.0/src/gpsea/analysis/_gp_analysis.py +202 -0
  12. gpsea-0.2.0/src/gpsea/analysis/_gp_impl.py +195 -0
  13. gpsea-0.2.0/src/gpsea/analysis/_stats.py +154 -0
  14. gpsea-0.2.0/src/gpsea/analysis/_test_fisherExact.py +28 -0
  15. gpsea-0.2.0/src/gpsea/analysis/_util.py +61 -0
  16. gpsea-0.2.0/src/gpsea/analysis/mtc_filter/__init__.py +14 -0
  17. gpsea-0.2.0/src/gpsea/analysis/mtc_filter/_impl.py +697 -0
  18. gpsea-0.2.0/src/gpsea/analysis/pcats/__init__.py +29 -0
  19. gpsea-0.2.0/src/gpsea/analysis/pcats/_impl.py +561 -0
  20. gpsea-0.2.0/src/gpsea/analysis/pcats/stats/__init__.py +5 -0
  21. gpsea-0.2.0/src/gpsea/analysis/pcats/stats/_stats.py +177 -0
  22. gpsea-0.2.0/src/gpsea/analysis/pcats/stats/_test__stats.py +33 -0
  23. gpsea-0.2.0/src/gpsea/analysis/predicate/__init__.py +7 -0
  24. gpsea-0.2.0/src/gpsea/analysis/predicate/_api.py +212 -0
  25. gpsea-0.2.0/src/gpsea/analysis/predicate/genotype/__init__.py +12 -0
  26. gpsea-0.2.0/src/gpsea/analysis/predicate/genotype/_api.py +188 -0
  27. gpsea-0.2.0/src/gpsea/analysis/predicate/genotype/_counter.py +65 -0
  28. gpsea-0.2.0/src/gpsea/analysis/predicate/genotype/_gt_predicates.py +223 -0
  29. gpsea-0.2.0/src/gpsea/analysis/predicate/genotype/_predicates.py +596 -0
  30. gpsea-0.2.0/src/gpsea/analysis/predicate/genotype/_variant.py +373 -0
  31. gpsea-0.2.0/src/gpsea/analysis/predicate/phenotype/__init__.py +19 -0
  32. gpsea-0.2.0/src/gpsea/analysis/predicate/phenotype/_pheno.py +240 -0
  33. gpsea-0.2.0/src/gpsea/analysis/predicate/phenotype/_util.py +88 -0
  34. gpsea-0.2.0/src/gpsea/analysis/pscore/__init__.py +7 -0
  35. gpsea-0.2.0/src/gpsea/analysis/pscore/_api.py +162 -0
  36. gpsea-0.2.0/src/gpsea/analysis/pscore/_impl.py +135 -0
  37. gpsea-0.2.0/src/gpsea/analysis/pscore/stats/__init__.py +7 -0
  38. gpsea-0.2.0/src/gpsea/analysis/pscore/stats/_stats.py +44 -0
  39. gpsea-0.2.0/src/gpsea/config.py +51 -0
  40. gpsea-0.2.0/src/gpsea/data/__init__.py +3 -0
  41. gpsea-0.2.0/src/gpsea/data/_toy.py +210 -0
  42. gpsea-0.2.0/src/gpsea/io.py +317 -0
  43. gpsea-0.2.0/src/gpsea/model/__init__.py +23 -0
  44. gpsea-0.2.0/src/gpsea/model/_base.py +60 -0
  45. gpsea-0.2.0/src/gpsea/model/_cohort.py +302 -0
  46. gpsea-0.2.0/src/gpsea/model/_gt.py +176 -0
  47. gpsea-0.2.0/src/gpsea/model/_phenotype.py +129 -0
  48. gpsea-0.2.0/src/gpsea/model/_protein.py +284 -0
  49. gpsea-0.2.0/src/gpsea/model/_test_gt.py +30 -0
  50. gpsea-0.2.0/src/gpsea/model/_test_tx.py +64 -0
  51. gpsea-0.2.0/src/gpsea/model/_tx.py +223 -0
  52. gpsea-0.2.0/src/gpsea/model/_variant.py +909 -0
  53. gpsea-0.2.0/src/gpsea/model/_variant_effects.py +77 -0
  54. gpsea-0.2.0/src/gpsea/model/genome/GCF_000001405.25_GRCh37.p13_assembly_report.tsv +333 -0
  55. gpsea-0.2.0/src/gpsea/model/genome/GCF_000001405.39_GRCh38.p13_assembly_report.tsv +703 -0
  56. gpsea-0.2.0/src/gpsea/model/genome/__init__.py +22 -0
  57. gpsea-0.2.0/src/gpsea/model/genome/_builds.py +49 -0
  58. gpsea-0.2.0/src/gpsea/model/genome/_genome.py +553 -0
  59. gpsea-0.2.0/src/gpsea/model/genome/_test_builds.py +42 -0
  60. gpsea-0.2.0/src/gpsea/model/genome/_test_genome.py +248 -0
  61. gpsea-0.2.0/src/gpsea/preprocessing/__init__.py +33 -0
  62. gpsea-0.2.0/src/gpsea/preprocessing/_api.py +227 -0
  63. gpsea-0.2.0/src/gpsea/preprocessing/_audit.py +372 -0
  64. gpsea-0.2.0/src/gpsea/preprocessing/_config.py +410 -0
  65. gpsea-0.2.0/src/gpsea/preprocessing/_generic.py +54 -0
  66. gpsea-0.2.0/src/gpsea/preprocessing/_patient.py +54 -0
  67. gpsea-0.2.0/src/gpsea/preprocessing/_phenopacket.py +450 -0
  68. gpsea-0.2.0/src/gpsea/preprocessing/_phenotype.py +114 -0
  69. gpsea-0.2.0/src/gpsea/preprocessing/_protein.py +97 -0
  70. gpsea-0.2.0/src/gpsea/preprocessing/_uniprot.py +99 -0
  71. gpsea-0.2.0/src/gpsea/preprocessing/_variant.py +118 -0
  72. gpsea-0.2.0/src/gpsea/preprocessing/_vep.py +211 -0
  73. gpsea-0.2.0/src/gpsea/preprocessing/_vv.py +385 -0
  74. gpsea-0.2.0/src/gpsea/py.typed +0 -0
  75. gpsea-0.2.0/src/gpsea/view/__init__.py +17 -0
  76. gpsea-0.2.0/src/gpsea/view/_cohort.py +190 -0
  77. gpsea-0.2.0/src/gpsea/view/_disease.py +50 -0
  78. gpsea-0.2.0/src/gpsea/view/_draw_variants.py +430 -0
  79. gpsea-0.2.0/src/gpsea/view/_formatter.py +47 -0
  80. gpsea-0.2.0/src/gpsea/view/_protein_viewer.py +79 -0
  81. gpsea-0.2.0/src/gpsea/view/_protein_visualizable.py +153 -0
  82. gpsea-0.2.0/src/gpsea/view/_protein_visualizer.py +691 -0
  83. gpsea-0.2.0/src/gpsea/view/_stats.py +65 -0
  84. gpsea-0.2.0/src/gpsea/view/_txp.py +108 -0
  85. gpsea-0.2.0/src/gpsea/view/templates/cohort.html +162 -0
  86. gpsea-0.2.0/src/gpsea/view/templates/disease.html +106 -0
  87. gpsea-0.2.0/src/gpsea/view/templates/protein.html +86 -0
  88. gpsea-0.2.0/src/gpsea/view/templates/stats.html +71 -0
  89. gpsea-0.2.0/src/gpsea.egg-info/PKG-INFO +112 -0
  90. gpsea-0.2.0/src/gpsea.egg-info/SOURCES.txt +95 -0
  91. gpsea-0.2.0/src/gpsea.egg-info/dependency_links.txt +1 -0
  92. gpsea-0.2.0/src/gpsea.egg-info/requires.txt +21 -0
  93. gpsea-0.2.0/src/gpsea.egg-info/top_level.txt +1 -0
  94. gpsea-0.2.0/tests/test_config.py +31 -0
  95. gpsea-0.2.0/tests/test_io.py +48 -0
  96. gpsea-0.2.0/tests/test_predicates.py +188 -0
  97. gpsea-0.2.0/tests/test_tutorial.py +90 -0
gpsea-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023, The Monarch Initiative
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ include src/gpsea/model/genome/GCF_*.tsv
2
+ include src/gpsea/view/templates/*.html
gpsea-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,112 @@
1
+ Metadata-Version: 2.1
2
+ Name: gpsea
3
+ Version: 0.2.0
4
+ Summary: Discover genotype-phenotype correlations with GA4GH phenopackets
5
+ Author-email: Lauren Rekerle <lauren.rekerle@jax.org>, Daniel Danis <daniel.danis@jax.org>, Peter Robinson <peter.robinson@jax.org>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2023, The Monarch Initiative
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ Project-URL: homepage, https://github.com/monarch-initiative/gpsea
28
+ Project-URL: repository, https://github.com/monarch-initiative/gpsea.git
29
+ Project-URL: documentation, https://monarch-initiative.github.io/gpsea/stable
30
+ Project-URL: bugtracker, https://github.com/monarch-initiative/gpsea/issues
31
+ Keywords: Global Alliance for Genomics and Health,GA4GH Phenopacket Schema,Human Phenotype Ontology,GA4GH,Genotype-phenotype correlation,HPO
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Operating System :: OS Independent
34
+ Classifier: Development Status :: 3 - Alpha
35
+ Classifier: Programming Language :: Python :: 3.10
36
+ Classifier: Programming Language :: Python :: 3.11
37
+ Classifier: Programming Language :: Python :: 3.12
38
+ Classifier: Intended Audience :: Science/Research
39
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
40
+ Requires-Python: >=3.10
41
+ Description-Content-Type: text/markdown
42
+ License-File: LICENSE
43
+ Requires-Dist: hpo-toolkit>=0.3.0
44
+ Requires-Dist: Jinja2<4.0.0,>=3.1.4
45
+ Requires-Dist: protobuf>=3.15.0
46
+ Requires-Dist: pandas<3.0.0,>=2.0.0
47
+ Requires-Dist: phenopacket-store-toolkit>=0.1.2
48
+ Requires-Dist: requests<3.0,>=2.25.0
49
+ Requires-Dist: scipy<2.0,>=1.10
50
+ Requires-Dist: statsmodels>=0.13.0
51
+ Requires-Dist: numpy>=1.23
52
+ Requires-Dist: matplotlib<4.0,>=3.2.0
53
+ Requires-Dist: ratelimit<3,>=2.2.1
54
+ Requires-Dist: tqdm>=4.60
55
+ Provides-Extra: test
56
+ Requires-Dist: pytest<8.0.0,>=7.0.0; extra == "test"
57
+ Requires-Dist: pytest-cov; extra == "test"
58
+ Provides-Extra: docs
59
+ Requires-Dist: sphinx>=7.0.0; extra == "docs"
60
+ Requires-Dist: sphinx-rtd-theme>=1.3.0; extra == "docs"
61
+ Requires-Dist: sphinx-copybutton>=0.5.0; extra == "docs"
62
+
63
+ [![Build status](https://github.com/monarch-initiative/gpsea/workflows/CI/badge.svg)](https://github.com/monarch-initiative/gpsea/actions/workflows/python_ci.yml)
64
+ [![GitHub release](https://img.shields.io/github/release/monarch-initiative/gpsea.svg)](https://github.com/monarch-initiative/gpsea/releases)
65
+ ![PyPi downloads](https://img.shields.io/pypi/dm/gpsea.svg?label=Pypi%20downloads)
66
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/gpsea)
67
+
68
+ GPSEA is a Python library for discovery of genotype-phenotype associations.
69
+
70
+ An example of simple genotype-phenotype association analysis
71
+
72
+ ```python
73
+ # Load HPO
74
+ import hpotk
75
+
76
+ store = hpotk.configure_ontology_store()
77
+ hpo = store.load_minimal_hpo()
78
+
79
+ # Load a cohort of phenopackets
80
+ from gpsea.data import get_toy_cohort
81
+
82
+ cohort = get_toy_cohort()
83
+
84
+ # Analyze genotype-phenotype associations
85
+ from gpsea.analysis import configure_cohort_analysis
86
+ from gpsea.analysis.predicate import PatientCategories
87
+
88
+ from gpsea.model import VariantEffect
89
+
90
+ cohort_analysis = configure_cohort_analysis(cohort, hpo)
91
+ frameshift = cohort_analysis.compare_by_variant_effect(VariantEffect.FRAMESHIFT_VARIANT, tx_id='NM_1234.5')
92
+
93
+ frameshift.summarize(hpo, category=PatientCategories.YES)
94
+ ```
95
+
96
+ provides a pandas data frame with genotype-phenotype correlations:
97
+
98
+ ```text
99
+ FRAMESHIFT_VARIANT on NM_1234.5 No Yes
100
+ Count Percent Count Percent p value Corrected p value
101
+ Arachnodactyly [HP:0001166] 1/10 10% 13/16 81% 0.000781 0.020299
102
+ Abnormality of the musculature [HP:0003011] 6/6 100% 11/11 100% 1.000000 1.000000
103
+ Abnormal nervous system physiology [HP:0012638] 9/9 100% 15/15 100% 1.000000 1.000000
104
+ ... ... ... ... ... ... ...
105
+ ```
106
+
107
+ ## Documentation
108
+
109
+ Check out the User guide and the API reference for more info:
110
+
111
+ - [Stable documentation](https://monarch-initiative.github.io/gpsea/stable/) (last release on `main` branch)
112
+ - [Latest documentation](https://monarch-initiative.github.io/gpsea/latest) (bleeding edge, latest commit on `develop` branch)
gpsea-0.2.0/README.md ADDED
@@ -0,0 +1,50 @@
1
+ [![Build status](https://github.com/monarch-initiative/gpsea/workflows/CI/badge.svg)](https://github.com/monarch-initiative/gpsea/actions/workflows/python_ci.yml)
2
+ [![GitHub release](https://img.shields.io/github/release/monarch-initiative/gpsea.svg)](https://github.com/monarch-initiative/gpsea/releases)
3
+ ![PyPi downloads](https://img.shields.io/pypi/dm/gpsea.svg?label=Pypi%20downloads)
4
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/gpsea)
5
+
6
+ GPSEA is a Python library for discovery of genotype-phenotype associations.
7
+
8
+ An example of simple genotype-phenotype association analysis
9
+
10
+ ```python
11
+ # Load HPO
12
+ import hpotk
13
+
14
+ store = hpotk.configure_ontology_store()
15
+ hpo = store.load_minimal_hpo()
16
+
17
+ # Load a cohort of phenopackets
18
+ from gpsea.data import get_toy_cohort
19
+
20
+ cohort = get_toy_cohort()
21
+
22
+ # Analyze genotype-phenotype associations
23
+ from gpsea.analysis import configure_cohort_analysis
24
+ from gpsea.analysis.predicate import PatientCategories
25
+
26
+ from gpsea.model import VariantEffect
27
+
28
+ cohort_analysis = configure_cohort_analysis(cohort, hpo)
29
+ frameshift = cohort_analysis.compare_by_variant_effect(VariantEffect.FRAMESHIFT_VARIANT, tx_id='NM_1234.5')
30
+
31
+ frameshift.summarize(hpo, category=PatientCategories.YES)
32
+ ```
33
+
34
+ provides a pandas data frame with genotype-phenotype correlations:
35
+
36
+ ```text
37
+ FRAMESHIFT_VARIANT on NM_1234.5 No Yes
38
+ Count Percent Count Percent p value Corrected p value
39
+ Arachnodactyly [HP:0001166] 1/10 10% 13/16 81% 0.000781 0.020299
40
+ Abnormality of the musculature [HP:0003011] 6/6 100% 11/11 100% 1.000000 1.000000
41
+ Abnormal nervous system physiology [HP:0012638] 9/9 100% 15/15 100% 1.000000 1.000000
42
+ ... ... ... ... ... ... ...
43
+ ```
44
+
45
+ ## Documentation
46
+
47
+ Check out the User guide and the API reference for more info:
48
+
49
+ - [Stable documentation](https://monarch-initiative.github.io/gpsea/stable/) (last release on `main` branch)
50
+ - [Latest documentation](https://monarch-initiative.github.io/gpsea/latest) (bleeding edge, latest commit on `develop` branch)
@@ -0,0 +1,67 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "gpsea"
7
+ authors = [
8
+ {name = "Lauren Rekerle", email="lauren.rekerle@jax.org"},
9
+ {name = "Daniel Danis", email="daniel.danis@jax.org"},
10
+ {name = "Peter Robinson", email="peter.robinson@jax.org"},
11
+ ]
12
+ description = "Discover genotype-phenotype correlations with GA4GH phenopackets"
13
+ readme = "README.md"
14
+ requires-python = ">=3.10"
15
+ keywords = [
16
+ "Global Alliance for Genomics and Health",
17
+ "GA4GH Phenopacket Schema",
18
+ "Human Phenotype Ontology",
19
+ "GA4GH",
20
+ "Genotype-phenotype correlation",
21
+ "HPO",
22
+ ]
23
+ license = { file = "LICENSE" }
24
+ classifiers = [
25
+ "License :: OSI Approved :: MIT License",
26
+ "Operating System :: OS Independent",
27
+ "Development Status :: 3 - Alpha",
28
+ "Programming Language :: Python :: 3.10",
29
+ "Programming Language :: Python :: 3.11",
30
+ "Programming Language :: Python :: 3.12",
31
+ "Intended Audience :: Science/Research",
32
+ "Topic :: Scientific/Engineering :: Bio-Informatics"
33
+ ]
34
+ dependencies = [
35
+ "hpo-toolkit>=0.3.0",
36
+ "Jinja2>=3.1.4,<4.0.0",
37
+ "protobuf>=3.15.0",
38
+ "pandas>=2.0.0,<3.0.0",
39
+ "phenopacket-store-toolkit>=0.1.2",
40
+ "requests>=2.25.0,<3.0",
41
+ "scipy>=1.10,<2.0",
42
+ "statsmodels>=0.13.0",
43
+ "numpy>=1.23",
44
+ "matplotlib>=3.2.0,<4.0",
45
+ "ratelimit>=2.2.1,<3",
46
+ "tqdm>=4.60",
47
+ ]
48
+ dynamic = ["version"]
49
+
50
+ [project.optional-dependencies]
51
+ test = [
52
+ "pytest>=7.0.0,<8.0.0",
53
+ "pytest-cov",
54
+ ]
55
+ docs = ["sphinx>=7.0.0", "sphinx-rtd-theme>=1.3.0", "sphinx-copybutton>=0.5.0"]
56
+
57
+ [project.urls]
58
+ homepage = "https://github.com/monarch-initiative/gpsea"
59
+ repository = "https://github.com/monarch-initiative/gpsea.git"
60
+ documentation = "https://monarch-initiative.github.io/gpsea/stable"
61
+ bugtracker = "https://github.com/monarch-initiative/gpsea/issues"
62
+
63
+ [tool.setuptools]
64
+ package-dir = { "" = "src" }
65
+
66
+ [tool.setuptools.dynamic]
67
+ version = { attr = "gpsea.__version__" }
gpsea-0.2.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ """
2
+ GPSEA is a library for analyzing genotype-phenotype correlations in cohorts of rare disease patients.
3
+ """
4
+
5
+ __version__ = "0.2.0"
@@ -0,0 +1,15 @@
1
+ from ._api import CohortAnalysis, GenotypePhenotypeAnalysisResult, HpoMtcReport
2
+ # TODO This should go away
3
+ from ._config import CohortAnalysisConfiguration, configure_cohort_analysis, configure_default_protein_metadata_service, MtcStrategy
4
+ from ._gp_analysis import apply_predicates_on_patients
5
+ from ._util import prepare_hpo_terms_of_interest
6
+
7
+ __all__ = [
8
+ 'configure_cohort_analysis',
9
+ 'CohortAnalysis', 'GenotypePhenotypeAnalysisResult',
10
+ 'CohortAnalysisConfiguration', 'MtcStrategy',
11
+ 'HpoMtcReport',
12
+ 'apply_predicates_on_patients',
13
+ 'configure_default_protein_metadata_service',
14
+ 'prepare_hpo_terms_of_interest',
15
+ ]