risk-network 0.0.9b15__py3-none-any.whl → 0.0.9b17__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
@@ -2,9 +2,9 @@
2
2
  risk
3
3
  ~~~~
4
4
 
5
- RISK: RISK Infers Spatial Kinships
5
+ RISK: Regional Inference of Significant Kinships
6
6
  """
7
7
 
8
8
  from risk.risk import RISK
9
9
 
10
- __version__ = "0.0.9-beta.15"
10
+ __version__ = "0.0.9-beta.17"
@@ -242,7 +242,7 @@ class Contour:
242
242
  logger.error("Contour levels must be strictly increasing. Skipping contour plot.")
243
243
  return None
244
244
 
245
- # Set the contour color and linestyle
245
+ # Set the contour color, fill, and linestyle
246
246
  contour_colors = [color for _ in range(levels - 1)]
247
247
  # Plot the filled contours using fill_alpha for transparency
248
248
  if fill_alpha and fill_alpha > 0:
@@ -258,21 +258,19 @@ class Contour:
258
258
  alpha=fill_alpha,
259
259
  )
260
260
 
261
- # Plot the contour lines with the specified RGBA alpha for transparency
262
- c = ax.contour(
261
+ # Plot the base contour line with the specified RGBA alpha for transparency
262
+ base_contour_color = [color]
263
+ base_contour_level = [contour_levels[0]]
264
+ ax.contour(
263
265
  x,
264
266
  y,
265
267
  z,
266
- levels=contour_levels,
267
- colors=contour_colors,
268
+ levels=base_contour_level,
269
+ colors=base_contour_color,
268
270
  linestyles=linestyle,
269
271
  linewidths=linewidth,
270
272
  )
271
273
 
272
- # Set linewidth for the contour lines to 0 for levels other than the base level
273
- for i in range(1, len(contour_levels)):
274
- c.collections[i].set_linewidth(0)
275
-
276
274
  def get_annotated_contour_colors(
277
275
  self,
278
276
  cmap: str = "gist_rainbow",
risk/risk.py CHANGED
@@ -63,7 +63,7 @@ class RISK(NetworkIO, AnnotationsIO):
63
63
  network (nx.Graph): The network graph.
64
64
  annotations (Dict[str, Any]): The annotations associated with the network.
65
65
  distance_metric (str, List, Tuple, or np.ndarray, optional): The distance metric(s) to use. Can be a string for one
66
- metric or a list/tuple/ndarray of metrics ('greedy_modularity', 'louvain', 'label_propagation',
66
+ metric or a list/tuple/ndarray of metrics ('greedy_modularity', 'louvain', 'leiden', 'label_propagation',
67
67
  'markov_clustering', 'walktrap', 'spinglass'). Defaults to 'louvain'.
68
68
  louvain_resolution (float, optional): Resolution parameter for Louvain clustering. Defaults to 0.1.
69
69
  leiden_resolution (float, optional): Resolution parameter for Leiden clustering. Defaults to 1.0.
@@ -127,7 +127,7 @@ class RISK(NetworkIO, AnnotationsIO):
127
127
  network (nx.Graph): The network graph.
128
128
  annotations (Dict[str, Any]): The annotations associated with the network.
129
129
  distance_metric (str, List, Tuple, or np.ndarray, optional): The distance metric(s) to use. Can be a string for one
130
- metric or a list/tuple/ndarray of metrics ('greedy_modularity', 'louvain', 'label_propagation',
130
+ metric or a list/tuple/ndarray of metrics ('greedy_modularity', 'louvain', 'leiden', 'label_propagation',
131
131
  'markov_clustering', 'walktrap', 'spinglass'). Defaults to 'louvain'.
132
132
  louvain_resolution (float, optional): Resolution parameter for Louvain clustering. Defaults to 0.1.
133
133
  leiden_resolution (float, optional): Resolution parameter for Leiden clustering. Defaults to 1.0.
@@ -194,7 +194,7 @@ class RISK(NetworkIO, AnnotationsIO):
194
194
  network (nx.Graph): The network graph.
195
195
  annotations (Dict[str, Any]): The annotations associated with the network.
196
196
  distance_metric (str, List, Tuple, or np.ndarray, optional): The distance metric(s) to use. Can be a string for one
197
- metric or a list/tuple/ndarray of metrics ('greedy_modularity', 'louvain', 'label_propagation',
197
+ metric or a list/tuple/ndarray of metrics ('greedy_modularity', 'louvain', 'leiden', 'label_propagation',
198
198
  'markov_clustering', 'walktrap', 'spinglass'). Defaults to 'louvain'.
199
199
  louvain_resolution (float, optional): Resolution parameter for Louvain clustering. Defaults to 0.1.
200
200
  leiden_resolution (float, optional): Resolution parameter for Leiden clustering. Defaults to 1.0.
@@ -430,7 +430,7 @@ class RISK(NetworkIO, AnnotationsIO):
430
430
  network (nx.Graph): The network graph.
431
431
  annotations (pd.DataFrame): The matrix of annotations associated with the network.
432
432
  distance_metric (str, List, Tuple, or np.ndarray, optional): The distance metric(s) to use. Can be a string for one
433
- metric or a list/tuple/ndarray of metrics ('greedy_modularity', 'louvain', 'label_propagation',
433
+ metric or a list/tuple/ndarray of metrics ('greedy_modularity', 'louvain', 'leiden', 'label_propagation',
434
434
  'markov_clustering', 'walktrap', 'spinglass'). Defaults to 'louvain'.
435
435
  louvain_resolution (float, optional): Resolution parameter for Louvain clustering. Defaults to 0.1.
436
436
  leiden_resolution (float, optional): Resolution parameter for Leiden clustering. Defaults to 1.0.
@@ -192,7 +192,9 @@ def _permutation_process_subset(
192
192
  local_counts_depletion = np.zeros(observed_neighborhood_scores.shape)
193
193
  local_counts_enrichment = np.zeros(observed_neighborhood_scores.shape)
194
194
 
195
- # NOTE: Limit the number of threads used by NumPy's BLAS implementation to 1 when more than one worker is used.
195
+ # Limit the number of threads used by NumPy's BLAS implementation to 1 when more than one worker is used
196
+ # NOTE: This does not work for Mac M chips due to a bug in the threadpoolctl package
197
+ # This is currently a known issue and is being addressed by the maintainers [https://github.com/joblib/threadpoolctl/issues/135]
196
198
  limits = None if max_workers == 1 else 1
197
199
  with threadpool_limits(limits=limits, user_api="blas"):
198
200
  # Initialize a local counter for batched progress updates
@@ -1,10 +1,10 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: risk-network
3
- Version: 0.0.9b15
3
+ Version: 0.0.9b17
4
4
  Summary: A Python package for biological network analysis
5
5
  Author: Ira Horecka
6
6
  Author-email: Ira Horecka <ira89@icloud.com>
7
- License: GNU GENERAL PUBLIC LICENSE
7
+ License: GNU GENERAL PUBLIC LICENSE
8
8
  Version 3, 29 June 2007
9
9
 
10
10
  Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
@@ -696,7 +696,7 @@ Description-Content-Type: text/markdown
696
696
  License-File: LICENSE
697
697
  Requires-Dist: ipywidgets
698
698
  Requires-Dist: leidenalg
699
- Requires-Dist: markov-clustering
699
+ Requires-Dist: markov_clustering
700
700
  Requires-Dist: matplotlib
701
701
  Requires-Dist: networkx
702
702
  Requires-Dist: nltk==3.8.1
@@ -710,6 +710,8 @@ Requires-Dist: scipy
710
710
  Requires-Dist: statsmodels
711
711
  Requires-Dist: threadpoolctl
712
712
  Requires-Dist: tqdm
713
+ Dynamic: author
714
+ Dynamic: requires-python
713
715
 
714
716
  # RISK Network
715
717
 
@@ -726,7 +728,7 @@ Requires-Dist: tqdm
726
728
  ![Downloads](https://img.shields.io/pypi/dm/risk-network)
727
729
  ![Platforms](https://img.shields.io/badge/platform-linux%20%7C%20macos%20%7C%20windows-lightgrey)
728
730
 
729
- **RISK (RISK Infers Spatial Kinships)** is a next-generation tool designed to streamline the analysis of biological and non-biological networks. RISK enhances network analysis with its modular architecture, extensive file format support, and advanced clustering algorithms. It simplifies the creation of publication-quality figures, making it an important tool for researchers across disciplines.
731
+ **RISK** (Regional Inference of Significant Kinships) is a next-generation tool designed to streamline the analysis of biological and non-biological networks. RISK enhances network analysis with its modular architecture, extensive file format support, and advanced clustering algorithms. It simplifies the creation of publication-quality figures, making it an important tool for researchers across disciplines.
730
732
 
731
733
  ## Documentation and Tutorial
732
734
 
@@ -1,6 +1,6 @@
1
- risk/__init__.py,sha256=ETGu8S9_cXRpS9mAcoD97c7JUkhQcr100I7We_cRAls,113
1
+ risk/__init__.py,sha256=95ug0762a0OMBkPuFt_fuQuF8BgPXRfF_Dl3UCP6jMw,127
2
2
  risk/constants.py,sha256=XInRaH78Slnw_sWgAsBFbUHkyA0h0jL0DKGuQNbOvjM,550
3
- risk/risk.py,sha256=7OvKwKVEvTdnQk4bYYz_pEtNCw2xYOfDoOC-ZrxrPjA,23592
3
+ risk/risk.py,sha256=nodTixy31O3VK7ld-g74Fb9YEiyvKs_Vbor2lE2ADJ8,23632
4
4
  risk/annotations/__init__.py,sha256=kXgadEXaCh0z8OyhOhTj7c3qXGmWgOhaSZ4gSzSb59U,147
5
5
  risk/annotations/annotations.py,sha256=WVT9wzTm8lTpMw_3SnbyljWR77yExo0rb1zVgJza8nw,14284
6
6
  risk/annotations/io.py,sha256=tk1dAsxIwW5oLxB294ppiuZd4__Y5pj8se8KhitRSNA,10554
@@ -19,7 +19,7 @@ risk/network/graph/network.py,sha256=JzYbrgJLiNWFyPIR6_qNSjMtmXmfzRv2FwWSdyg8HjY
19
19
  risk/network/graph/summary.py,sha256=7w5gNYNspv02SscDAfHxdx-D1CWKmelSonyBnB9hbrE,9737
20
20
  risk/network/plot/__init__.py,sha256=MfmaXJgAZJgXZ2wrhK8pXwzETlcMaLChhWXKAozniAo,98
21
21
  risk/network/plot/canvas.py,sha256=W8dFv4XYTzCWXBchgsc0esOQRn4usM4LkwNGPSDMobE,13357
22
- risk/network/plot/contour.py,sha256=VONX9l6owrZvWtR0mWQ6z2GSd1YXIv5wV_sf5ROQLT4,15581
22
+ risk/network/plot/contour.py,sha256=zM2oRbiGbKHi9fWL7QNcwnTRkxCuQYEwH2mm6TaN_hw,15499
23
23
  risk/network/plot/labels.py,sha256=aU_ClDGVPHyQ3H5E_ygx8hsMhrpJB0i9Cn65PlLmw7s,45679
24
24
  risk/network/plot/network.py,sha256=0j7pAZgt9PBfFCnOz4QwXnYWTlnLjTrtMm-50I_1G8o,14028
25
25
  risk/network/plot/plotter.py,sha256=eS1vHqvOA2O001Rq7WiDcgqcehJ3fg4OPfvkezH4erw,5771
@@ -30,10 +30,10 @@ risk/stats/hypergeom.py,sha256=oc39f02ViB1vQ-uaDrxG_tzAT6dxQBRjc88EK2EGn78,2282
30
30
  risk/stats/poisson.py,sha256=polLgwS08MTCNzupYdmMUoEUYrJOjAbcYtYwjlfeE5Y,1803
31
31
  risk/stats/stats.py,sha256=z8NrhiVj4BzJ250bVLfytpmfC7RzYu7mBuIZD_l0aCA,7222
32
32
  risk/stats/permutation/__init__.py,sha256=neJp7FENC-zg_CGOXqv-iIvz1r5XUKI9Ruxhmq7kDOI,105
33
- risk/stats/permutation/permutation.py,sha256=meBNSrbRa9P8WJ54n485l0H7VQJlMSfHqdN4aCKYCtQ,10105
33
+ risk/stats/permutation/permutation.py,sha256=jfo7J7bjXTHH-k6_WuZ_5eB31JVynlI6SYMC_7icYyM,10320
34
34
  risk/stats/permutation/test_functions.py,sha256=lftOude6hee0pyR80HlBD32522JkDoN5hrKQ9VEbuoY,2345
35
- risk_network-0.0.9b15.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
36
- risk_network-0.0.9b15.dist-info/METADATA,sha256=-vbz9K7rwGcks1hRc26hGWGct4nd2JvJ9su-SuJnAVw,47552
37
- risk_network-0.0.9b15.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
38
- risk_network-0.0.9b15.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
39
- risk_network-0.0.9b15.dist-info/RECORD,,
35
+ risk_network-0.0.9b17.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
36
+ risk_network-0.0.9b17.dist-info/METADATA,sha256=7Jh5RwTtOR7nnQIoLnT6wCamrgaAJxAZs6Zzncs0H9g,47627
37
+ risk_network-0.0.9b17.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
38
+ risk_network-0.0.9b17.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
39
+ risk_network-0.0.9b17.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5