risk-network 0.0.8b12__py3-none-any.whl → 0.0.8b13__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
@@ -7,4 +7,4 @@ RISK: RISK Infers Spatial Kinships
7
7
 
8
8
  from risk.risk import RISK
9
9
 
10
- __version__ = "0.0.8-beta.12"
10
+ __version__ = "0.0.8-beta.13"
@@ -234,12 +234,22 @@ 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
- # Adjust node colors: replace any fully black nodes (RGB == 0) with the non-enriched color and its alpha
237
+
238
+ # Compute the sum of RGB values for each color (ignoring alpha)
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
238
245
  adjusted_network_colors = np.where(
239
- np.all(network_colors[:, :3] == 0, axis=1, keepdims=True), # Check RGB values only
246
+ np.all(
247
+ network_colors[:, :3] == darkest_color, axis=1, keepdims=True
248
+ ), # Check if the color matches the darkest color
240
249
  np.array(nonenriched_color), # Apply the non-enriched color with alpha
241
250
  network_colors, # Keep the original colors for enriched nodes
242
251
  )
252
+
243
253
  return adjusted_network_colors
244
254
 
245
255
  def get_annotated_node_sizes(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: risk-network
3
- Version: 0.0.8b12
3
+ Version: 0.0.8b13
4
4
  Summary: A Python package for biological network analysis
5
5
  Author: Ira Horecka
6
6
  Author-email: Ira Horecka <ira89@icloud.com>
@@ -1,4 +1,4 @@
1
- risk/__init__.py,sha256=likYFfZ5PmIhnkglQu8_zeaHGOBKURKzUUbrBCBZY8o,113
1
+ risk/__init__.py,sha256=NFLV6xDRDZaq7QKj28pf0H3eQA2SphZ1FXgsKXfGbkk,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
@@ -19,7 +19,7 @@ risk/network/plot/__init__.py,sha256=MfmaXJgAZJgXZ2wrhK8pXwzETlcMaLChhWXKAozniAo
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=83ZXjGGrgRprWvDldWfhRe6SFXTv_QoI20OWzyEmVJU,12593
22
+ risk/network/plot/network.py,sha256=iikZpPKFxeIJgAlp0Wd6kXVzVp341wHpvQ2vLFdQELw,13000
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.8b12.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
33
- risk_network-0.0.8b12.dist-info/METADATA,sha256=-wKC6cGDbBGW7fG0wmdkxHRZKHvC5knHUYMqD0egagI,47498
34
- risk_network-0.0.8b12.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
35
- risk_network-0.0.8b12.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
36
- risk_network-0.0.8b12.dist-info/RECORD,,
32
+ risk_network-0.0.8b13.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
33
+ risk_network-0.0.8b13.dist-info/METADATA,sha256=_Fn1n_WLyoZ8NTHq_bfr3tnx9_16CXcmvyWWrclNNFY,47498
34
+ risk_network-0.0.8b13.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
35
+ risk_network-0.0.8b13.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
36
+ risk_network-0.0.8b13.dist-info/RECORD,,