risk-network 0.0.14b3__tar.gz → 0.0.15__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.
- risk_network-0.0.15/PKG-INFO +109 -0
- risk_network-0.0.15/README.md +68 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/pyproject.toml +2 -2
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/__init__.py +1 -1
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_neighborhoods/_api.py +1 -95
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_neighborhoods/_stats/__init__.py +0 -2
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_neighborhoods/_stats/_tests.py +1 -105
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_graph/_summary.py +2 -2
- risk_network-0.0.15/src/risk_network.egg-info/PKG-INFO +109 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/tests/test_load_neighborhoods.py +0 -52
- {risk_network-0.0.14b3 → risk_network-0.0.15}/tests/test_load_plotter.py +2 -1
- risk_network-0.0.14b3/PKG-INFO +0 -125
- risk_network-0.0.14b3/README.md +0 -84
- risk_network-0.0.14b3/src/risk_network.egg-info/PKG-INFO +0 -125
- {risk_network-0.0.14b3 → risk_network-0.0.15}/LICENSE +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/setup.cfg +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_annotation/__init__.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_annotation/_annotation.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_annotation/_io.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_annotation/_nltk_setup.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_log/__init__.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_log/_console.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_log/_parameters.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_neighborhoods/__init__.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_neighborhoods/_community.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_neighborhoods/_domains.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_neighborhoods/_neighborhoods.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_neighborhoods/_stats/_permutation/__init__.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_neighborhoods/_stats/_permutation/_permutation.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_neighborhoods/_stats/_permutation/_test_functions.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/__init__.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_graph/__init__.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_graph/_api.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_graph/_graph.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_graph/_stats.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_io.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_plotter/__init__.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_plotter/_api.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_plotter/_canvas.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_plotter/_contour.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_plotter/_labels.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_plotter/_network.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_plotter/_plotter.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_plotter/_utils/__init__.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_plotter/_utils/_colors.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_network/_plotter/_utils/_layout.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk/_risk.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk_network.egg-info/SOURCES.txt +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk_network.egg-info/dependency_links.txt +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk_network.egg-info/requires.txt +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk_network.egg-info/top_level.txt +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/tests/test_load_annotation.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/tests/test_load_graph.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/tests/test_load_io_combinations.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/tests/test_load_network.py +0 -0
- {risk_network-0.0.14b3 → risk_network-0.0.15}/tests/test_log.py +0 -0
@@ -0,0 +1,109 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: risk-network
|
3
|
+
Version: 0.0.15
|
4
|
+
Summary: A Python package for scalable network analysis and high-quality visualization.
|
5
|
+
Author-email: Ira Horecka <ira89@icloud.com>
|
6
|
+
License: GPL-3.0-or-later
|
7
|
+
Project-URL: Homepage, https://github.com/riskportal/risk
|
8
|
+
Project-URL: Issues, https://github.com/riskportal/risk/issues
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
10
|
+
Classifier: Intended Audience :: Developers
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
12
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
13
|
+
Classifier: Operating System :: OS Independent
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
21
|
+
Requires-Python: >=3.8
|
22
|
+
Description-Content-Type: text/markdown
|
23
|
+
License-File: LICENSE
|
24
|
+
Requires-Dist: ipywidgets
|
25
|
+
Requires-Dist: leidenalg
|
26
|
+
Requires-Dist: markov_clustering
|
27
|
+
Requires-Dist: matplotlib
|
28
|
+
Requires-Dist: networkx
|
29
|
+
Requires-Dist: nltk
|
30
|
+
Requires-Dist: numpy
|
31
|
+
Requires-Dist: openpyxl
|
32
|
+
Requires-Dist: pandas
|
33
|
+
Requires-Dist: python-igraph
|
34
|
+
Requires-Dist: python-louvain
|
35
|
+
Requires-Dist: scikit-learn
|
36
|
+
Requires-Dist: scipy
|
37
|
+
Requires-Dist: statsmodels
|
38
|
+
Requires-Dist: threadpoolctl
|
39
|
+
Requires-Dist: tqdm
|
40
|
+
Dynamic: license-file
|
41
|
+
|
42
|
+
# RISK
|
43
|
+
|
44
|
+

|
45
|
+
[](https://pypi.python.org/pypi/risk-network)
|
46
|
+

|
47
|
+
[](https://doi.org/10.5281/zenodo.xxxxxxx)
|
48
|
+

|
49
|
+

|
50
|
+
|
51
|
+
**RISK** (Regional Inference of Significant Kinships) is a next-generation tool for biological network annotation and visualization. It integrates community detection algorithms, rigorous overrepresentation analysis, and a modular framework for diverse network types. RISK identifies biologically coherent relationships within networks and generates publication-ready visualizations, making it a useful tool for biological and interdisciplinary network analysis.
|
52
|
+
|
53
|
+
For a full description of RISK and its applications, see:
|
54
|
+
<br>
|
55
|
+
**Horecka and Röst (2025)**, _"RISK: a next-generation tool for biological network annotation and visualization"_.
|
56
|
+
<br>
|
57
|
+
DOI: [10.5281/zenodo.xxxxxxx](https://doi.org/10.5281/zenodo.xxxxxxx)
|
58
|
+
|
59
|
+
## Documentation and Tutorial
|
60
|
+
|
61
|
+
Full documentation is available at:
|
62
|
+
|
63
|
+
- **Docs:** [https://riskportal.github.io/risk-docs](https://riskportal.github.io/risk-docs)
|
64
|
+
- **Tutorial Jupyter Notebook Repository:** [https://github.com/riskportal/risk-docs](https://github.com/riskportal/risk-docs)
|
65
|
+
|
66
|
+
## Installation
|
67
|
+
|
68
|
+
RISK is compatible with Python 3.8 or later and runs on all major operating systems. To install the latest version of RISK, run:
|
69
|
+
|
70
|
+
```bash
|
71
|
+
pip install risk-network --upgrade
|
72
|
+
```
|
73
|
+
|
74
|
+
## Key Features of RISK
|
75
|
+
|
76
|
+
- **Broad Data Compatibility**: Accepts multiple network formats (Cytoscape, Cytoscape JSON, GPickle, NetworkX) and user-provided annotations formatted as term–to–gene membership tables (JSON, CSV, TSV, Excel, Python dictionaries).
|
77
|
+
- **Flexible Clustering**: Offers Louvain, Leiden, Markov Clustering, Greedy Modularity, Label Propagation, Spinglass, and Walktrap, with user-defined resolution parameters to detect both coarse and fine-grained modules.
|
78
|
+
- **Statistical Testing**: Provides permutation, hypergeometric, chi-squared, and binomial tests, balancing statistical rigor with speed.
|
79
|
+
- **High-Resolution Visualization**: Generates publication-ready figures with customizable node/edge properties, contour overlays, and export to SVG, PNG, or PDF.
|
80
|
+
|
81
|
+
## Example Usage
|
82
|
+
|
83
|
+
We applied RISK to a _Saccharomyces cerevisiae_ protein–protein interaction (PPI) network (Michaelis _et al_., 2023; 3,839 proteins, 30,955 interactions). RISK identified compact, functional modules overrepresented in Gene Ontology Biological Process (GO BP) terms (Ashburner _et al_., 2000), revealing biological organization including ribosomal assembly, mitochondrial organization, and RNA polymerase activity (P < 0.0001).
|
84
|
+
|
85
|
+
[](https://i.imgur.com/fSNf5Ad.jpeg)
|
86
|
+
**RISK workflow overview and analysis of the yeast PPI network**. GO BP terms are color-coded to represent key cellular processes—including ribosomal assembly, mitochondrial organization, and RNA polymerase activity (P < 0.0001).
|
87
|
+
|
88
|
+
## Citation
|
89
|
+
|
90
|
+
If you use RISK in your research, please cite the following:
|
91
|
+
|
92
|
+
**Horecka and Röst (2025)**, _"RISK: a next-generation tool for biological network annotation and visualization"_.
|
93
|
+
<br>
|
94
|
+
DOI: [10.5281/zenodo.xxxxxxx](https://doi.org/10.5281/zenodo.xxxxxxx)
|
95
|
+
|
96
|
+
## Contributing
|
97
|
+
|
98
|
+
We welcome contributions from the community:
|
99
|
+
|
100
|
+
- [Issues Tracker](https://github.com/riskportal/risk/issues)
|
101
|
+
- [Source Code](https://github.com/riskportal/risk/tree/main/risk)
|
102
|
+
|
103
|
+
## Support
|
104
|
+
|
105
|
+
If you encounter issues or have suggestions for new features, please use the [Issues Tracker](https://github.com/riskportal/risk/issues) on GitHub.
|
106
|
+
|
107
|
+
## License
|
108
|
+
|
109
|
+
RISK is open source under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# RISK
|
2
|
+
|
3
|
+

|
4
|
+
[](https://pypi.python.org/pypi/risk-network)
|
5
|
+

|
6
|
+
[](https://doi.org/10.5281/zenodo.xxxxxxx)
|
7
|
+

|
8
|
+

|
9
|
+
|
10
|
+
**RISK** (Regional Inference of Significant Kinships) is a next-generation tool for biological network annotation and visualization. It integrates community detection algorithms, rigorous overrepresentation analysis, and a modular framework for diverse network types. RISK identifies biologically coherent relationships within networks and generates publication-ready visualizations, making it a useful tool for biological and interdisciplinary network analysis.
|
11
|
+
|
12
|
+
For a full description of RISK and its applications, see:
|
13
|
+
<br>
|
14
|
+
**Horecka and Röst (2025)**, _"RISK: a next-generation tool for biological network annotation and visualization"_.
|
15
|
+
<br>
|
16
|
+
DOI: [10.5281/zenodo.xxxxxxx](https://doi.org/10.5281/zenodo.xxxxxxx)
|
17
|
+
|
18
|
+
## Documentation and Tutorial
|
19
|
+
|
20
|
+
Full documentation is available at:
|
21
|
+
|
22
|
+
- **Docs:** [https://riskportal.github.io/risk-docs](https://riskportal.github.io/risk-docs)
|
23
|
+
- **Tutorial Jupyter Notebook Repository:** [https://github.com/riskportal/risk-docs](https://github.com/riskportal/risk-docs)
|
24
|
+
|
25
|
+
## Installation
|
26
|
+
|
27
|
+
RISK is compatible with Python 3.8 or later and runs on all major operating systems. To install the latest version of RISK, run:
|
28
|
+
|
29
|
+
```bash
|
30
|
+
pip install risk-network --upgrade
|
31
|
+
```
|
32
|
+
|
33
|
+
## Key Features of RISK
|
34
|
+
|
35
|
+
- **Broad Data Compatibility**: Accepts multiple network formats (Cytoscape, Cytoscape JSON, GPickle, NetworkX) and user-provided annotations formatted as term–to–gene membership tables (JSON, CSV, TSV, Excel, Python dictionaries).
|
36
|
+
- **Flexible Clustering**: Offers Louvain, Leiden, Markov Clustering, Greedy Modularity, Label Propagation, Spinglass, and Walktrap, with user-defined resolution parameters to detect both coarse and fine-grained modules.
|
37
|
+
- **Statistical Testing**: Provides permutation, hypergeometric, chi-squared, and binomial tests, balancing statistical rigor with speed.
|
38
|
+
- **High-Resolution Visualization**: Generates publication-ready figures with customizable node/edge properties, contour overlays, and export to SVG, PNG, or PDF.
|
39
|
+
|
40
|
+
## Example Usage
|
41
|
+
|
42
|
+
We applied RISK to a _Saccharomyces cerevisiae_ protein–protein interaction (PPI) network (Michaelis _et al_., 2023; 3,839 proteins, 30,955 interactions). RISK identified compact, functional modules overrepresented in Gene Ontology Biological Process (GO BP) terms (Ashburner _et al_., 2000), revealing biological organization including ribosomal assembly, mitochondrial organization, and RNA polymerase activity (P < 0.0001).
|
43
|
+
|
44
|
+
[](https://i.imgur.com/fSNf5Ad.jpeg)
|
45
|
+
**RISK workflow overview and analysis of the yeast PPI network**. GO BP terms are color-coded to represent key cellular processes—including ribosomal assembly, mitochondrial organization, and RNA polymerase activity (P < 0.0001).
|
46
|
+
|
47
|
+
## Citation
|
48
|
+
|
49
|
+
If you use RISK in your research, please cite the following:
|
50
|
+
|
51
|
+
**Horecka and Röst (2025)**, _"RISK: a next-generation tool for biological network annotation and visualization"_.
|
52
|
+
<br>
|
53
|
+
DOI: [10.5281/zenodo.xxxxxxx](https://doi.org/10.5281/zenodo.xxxxxxx)
|
54
|
+
|
55
|
+
## Contributing
|
56
|
+
|
57
|
+
We welcome contributions from the community:
|
58
|
+
|
59
|
+
- [Issues Tracker](https://github.com/riskportal/risk/issues)
|
60
|
+
- [Source Code](https://github.com/riskportal/risk/tree/main/risk)
|
61
|
+
|
62
|
+
## Support
|
63
|
+
|
64
|
+
If you encounter issues or have suggestions for new features, please use the [Issues Tracker](https://github.com/riskportal/risk/issues) on GitHub.
|
65
|
+
|
66
|
+
## License
|
67
|
+
|
68
|
+
RISK is open source under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).
|
@@ -48,8 +48,8 @@ dependencies = [
|
|
48
48
|
text = "GPL-3.0-or-later"
|
49
49
|
|
50
50
|
[project.urls]
|
51
|
-
Homepage = "https://github.com/riskportal/
|
52
|
-
Issues = "https://github.com/riskportal/
|
51
|
+
Homepage = "https://github.com/riskportal/risk"
|
52
|
+
Issues = "https://github.com/riskportal/risk/issues"
|
53
53
|
|
54
54
|
[tool.setuptools]
|
55
55
|
package-dir = {"" = "src"}
|
@@ -17,8 +17,6 @@ from ._stats import (
|
|
17
17
|
compute_chi2_test,
|
18
18
|
compute_hypergeom_test,
|
19
19
|
compute_permutation_test,
|
20
|
-
compute_poisson_test,
|
21
|
-
compute_zscore_test,
|
22
20
|
)
|
23
21
|
|
24
22
|
|
@@ -226,98 +224,6 @@ class NeighborhoodsAPI:
|
|
226
224
|
max_workers=max_workers,
|
227
225
|
)
|
228
226
|
|
229
|
-
def load_neighborhoods_poisson(
|
230
|
-
self,
|
231
|
-
network: nx.Graph,
|
232
|
-
annotation: Dict[str, Any],
|
233
|
-
distance_metric: Union[str, List, Tuple, np.ndarray] = "louvain",
|
234
|
-
louvain_resolution: float = 0.1,
|
235
|
-
leiden_resolution: float = 1.0,
|
236
|
-
fraction_shortest_edges: Union[float, List, Tuple, np.ndarray] = 0.5,
|
237
|
-
null_distribution: str = "network",
|
238
|
-
random_seed: int = 888,
|
239
|
-
) -> Dict[str, Any]:
|
240
|
-
"""
|
241
|
-
Load significant neighborhoods for the network using the Poisson test.
|
242
|
-
|
243
|
-
Args:
|
244
|
-
network (nx.Graph): The network graph.
|
245
|
-
annotation (Dict[str, Any]): The annotation associated with the network.
|
246
|
-
distance_metric (str, List, Tuple, or np.ndarray, optional): The distance metric(s) to use. Can be a string for one
|
247
|
-
metric or a list/tuple/ndarray of metrics ('greedy_modularity', 'louvain', 'leiden', 'label_propagation',
|
248
|
-
'markov_clustering', 'walktrap', 'spinglass'). Defaults to 'louvain'.
|
249
|
-
louvain_resolution (float, optional): Resolution parameter for Louvain clustering. Defaults to 0.1.
|
250
|
-
leiden_resolution (float, optional): Resolution parameter for Leiden clustering. Defaults to 1.0.
|
251
|
-
fraction_shortest_edges (float, List, Tuple, or np.ndarray, optional): Shortest edge rank fraction threshold(s) for creating subgraphs.
|
252
|
-
Can be a single float for one threshold or a list/tuple of floats corresponding to multiple thresholds.
|
253
|
-
Defaults to 0.5.
|
254
|
-
null_distribution (str, optional): Type of null distribution ('network' or 'annotation'). Defaults to "network".
|
255
|
-
random_seed (int, optional): Seed for random number generation. Defaults to 888.
|
256
|
-
|
257
|
-
Returns:
|
258
|
-
Dict[str, Any]: Computed significance of neighborhoods.
|
259
|
-
"""
|
260
|
-
log_header("Running Poisson test")
|
261
|
-
# Compute neighborhood significance using the Poisson test
|
262
|
-
return self._load_neighborhoods_by_statistical_test(
|
263
|
-
network=network,
|
264
|
-
annotation=annotation,
|
265
|
-
distance_metric=distance_metric,
|
266
|
-
louvain_resolution=louvain_resolution,
|
267
|
-
leiden_resolution=leiden_resolution,
|
268
|
-
fraction_shortest_edges=fraction_shortest_edges,
|
269
|
-
null_distribution=null_distribution,
|
270
|
-
random_seed=random_seed,
|
271
|
-
statistical_test_key="poisson",
|
272
|
-
statistical_test_function=compute_poisson_test,
|
273
|
-
)
|
274
|
-
|
275
|
-
def load_neighborhoods_zscore(
|
276
|
-
self,
|
277
|
-
network: nx.Graph,
|
278
|
-
annotation: Dict[str, Any],
|
279
|
-
distance_metric: Union[str, List, Tuple, np.ndarray] = "louvain",
|
280
|
-
louvain_resolution: float = 0.1,
|
281
|
-
leiden_resolution: float = 1.0,
|
282
|
-
fraction_shortest_edges: Union[float, List, Tuple, np.ndarray] = 0.5,
|
283
|
-
null_distribution: str = "network",
|
284
|
-
random_seed: int = 888,
|
285
|
-
) -> Dict[str, Any]:
|
286
|
-
"""
|
287
|
-
Load significant neighborhoods for the network using the z-score test.
|
288
|
-
|
289
|
-
Args:
|
290
|
-
network (nx.Graph): The network graph.
|
291
|
-
annotation (Dict[str, Any]): The annotation associated with the network.
|
292
|
-
distance_metric (str, List, Tuple, or np.ndarray, optional): The distance metric(s) to use. Can be a string for one
|
293
|
-
metric or a list/tuple/ndarray of metrics ('greedy_modularity', 'louvain', 'leiden', 'label_propagation',
|
294
|
-
'markov_clustering', 'walktrap', 'spinglass'). Defaults to 'louvain'.
|
295
|
-
louvain_resolution (float, optional): Resolution parameter for Louvain clustering. Defaults to 0.1.
|
296
|
-
leiden_resolution (float, optional): Resolution parameter for Leiden clustering. Defaults to 1.0.
|
297
|
-
fraction_shortest_edges (float, List, Tuple, or np.ndarray, optional): Shortest edge rank fraction threshold(s) for creating subgraphs.
|
298
|
-
Can be a single float for one threshold or a list/tuple of floats corresponding to multiple thresholds.
|
299
|
-
Defaults to 0.5.
|
300
|
-
null_distribution (str, optional): Type of null distribution ('network' or 'annotation'). Defaults to "network".
|
301
|
-
random_seed (int, optional): Seed for random number generation. Defaults to 888.
|
302
|
-
|
303
|
-
Returns:
|
304
|
-
Dict[str, Any]: Computed significance of neighborhoods.
|
305
|
-
"""
|
306
|
-
log_header("Running z-score test")
|
307
|
-
# Compute neighborhood significance using the z-score test
|
308
|
-
return self._load_neighborhoods_by_statistical_test(
|
309
|
-
network=network,
|
310
|
-
annotation=annotation,
|
311
|
-
distance_metric=distance_metric,
|
312
|
-
louvain_resolution=louvain_resolution,
|
313
|
-
leiden_resolution=leiden_resolution,
|
314
|
-
fraction_shortest_edges=fraction_shortest_edges,
|
315
|
-
null_distribution=null_distribution,
|
316
|
-
random_seed=random_seed,
|
317
|
-
statistical_test_key="zscore",
|
318
|
-
statistical_test_function=compute_zscore_test,
|
319
|
-
)
|
320
|
-
|
321
227
|
def _load_neighborhoods_by_statistical_test(
|
322
228
|
self,
|
323
229
|
network: nx.Graph,
|
@@ -348,7 +254,7 @@ class NeighborhoodsAPI:
|
|
348
254
|
null_distribution (str, optional): The type of null distribution to use ('network' or 'annotation').
|
349
255
|
Defaults to "network".
|
350
256
|
random_seed (int, optional): Seed for random number generation to ensure reproducibility. Defaults to 888.
|
351
|
-
statistical_test_key (str, optional): Key or name of the statistical test to be applied (e.g., "hypergeom", "
|
257
|
+
statistical_test_key (str, optional): Key or name of the statistical test to be applied (e.g., "hypergeom", "binom").
|
352
258
|
Used for logging and debugging. Defaults to "hypergeom".
|
353
259
|
statistical_test_function (Any, optional): The function implementing the statistical test.
|
354
260
|
It should accept neighborhoods, annotation, null distribution, and additional kwargs.
|
@@ -7,7 +7,7 @@ from typing import Any, Dict
|
|
7
7
|
|
8
8
|
import numpy as np
|
9
9
|
from scipy.sparse import csr_matrix
|
10
|
-
from scipy.stats import binom, chi2, hypergeom, norm
|
10
|
+
from scipy.stats import binom, chi2, hypergeom, norm
|
11
11
|
|
12
12
|
|
13
13
|
def compute_binom_test(
|
@@ -174,107 +174,3 @@ def compute_hypergeom_test(
|
|
174
174
|
)
|
175
175
|
|
176
176
|
return {"depletion_pvals": depletion_pvals, "enrichment_pvals": enrichment_pvals}
|
177
|
-
|
178
|
-
|
179
|
-
def compute_poisson_test(
|
180
|
-
neighborhoods: csr_matrix,
|
181
|
-
annotation: csr_matrix,
|
182
|
-
null_distribution: str = "network",
|
183
|
-
) -> Dict[str, Any]:
|
184
|
-
"""
|
185
|
-
Compute Poisson test for enrichment and depletion in neighborhoods with selectable null distribution.
|
186
|
-
|
187
|
-
Args:
|
188
|
-
neighborhoods (csr_matrix): Sparse binary matrix representing neighborhoods.
|
189
|
-
annotation (csr_matrix): Sparse binary matrix representing annotation.
|
190
|
-
null_distribution (str, optional): Type of null distribution ('network' or 'annotation'). Defaults to "network".
|
191
|
-
|
192
|
-
Returns:
|
193
|
-
Dict[str, Any]: Dictionary containing depletion and enrichment p-values.
|
194
|
-
|
195
|
-
Raises:
|
196
|
-
ValueError: If an invalid null_distribution value is provided.
|
197
|
-
"""
|
198
|
-
# Matrix multiplication to get the number of annotated nodes in each neighborhood
|
199
|
-
annotated_in_neighborhood = neighborhoods @ annotation # Sparse result
|
200
|
-
# Convert annotated counts to dense for downstream calculations
|
201
|
-
annotated_in_neighborhood_dense = annotated_in_neighborhood.toarray()
|
202
|
-
|
203
|
-
# Compute lambda_expected based on the chosen null distribution
|
204
|
-
if null_distribution == "network":
|
205
|
-
# Use the mean across neighborhoods (axis=1)
|
206
|
-
lambda_expected = np.mean(annotated_in_neighborhood_dense, axis=1, keepdims=True)
|
207
|
-
elif null_distribution == "annotation":
|
208
|
-
# Use the mean across annotations (axis=0)
|
209
|
-
lambda_expected = np.mean(annotated_in_neighborhood_dense, axis=0, keepdims=True)
|
210
|
-
else:
|
211
|
-
raise ValueError(
|
212
|
-
"Invalid null_distribution value. Choose either 'network' or 'annotation'."
|
213
|
-
)
|
214
|
-
|
215
|
-
# Compute p-values for enrichment and depletion using Poisson distribution
|
216
|
-
enrichment_pvals = 1 - poisson.cdf(annotated_in_neighborhood_dense - 1, lambda_expected)
|
217
|
-
depletion_pvals = poisson.cdf(annotated_in_neighborhood_dense, lambda_expected)
|
218
|
-
|
219
|
-
return {"enrichment_pvals": enrichment_pvals, "depletion_pvals": depletion_pvals}
|
220
|
-
|
221
|
-
|
222
|
-
def compute_zscore_test(
|
223
|
-
neighborhoods: csr_matrix,
|
224
|
-
annotation: csr_matrix,
|
225
|
-
null_distribution: str = "network",
|
226
|
-
) -> Dict[str, Any]:
|
227
|
-
"""
|
228
|
-
Compute z-score test for enrichment and depletion in neighborhoods with selectable null distribution.
|
229
|
-
|
230
|
-
Args:
|
231
|
-
neighborhoods (csr_matrix): Sparse binary matrix representing neighborhoods.
|
232
|
-
annotation (csr_matrix): Sparse binary matrix representing annotation.
|
233
|
-
null_distribution (str, optional): Type of null distribution ('network' or 'annotation'). Defaults to "network".
|
234
|
-
|
235
|
-
Returns:
|
236
|
-
Dict[str, Any]: Dictionary containing depletion and enrichment p-values.
|
237
|
-
|
238
|
-
Raises:
|
239
|
-
ValueError: If an invalid null_distribution value is provided.
|
240
|
-
"""
|
241
|
-
# Total number of nodes in the network
|
242
|
-
total_node_count = neighborhoods.shape[1]
|
243
|
-
|
244
|
-
# Compute sums
|
245
|
-
if null_distribution == "network":
|
246
|
-
background_population = total_node_count
|
247
|
-
neighborhood_sums = neighborhoods.sum(axis=0).A.flatten() # Dense column sums
|
248
|
-
annotation_sums = annotation.sum(axis=0).A.flatten() # Dense row sums
|
249
|
-
elif null_distribution == "annotation":
|
250
|
-
annotated_nodes = annotation.sum(axis=1).A.flatten() > 0 # Dense boolean mask
|
251
|
-
background_population = annotated_nodes.sum()
|
252
|
-
neighborhood_sums = neighborhoods[annotated_nodes].sum(axis=0).A.flatten()
|
253
|
-
annotation_sums = annotation[annotated_nodes].sum(axis=0).A.flatten()
|
254
|
-
else:
|
255
|
-
raise ValueError(
|
256
|
-
"Invalid null_distribution value. Choose either 'network' or 'annotation'."
|
257
|
-
)
|
258
|
-
|
259
|
-
# Observed values
|
260
|
-
observed = (neighborhoods.T @ annotation).toarray() # Convert sparse result to dense
|
261
|
-
# Expected values under the null
|
262
|
-
neighborhood_sums = neighborhood_sums.reshape(-1, 1) # Ensure correct shape
|
263
|
-
annotation_sums = annotation_sums.reshape(1, -1) # Ensure correct shape
|
264
|
-
expected = (neighborhood_sums @ annotation_sums) / background_population
|
265
|
-
|
266
|
-
# Standard deviation under the null
|
267
|
-
std_dev = np.sqrt(
|
268
|
-
expected
|
269
|
-
* (1 - annotation_sums / background_population)
|
270
|
-
* (1 - neighborhood_sums / background_population)
|
271
|
-
)
|
272
|
-
std_dev[std_dev == 0] = np.nan # Avoid division by zero
|
273
|
-
# Compute z-scores
|
274
|
-
z_scores = (observed - expected) / std_dev
|
275
|
-
|
276
|
-
# Convert z-scores to depletion and enrichment p-values
|
277
|
-
enrichment_pvals = norm.sf(z_scores) # Upper tail
|
278
|
-
depletion_pvals = norm.cdf(z_scores) # Lower tail
|
279
|
-
|
280
|
-
return {"depletion_pvals": depletion_pvals, "enrichment_pvals": enrichment_pvals}
|
@@ -134,6 +134,8 @@ class Summary:
|
|
134
134
|
lambda x: len(x.split(";")) if x else 0
|
135
135
|
)
|
136
136
|
|
137
|
+
# Drop the "Summed Significance Score" column before reordering and returning
|
138
|
+
results = results.drop(columns=["Summed Significance Score"])
|
137
139
|
# Reorder columns and drop rows with NaN values
|
138
140
|
results = (
|
139
141
|
results[
|
@@ -142,7 +144,6 @@ class Summary:
|
|
142
144
|
"Annotation",
|
143
145
|
"Matched Members",
|
144
146
|
"Matched Count",
|
145
|
-
"Summed Significance Score",
|
146
147
|
"Enrichment P-value",
|
147
148
|
"Enrichment Q-value",
|
148
149
|
"Depletion P-value",
|
@@ -161,7 +162,6 @@ class Summary:
|
|
161
162
|
"Domain ID": -1,
|
162
163
|
"Matched Members": "",
|
163
164
|
"Matched Count": 0,
|
164
|
-
"Summed Significance Score": 0.0,
|
165
165
|
"Enrichment P-value": 1.0,
|
166
166
|
"Enrichment Q-value": 1.0,
|
167
167
|
"Depletion P-value": 1.0,
|
@@ -0,0 +1,109 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: risk-network
|
3
|
+
Version: 0.0.15
|
4
|
+
Summary: A Python package for scalable network analysis and high-quality visualization.
|
5
|
+
Author-email: Ira Horecka <ira89@icloud.com>
|
6
|
+
License: GPL-3.0-or-later
|
7
|
+
Project-URL: Homepage, https://github.com/riskportal/risk
|
8
|
+
Project-URL: Issues, https://github.com/riskportal/risk/issues
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
10
|
+
Classifier: Intended Audience :: Developers
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
12
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
13
|
+
Classifier: Operating System :: OS Independent
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
21
|
+
Requires-Python: >=3.8
|
22
|
+
Description-Content-Type: text/markdown
|
23
|
+
License-File: LICENSE
|
24
|
+
Requires-Dist: ipywidgets
|
25
|
+
Requires-Dist: leidenalg
|
26
|
+
Requires-Dist: markov_clustering
|
27
|
+
Requires-Dist: matplotlib
|
28
|
+
Requires-Dist: networkx
|
29
|
+
Requires-Dist: nltk
|
30
|
+
Requires-Dist: numpy
|
31
|
+
Requires-Dist: openpyxl
|
32
|
+
Requires-Dist: pandas
|
33
|
+
Requires-Dist: python-igraph
|
34
|
+
Requires-Dist: python-louvain
|
35
|
+
Requires-Dist: scikit-learn
|
36
|
+
Requires-Dist: scipy
|
37
|
+
Requires-Dist: statsmodels
|
38
|
+
Requires-Dist: threadpoolctl
|
39
|
+
Requires-Dist: tqdm
|
40
|
+
Dynamic: license-file
|
41
|
+
|
42
|
+
# RISK
|
43
|
+
|
44
|
+

|
45
|
+
[](https://pypi.python.org/pypi/risk-network)
|
46
|
+

|
47
|
+
[](https://doi.org/10.5281/zenodo.xxxxxxx)
|
48
|
+

|
49
|
+

|
50
|
+
|
51
|
+
**RISK** (Regional Inference of Significant Kinships) is a next-generation tool for biological network annotation and visualization. It integrates community detection algorithms, rigorous overrepresentation analysis, and a modular framework for diverse network types. RISK identifies biologically coherent relationships within networks and generates publication-ready visualizations, making it a useful tool for biological and interdisciplinary network analysis.
|
52
|
+
|
53
|
+
For a full description of RISK and its applications, see:
|
54
|
+
<br>
|
55
|
+
**Horecka and Röst (2025)**, _"RISK: a next-generation tool for biological network annotation and visualization"_.
|
56
|
+
<br>
|
57
|
+
DOI: [10.5281/zenodo.xxxxxxx](https://doi.org/10.5281/zenodo.xxxxxxx)
|
58
|
+
|
59
|
+
## Documentation and Tutorial
|
60
|
+
|
61
|
+
Full documentation is available at:
|
62
|
+
|
63
|
+
- **Docs:** [https://riskportal.github.io/risk-docs](https://riskportal.github.io/risk-docs)
|
64
|
+
- **Tutorial Jupyter Notebook Repository:** [https://github.com/riskportal/risk-docs](https://github.com/riskportal/risk-docs)
|
65
|
+
|
66
|
+
## Installation
|
67
|
+
|
68
|
+
RISK is compatible with Python 3.8 or later and runs on all major operating systems. To install the latest version of RISK, run:
|
69
|
+
|
70
|
+
```bash
|
71
|
+
pip install risk-network --upgrade
|
72
|
+
```
|
73
|
+
|
74
|
+
## Key Features of RISK
|
75
|
+
|
76
|
+
- **Broad Data Compatibility**: Accepts multiple network formats (Cytoscape, Cytoscape JSON, GPickle, NetworkX) and user-provided annotations formatted as term–to–gene membership tables (JSON, CSV, TSV, Excel, Python dictionaries).
|
77
|
+
- **Flexible Clustering**: Offers Louvain, Leiden, Markov Clustering, Greedy Modularity, Label Propagation, Spinglass, and Walktrap, with user-defined resolution parameters to detect both coarse and fine-grained modules.
|
78
|
+
- **Statistical Testing**: Provides permutation, hypergeometric, chi-squared, and binomial tests, balancing statistical rigor with speed.
|
79
|
+
- **High-Resolution Visualization**: Generates publication-ready figures with customizable node/edge properties, contour overlays, and export to SVG, PNG, or PDF.
|
80
|
+
|
81
|
+
## Example Usage
|
82
|
+
|
83
|
+
We applied RISK to a _Saccharomyces cerevisiae_ protein–protein interaction (PPI) network (Michaelis _et al_., 2023; 3,839 proteins, 30,955 interactions). RISK identified compact, functional modules overrepresented in Gene Ontology Biological Process (GO BP) terms (Ashburner _et al_., 2000), revealing biological organization including ribosomal assembly, mitochondrial organization, and RNA polymerase activity (P < 0.0001).
|
84
|
+
|
85
|
+
[](https://i.imgur.com/fSNf5Ad.jpeg)
|
86
|
+
**RISK workflow overview and analysis of the yeast PPI network**. GO BP terms are color-coded to represent key cellular processes—including ribosomal assembly, mitochondrial organization, and RNA polymerase activity (P < 0.0001).
|
87
|
+
|
88
|
+
## Citation
|
89
|
+
|
90
|
+
If you use RISK in your research, please cite the following:
|
91
|
+
|
92
|
+
**Horecka and Röst (2025)**, _"RISK: a next-generation tool for biological network annotation and visualization"_.
|
93
|
+
<br>
|
94
|
+
DOI: [10.5281/zenodo.xxxxxxx](https://doi.org/10.5281/zenodo.xxxxxxx)
|
95
|
+
|
96
|
+
## Contributing
|
97
|
+
|
98
|
+
We welcome contributions from the community:
|
99
|
+
|
100
|
+
- [Issues Tracker](https://github.com/riskportal/risk/issues)
|
101
|
+
- [Source Code](https://github.com/riskportal/risk/tree/main/risk)
|
102
|
+
|
103
|
+
## Support
|
104
|
+
|
105
|
+
If you encounter issues or have suggestions for new features, please use the [Issues Tracker](https://github.com/riskportal/risk/issues) on GitHub.
|
106
|
+
|
107
|
+
## License
|
108
|
+
|
109
|
+
RISK is open source under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).
|
@@ -145,58 +145,6 @@ def test_load_neighborhoods_permutation_multi_process(risk_obj, cytoscape_networ
|
|
145
145
|
assert len(neighborhoods) > 0 # Ensure neighborhoods are loaded
|
146
146
|
|
147
147
|
|
148
|
-
@pytest.mark.parametrize("null_distribution", ["network", "annotation"])
|
149
|
-
def test_load_neighborhoods_poisson(
|
150
|
-
risk_obj, cytoscape_network, json_annotation, null_distribution
|
151
|
-
):
|
152
|
-
"""
|
153
|
-
Test loading neighborhoods using the Poisson test with multiple null distributions.
|
154
|
-
|
155
|
-
Args:
|
156
|
-
risk_obj: The RISK object instance used for loading neighborhoods.
|
157
|
-
cytoscape_network: The network object to be used for neighborhood generation.
|
158
|
-
json_annotation: The annotation associated with the network.
|
159
|
-
null_distribution: Null distribution type for the Poisson test (either 'network' or 'annotation').
|
160
|
-
"""
|
161
|
-
neighborhoods = risk_obj.load_neighborhoods_poisson(
|
162
|
-
network=cytoscape_network,
|
163
|
-
annotation=json_annotation,
|
164
|
-
distance_metric="louvain",
|
165
|
-
louvain_resolution=0.01,
|
166
|
-
fraction_shortest_edges=0.15,
|
167
|
-
null_distribution=null_distribution,
|
168
|
-
random_seed=887,
|
169
|
-
)
|
170
|
-
|
171
|
-
assert neighborhoods is not None
|
172
|
-
assert len(neighborhoods) > 0 # Ensure neighborhoods are loaded
|
173
|
-
|
174
|
-
|
175
|
-
@pytest.mark.parametrize("null_distribution", ["network", "annotation"])
|
176
|
-
def test_load_neighborhoods_zscore(risk_obj, cytoscape_network, json_annotation, null_distribution):
|
177
|
-
"""
|
178
|
-
Test loading neighborhoods using the z-score test with multiple null distributions.
|
179
|
-
|
180
|
-
Args:
|
181
|
-
risk_obj: The RISK object instance used for loading neighborhoods.
|
182
|
-
cytoscape_network: The network object to be used for neighborhood generation.
|
183
|
-
json_annotation: The annotation associated with the network.
|
184
|
-
null_distribution: Null distribution type for the z-score test (either 'network' or 'annotation').
|
185
|
-
"""
|
186
|
-
neighborhoods = risk_obj.load_neighborhoods_zscore(
|
187
|
-
network=cytoscape_network,
|
188
|
-
annotation=json_annotation,
|
189
|
-
distance_metric="louvain",
|
190
|
-
louvain_resolution=0.01,
|
191
|
-
fraction_shortest_edges=0.25,
|
192
|
-
null_distribution=null_distribution,
|
193
|
-
random_seed=887,
|
194
|
-
)
|
195
|
-
|
196
|
-
assert neighborhoods is not None
|
197
|
-
assert len(neighborhoods) > 0 # Ensure neighborhoods are loaded
|
198
|
-
|
199
|
-
|
200
148
|
@pytest.mark.parametrize(
|
201
149
|
"distance_metric, fraction_shortest_edges",
|
202
150
|
[
|
@@ -3,11 +3,12 @@ tests/test_load_plotter
|
|
3
3
|
~~~~~~~~~~~~~~~~~~~~~~~
|
4
4
|
"""
|
5
5
|
|
6
|
+
import matplotlib
|
6
7
|
import matplotlib.pyplot as plt
|
7
8
|
import pytest
|
8
9
|
|
9
10
|
# NOTE: Displaying plots during testing can cause the program to hang. Avoid including plot displays in tests.
|
10
|
-
#
|
11
|
+
matplotlib.use("Agg") # non-GUI backend
|
11
12
|
|
12
13
|
|
13
14
|
def initialize_plotter(risk, graph):
|
risk_network-0.0.14b3/PKG-INFO
DELETED
@@ -1,125 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: risk-network
|
3
|
-
Version: 0.0.14b3
|
4
|
-
Summary: A Python package for scalable network analysis and high-quality visualization.
|
5
|
-
Author-email: Ira Horecka <ira89@icloud.com>
|
6
|
-
License: GPL-3.0-or-later
|
7
|
-
Project-URL: Homepage, https://github.com/riskportal/network
|
8
|
-
Project-URL: Issues, https://github.com/riskportal/network/issues
|
9
|
-
Classifier: Development Status :: 4 - Beta
|
10
|
-
Classifier: Intended Audience :: Developers
|
11
|
-
Classifier: Intended Audience :: Science/Research
|
12
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
13
|
-
Classifier: Operating System :: OS Independent
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
15
|
-
Classifier: Programming Language :: Python :: 3.8
|
16
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
17
|
-
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
18
|
-
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
19
|
-
Classifier: Topic :: Scientific/Engineering :: Visualization
|
20
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
21
|
-
Requires-Python: >=3.8
|
22
|
-
Description-Content-Type: text/markdown
|
23
|
-
License-File: LICENSE
|
24
|
-
Requires-Dist: ipywidgets
|
25
|
-
Requires-Dist: leidenalg
|
26
|
-
Requires-Dist: markov_clustering
|
27
|
-
Requires-Dist: matplotlib
|
28
|
-
Requires-Dist: networkx
|
29
|
-
Requires-Dist: nltk
|
30
|
-
Requires-Dist: numpy
|
31
|
-
Requires-Dist: openpyxl
|
32
|
-
Requires-Dist: pandas
|
33
|
-
Requires-Dist: python-igraph
|
34
|
-
Requires-Dist: python-louvain
|
35
|
-
Requires-Dist: scikit-learn
|
36
|
-
Requires-Dist: scipy
|
37
|
-
Requires-Dist: statsmodels
|
38
|
-
Requires-Dist: threadpoolctl
|
39
|
-
Requires-Dist: tqdm
|
40
|
-
Dynamic: license-file
|
41
|
-
|
42
|
-
# RISK Network
|
43
|
-
|
44
|
-
<p align="center">
|
45
|
-
<img src="https://i.imgur.com/8TleEJs.png" width="50%" />
|
46
|
-
</p>
|
47
|
-
|
48
|
-
<br>
|
49
|
-
|
50
|
-

|
51
|
-
[](https://pypi.python.org/pypi/risk-network)
|
52
|
-

|
53
|
-
[](https://doi.org/10.5281/zenodo.xxxxxxx)
|
54
|
-

|
55
|
-

|
56
|
-
|
57
|
-
**RISK** (Regional Inference of Significant Kinships) is a next-generation tool for biological network annotation and visualization. RISK integrates community detection-based clustering, rigorous statistical enrichment analysis, and a modular framework to uncover biologically meaningful relationships and generate high-resolution visualizations. RISK supports diverse data formats and is optimized for large-scale network analysis, making it a valuable resource for researchers in systems biology and beyond.
|
58
|
-
|
59
|
-
## Documentation and Tutorial
|
60
|
-
|
61
|
-
Full documentation is available at:
|
62
|
-
|
63
|
-
- **Docs:** [https://riskportal.github.io/network-tutorial](https://riskportal.github.io/network-tutorial)
|
64
|
-
- **Tutorial Jupyter Notebook Repository:** [https://github.com/riskportal/network-tutorial](https://github.com/riskportal/network-tutorial)
|
65
|
-
|
66
|
-
## Installation
|
67
|
-
|
68
|
-
RISK is compatible with Python 3.8 or later and runs on all major operating systems. To install the latest version of RISK, run:
|
69
|
-
|
70
|
-
```bash
|
71
|
-
pip install risk-network --upgrade
|
72
|
-
```
|
73
|
-
|
74
|
-
## Features
|
75
|
-
|
76
|
-
- **Comprehensive Network Analysis**: Analyze biological networks (e.g., protein–protein interaction and genetic interaction networks) as well as non-biological networks.
|
77
|
-
- **Advanced Clustering Algorithms**: Supports Louvain, Leiden, Markov Clustering, Greedy Modularity, Label Propagation, Spinglass, and Walktrap for identifying structured network regions.
|
78
|
-
- **Flexible Visualization**: Produce customizable, high-resolution network visualizations with kernel density estimate overlays, adjustable node and edge attributes, and export options in SVG, PNG, and PDF formats.
|
79
|
-
- **Efficient Data Handling**: Supports multiple input/output formats, including JSON, CSV, TSV, Excel, Cytoscape, and GPickle.
|
80
|
-
- **Statistical Analysis**: Assess functional enrichment using hypergeometric, permutation (network-aware), binomial, chi-squared, Poisson, and z-score tests, ensuring statistical adaptability across datasets.
|
81
|
-
- **Cross-Domain Applicability**: Suitable for network analysis across biological and non-biological domains, including social and communication networks.
|
82
|
-
|
83
|
-
## Example Usage
|
84
|
-
|
85
|
-
We applied RISK to a *Saccharomyces cerevisiae* protein–protein interaction network from Michaelis et al. (2023), filtering for proteins with six or more interactions to emphasize core functional relationships. RISK identified compact, statistically enriched clusters corresponding to biological processes such as ribosomal assembly and mitochondrial organization.
|
86
|
-
|
87
|
-
[](https://i.imgur.com/lJHJrJr.jpeg)
|
88
|
-
|
89
|
-
This figure highlights RISK’s capability to detect both established and novel functional modules within the yeast interactome.
|
90
|
-
|
91
|
-
## Citation
|
92
|
-
|
93
|
-
If you use RISK in your research, please reference the following:
|
94
|
-
|
95
|
-
**Horecka et al.**, *"RISK: a next-generation tool for biological network annotation and visualization"*, 2025.
|
96
|
-
DOI: [10.1234/zenodo.xxxxxxx](https://doi.org/10.1234/zenodo.xxxxxxx)
|
97
|
-
|
98
|
-
## Software Architecture and Implementation
|
99
|
-
|
100
|
-
RISK features a streamlined, modular architecture designed to meet diverse research needs. RISK’s modular design enables users to run individual components—such as clustering, statistical testing, or visualization—independently or in combination, depending on the analysis workflow. It includes dedicated modules for:
|
101
|
-
|
102
|
-
- **Data I/O**: Supports JSON, CSV, TSV, Excel, Cytoscape, and GPickle formats.
|
103
|
-
- **Clustering**: Supports multiple clustering methods, including Louvain, Leiden, Markov Clustering, Greedy Modularity, Label Propagation, Spinglass, and Walktrap. Provides flexible distance metrics tailored to network structure.
|
104
|
-
- **Statistical Analysis**: Provides a suite of tests for overrepresentation analysis of annotations.
|
105
|
-
- **Visualization**: Offers customizable, high-resolution output in multiple formats, including SVG, PNG, and PDF.
|
106
|
-
- **Configuration Management**: Centralized parameters in risk.params ensure reproducibility and easy tuning for large-scale analyses.
|
107
|
-
|
108
|
-
## Performance and Efficiency
|
109
|
-
|
110
|
-
Benchmarking results demonstrate that RISK efficiently scales to networks exceeding hundreds of thousands of edges, maintaining low execution times and optimal memory usage across statistical tests.
|
111
|
-
|
112
|
-
## Contributing
|
113
|
-
|
114
|
-
We welcome contributions from the community:
|
115
|
-
|
116
|
-
- [Issues Tracker](https://github.com/riskportal/network/issues)
|
117
|
-
- [Source Code](https://github.com/riskportal/network/tree/main/risk)
|
118
|
-
|
119
|
-
## Support
|
120
|
-
|
121
|
-
If you encounter issues or have suggestions for new features, please use the [Issues Tracker](https://github.com/riskportal/network/issues) on GitHub.
|
122
|
-
|
123
|
-
## License
|
124
|
-
|
125
|
-
RISK is open source under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).
|
risk_network-0.0.14b3/README.md
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
# RISK Network
|
2
|
-
|
3
|
-
<p align="center">
|
4
|
-
<img src="https://i.imgur.com/8TleEJs.png" width="50%" />
|
5
|
-
</p>
|
6
|
-
|
7
|
-
<br>
|
8
|
-
|
9
|
-

|
10
|
-
[](https://pypi.python.org/pypi/risk-network)
|
11
|
-

|
12
|
-
[](https://doi.org/10.5281/zenodo.xxxxxxx)
|
13
|
-

|
14
|
-

|
15
|
-
|
16
|
-
**RISK** (Regional Inference of Significant Kinships) is a next-generation tool for biological network annotation and visualization. RISK integrates community detection-based clustering, rigorous statistical enrichment analysis, and a modular framework to uncover biologically meaningful relationships and generate high-resolution visualizations. RISK supports diverse data formats and is optimized for large-scale network analysis, making it a valuable resource for researchers in systems biology and beyond.
|
17
|
-
|
18
|
-
## Documentation and Tutorial
|
19
|
-
|
20
|
-
Full documentation is available at:
|
21
|
-
|
22
|
-
- **Docs:** [https://riskportal.github.io/network-tutorial](https://riskportal.github.io/network-tutorial)
|
23
|
-
- **Tutorial Jupyter Notebook Repository:** [https://github.com/riskportal/network-tutorial](https://github.com/riskportal/network-tutorial)
|
24
|
-
|
25
|
-
## Installation
|
26
|
-
|
27
|
-
RISK is compatible with Python 3.8 or later and runs on all major operating systems. To install the latest version of RISK, run:
|
28
|
-
|
29
|
-
```bash
|
30
|
-
pip install risk-network --upgrade
|
31
|
-
```
|
32
|
-
|
33
|
-
## Features
|
34
|
-
|
35
|
-
- **Comprehensive Network Analysis**: Analyze biological networks (e.g., protein–protein interaction and genetic interaction networks) as well as non-biological networks.
|
36
|
-
- **Advanced Clustering Algorithms**: Supports Louvain, Leiden, Markov Clustering, Greedy Modularity, Label Propagation, Spinglass, and Walktrap for identifying structured network regions.
|
37
|
-
- **Flexible Visualization**: Produce customizable, high-resolution network visualizations with kernel density estimate overlays, adjustable node and edge attributes, and export options in SVG, PNG, and PDF formats.
|
38
|
-
- **Efficient Data Handling**: Supports multiple input/output formats, including JSON, CSV, TSV, Excel, Cytoscape, and GPickle.
|
39
|
-
- **Statistical Analysis**: Assess functional enrichment using hypergeometric, permutation (network-aware), binomial, chi-squared, Poisson, and z-score tests, ensuring statistical adaptability across datasets.
|
40
|
-
- **Cross-Domain Applicability**: Suitable for network analysis across biological and non-biological domains, including social and communication networks.
|
41
|
-
|
42
|
-
## Example Usage
|
43
|
-
|
44
|
-
We applied RISK to a *Saccharomyces cerevisiae* protein–protein interaction network from Michaelis et al. (2023), filtering for proteins with six or more interactions to emphasize core functional relationships. RISK identified compact, statistically enriched clusters corresponding to biological processes such as ribosomal assembly and mitochondrial organization.
|
45
|
-
|
46
|
-
[](https://i.imgur.com/lJHJrJr.jpeg)
|
47
|
-
|
48
|
-
This figure highlights RISK’s capability to detect both established and novel functional modules within the yeast interactome.
|
49
|
-
|
50
|
-
## Citation
|
51
|
-
|
52
|
-
If you use RISK in your research, please reference the following:
|
53
|
-
|
54
|
-
**Horecka et al.**, *"RISK: a next-generation tool for biological network annotation and visualization"*, 2025.
|
55
|
-
DOI: [10.1234/zenodo.xxxxxxx](https://doi.org/10.1234/zenodo.xxxxxxx)
|
56
|
-
|
57
|
-
## Software Architecture and Implementation
|
58
|
-
|
59
|
-
RISK features a streamlined, modular architecture designed to meet diverse research needs. RISK’s modular design enables users to run individual components—such as clustering, statistical testing, or visualization—independently or in combination, depending on the analysis workflow. It includes dedicated modules for:
|
60
|
-
|
61
|
-
- **Data I/O**: Supports JSON, CSV, TSV, Excel, Cytoscape, and GPickle formats.
|
62
|
-
- **Clustering**: Supports multiple clustering methods, including Louvain, Leiden, Markov Clustering, Greedy Modularity, Label Propagation, Spinglass, and Walktrap. Provides flexible distance metrics tailored to network structure.
|
63
|
-
- **Statistical Analysis**: Provides a suite of tests for overrepresentation analysis of annotations.
|
64
|
-
- **Visualization**: Offers customizable, high-resolution output in multiple formats, including SVG, PNG, and PDF.
|
65
|
-
- **Configuration Management**: Centralized parameters in risk.params ensure reproducibility and easy tuning for large-scale analyses.
|
66
|
-
|
67
|
-
## Performance and Efficiency
|
68
|
-
|
69
|
-
Benchmarking results demonstrate that RISK efficiently scales to networks exceeding hundreds of thousands of edges, maintaining low execution times and optimal memory usage across statistical tests.
|
70
|
-
|
71
|
-
## Contributing
|
72
|
-
|
73
|
-
We welcome contributions from the community:
|
74
|
-
|
75
|
-
- [Issues Tracker](https://github.com/riskportal/network/issues)
|
76
|
-
- [Source Code](https://github.com/riskportal/network/tree/main/risk)
|
77
|
-
|
78
|
-
## Support
|
79
|
-
|
80
|
-
If you encounter issues or have suggestions for new features, please use the [Issues Tracker](https://github.com/riskportal/network/issues) on GitHub.
|
81
|
-
|
82
|
-
## License
|
83
|
-
|
84
|
-
RISK is open source under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).
|
@@ -1,125 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: risk-network
|
3
|
-
Version: 0.0.14b3
|
4
|
-
Summary: A Python package for scalable network analysis and high-quality visualization.
|
5
|
-
Author-email: Ira Horecka <ira89@icloud.com>
|
6
|
-
License: GPL-3.0-or-later
|
7
|
-
Project-URL: Homepage, https://github.com/riskportal/network
|
8
|
-
Project-URL: Issues, https://github.com/riskportal/network/issues
|
9
|
-
Classifier: Development Status :: 4 - Beta
|
10
|
-
Classifier: Intended Audience :: Developers
|
11
|
-
Classifier: Intended Audience :: Science/Research
|
12
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
13
|
-
Classifier: Operating System :: OS Independent
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
15
|
-
Classifier: Programming Language :: Python :: 3.8
|
16
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
17
|
-
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
18
|
-
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
19
|
-
Classifier: Topic :: Scientific/Engineering :: Visualization
|
20
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
21
|
-
Requires-Python: >=3.8
|
22
|
-
Description-Content-Type: text/markdown
|
23
|
-
License-File: LICENSE
|
24
|
-
Requires-Dist: ipywidgets
|
25
|
-
Requires-Dist: leidenalg
|
26
|
-
Requires-Dist: markov_clustering
|
27
|
-
Requires-Dist: matplotlib
|
28
|
-
Requires-Dist: networkx
|
29
|
-
Requires-Dist: nltk
|
30
|
-
Requires-Dist: numpy
|
31
|
-
Requires-Dist: openpyxl
|
32
|
-
Requires-Dist: pandas
|
33
|
-
Requires-Dist: python-igraph
|
34
|
-
Requires-Dist: python-louvain
|
35
|
-
Requires-Dist: scikit-learn
|
36
|
-
Requires-Dist: scipy
|
37
|
-
Requires-Dist: statsmodels
|
38
|
-
Requires-Dist: threadpoolctl
|
39
|
-
Requires-Dist: tqdm
|
40
|
-
Dynamic: license-file
|
41
|
-
|
42
|
-
# RISK Network
|
43
|
-
|
44
|
-
<p align="center">
|
45
|
-
<img src="https://i.imgur.com/8TleEJs.png" width="50%" />
|
46
|
-
</p>
|
47
|
-
|
48
|
-
<br>
|
49
|
-
|
50
|
-

|
51
|
-
[](https://pypi.python.org/pypi/risk-network)
|
52
|
-

|
53
|
-
[](https://doi.org/10.5281/zenodo.xxxxxxx)
|
54
|
-

|
55
|
-

|
56
|
-
|
57
|
-
**RISK** (Regional Inference of Significant Kinships) is a next-generation tool for biological network annotation and visualization. RISK integrates community detection-based clustering, rigorous statistical enrichment analysis, and a modular framework to uncover biologically meaningful relationships and generate high-resolution visualizations. RISK supports diverse data formats and is optimized for large-scale network analysis, making it a valuable resource for researchers in systems biology and beyond.
|
58
|
-
|
59
|
-
## Documentation and Tutorial
|
60
|
-
|
61
|
-
Full documentation is available at:
|
62
|
-
|
63
|
-
- **Docs:** [https://riskportal.github.io/network-tutorial](https://riskportal.github.io/network-tutorial)
|
64
|
-
- **Tutorial Jupyter Notebook Repository:** [https://github.com/riskportal/network-tutorial](https://github.com/riskportal/network-tutorial)
|
65
|
-
|
66
|
-
## Installation
|
67
|
-
|
68
|
-
RISK is compatible with Python 3.8 or later and runs on all major operating systems. To install the latest version of RISK, run:
|
69
|
-
|
70
|
-
```bash
|
71
|
-
pip install risk-network --upgrade
|
72
|
-
```
|
73
|
-
|
74
|
-
## Features
|
75
|
-
|
76
|
-
- **Comprehensive Network Analysis**: Analyze biological networks (e.g., protein–protein interaction and genetic interaction networks) as well as non-biological networks.
|
77
|
-
- **Advanced Clustering Algorithms**: Supports Louvain, Leiden, Markov Clustering, Greedy Modularity, Label Propagation, Spinglass, and Walktrap for identifying structured network regions.
|
78
|
-
- **Flexible Visualization**: Produce customizable, high-resolution network visualizations with kernel density estimate overlays, adjustable node and edge attributes, and export options in SVG, PNG, and PDF formats.
|
79
|
-
- **Efficient Data Handling**: Supports multiple input/output formats, including JSON, CSV, TSV, Excel, Cytoscape, and GPickle.
|
80
|
-
- **Statistical Analysis**: Assess functional enrichment using hypergeometric, permutation (network-aware), binomial, chi-squared, Poisson, and z-score tests, ensuring statistical adaptability across datasets.
|
81
|
-
- **Cross-Domain Applicability**: Suitable for network analysis across biological and non-biological domains, including social and communication networks.
|
82
|
-
|
83
|
-
## Example Usage
|
84
|
-
|
85
|
-
We applied RISK to a *Saccharomyces cerevisiae* protein–protein interaction network from Michaelis et al. (2023), filtering for proteins with six or more interactions to emphasize core functional relationships. RISK identified compact, statistically enriched clusters corresponding to biological processes such as ribosomal assembly and mitochondrial organization.
|
86
|
-
|
87
|
-
[](https://i.imgur.com/lJHJrJr.jpeg)
|
88
|
-
|
89
|
-
This figure highlights RISK’s capability to detect both established and novel functional modules within the yeast interactome.
|
90
|
-
|
91
|
-
## Citation
|
92
|
-
|
93
|
-
If you use RISK in your research, please reference the following:
|
94
|
-
|
95
|
-
**Horecka et al.**, *"RISK: a next-generation tool for biological network annotation and visualization"*, 2025.
|
96
|
-
DOI: [10.1234/zenodo.xxxxxxx](https://doi.org/10.1234/zenodo.xxxxxxx)
|
97
|
-
|
98
|
-
## Software Architecture and Implementation
|
99
|
-
|
100
|
-
RISK features a streamlined, modular architecture designed to meet diverse research needs. RISK’s modular design enables users to run individual components—such as clustering, statistical testing, or visualization—independently or in combination, depending on the analysis workflow. It includes dedicated modules for:
|
101
|
-
|
102
|
-
- **Data I/O**: Supports JSON, CSV, TSV, Excel, Cytoscape, and GPickle formats.
|
103
|
-
- **Clustering**: Supports multiple clustering methods, including Louvain, Leiden, Markov Clustering, Greedy Modularity, Label Propagation, Spinglass, and Walktrap. Provides flexible distance metrics tailored to network structure.
|
104
|
-
- **Statistical Analysis**: Provides a suite of tests for overrepresentation analysis of annotations.
|
105
|
-
- **Visualization**: Offers customizable, high-resolution output in multiple formats, including SVG, PNG, and PDF.
|
106
|
-
- **Configuration Management**: Centralized parameters in risk.params ensure reproducibility and easy tuning for large-scale analyses.
|
107
|
-
|
108
|
-
## Performance and Efficiency
|
109
|
-
|
110
|
-
Benchmarking results demonstrate that RISK efficiently scales to networks exceeding hundreds of thousands of edges, maintaining low execution times and optimal memory usage across statistical tests.
|
111
|
-
|
112
|
-
## Contributing
|
113
|
-
|
114
|
-
We welcome contributions from the community:
|
115
|
-
|
116
|
-
- [Issues Tracker](https://github.com/riskportal/network/issues)
|
117
|
-
- [Source Code](https://github.com/riskportal/network/tree/main/risk)
|
118
|
-
|
119
|
-
## Support
|
120
|
-
|
121
|
-
If you encounter issues or have suggestions for new features, please use the [Issues Tracker](https://github.com/riskportal/network/issues) on GitHub.
|
122
|
-
|
123
|
-
## License
|
124
|
-
|
125
|
-
RISK is open source under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).
|
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
|
{risk_network-0.0.14b3 → risk_network-0.0.15}/src/risk_network.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|