risk-network 0.0.14b3__py3-none-any.whl → 0.0.15b0__py3-none-any.whl

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/__init__.py CHANGED
@@ -8,4 +8,4 @@ RISK: Regional Inference of Significant Kinships
8
8
  from ._risk import RISK
9
9
 
10
10
  __all__ = ["RISK"]
11
- __version__ = "0.0.14-beta.3"
11
+ __version__ = "0.0.15-beta.0"
@@ -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", "poisson").
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.
@@ -8,6 +8,4 @@ from ._tests import (
8
8
  compute_binom_test,
9
9
  compute_chi2_test,
10
10
  compute_hypergeom_test,
11
- compute_poisson_test,
12
- compute_zscore_test,
13
11
  )
@@ -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, poisson
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,115 @@
1
+ Metadata-Version: 2.4
2
+ Name: risk-network
3
+ Version: 0.0.15b0
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
+ ![Python](https://img.shields.io/badge/python-3.8%2B-yellow)
51
+ [![pypiv](https://img.shields.io/pypi/v/risk-network.svg)](https://pypi.python.org/pypi/risk-network)
52
+ ![License](https://img.shields.io/badge/license-GPLv3-purple)
53
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.xxxxxxx.svg)](https://doi.org/10.5281/zenodo.xxxxxxx)
54
+ ![Downloads](https://img.shields.io/pypi/dm/risk-network)
55
+ ![Tests](https://github.com/riskportal/network/actions/workflows/ci.yml/badge.svg)
56
+
57
+ **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.
58
+
59
+ For a full description of RISK and its applications, see:
60
+ <br>
61
+ **Horecka and Röst (2025)**, _"RISK: a next-generation tool for biological network annotation and visualization"_.
62
+ <br>
63
+ DOI: [10.5281/zenodo.xxxxxxx](https://doi.org/10.5281/zenodo.xxxxxxx)
64
+
65
+ ## Documentation and Tutorial
66
+
67
+ Full documentation is available at:
68
+
69
+ - **Docs:** [https://riskportal.github.io/network-tutorial](https://riskportal.github.io/network-tutorial)
70
+ - **Tutorial Jupyter Notebook Repository:** [https://github.com/riskportal/network-tutorial](https://github.com/riskportal/network-tutorial)
71
+
72
+ ## Installation
73
+
74
+ RISK is compatible with Python 3.8 or later and runs on all major operating systems. To install the latest version of RISK, run:
75
+
76
+ ```bash
77
+ pip install risk-network --upgrade
78
+ ```
79
+
80
+ ## Key Features of RISK
81
+
82
+ - **Broad Data Compatibility**: Accepts multiple network formats (NetworkX, Cytoscape, GPickle) and user-provided annotations formatted as term–to–gene membership tables (JSON, CSV, TSV, Excel, or Python dictionaries).
83
+ - **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.
84
+ - **Statistical Testing**: Provides hypergeometric, chi-squared, binomial, and permutation tests, balancing speed with statistical rigor.
85
+ - **High-Resolution Visualization**: Generates publication-ready figures with contour overlays, customizable node/edge properties, and export to SVG, PNG, or PDF.
86
+
87
+ ## Example Usage
88
+
89
+ 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).
90
+
91
+ [![RISK analysis of the yeast PPI network](https://i.imgur.com/fSNf5Ad.jpeg)](https://i.imgur.com/fSNf5Ad.jpeg)
92
+ **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).
93
+
94
+ ## Citation
95
+
96
+ If you use RISK in your research, please cite the following:
97
+
98
+ **Horecka and Röst (2025)**, _"RISK: a next-generation tool for biological network annotation and visualization"_.
99
+ <br>
100
+ DOI: [10.5281/zenodo.xxxxxxx](https://doi.org/10.5281/zenodo.xxxxxxx)
101
+
102
+ ## Contributing
103
+
104
+ We welcome contributions from the community:
105
+
106
+ - [Issues Tracker](https://github.com/riskportal/network/issues)
107
+ - [Source Code](https://github.com/riskportal/network/tree/main/risk)
108
+
109
+ ## Support
110
+
111
+ If you encounter issues or have suggestions for new features, please use the [Issues Tracker](https://github.com/riskportal/network/issues) on GitHub.
112
+
113
+ ## License
114
+
115
+ RISK is open source under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).
@@ -1,4 +1,4 @@
1
- risk/__init__.py,sha256=14fTdsWCVA1DS1M7axwUvQzyssu4dRwwhdLdnN-5h1M,143
1
+ risk/__init__.py,sha256=gMD1uoPq7pvKGIv9mgz6gr4UZvJiPKhkv-XbW1zAZtk,143
2
2
  risk/_risk.py,sha256=VULCdM41BlWKM1ou4Qc579ffZ9dMZkfhAwKYgbaEeKM,1054
3
3
  risk/_annotation/__init__.py,sha256=zr7w1DHkmvrkKFGKdPhrcvZHV-xsfd5TZOaWtFiP4Dc,164
4
4
  risk/_annotation/_annotation.py,sha256=03vcnkdi4HGH5UUyokUyOdyyjXOLoKSmLFuK7VAl41c,15174
@@ -8,12 +8,12 @@ risk/_log/__init__.py,sha256=LX6BsfcGOH0RbAdQaUmIU-LVMmArDdKwn0jFtj45FYo,205
8
8
  risk/_log/_console.py,sha256=1jSFzY3w0-vVqIBCgc-IhyJPNT6vRg8GSGxhyw_D9MI,4653
9
9
  risk/_log/_parameters.py,sha256=8FkeeBtULDFVw3UijLArK-G3OIjy6YXyRXmPPckK7fU,5893
10
10
  risk/_neighborhoods/__init__.py,sha256=eKwjpEUKSUmAirRZ_qPTVF7MLkvhCn_fulPVq158wM8,185
11
- risk/_neighborhoods/_api.py,sha256=s1f4d_nEPWc66KDmOUUpRNXzp6dfoevw45ewOg9eMNo,23298
11
+ risk/_neighborhoods/_api.py,sha256=kwCJo8fW1v11fNlCZmC_2XH4TG2ZrIL2j2PvBJrlyj8,18236
12
12
  risk/_neighborhoods/_community.py,sha256=Tr-EHO91EWbMmNr_z21UCngiqWOlWIqcjwBig_VXI8c,17850
13
13
  risk/_neighborhoods/_domains.py,sha256=Q3MUWW9KjuERpxs4H1dNFhalDjdatMkWSnB12BerUDU,16580
14
14
  risk/_neighborhoods/_neighborhoods.py,sha256=9hpQCYG0d9fZLYj-fVACgLJBtw3dW8C-0YbE2OWuX-M,21436
15
- risk/_neighborhoods/_stats/__init__.py,sha256=nL83A3unzpCTzRDPanCiqU1RsKPJJNDe46S9igoe3pg,264
16
- risk/_neighborhoods/_stats/_tests.py,sha256=-ioHdyrsgW63YnypKFpanatauuKrF3LT7aMZ3b6otrU,12091
15
+ risk/_neighborhoods/_stats/__init__.py,sha256=iu22scpdgTHm6N_hAN81iXIoZCRPFuFAxf71jYWwsUU,213
16
+ risk/_neighborhoods/_stats/_tests.py,sha256=KWwNWyKJ3Rrb1cI5qJcKv9YhU1-7sJoI-yMR1RqvHOQ,7557
17
17
  risk/_neighborhoods/_stats/_permutation/__init__.py,sha256=nfTaW29CK8OZCdFnpMVlHnFaqr1E4AZp6mvhlUazHXM,140
18
18
  risk/_neighborhoods/_stats/_permutation/_permutation.py,sha256=e5qVuYWGhiAn5Jv8VILk-WYMOO4km48cGdRYTOl355M,10661
19
19
  risk/_neighborhoods/_stats/_permutation/_test_functions.py,sha256=lGI_MkdbW4UHI0jWN_T1OattRjXrq_qmzAmOfels670,3165
@@ -23,7 +23,7 @@ risk/_network/_graph/__init__.py,sha256=SFgxgxUiZK4vvw6bdQ04DSMXEr8xjMaQV-Wne6wA
23
23
  risk/_network/_graph/_api.py,sha256=sp3_mLJDP_xQexYBjyM17iyzLb2oGmiC050kcw-jVho,8474
24
24
  risk/_network/_graph/_graph.py,sha256=x2EWT_ZVwxh7m9a01yG4WMdmAxBxiaxX3CvkqP9QAXE,12486
25
25
  risk/_network/_graph/_stats.py,sha256=6mxZkuL6LJlwKDsBbP22DAVkNUEhq-JZwYMKhFKD08k,7359
26
- risk/_network/_graph/_summary.py,sha256=I8FhMdpawGbvCJHPpsyvbtM7Qa0xXzwKvjnX9N8HSm8,10141
26
+ risk/_network/_graph/_summary.py,sha256=RISQHy6Ur37e6F8ZM9X-IwNOit-hUiUxSCUZU_8-1Tw,10198
27
27
  risk/_network/_plotter/__init__.py,sha256=qFRtQKSBGIqmUGwmA7VPL7hTHBb9yvRIt0nLISXnwkY,84
28
28
  risk/_network/_plotter/_api.py,sha256=OaV1CCRGsz98wEEzyEhaq2CqEuZh6t2qS7g_rY6HJJs,1727
29
29
  risk/_network/_plotter/_canvas.py,sha256=H7rPz4Gv7ED3bDHMif4cf2usdU4ifmxzXeug5A_no68,13599
@@ -34,8 +34,8 @@ risk/_network/_plotter/_plotter.py,sha256=F2hw-spUdsXjvuG36o0YFR3Pnd-CZOHYUq4vW0
34
34
  risk/_network/_plotter/_utils/__init__.py,sha256=JXgjKiBWvXx0X2IeFnrOh5YZQGQoELbhJZ0Zh2mFEOo,211
35
35
  risk/_network/_plotter/_utils/_colors.py,sha256=JCliSvz8_-TsjilaRHSEsqdXFBUYlzhXKOSRGdCm9Kw,19177
36
36
  risk/_network/_plotter/_utils/_layout.py,sha256=GyGLc2U1WWUVL1Te9uPi_CLqlW_E4TImXRAL5TeA5D8,3633
37
- risk_network-0.0.14b3.dist-info/licenses/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
38
- risk_network-0.0.14b3.dist-info/METADATA,sha256=SG8HbB0TBqNd_zgtKV1Ri23RoBIRy_poTAfeN9ZaSBA,6853
39
- risk_network-0.0.14b3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
40
- risk_network-0.0.14b3.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
41
- risk_network-0.0.14b3.dist-info/RECORD,,
37
+ risk_network-0.0.15b0.dist-info/licenses/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
38
+ risk_network-0.0.15b0.dist-info/METADATA,sha256=zvJFbC8wrBq6RV_UcikwbsqHDFEZHnV5nK5OzDUQArw,5676
39
+ risk_network-0.0.15b0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
40
+ risk_network-0.0.15b0.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
41
+ risk_network-0.0.15b0.dist-info/RECORD,,
@@ -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
- ![Python](https://img.shields.io/badge/python-3.8%2B-yellow)
51
- [![pypiv](https://img.shields.io/pypi/v/risk-network.svg)](https://pypi.python.org/pypi/risk-network)
52
- ![License](https://img.shields.io/badge/license-GPLv3-purple)
53
- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.xxxxxxx.svg)](https://doi.org/10.5281/zenodo.xxxxxxx)
54
- ![Downloads](https://img.shields.io/pypi/dm/risk-network)
55
- ![Tests](https://github.com/riskportal/network/actions/workflows/ci.yml/badge.svg)
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
- [![Figure 1](https://i.imgur.com/lJHJrJr.jpeg)](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).