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 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.5-beta.0"
10
+ __version__ = "0.0.5-beta.2"
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 = cm.get_cmap(cmap)
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 = self.graph.trimmed_domain_to_term[domain].split(" ")[:max_words]
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
1
  Metadata-Version: 2.1
2
2
  Name: risk-network
3
- Version: 0.0.5b0
3
+ Version: 0.0.5b2
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,6 +1,6 @@
1
- risk/__init__.py,sha256=BeaJc2vCPQfWsDq_X0WgE8j297o7o4mNWJXOR7oAvQw,112
1
+ risk/__init__.py,sha256=g5Fqdi0t7DMMUt-AIDs34tPprO6samWzfE57y5gp5Tg,112
2
2
  risk/constants.py,sha256=AICk3x5qRQhls_ijTb4VdbdxU6mZ1aLGbAjLEdBwfJI,550
3
- risk/risk.py,sha256=4Y-fViqdK9gvxEjJRYsV_7gbN0kh7eiTwD8eesd_M6o,21109
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=m3bFWU5528OEm246LPG5XP3l_30vaBiJv4AO4iq0pSA,11552
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=kjQYWJawYnKRau1JL68L3LUn1MROuue0fdYWEoN7ct4,40469
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.5b0.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
27
- risk_network-0.0.5b0.dist-info/METADATA,sha256=DgS8QL4IrzTqHgrz7hnJRnmQZETqzi6L-b5PLaGYOJI,43236
28
- risk_network-0.0.5b0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
29
- risk_network-0.0.5b0.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
30
- risk_network-0.0.5b0.dist-info/RECORD,,
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,,