risk-network 0.0.8b13__py3-none-any.whl → 0.0.8b14__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 +2 -1
- risk/network/plot/network.py +10 -14
- {risk_network-0.0.8b13.dist-info → risk_network-0.0.8b14.dist-info}/METADATA +1 -1
- {risk_network-0.0.8b13.dist-info → risk_network-0.0.8b14.dist-info}/RECORD +8 -8
- {risk_network-0.0.8b13.dist-info → risk_network-0.0.8b14.dist-info}/LICENSE +0 -0
- {risk_network-0.0.8b13.dist-info → risk_network-0.0.8b14.dist-info}/WHEEL +0 -0
- {risk_network-0.0.8b13.dist-info → risk_network-0.0.8b14.dist-info}/top_level.txt +0 -0
risk/__init__.py
CHANGED
risk/network/graph.py
CHANGED
@@ -203,7 +203,8 @@ def _transform_colors(
|
|
203
203
|
max_scale: float = 1.0,
|
204
204
|
scale_factor: float = 1.0,
|
205
205
|
) -> np.ndarray:
|
206
|
-
"""Transform colors using power scaling to emphasize high enrichment sums more.
|
206
|
+
"""Transform colors using power scaling to emphasize high enrichment sums more. Black colors are replaced with
|
207
|
+
very dark grey to avoid issues with color scaling (rgb(0.1, 0.1, 0.1)).
|
207
208
|
|
208
209
|
Args:
|
209
210
|
colors (np.ndarray): An array of RGBA colors.
|
risk/network/plot/network.py
CHANGED
@@ -234,22 +234,18 @@ class Network:
|
|
234
234
|
network_colors[:, 3] = alpha # Apply the alpha value to the enriched nodes' A channel
|
235
235
|
# Convert the non-enriched color to RGBA using the to_rgba helper function
|
236
236
|
nonenriched_color = to_rgba(color=nonenriched_color, alpha=nonenriched_alpha)
|
237
|
-
|
238
|
-
#
|
239
|
-
color_sums = network_colors[:, :3].sum(axis=1)
|
240
|
-
# Find the index of the darkest color (the lowest sum of RGB values)
|
241
|
-
darkest_color_index = np.argmin(color_sums)
|
242
|
-
# Extract the darkest color's RGB values
|
243
|
-
darkest_color = network_colors[darkest_color_index, :3]
|
244
|
-
# Adjust node colors: replace the darkest color with the non-enriched color
|
237
|
+
# Adjust node colors: replace any nodes where all three RGB values are equal and less than 0.1
|
238
|
+
# 0.1 is a predefined threshold for the minimum color intensity
|
245
239
|
adjusted_network_colors = np.where(
|
246
|
-
|
247
|
-
network_colors[:, :3]
|
248
|
-
|
249
|
-
|
250
|
-
|
240
|
+
(
|
241
|
+
np.all(network_colors[:, :3] < 0.1, axis=1)
|
242
|
+
& np.all(network_colors[:, :3] == network_colors[:, 0:1], axis=1)
|
243
|
+
)[:, None],
|
244
|
+
np.tile(
|
245
|
+
np.array(nonenriched_color), (network_colors.shape[0], 1)
|
246
|
+
), # Replace with the full RGBA non-enriched color
|
247
|
+
network_colors, # Keep the original colors where no match is found
|
251
248
|
)
|
252
|
-
|
253
249
|
return adjusted_network_colors
|
254
250
|
|
255
251
|
def get_annotated_node_sizes(
|
@@ -1,4 +1,4 @@
|
|
1
|
-
risk/__init__.py,sha256=
|
1
|
+
risk/__init__.py,sha256=m9OKov65SuifezPxufH3hRsggm2xXDSzlRDR6p5FURo,113
|
2
2
|
risk/constants.py,sha256=XInRaH78Slnw_sWgAsBFbUHkyA0h0jL0DKGuQNbOvjM,550
|
3
3
|
risk/risk.py,sha256=slJXca_a726_D7oXwe765HaKTv3ZrOvhttyrWdCGPkA,21231
|
4
4
|
risk/annotations/__init__.py,sha256=vUpVvMRE5if01Ic8QY6M2Ae3EFGJHdugEe9PdEkAW4Y,138
|
@@ -13,13 +13,13 @@ risk/neighborhoods/domains.py,sha256=D5MUIghbwyKKCAE8PN_HXvsO9NxLTGejQmyEqetD1Bk
|
|
13
13
|
risk/neighborhoods/neighborhoods.py,sha256=M-wL4xB_BUTlSZg90swygO5NdrZ6hFUFqs6jsiZaqHk,18260
|
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=WxWh1BZvH9E_kgDb5HrwcQ-30hM8aNHPkBm2l3vzkAw,16973
|
17
17
|
risk/network/io.py,sha256=u0PPcKjp6Xze--7eDOlvalYkjQ9S2sjiC-ac2476PUI,22942
|
18
18
|
risk/network/plot/__init__.py,sha256=MfmaXJgAZJgXZ2wrhK8pXwzETlcMaLChhWXKAozniAo,98
|
19
19
|
risk/network/plot/canvas.py,sha256=LXHndwanWIBShChoPag8zgGHF2P9MFWYdEnLKc2eeb0,10295
|
20
20
|
risk/network/plot/contour.py,sha256=YPG8Uz0VlJ4skLdGaTH_FmQN6A_ArK8XSTNo1LzkSws,14276
|
21
21
|
risk/network/plot/labels.py,sha256=PV21hig6gQJZRgfUAP9-zpn4wEmQFEjS2_X63SgzWMs,42064
|
22
|
-
risk/network/plot/network.py,sha256=
|
22
|
+
risk/network/plot/network.py,sha256=t5eMh7mBJOh_Wa19aK8g_1zpL7maiXZAYw-TEFHxAVM,12819
|
23
23
|
risk/network/plot/plotter.py,sha256=rQV4Db6Ud86FJm11uaBvgSuzpmGsrZxnsRnUKjg6w84,5572
|
24
24
|
risk/network/plot/utils.py,sha256=jZgI8EysSjviQmdYAceZk2MwJXcdeFAkYp-odZNqV0k,6316
|
25
25
|
risk/stats/__init__.py,sha256=WcgoETQ-hS0LQqKRsAMIPtP15xZ-4eul6VUBuUx4Wzc,220
|
@@ -29,8 +29,8 @@ risk/stats/stats.py,sha256=kvShov-94W6ffgDUTb522vB9hDJQSyTsYif_UIaFfSM,7059
|
|
29
29
|
risk/stats/permutation/__init__.py,sha256=neJp7FENC-zg_CGOXqv-iIvz1r5XUKI9Ruxhmq7kDOI,105
|
30
30
|
risk/stats/permutation/permutation.py,sha256=D84Rcpt6iTQniK0PfQGcw9bLcHbMt9p-ARcurUnIXZQ,10095
|
31
31
|
risk/stats/permutation/test_functions.py,sha256=lftOude6hee0pyR80HlBD32522JkDoN5hrKQ9VEbuoY,2345
|
32
|
-
risk_network-0.0.
|
33
|
-
risk_network-0.0.
|
34
|
-
risk_network-0.0.
|
35
|
-
risk_network-0.0.
|
36
|
-
risk_network-0.0.
|
32
|
+
risk_network-0.0.8b14.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
33
|
+
risk_network-0.0.8b14.dist-info/METADATA,sha256=QUStGHs-tu2cPCAtumH931wZx1ll8PUaewDgPROd9hM,47498
|
34
|
+
risk_network-0.0.8b14.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
35
|
+
risk_network-0.0.8b14.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
|
36
|
+
risk_network-0.0.8b14.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|