phenosign 0.1.2__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.
- phenosign-0.1.2/LICENSE +28 -0
- phenosign-0.1.2/PKG-INFO +128 -0
- phenosign-0.1.2/README.md +59 -0
- phenosign-0.1.2/pyproject.toml +90 -0
- phenosign-0.1.2/setup.cfg +4 -0
- phenosign-0.1.2/src/phenosign/__init__.py +19 -0
- phenosign-0.1.2/src/phenosign/analysis/__init__.py +7 -0
- phenosign-0.1.2/src/phenosign/analysis/hpo_correlation_analyzer.py +658 -0
- phenosign-0.1.2/src/phenosign/analysis/synergy_analyzer.py +751 -0
- phenosign-0.1.2/src/phenosign/core/__init__.py +14 -0
- phenosign-0.1.2/src/phenosign/core/builder.py +356 -0
- phenosign-0.1.2/src/phenosign/core/dataset.py +544 -0
- phenosign-0.1.2/src/phenosign/core/features_data.py +121 -0
- phenosign-0.1.2/src/phenosign/core/predicates.py +271 -0
- phenosign-0.1.2/src/phenosign/ontology/__init__.py +5 -0
- phenosign-0.1.2/src/phenosign/ontology/_hpo_hierarchy.py +242 -0
- phenosign-0.1.2/src/phenosign/ontology/_term_manager.py +188 -0
- phenosign-0.1.2/src/phenosign/synergy_tree/__init__.py +18 -0
- phenosign-0.1.2/src/phenosign/synergy_tree/builder.py +234 -0
- phenosign-0.1.2/src/phenosign/synergy_tree/mi_calculator.py +104 -0
- phenosign-0.1.2/src/phenosign/synergy_tree/partition.py +172 -0
- phenosign-0.1.2/src/phenosign/synergy_tree/tree_node.py +80 -0
- phenosign-0.1.2/src/phenosign/synergy_tree/visualizer.py +124 -0
- phenosign-0.1.2/src/phenosign.egg-info/PKG-INFO +128 -0
- phenosign-0.1.2/src/phenosign.egg-info/SOURCES.txt +27 -0
- phenosign-0.1.2/src/phenosign.egg-info/dependency_links.txt +1 -0
- phenosign-0.1.2/src/phenosign.egg-info/not-zip-safe +1 -0
- phenosign-0.1.2/src/phenosign.egg-info/requires.txt +22 -0
- phenosign-0.1.2/src/phenosign.egg-info/top_level.txt +1 -0
phenosign-0.1.2/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024, Monarch Initiative and contributors
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
phenosign-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: phenosign
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: A Python package for synergy and correlation analysis of HPO annotations in GA4GH phenopacket cohorts
|
|
5
|
+
Author-email: Jing Chen <jing.chen@bih-charite.de>
|
|
6
|
+
Maintainer-email: Peter Robinson <peter.robinson@bih-charite.de>, Daniel Danis <daniel.danis@bih-charite.de>
|
|
7
|
+
License: BSD 3-Clause License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2024, Monarch Initiative and contributors
|
|
10
|
+
|
|
11
|
+
Redistribution and use in source and binary forms, with or without
|
|
12
|
+
modification, are permitted provided that the following conditions are met:
|
|
13
|
+
|
|
14
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
15
|
+
list of conditions and the following disclaimer.
|
|
16
|
+
|
|
17
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
18
|
+
this list of conditions and the following disclaimer in the documentation
|
|
19
|
+
and/or other materials provided with the distribution.
|
|
20
|
+
|
|
21
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
22
|
+
contributors may be used to endorse or promote products derived from
|
|
23
|
+
this software without specific prior written permission.
|
|
24
|
+
|
|
25
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
26
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
27
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
28
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
29
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
30
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
31
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
32
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
33
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
34
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
35
|
+
|
|
36
|
+
Project-URL: homepage, https://github.com/P2GX/phenosign
|
|
37
|
+
Project-URL: repository, https://github.com/P2GX/phenosign.git
|
|
38
|
+
Project-URL: documentation, https://P2GX.github.io/phenosign/
|
|
39
|
+
Project-URL: bugtracker, https://github.com/P2GX/phenosign/issues
|
|
40
|
+
Keywords: Global Alliance for Genomics and Health,GA4GH Phenopacket Schema,Human Phenotype Ontology,GA4GH,HPO
|
|
41
|
+
Classifier: Development Status :: 3 - Alpha
|
|
42
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
43
|
+
Classifier: Operating System :: OS Independent
|
|
44
|
+
Classifier: Programming Language :: Python :: 3
|
|
45
|
+
Requires-Python: >=3.10
|
|
46
|
+
Description-Content-Type: text/markdown
|
|
47
|
+
License-File: LICENSE
|
|
48
|
+
Requires-Dist: hpo-toolkit<0.6,>=0.5.0
|
|
49
|
+
Requires-Dist: phenopackets<3.0,>=2.0.2
|
|
50
|
+
Requires-Dist: scikit-learn<2.0,>=1.6.1
|
|
51
|
+
Requires-Dist: numpy<3.0,>=1.26.4
|
|
52
|
+
Requires-Dist: pandas<3.0,>=2.2.3
|
|
53
|
+
Requires-Dist: plotly<6.0,>=5.24.1
|
|
54
|
+
Requires-Dist: gpsea>=0.9.11
|
|
55
|
+
Requires-Dist: scipy<2.0,>=1.15.1
|
|
56
|
+
Requires-Dist: joblib<2.0,>=1.4.2
|
|
57
|
+
Requires-Dist: tqdm<5.0,>=4.67.1
|
|
58
|
+
Requires-Dist: statsmodels<1.0,>=0.14.4
|
|
59
|
+
Provides-Extra: test
|
|
60
|
+
Requires-Dist: pytest<8.0.0,>=7.0.0; extra == "test"
|
|
61
|
+
Provides-Extra: docs
|
|
62
|
+
Requires-Dist: mkdocs-material[imaging]<10,>=9.5.10; extra == "docs"
|
|
63
|
+
Requires-Dist: mkdocs-material-extensions<2.0,>=1.3; extra == "docs"
|
|
64
|
+
Requires-Dist: mkdocstrings[python]<1.0,>=0.22; extra == "docs"
|
|
65
|
+
Requires-Dist: mkdocs-gen-files>=0.5.0; extra == "docs"
|
|
66
|
+
Requires-Dist: pillow; extra == "docs"
|
|
67
|
+
Requires-Dist: cairosvg; extra == "docs"
|
|
68
|
+
Dynamic: license-file
|
|
69
|
+
|
|
70
|
+
# phenosign
|
|
71
|
+
|
|
72
|
+
**phenosign** is a Python library for analyzing correlations and synergy in [GA4GH Phenopacket](https://www.ga4gh.org/product/phenopackets/) cohorts.
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Installation
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pip install phenosign
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## Overview
|
|
83
|
+
|
|
84
|
+
This package enables the identification of pairwise associations and higher-order interactions between phenotypic features, helping to uncover biologically meaningful patterns in rare disease data.
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## Features
|
|
88
|
+
|
|
89
|
+
* Correlation analysis of HPO features (Phi Coefficient)
|
|
90
|
+
* Synergy analysis to detect non-additive interactions between phenotypic features with respect to a target variable (e.g., variant effects or disease)
|
|
91
|
+
* Support for GA4GH phenopacket data
|
|
92
|
+
* Structured dataset construction from phenotypic profiles
|
|
93
|
+
* Visualization utilities (e.g., correlation heatmaps)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
## Quickstart
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from pathlib import Path
|
|
100
|
+
import json
|
|
101
|
+
from phenosign import (
|
|
102
|
+
PhenotypeDatasetBuilder,
|
|
103
|
+
HPOCorrelationAnalyzer,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
# Load phenopackets
|
|
107
|
+
phenopacket_dir = Path("path/to/your/fbn1_phenopackets/")
|
|
108
|
+
|
|
109
|
+
phenopackets = []
|
|
110
|
+
for file_path in phenopacket_dir.glob("*.json"):
|
|
111
|
+
with open(file_path, "r", encoding="utf-8") as f:
|
|
112
|
+
data: str = f.read()
|
|
113
|
+
phenopacket: Phenopacket = Parse(data, Phenopacket())
|
|
114
|
+
phenopackets.append(phenopacket)
|
|
115
|
+
|
|
116
|
+
# Build dataset
|
|
117
|
+
dataset = PhenotypeDatasetBuilder(phenopackets).build()
|
|
118
|
+
|
|
119
|
+
# Run correlation analysis
|
|
120
|
+
analyzer = HPOCorrelationAnalyzer(dataset)
|
|
121
|
+
results = analyzer.compute_correlation_matrix()
|
|
122
|
+
results.result_table.head()
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
For a complete workflow and advanced options, see the documentation.
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# phenosign
|
|
2
|
+
|
|
3
|
+
**phenosign** is a Python library for analyzing correlations and synergy in [GA4GH Phenopacket](https://www.ga4gh.org/product/phenopackets/) cohorts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pip install phenosign
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This package enables the identification of pairwise associations and higher-order interactions between phenotypic features, helping to uncover biologically meaningful patterns in rare disease data.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
* Correlation analysis of HPO features (Phi Coefficient)
|
|
21
|
+
* Synergy analysis to detect non-additive interactions between phenotypic features with respect to a target variable (e.g., variant effects or disease)
|
|
22
|
+
* Support for GA4GH phenopacket data
|
|
23
|
+
* Structured dataset construction from phenotypic profiles
|
|
24
|
+
* Visualization utilities (e.g., correlation heatmaps)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Quickstart
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
from pathlib import Path
|
|
31
|
+
import json
|
|
32
|
+
from phenosign import (
|
|
33
|
+
PhenotypeDatasetBuilder,
|
|
34
|
+
HPOCorrelationAnalyzer,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# Load phenopackets
|
|
38
|
+
phenopacket_dir = Path("path/to/your/fbn1_phenopackets/")
|
|
39
|
+
|
|
40
|
+
phenopackets = []
|
|
41
|
+
for file_path in phenopacket_dir.glob("*.json"):
|
|
42
|
+
with open(file_path, "r", encoding="utf-8") as f:
|
|
43
|
+
data: str = f.read()
|
|
44
|
+
phenopacket: Phenopacket = Parse(data, Phenopacket())
|
|
45
|
+
phenopackets.append(phenopacket)
|
|
46
|
+
|
|
47
|
+
# Build dataset
|
|
48
|
+
dataset = PhenotypeDatasetBuilder(phenopackets).build()
|
|
49
|
+
|
|
50
|
+
# Run correlation analysis
|
|
51
|
+
analyzer = HPOCorrelationAnalyzer(dataset)
|
|
52
|
+
results = analyzer.compute_correlation_matrix()
|
|
53
|
+
results.result_table.head()
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For a complete workflow and advanced options, see the documentation.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# pyproject.toml
|
|
2
|
+
|
|
3
|
+
[build-system]
|
|
4
|
+
requires = ["setuptools>=65.6.3", "wheel"]
|
|
5
|
+
build-backend = "setuptools.build_meta"
|
|
6
|
+
|
|
7
|
+
[project]
|
|
8
|
+
name = "phenosign"
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
description = "A Python package for synergy and correlation analysis of HPO annotations in GA4GH phenopacket cohorts"
|
|
11
|
+
readme = { file = "README.md", content-type = "text/markdown" }
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Jing Chen", email="jing.chen@bih-charite.de"},
|
|
14
|
+
]
|
|
15
|
+
maintainers =[{name = "Peter Robinson", email="peter.robinson@bih-charite.de"},
|
|
16
|
+
{name = "Daniel Danis", email="daniel.danis@bih-charite.de"},]
|
|
17
|
+
license = { file = "LICENSE" }
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Development Status :: 3 - Alpha",
|
|
20
|
+
"License :: OSI Approved :: BSD License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
]
|
|
24
|
+
keywords = [
|
|
25
|
+
"Global Alliance for Genomics and Health",
|
|
26
|
+
"GA4GH Phenopacket Schema",
|
|
27
|
+
"Human Phenotype Ontology",
|
|
28
|
+
"GA4GH",
|
|
29
|
+
"HPO"]
|
|
30
|
+
|
|
31
|
+
# version in __init__
|
|
32
|
+
dynamic = ["version"]
|
|
33
|
+
|
|
34
|
+
dependencies = [
|
|
35
|
+
"hpo-toolkit>=0.5.0,<0.6",
|
|
36
|
+
"phenopackets>=2.0.2,<3.0",
|
|
37
|
+
"scikit-learn>=1.6.1,<2.0",
|
|
38
|
+
"numpy>=1.26.4,<3.0",
|
|
39
|
+
"pandas>=2.2.3,<3.0",
|
|
40
|
+
"plotly>=5.24.1,<6.0",
|
|
41
|
+
"gpsea>=0.9.11",
|
|
42
|
+
"scipy>=1.15.1,<2.0",
|
|
43
|
+
"joblib>=1.4.2,<2.0",
|
|
44
|
+
"tqdm>=4.67.1,<5.0",
|
|
45
|
+
"statsmodels>=0.14.4,<1.0"
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[project.optional-dependencies]
|
|
49
|
+
test = ["pytest>=7.0.0,<8.0.0"]
|
|
50
|
+
docs = [
|
|
51
|
+
'mkdocs-material[imaging]>=9.5.10,<10',
|
|
52
|
+
'mkdocs-material-extensions>=1.3,<2.0',
|
|
53
|
+
'mkdocstrings[python]>=0.22,<1.0',
|
|
54
|
+
'mkdocs-gen-files>=0.5.0',
|
|
55
|
+
'pillow',
|
|
56
|
+
'cairosvg',
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
[project.urls]
|
|
62
|
+
homepage = "https://github.com/P2GX/phenosign"
|
|
63
|
+
repository = "https://github.com/P2GX/phenosign.git"
|
|
64
|
+
documentation = "https://P2GX.github.io/phenosign/"
|
|
65
|
+
bugtracker = "https://github.com/P2GX/phenosign/issues"
|
|
66
|
+
|
|
67
|
+
[tool.setuptools]
|
|
68
|
+
package-dir = { "" = "src" }
|
|
69
|
+
zip-safe = false
|
|
70
|
+
|
|
71
|
+
[tool.setuptools.dynamic]
|
|
72
|
+
version = { attr = "phenosign.__version__" }
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
[tool.yapf]
|
|
77
|
+
blank_line_before_nested_class_or_def = true
|
|
78
|
+
column_limit = 88
|
|
79
|
+
|
|
80
|
+
[tool.pylint]
|
|
81
|
+
max-line-length = 88
|
|
82
|
+
disable = [
|
|
83
|
+
"C0103", # (invalid-name)
|
|
84
|
+
"C0114", # (missing-module-docstring)
|
|
85
|
+
"C0115", # (missing-class-docstring)
|
|
86
|
+
"C0116", # (missing-function-docstring)
|
|
87
|
+
"R0903", # (too-few-public-methods)
|
|
88
|
+
"R0913", # (too-many-arguments)
|
|
89
|
+
"W0105", # (pointless-string-statement)
|
|
90
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from .analysis import HPOCorrelationAnalyzer, SynergyAnalyzer
|
|
2
|
+
from .core import has_disease, has_gene, has_sex, has_variant_effect, has_exon_and_variant_effect, PhenotypeDatasetBuilder
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
__version__ = "0.1.2"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"PhenotypeDatasetBuilder",
|
|
11
|
+
"HPOCorrelationAnalyzer",
|
|
12
|
+
"SynergyAnalyzer",
|
|
13
|
+
"has_disease",
|
|
14
|
+
"has_gene",
|
|
15
|
+
"has_sex",
|
|
16
|
+
"has_variant_effect",
|
|
17
|
+
"has_exon_and_variant_effect"
|
|
18
|
+
|
|
19
|
+
]
|