risk-network 0.0.5b0__py3-none-any.whl → 0.0.5b2__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/network/graph.py +1 -2
- risk/network/plot.py +3 -7
- risk/risk.py +4 -0
- {risk_network-0.0.5b0.dist-info → risk_network-0.0.5b2.dist-info}/METADATA +1 -1
- {risk_network-0.0.5b0.dist-info → risk_network-0.0.5b2.dist-info}/RECORD +9 -9
- {risk_network-0.0.5b0.dist-info → risk_network-0.0.5b2.dist-info}/LICENSE +0 -0
- {risk_network-0.0.5b0.dist-info → risk_network-0.0.5b2.dist-info}/WHEEL +0 -0
- {risk_network-0.0.5b0.dist-info → risk_network-0.0.5b2.dist-info}/top_level.txt +0 -0
risk/__init__.py
CHANGED
risk/network/graph.py
CHANGED
@@ -11,7 +11,6 @@ import networkx as nx
|
|
11
11
|
import numpy as np
|
12
12
|
import pandas as pd
|
13
13
|
import matplotlib
|
14
|
-
import matplotlib.cm as cm
|
15
14
|
|
16
15
|
|
17
16
|
class NetworkGraph:
|
@@ -270,7 +269,7 @@ def _get_colors(
|
|
270
269
|
rgba = matplotlib.colors.to_rgba(kwargs["color"])
|
271
270
|
rgbas = [rgba] * num_colors_to_generate
|
272
271
|
else:
|
273
|
-
colormap =
|
272
|
+
colormap = matplotlib.colormaps.get_cmap(cmap)
|
274
273
|
# Generate evenly distributed color positions
|
275
274
|
color_positions = np.linspace(0, 1, num_colors_to_generate)
|
276
275
|
random.shuffle(color_positions) # Shuffle the positions to randomize colors
|
risk/network/plot.py
CHANGED
@@ -33,7 +33,7 @@ class NetworkPlotter:
|
|
33
33
|
plot_outline: bool = True,
|
34
34
|
outline_color: str = "black",
|
35
35
|
outline_scale: float = 1.0,
|
36
|
-
linestyle: str = "
|
36
|
+
linestyle: str = "dashed",
|
37
37
|
) -> None:
|
38
38
|
"""Initialize the NetworkPlotter with a NetworkGraph object and plotting parameters.
|
39
39
|
|
@@ -44,7 +44,7 @@ class NetworkPlotter:
|
|
44
44
|
plot_outline (bool, optional): Whether to plot the network perimeter circle. Defaults to True.
|
45
45
|
outline_color (str, optional): Color of the network perimeter circle. Defaults to "black".
|
46
46
|
outline_scale (float, optional): Outline scaling factor for the perimeter diameter. Defaults to 1.0.
|
47
|
-
linestyle (str): Line style for the network perimeter circle (e.g., dashed, solid). Defaults to "
|
47
|
+
linestyle (str): Line style for the network perimeter circle (e.g., dashed, solid). Defaults to "dashed".
|
48
48
|
"""
|
49
49
|
self.graph = graph
|
50
50
|
# Initialize the plot with the specified parameters
|
@@ -499,10 +499,6 @@ class NetworkPlotter:
|
|
499
499
|
fontcolor = fontcolor[selected_indices]
|
500
500
|
arrow_color = arrow_color[selected_indices]
|
501
501
|
|
502
|
-
# Update the terms in the graph after omitting words and filtering
|
503
|
-
for domain, terms in filtered_domain_terms.items():
|
504
|
-
self.graph.trimmed_domain_to_term[domain] = terms
|
505
|
-
|
506
502
|
# Calculate the bounding box around the network
|
507
503
|
center, radius = _calculate_bounding_box(
|
508
504
|
self.graph.node_coordinates, radius_margin=perimeter_scale
|
@@ -514,7 +510,7 @@ class NetworkPlotter:
|
|
514
510
|
# Annotate the network with labels
|
515
511
|
for idx, (domain, pos) in enumerate(best_label_positions.items()):
|
516
512
|
centroid = filtered_domain_centroids[domain]
|
517
|
-
annotations =
|
513
|
+
annotations = filtered_domain_terms[domain].split(" ")[:max_words]
|
518
514
|
self.ax.annotate(
|
519
515
|
"\n".join(annotations),
|
520
516
|
xy=centroid,
|
risk/risk.py
CHANGED
@@ -352,6 +352,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
352
352
|
plot_outline: bool = True,
|
353
353
|
outline_color: str = "black",
|
354
354
|
outline_scale: float = 1.00,
|
355
|
+
linestyle: str = "dashed",
|
355
356
|
) -> NetworkPlotter:
|
356
357
|
"""Get a NetworkPlotter object for plotting.
|
357
358
|
|
@@ -362,6 +363,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
362
363
|
plot_outline (bool, optional): Whether to plot the network outline. Defaults to True.
|
363
364
|
outline_color (str, optional): Color of the outline. Defaults to "black".
|
364
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".
|
365
367
|
|
366
368
|
Returns:
|
367
369
|
NetworkPlotter: A NetworkPlotter object configured with the given parameters.
|
@@ -374,6 +376,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
374
376
|
plot_outline=plot_outline,
|
375
377
|
outline_color=outline_color,
|
376
378
|
outline_scale=outline_scale,
|
379
|
+
linestyle=linestyle,
|
377
380
|
)
|
378
381
|
|
379
382
|
# Initialize and return a NetworkPlotter object
|
@@ -384,6 +387,7 @@ class RISK(NetworkIO, AnnotationsIO):
|
|
384
387
|
plot_outline=plot_outline,
|
385
388
|
outline_color=outline_color,
|
386
389
|
outline_scale=outline_scale,
|
390
|
+
linestyle=linestyle,
|
387
391
|
)
|
388
392
|
|
389
393
|
def _load_neighborhoods(
|
@@ -1,6 +1,6 @@
|
|
1
|
-
risk/__init__.py,sha256=
|
1
|
+
risk/__init__.py,sha256=g5Fqdi0t7DMMUt-AIDs34tPprO6samWzfE57y5gp5Tg,112
|
2
2
|
risk/constants.py,sha256=AICk3x5qRQhls_ijTb4VdbdxU6mZ1aLGbAjLEdBwfJI,550
|
3
|
-
risk/risk.py,sha256=
|
3
|
+
risk/risk.py,sha256=UYM_Pf2Db-lbf4O5T2v5zKutz_GLXK-f43PgYT6xRyY,21328
|
4
4
|
risk/annotations/__init__.py,sha256=vUpVvMRE5if01Ic8QY6M2Ae3EFGJHdugEe9PdEkAW4Y,138
|
5
5
|
risk/annotations/annotations.py,sha256=t4aLwROCFHcqk8g-viuwkFG--HqVpVN_2yVVcjhg6wI,10534
|
6
6
|
risk/annotations/io.py,sha256=TMicRACfY8bNtmbvVrxHoh8zkOVLOIhZwWrpxUlR28Q,7988
|
@@ -13,9 +13,9 @@ risk/neighborhoods/domains.py,sha256=HwuChmZH0RGD9eQOvk2-ezQDJRUHHn93vhVgHb-kX6I
|
|
13
13
|
risk/neighborhoods/neighborhoods.py,sha256=SqYJaT49rUj77ts0XsPXb9cURM11aGh2Teks0nBH_4s,13939
|
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=
|
16
|
+
risk/network/graph.py,sha256=F_SY7nZev6XZuHwkJnVdeow-oMSmR4u8AUiFCrh6yvk,11543
|
17
17
|
risk/network/io.py,sha256=otiRG6uT6HLgbbJql7X2wjYxab8OFJSgRoWJlcDoyu4,20291
|
18
|
-
risk/network/plot.py,sha256=
|
18
|
+
risk/network/plot.py,sha256=HBF8uQVNddU6v_vLWHDvhw2YeKQ1zkNR1SINd-KGk3Q,40267
|
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.5b2.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
27
|
+
risk_network-0.0.5b2.dist-info/METADATA,sha256=YYcItoAoouEEdFmBo8DsvAw3gmp2M22RfNNSYaSYjWs,43236
|
28
|
+
risk_network-0.0.5b2.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
29
|
+
risk_network-0.0.5b2.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
|
30
|
+
risk_network-0.0.5b2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|