risk-network 0.0.8b8__tar.gz → 0.0.8b10__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.8b8 → risk_network-0.0.8b10}/PKG-INFO +5 -5
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/README.md +4 -4
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/__init__.py +1 -1
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/neighborhoods/domains.py +1 -1
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/network/io.py +2 -1
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/network/plot/canvas.py +8 -5
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/network/plot/plotter.py +16 -2
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/risk.py +3 -5
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk_network.egg-info/PKG-INFO +5 -5
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/LICENSE +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/MANIFEST.in +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/pyproject.toml +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/annotations/__init__.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/annotations/annotations.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/annotations/io.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/constants.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/log/__init__.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/log/config.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/log/params.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/neighborhoods/__init__.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/neighborhoods/community.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/neighborhoods/neighborhoods.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/network/__init__.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/network/geometry.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/network/graph.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/network/plot/__init__.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/network/plot/contour.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/network/plot/labels.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/network/plot/network.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/network/plot/utils.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/stats/__init__.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/stats/hypergeom.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/stats/permutation/__init__.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/stats/permutation/permutation.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/stats/permutation/test_functions.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/stats/poisson.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk/stats/stats.py +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk_network.egg-info/SOURCES.txt +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk_network.egg-info/dependency_links.txt +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk_network.egg-info/requires.txt +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/risk_network.egg-info/top_level.txt +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/setup.cfg +0 -0
- {risk_network-0.0.8b8 → risk_network-0.0.8b10}/setup.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: risk-network
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.8b10
|
4
4
|
Summary: A Python package for biological network analysis
|
5
5
|
Author: Ira Horecka
|
6
6
|
Author-email: Ira Horecka <ira89@icloud.com>
|
@@ -709,7 +709,7 @@ Requires-Dist: statsmodels
|
|
709
709
|
Requires-Dist: threadpoolctl
|
710
710
|
Requires-Dist: tqdm
|
711
711
|
|
712
|
-
# RISK
|
712
|
+
# RISK Network
|
713
713
|
|
714
714
|
<p align="center">
|
715
715
|
<img src="https://i.imgur.com/8TleEJs.png" width="50%" />
|
@@ -728,8 +728,8 @@ Requires-Dist: tqdm
|
|
728
728
|
|
729
729
|
## Documentation and Tutorial
|
730
730
|
|
731
|
-
- **Documentation**: Comprehensive documentation is available
|
732
|
-
- **Tutorial**: An interactive Jupyter notebook tutorial can be found
|
731
|
+
- **Documentation**: Comprehensive documentation is available [here](Documentation link).
|
732
|
+
- **Tutorial**: An interactive Jupyter notebook tutorial can be found [here](https://github.com/riskportal/network-tutorial).
|
733
733
|
We highly recommend new users to consult the documentation and tutorial early on to fully leverage RISK's capabilities.
|
734
734
|
|
735
735
|
## Installation
|
@@ -753,7 +753,7 @@ pip install risk-network
|
|
753
753
|
|
754
754
|
We applied RISK to a *Saccharomyces cerevisiae* protein–protein interaction network, revealing both established and novel functional relationships. The visualization below highlights key biological processes such as ribosomal assembly and mitochondrial organization.
|
755
755
|
|
756
|
-

|
757
757
|
|
758
758
|
RISK successfully detected both known and novel functional clusters within the yeast interactome. Clusters related to Golgi transport and actin nucleation were clearly defined and closely located, showcasing RISK's ability to map well-characterized interactions. Additionally, RISK identified links between mRNA processing pathways and vesicle trafficking proteins, consistent with recent studies demonstrating the role of vesicles in mRNA localization and stability.
|
759
759
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# RISK
|
1
|
+
# RISK Network
|
2
2
|
|
3
3
|
<p align="center">
|
4
4
|
<img src="https://i.imgur.com/8TleEJs.png" width="50%" />
|
@@ -17,8 +17,8 @@
|
|
17
17
|
|
18
18
|
## Documentation and Tutorial
|
19
19
|
|
20
|
-
- **Documentation**: Comprehensive documentation is available
|
21
|
-
- **Tutorial**: An interactive Jupyter notebook tutorial can be found
|
20
|
+
- **Documentation**: Comprehensive documentation is available [here](Documentation link).
|
21
|
+
- **Tutorial**: An interactive Jupyter notebook tutorial can be found [here](https://github.com/riskportal/network-tutorial).
|
22
22
|
We highly recommend new users to consult the documentation and tutorial early on to fully leverage RISK's capabilities.
|
23
23
|
|
24
24
|
## Installation
|
@@ -42,7 +42,7 @@ pip install risk-network
|
|
42
42
|
|
43
43
|
We applied RISK to a *Saccharomyces cerevisiae* protein–protein interaction network, revealing both established and novel functional relationships. The visualization below highlights key biological processes such as ribosomal assembly and mitochondrial organization.
|
44
44
|
|
45
|
-

|
46
46
|
|
47
47
|
RISK successfully detected both known and novel functional clusters within the yeast interactome. Clusters related to Golgi transport and actin nucleation were clearly defined and closely located, showcasing RISK's ability to map well-characterized interactions. Additionally, RISK identified links between mRNA processing pathways and vesicle trafficking proteins, consistent with recent studies demonstrating the role of vesicles in mRNA localization and stability.
|
48
48
|
|
@@ -121,7 +121,7 @@ def trim_domains_and_top_annotations(
|
|
121
121
|
].transform(lambda x: (x.rank(pct=True) * 10).apply(np.ceil).astype(int))
|
122
122
|
# Multiply 'words' column by normalized values
|
123
123
|
top_annotations["words"] = top_annotations.apply(
|
124
|
-
lambda row: " ".join([row["words"]] * row["normalized_value"]), axis=1
|
124
|
+
lambda row: " ".join([str(row["words"])] * row["normalized_value"]), axis=1
|
125
125
|
)
|
126
126
|
|
127
127
|
# Generate domain labels
|
@@ -13,6 +13,7 @@ import zipfile
|
|
13
13
|
from xml.dom import minidom
|
14
14
|
|
15
15
|
import networkx as nx
|
16
|
+
import numpy as np
|
16
17
|
import pandas as pd
|
17
18
|
|
18
19
|
from risk.network.geometry import assign_edge_lengths
|
@@ -490,7 +491,7 @@ class NetworkIO:
|
|
490
491
|
if "x" not in attrs or "y" not in attrs:
|
491
492
|
if (
|
492
493
|
"pos" in attrs
|
493
|
-
and isinstance(attrs["pos"], (tuple,
|
494
|
+
and isinstance(attrs["pos"], (list, tuple, np.ndarray))
|
494
495
|
and len(attrs["pos"]) >= 2
|
495
496
|
):
|
496
497
|
attrs["x"], attrs["y"] = attrs["pos"][
|
@@ -44,8 +44,8 @@ class Canvas:
|
|
44
44
|
Args:
|
45
45
|
title (str, optional): Title of the plot. Defaults to None.
|
46
46
|
subtitle (str, optional): Subtitle of the plot. Defaults to None.
|
47
|
-
title_fontsize (int, optional): Font size for the title. Defaults to
|
48
|
-
subtitle_fontsize (int, optional): Font size for the subtitle. Defaults to
|
47
|
+
title_fontsize (int, optional): Font size for the title. Defaults to 20.
|
48
|
+
subtitle_fontsize (int, optional): Font size for the subtitle. Defaults to 14.
|
49
49
|
font (str, optional): Font family used for both title and subtitle. Defaults to "Arial".
|
50
50
|
title_color (str, optional): Color of the title text. Defaults to "black".
|
51
51
|
subtitle_color (str, optional): Color of the subtitle text. Defaults to "gray".
|
@@ -90,11 +90,14 @@ class Canvas:
|
|
90
90
|
|
91
91
|
# Plot subtitle if provided
|
92
92
|
if subtitle:
|
93
|
-
# Calculate the subtitle's y position based on title
|
94
|
-
|
93
|
+
# Calculate the subtitle's y position based on the midpoint of the title and subtitle_offset
|
94
|
+
# Calculate the approximate height of the title in relative axis units
|
95
|
+
title_height = title_fontsize / fig.bbox.height
|
96
|
+
# Position the subtitle relative to the title's center (title_y - half the title height)
|
97
|
+
subtitle_y_position = title_y - (title_height / 2) - subtitle_offset
|
95
98
|
self.ax.figure.text(
|
96
99
|
0.5, # Ensure horizontal centering for subtitle
|
97
|
-
subtitle_y_position,
|
100
|
+
subtitle_y_position, # Position subtitle based on the center of the title
|
98
101
|
subtitle,
|
99
102
|
ha="center",
|
100
103
|
va="top",
|
@@ -8,6 +8,7 @@ from typing import List, Tuple, Union
|
|
8
8
|
import matplotlib.pyplot as plt
|
9
9
|
import numpy as np
|
10
10
|
|
11
|
+
from risk.log import params
|
11
12
|
from risk.network.graph import NetworkGraph
|
12
13
|
from risk.network.plot.canvas import Canvas
|
13
14
|
from risk.network.plot.contour import Contour
|
@@ -30,6 +31,7 @@ class NetworkPlotter(Canvas, Network, Contour, Labels):
|
|
30
31
|
figsize: Tuple = (10, 10),
|
31
32
|
background_color: Union[str, List, Tuple, np.ndarray] = "white",
|
32
33
|
background_alpha: Union[float, None] = 1.0,
|
34
|
+
pad: float = 0.3,
|
33
35
|
) -> None:
|
34
36
|
"""Initialize the NetworkPlotter with a NetworkGraph object and plotting parameters.
|
35
37
|
|
@@ -39,6 +41,7 @@ class NetworkPlotter(Canvas, Network, Contour, Labels):
|
|
39
41
|
background_color (str, list, tuple, np.ndarray, optional): Background color of the plot. Defaults to "white".
|
40
42
|
background_alpha (float, None, optional): Transparency level of the background color. If provided, it overrides
|
41
43
|
any existing alpha values found in background_color. Defaults to 1.0.
|
44
|
+
pad (float, optional): Padding value to adjust the axis limits. Defaults to 0.3.
|
42
45
|
"""
|
43
46
|
self.graph = graph
|
44
47
|
# Initialize the plot with the specified parameters
|
@@ -47,6 +50,7 @@ class NetworkPlotter(Canvas, Network, Contour, Labels):
|
|
47
50
|
figsize=figsize,
|
48
51
|
background_color=background_color,
|
49
52
|
background_alpha=background_alpha,
|
53
|
+
pad=pad,
|
50
54
|
)
|
51
55
|
super().__init__(graph=graph, ax=self.ax)
|
52
56
|
|
@@ -56,6 +60,7 @@ class NetworkPlotter(Canvas, Network, Contour, Labels):
|
|
56
60
|
figsize: Tuple,
|
57
61
|
background_color: Union[str, List, Tuple, np.ndarray],
|
58
62
|
background_alpha: Union[float, None],
|
63
|
+
pad: float,
|
59
64
|
) -> plt.Axes:
|
60
65
|
"""Set up the plot with figure size and background color.
|
61
66
|
|
@@ -65,10 +70,19 @@ class NetworkPlotter(Canvas, Network, Contour, Labels):
|
|
65
70
|
background_color (str): Background color of the plot.
|
66
71
|
background_alpha (float, None, optional): Transparency level of the background color. If provided, it overrides any
|
67
72
|
existing alpha values found in background_color.
|
73
|
+
pad (float, optional): Padding value to adjust the axis limits.
|
68
74
|
|
69
75
|
Returns:
|
70
76
|
plt.Axes: The axis object for the plot.
|
71
77
|
"""
|
78
|
+
# Log the plotter settings
|
79
|
+
params.log_plotter(
|
80
|
+
figsize=figsize,
|
81
|
+
background_color=background_color,
|
82
|
+
background_alpha=background_alpha,
|
83
|
+
pad=pad,
|
84
|
+
)
|
85
|
+
|
72
86
|
# Extract node coordinates from the network graph
|
73
87
|
node_coordinates = graph.node_coordinates
|
74
88
|
# Calculate the center and radius of the bounding box around the network
|
@@ -78,8 +92,8 @@ class NetworkPlotter(Canvas, Network, Contour, Labels):
|
|
78
92
|
fig, ax = plt.subplots(figsize=figsize)
|
79
93
|
fig.tight_layout() # Adjust subplot parameters to give specified padding
|
80
94
|
# Set axis limits based on the calculated bounding box and radius
|
81
|
-
ax.set_xlim([center[0] - radius -
|
82
|
-
ax.set_ylim([center[1] - radius -
|
95
|
+
ax.set_xlim([center[0] - radius - pad, center[0] + radius + pad])
|
96
|
+
ax.set_ylim([center[1] - radius - pad, center[1] + radius + pad])
|
83
97
|
ax.set_aspect("equal") # Ensure the aspect ratio is equal
|
84
98
|
|
85
99
|
# Set the background color of the plot
|
@@ -356,6 +356,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
356
356
|
figsize: Tuple = (10, 10),
|
357
357
|
background_color: str = "white",
|
358
358
|
background_alpha: Union[float, None] = 1.0,
|
359
|
+
pad: float = 0.3,
|
359
360
|
) -> NetworkPlotter:
|
360
361
|
"""Get a NetworkPlotter object for plotting.
|
361
362
|
|
@@ -365,16 +366,12 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
365
366
|
background_color (str, optional): Background color of the plot. Defaults to "white".
|
366
367
|
background_alpha (float, None, optional): Transparency level of the background color. If provided, it overrides
|
367
368
|
any existing alpha values found in background_color. Defaults to 1.0.
|
369
|
+
pad (float, optional): Padding value to adjust the axis limits. Defaults to 0.3.
|
368
370
|
|
369
371
|
Returns:
|
370
372
|
NetworkPlotter: A NetworkPlotter object configured with the given parameters.
|
371
373
|
"""
|
372
374
|
log_header("Loading plotter")
|
373
|
-
# Log the plotter settings
|
374
|
-
params.log_plotter(
|
375
|
-
figsize=figsize,
|
376
|
-
background_color=background_color,
|
377
|
-
)
|
378
375
|
|
379
376
|
# Initialize and return a NetworkPlotter object
|
380
377
|
return NetworkPlotter(
|
@@ -382,6 +379,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
382
379
|
figsize=figsize,
|
383
380
|
background_color=background_color,
|
384
381
|
background_alpha=background_alpha,
|
382
|
+
pad=pad,
|
385
383
|
)
|
386
384
|
|
387
385
|
def _load_neighborhoods(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: risk-network
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.8b10
|
4
4
|
Summary: A Python package for biological network analysis
|
5
5
|
Author: Ira Horecka
|
6
6
|
Author-email: Ira Horecka <ira89@icloud.com>
|
@@ -709,7 +709,7 @@ Requires-Dist: statsmodels
|
|
709
709
|
Requires-Dist: threadpoolctl
|
710
710
|
Requires-Dist: tqdm
|
711
711
|
|
712
|
-
# RISK
|
712
|
+
# RISK Network
|
713
713
|
|
714
714
|
<p align="center">
|
715
715
|
<img src="https://i.imgur.com/8TleEJs.png" width="50%" />
|
@@ -728,8 +728,8 @@ Requires-Dist: tqdm
|
|
728
728
|
|
729
729
|
## Documentation and Tutorial
|
730
730
|
|
731
|
-
- **Documentation**: Comprehensive documentation is available
|
732
|
-
- **Tutorial**: An interactive Jupyter notebook tutorial can be found
|
731
|
+
- **Documentation**: Comprehensive documentation is available [here](Documentation link).
|
732
|
+
- **Tutorial**: An interactive Jupyter notebook tutorial can be found [here](https://github.com/riskportal/network-tutorial).
|
733
733
|
We highly recommend new users to consult the documentation and tutorial early on to fully leverage RISK's capabilities.
|
734
734
|
|
735
735
|
## Installation
|
@@ -753,7 +753,7 @@ pip install risk-network
|
|
753
753
|
|
754
754
|
We applied RISK to a *Saccharomyces cerevisiae* protein–protein interaction network, revealing both established and novel functional relationships. The visualization below highlights key biological processes such as ribosomal assembly and mitochondrial organization.
|
755
755
|
|
756
|
-

|
757
757
|
|
758
758
|
RISK successfully detected both known and novel functional clusters within the yeast interactome. Clusters related to Golgi transport and actin nucleation were clearly defined and closely located, showcasing RISK's ability to map well-characterized interactions. Additionally, RISK identified links between mRNA processing pathways and vesicle trafficking proteins, consistent with recent studies demonstrating the role of vesicles in mRNA localization and stability.
|
759
759
|
|
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
|