risk-network 0.0.5b6__py3-none-any.whl → 0.0.6__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 +1 -1
- risk/annotations/io.py +44 -3
- risk/log/params.py +2 -0
- risk/neighborhoods/community.py +7 -3
- risk/neighborhoods/domains.py +24 -18
- risk/neighborhoods/neighborhoods.py +2 -2
- risk/network/graph.py +68 -40
- risk/network/io.py +30 -10
- risk/network/plot.py +713 -309
- risk/risk.py +10 -22
- {risk_network-0.0.5b6.dist-info → risk_network-0.0.6.dist-info}/METADATA +3 -4
- {risk_network-0.0.5b6.dist-info → risk_network-0.0.6.dist-info}/RECORD +15 -15
- {risk_network-0.0.5b6.dist-info → risk_network-0.0.6.dist-info}/WHEEL +1 -1
- {risk_network-0.0.5b6.dist-info → risk_network-0.0.6.dist-info}/LICENSE +0 -0
- {risk_network-0.0.5b6.dist-info → risk_network-0.0.6.dist-info}/top_level.txt +0 -0
risk/risk.py
CHANGED
@@ -3,7 +3,7 @@ risk/risk
|
|
3
3
|
~~~~~~~~~
|
4
4
|
"""
|
5
5
|
|
6
|
-
from typing import Any, Dict
|
6
|
+
from typing import Any, Dict, Tuple
|
7
7
|
|
8
8
|
import networkx as nx
|
9
9
|
import numpy as np
|
@@ -62,7 +62,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
62
62
|
|
63
63
|
Args:
|
64
64
|
network (nx.Graph): The network graph.
|
65
|
-
annotations (
|
65
|
+
annotations (dict): The annotations associated with the network.
|
66
66
|
distance_metric (str, optional): Distance metric for neighborhood analysis. Defaults to "dijkstra".
|
67
67
|
louvain_resolution (float, optional): Resolution parameter for Louvain clustering. Defaults to 0.1.
|
68
68
|
edge_length_threshold (float, optional): Edge length threshold for neighborhood analysis. Defaults to 0.5.
|
@@ -114,6 +114,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
114
114
|
max_workers=max_workers,
|
115
115
|
)
|
116
116
|
|
117
|
+
# Return the computed neighborhood significance
|
117
118
|
return neighborhood_significance
|
118
119
|
|
119
120
|
def load_neighborhoods_by_fisher_exact(
|
@@ -130,7 +131,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
130
131
|
|
131
132
|
Args:
|
132
133
|
network (nx.Graph): The network graph.
|
133
|
-
annotations (
|
134
|
+
annotations (dict): The annotations associated with the network.
|
134
135
|
distance_metric (str, optional): Distance metric for neighborhood analysis. Defaults to "dijkstra".
|
135
136
|
louvain_resolution (float, optional): Resolution parameter for Louvain clustering. Defaults to 0.1.
|
136
137
|
edge_length_threshold (float, optional): Edge length threshold for neighborhood analysis. Defaults to 0.5.
|
@@ -169,6 +170,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
169
170
|
max_workers=max_workers,
|
170
171
|
)
|
171
172
|
|
173
|
+
# Return the computed neighborhood significance
|
172
174
|
return neighborhood_significance
|
173
175
|
|
174
176
|
def load_neighborhoods_by_hypergeom(
|
@@ -185,7 +187,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
185
187
|
|
186
188
|
Args:
|
187
189
|
network (nx.Graph): The network graph.
|
188
|
-
annotations (
|
190
|
+
annotations (dict): The annotations associated with the network.
|
189
191
|
distance_metric (str, optional): Distance metric for neighborhood analysis. Defaults to "dijkstra".
|
190
192
|
louvain_resolution (float, optional): Resolution parameter for Louvain clustering. Defaults to 0.1.
|
191
193
|
edge_length_threshold (float, optional): Edge length threshold for neighborhood analysis. Defaults to 0.5.
|
@@ -224,6 +226,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
224
226
|
max_workers=max_workers,
|
225
227
|
)
|
226
228
|
|
229
|
+
# Return the computed neighborhood significance
|
227
230
|
return neighborhood_significance
|
228
231
|
|
229
232
|
def load_graph(
|
@@ -340,19 +343,15 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
340
343
|
top_annotations=top_annotations,
|
341
344
|
domains=domains,
|
342
345
|
trimmed_domains=trimmed_domains,
|
343
|
-
|
346
|
+
node_label_to_node_id_map=node_label_to_id,
|
344
347
|
node_enrichment_sums=node_enrichment_sums,
|
345
348
|
)
|
346
349
|
|
347
350
|
def load_plotter(
|
348
351
|
self,
|
349
352
|
graph: NetworkGraph,
|
350
|
-
figsize:
|
353
|
+
figsize: Tuple = (10, 10),
|
351
354
|
background_color: str = "white",
|
352
|
-
plot_outline: bool = True,
|
353
|
-
outline_color: str = "black",
|
354
|
-
outline_scale: float = 1.00,
|
355
|
-
linestyle: str = "dashed",
|
356
355
|
) -> NetworkPlotter:
|
357
356
|
"""Get a NetworkPlotter object for plotting.
|
358
357
|
|
@@ -360,10 +359,6 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
360
359
|
graph (NetworkGraph): The graph to plot.
|
361
360
|
figsize (tuple, optional): Size of the figure. Defaults to (10, 10).
|
362
361
|
background_color (str, optional): Background color of the plot. Defaults to "white".
|
363
|
-
plot_outline (bool, optional): Whether to plot the network outline. Defaults to True.
|
364
|
-
outline_color (str, optional): Color of the outline. Defaults to "black".
|
365
|
-
outline_scale (float, optional): Scaling factor for the outline. Defaults to 1.00.
|
366
|
-
linestyle (str): Line style for the network perimeter circle (e.g., dashed, solid). Defaults to "dashed".
|
367
362
|
|
368
363
|
Returns:
|
369
364
|
NetworkPlotter: A NetworkPlotter object configured with the given parameters.
|
@@ -373,10 +368,6 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
373
368
|
params.log_plotter(
|
374
369
|
figsize=figsize,
|
375
370
|
background_color=background_color,
|
376
|
-
plot_outline=plot_outline,
|
377
|
-
outline_color=outline_color,
|
378
|
-
outline_scale=outline_scale,
|
379
|
-
linestyle=linestyle,
|
380
371
|
)
|
381
372
|
|
382
373
|
# Initialize and return a NetworkPlotter object
|
@@ -384,10 +375,6 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
384
375
|
graph,
|
385
376
|
figsize=figsize,
|
386
377
|
background_color=background_color,
|
387
|
-
plot_outline=plot_outline,
|
388
|
-
outline_color=outline_color,
|
389
|
-
outline_scale=outline_scale,
|
390
|
-
linestyle=linestyle,
|
391
378
|
)
|
392
379
|
|
393
380
|
def _load_neighborhoods(
|
@@ -430,6 +417,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
430
417
|
random_seed=random_seed,
|
431
418
|
)
|
432
419
|
|
420
|
+
# Return the computed neighborhoods
|
433
421
|
return neighborhoods
|
434
422
|
|
435
423
|
def _define_top_annotations(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: risk-network
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.6
|
4
4
|
Summary: A Python package for biological network analysis
|
5
5
|
Author: Ira Horecka
|
6
6
|
Author-email: Ira Horecka <ira89@icloud.com>
|
@@ -710,8 +710,7 @@ Requires-Dist: threadpoolctl
|
|
710
710
|
Requires-Dist: tqdm
|
711
711
|
|
712
712
|
<p align="center">
|
713
|
-
<img src="
|
714
|
-
<img src="./docs/github/risk-logo-light.png#gh-light-mode-only" width="400" />
|
713
|
+
<img src="https://i.imgur.com/Fo9EmnK.png" width="400" />
|
715
714
|
</p>
|
716
715
|
|
717
716
|
<p align="center">
|
@@ -736,7 +735,7 @@ RISK is a software tool for visualizing spatial relationships in networks. It ai
|
|
736
735
|
|
737
736
|
*Saccharomyces cerevisiae* proteins oriented by physical interactions discovered through affinity enrichment and mass spectrometry (Michaelis et al., 2023).
|
738
737
|
|
739
|
-

|
740
739
|
|
741
740
|
## Installation
|
742
741
|
|
@@ -1,21 +1,21 @@
|
|
1
|
-
risk/__init__.py,sha256=
|
1
|
+
risk/__init__.py,sha256=is0cU74uqxLBDA8RBSAV8DgntPYa1peA9P3Jf3uoPlM,105
|
2
2
|
risk/constants.py,sha256=XInRaH78Slnw_sWgAsBFbUHkyA0h0jL0DKGuQNbOvjM,550
|
3
|
-
risk/risk.py,sha256=
|
3
|
+
risk/risk.py,sha256=CKDIzVo9Jvl-fgzIlk5ZtJL9pIBMma24WK6EYdVu5po,20648
|
4
4
|
risk/annotations/__init__.py,sha256=vUpVvMRE5if01Ic8QY6M2Ae3EFGJHdugEe9PdEkAW4Y,138
|
5
5
|
risk/annotations/annotations.py,sha256=DRUTdGzMdqo62NWSapBUksbvPr9CrzD76qtOcxeNKmo,10554
|
6
|
-
risk/annotations/io.py,sha256=
|
6
|
+
risk/annotations/io.py,sha256=lo7NKqOVkeeBp58JBxWJHtA0xjL5Yoxqe9Ox0daKlZk,9457
|
7
7
|
risk/log/__init__.py,sha256=xuLImfxFlKpnVhzi_gDYlr2_c9cLkrw2c_3iEsXb1as,107
|
8
8
|
risk/log/console.py,sha256=im9DRExwf6wHlcn9fewoDcKIpo3vPcorZIaNAl-0csY,355
|
9
|
-
risk/log/params.py,sha256=
|
9
|
+
risk/log/params.py,sha256=Rfdg5UcGCrG80m6V79FyORERWUqIzHFO7tGiY4zAImM,6347
|
10
10
|
risk/neighborhoods/__init__.py,sha256=tKKEg4lsbqFukpgYlUGxU_v_9FOqK7V0uvM9T2QzoL0,206
|
11
|
-
risk/neighborhoods/community.py,sha256=
|
12
|
-
risk/neighborhoods/domains.py,sha256=
|
13
|
-
risk/neighborhoods/neighborhoods.py,sha256=
|
11
|
+
risk/neighborhoods/community.py,sha256=7ebo1Q5KokSQISnxZIh2SQxsKXdXm8aVkp-h_DiQ3K0,6818
|
12
|
+
risk/neighborhoods/domains.py,sha256=5V--Nj-TrSdubhD_2PI57ffcn_PMSEgpX_iY5OjT6R8,10626
|
13
|
+
risk/neighborhoods/neighborhoods.py,sha256=sHmjFFl2U5qV9YbQCRbpbI36j7dS7IFfFwwRb1_-AuM,13945
|
14
14
|
risk/network/__init__.py,sha256=iEPeJdZfqp0toxtbElryB8jbz9_t_k4QQ3iDvKE8C_0,126
|
15
15
|
risk/network/geometry.py,sha256=H1yGVVqgbfpzBzJwEheDLfvGLSA284jGQQTn612L4Vc,6759
|
16
|
-
risk/network/graph.py,sha256=
|
17
|
-
risk/network/io.py,sha256=
|
18
|
-
risk/network/plot.py,sha256=
|
16
|
+
risk/network/graph.py,sha256=7haHu4M3fleqbrIzs6HC9jnKizSERzmmAYSmUwdoSXA,13953
|
17
|
+
risk/network/io.py,sha256=gG50kOknO-D3HkW1HsbHMkTMvjUtn3l4W4Jwd-rXNr8,21202
|
18
|
+
risk/network/plot.py,sha256=_g5xHolMTAfZCBvYYEX1CYME4s4zA2hTHtN-utaMPik,61978
|
19
19
|
risk/stats/__init__.py,sha256=e-BE_Dr_jgiK6hKM-T-tlG4yvHnId8e5qjnM0pdwNVc,230
|
20
20
|
risk/stats/fisher_exact.py,sha256=-bPwzu76-ob0HzrTV20mXUTot7v-MLuqFaAoab-QxPg,4966
|
21
21
|
risk/stats/hypergeom.py,sha256=lrIFdhCWRjvM4apYw1MlOKqT_IY5OjtCwrjdtJdt6Tg,4954
|
@@ -23,8 +23,8 @@ risk/stats/stats.py,sha256=kvShov-94W6ffgDUTb522vB9hDJQSyTsYif_UIaFfSM,7059
|
|
23
23
|
risk/stats/permutation/__init__.py,sha256=neJp7FENC-zg_CGOXqv-iIvz1r5XUKI9Ruxhmq7kDOI,105
|
24
24
|
risk/stats/permutation/permutation.py,sha256=qLWdwxEY6nmkYPxpM8HLDcd2mbqYv9Qr7CKtJvhLqIM,9220
|
25
25
|
risk/stats/permutation/test_functions.py,sha256=HuDIM-V1jkkfE1rlaIqrWWBSKZt3dQ1f-YEDjWpnLSE,2343
|
26
|
-
risk_network-0.0.
|
27
|
-
risk_network-0.0.
|
28
|
-
risk_network-0.0.
|
29
|
-
risk_network-0.0.
|
30
|
-
risk_network-0.0.
|
26
|
+
risk_network-0.0.6.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
27
|
+
risk_network-0.0.6.dist-info/METADATA,sha256=L5ITD9hXoxsmiKIr6q1yOgDQRtdKmOCCi8Clt2mxAEs,43140
|
28
|
+
risk_network-0.0.6.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
29
|
+
risk_network-0.0.6.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
|
30
|
+
risk_network-0.0.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|