risk-network 0.0.8b12__tar.gz → 0.0.8b14__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.8b12 → risk_network-0.0.8b14}/PKG-INFO +1 -1
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/__init__.py +1 -1
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/network/graph.py +2 -1
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/network/plot/network.py +10 -4
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk_network.egg-info/PKG-INFO +1 -1
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/LICENSE +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/MANIFEST.in +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/README.md +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/pyproject.toml +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/annotations/__init__.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/annotations/annotations.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/annotations/io.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/constants.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/log/__init__.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/log/config.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/log/params.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/neighborhoods/__init__.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/neighborhoods/community.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/neighborhoods/domains.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/neighborhoods/neighborhoods.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/network/__init__.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/network/geometry.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/network/io.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/network/plot/__init__.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/network/plot/canvas.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/network/plot/contour.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/network/plot/labels.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/network/plot/plotter.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/network/plot/utils.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/risk.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/stats/__init__.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/stats/hypergeom.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/stats/permutation/__init__.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/stats/permutation/permutation.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/stats/permutation/test_functions.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/stats/poisson.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk/stats/stats.py +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk_network.egg-info/SOURCES.txt +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk_network.egg-info/dependency_links.txt +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk_network.egg-info/requires.txt +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/risk_network.egg-info/top_level.txt +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/setup.cfg +0 -0
- {risk_network-0.0.8b12 → risk_network-0.0.8b14}/setup.py +0 -0
@@ -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.
|
@@ -234,11 +234,17 @@ 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
|
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
|
238
239
|
adjusted_network_colors = np.where(
|
239
|
-
|
240
|
-
|
241
|
-
|
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
|
242
248
|
)
|
243
249
|
return adjusted_network_colors
|
244
250
|
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|