risk-network 0.0.9b13__py3-none-any.whl → 0.0.9b14__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.9-beta.13"
10
+ __version__ = "0.0.9-beta.14"
risk/network/io.py CHANGED
@@ -379,15 +379,17 @@ class NetworkIO:
379
379
  node_y_positions = {}
380
380
  for node in cyjs_data["elements"]["nodes"]:
381
381
  node_data = node["data"]
382
- node_id = node_data["id_original"]
382
+ # Use the original node ID if available, otherwise use the default ID
383
+ node_id = node_data.get("id_original", node_data.get("id"))
383
384
  node_x_positions[node_id] = node["position"]["x"]
384
385
  node_y_positions[node_id] = node["position"]["y"]
385
386
 
386
387
  # Process edges and add them to the graph
387
388
  for edge in cyjs_data["elements"]["edges"]:
388
389
  edge_data = edge["data"]
389
- source = edge_data[f"{source_label}_original"]
390
- target = edge_data[f"{target_label}_original"]
390
+ # Use the original source and target labels if available, otherwise fall back to default labels
391
+ source = edge_data.get(f"{source_label}_original", edge_data.get(source_label))
392
+ target = edge_data.get(f"{target_label}_original", edge_data.get(target_label))
391
393
  # Add the edge to the graph, optionally including weights
392
394
  if self.weight_label is not None and self.weight_label in edge_data:
393
395
  weight = float(edge_data[self.weight_label])
@@ -250,11 +250,11 @@ class Network:
250
250
  nonsignificant_color_rgba = to_rgba(
251
251
  color=nonsignificant_color, alpha=nonsignificant_alpha, num_repeats=1
252
252
  ) # num_repeats=1 for a single color
253
- # Adjust node colors: replace any nodes where all three RGB values are equal and less than 0.1
253
+ # Adjust node colors: replace any nodes where all three RGB values are equal and less than or equal to 0.1
254
254
  # 0.1 is a predefined threshold for the minimum color intensity
255
255
  adjusted_network_colors = np.where(
256
256
  (
257
- np.all(network_colors[:, :3] < 0.1, axis=1)
257
+ np.all(network_colors[:, :3] <= 0.1, axis=1)
258
258
  & np.all(network_colors[:, :3] == network_colors[:, 0:1], axis=1)
259
259
  )[:, None],
260
260
  np.tile(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: risk-network
3
- Version: 0.0.9b13
3
+ Version: 0.0.9b14
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=bXkN8xIF7g0uIiSoCAXatSRkI_KRTbjWye4l_trCCfk,113
1
+ risk/__init__.py,sha256=Iidh958zzqC-3UdCs4vJpPixUJXUPBHxeQJYNHO4IHI,113
2
2
  risk/constants.py,sha256=XInRaH78Slnw_sWgAsBFbUHkyA0h0jL0DKGuQNbOvjM,550
3
3
  risk/risk.py,sha256=MXu8T93NUgMDl3NaZDbm0j9c4KWwzx-kmp9Rd1ax0N4,23534
4
4
  risk/annotations/__init__.py,sha256=kXgadEXaCh0z8OyhOhTj7c3qXGmWgOhaSZ4gSzSb59U,147
@@ -13,7 +13,7 @@ risk/neighborhoods/domains.py,sha256=t91xSpx9Ty9hSlhRq2_XwyPpBP7sjKhovcPPvkwWtf0
13
13
  risk/neighborhoods/neighborhoods.py,sha256=XB2Gd0xghKKBNkwp1H-1138NegTlAiyOqAkv_vaLEZM,21150
14
14
  risk/network/__init__.py,sha256=iEPeJdZfqp0toxtbElryB8jbz9_t_k4QQ3iDvKE8C_0,126
15
15
  risk/network/geometry.py,sha256=gFtYUj9j9aul4paKq_qSGJn39Nazxu_MXv8m-tYYtrk,6840
16
- risk/network/io.py,sha256=AWSbZGLZHtl72KSlafQlcYoG00YLSznG7UYDi_wDT7M,22958
16
+ risk/network/io.py,sha256=Dl-Xwv1gWdmvDkZ77581s_JYO5ujZjvmHG7wq_-ApZU,23239
17
17
  risk/network/graph/__init__.py,sha256=H0YEiwqZ02LBTkH4blPwUjQ-DOUnhaTTNHM0BcXii6U,81
18
18
  risk/network/graph/network.py,sha256=JzYbrgJLiNWFyPIR6_qNSjMtmXmfzRv2FwWSdyg8HjY,12205
19
19
  risk/network/graph/summary.py,sha256=h2bpUjfwI1NMflkKwplGQEGPswfAtunormdTIEQYbvs,8987
@@ -21,7 +21,7 @@ risk/network/plot/__init__.py,sha256=MfmaXJgAZJgXZ2wrhK8pXwzETlcMaLChhWXKAozniAo
21
21
  risk/network/plot/canvas.py,sha256=W8dFv4XYTzCWXBchgsc0esOQRn4usM4LkwNGPSDMobE,13357
22
22
  risk/network/plot/contour.py,sha256=VONX9l6owrZvWtR0mWQ6z2GSd1YXIv5wV_sf5ROQLT4,15581
23
23
  risk/network/plot/labels.py,sha256=aU_ClDGVPHyQ3H5E_ygx8hsMhrpJB0i9Cn65PlLmw7s,45679
24
- risk/network/plot/network.py,sha256=_K8Am2y6zSGrm3fAgMbXxzgspbugJi3uK4_tG8qqGoI,14015
24
+ risk/network/plot/network.py,sha256=0j7pAZgt9PBfFCnOz4QwXnYWTlnLjTrtMm-50I_1G8o,14028
25
25
  risk/network/plot/plotter.py,sha256=eS1vHqvOA2O001Rq7WiDcgqcehJ3fg4OPfvkezH4erw,5771
26
26
  risk/network/plot/utils/colors.py,sha256=9zuU2O-Nkpljb1yVGUR_IjqD1y-wH6Bf6Vm1MMVB0Lo,18718
27
27
  risk/network/plot/utils/layout.py,sha256=6o7idoWQnyzujSWOFXQykUvyPy8NuRtJV04TnlbXXBo,3647
@@ -32,8 +32,8 @@ risk/stats/stats.py,sha256=z8NrhiVj4BzJ250bVLfytpmfC7RzYu7mBuIZD_l0aCA,7222
32
32
  risk/stats/permutation/__init__.py,sha256=neJp7FENC-zg_CGOXqv-iIvz1r5XUKI9Ruxhmq7kDOI,105
33
33
  risk/stats/permutation/permutation.py,sha256=meBNSrbRa9P8WJ54n485l0H7VQJlMSfHqdN4aCKYCtQ,10105
34
34
  risk/stats/permutation/test_functions.py,sha256=lftOude6hee0pyR80HlBD32522JkDoN5hrKQ9VEbuoY,2345
35
- risk_network-0.0.9b13.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
36
- risk_network-0.0.9b13.dist-info/METADATA,sha256=tbqUuKfdv5QjAprQruLMmTk5wzGWrwVqg528BeWcynQ,47552
37
- risk_network-0.0.9b13.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
38
- risk_network-0.0.9b13.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
39
- risk_network-0.0.9b13.dist-info/RECORD,,
35
+ risk_network-0.0.9b14.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
36
+ risk_network-0.0.9b14.dist-info/METADATA,sha256=-H8Qrl5r36ZNGNJO3RHOzUOi_CzgplZf061rYGcIfJI,47552
37
+ risk_network-0.0.9b14.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
38
+ risk_network-0.0.9b14.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
39
+ risk_network-0.0.9b14.dist-info/RECORD,,