risk-network 0.0.7b10__tar.gz → 0.0.7b11__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.
Files changed (37) hide show
  1. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/PKG-INFO +1 -1
  2. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/__init__.py +1 -1
  3. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/annotations/io.py +2 -2
  4. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/log/config.py +8 -9
  5. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/neighborhoods/domains.py +2 -2
  6. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/neighborhoods/neighborhoods.py +2 -2
  7. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/network/io.py +12 -12
  8. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/risk.py +12 -12
  9. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/stats/permutation/test_functions.py +2 -2
  10. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk_network.egg-info/PKG-INFO +1 -1
  11. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/LICENSE +0 -0
  12. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/MANIFEST.in +0 -0
  13. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/README.md +0 -0
  14. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/pyproject.toml +0 -0
  15. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/annotations/__init__.py +0 -0
  16. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/annotations/annotations.py +0 -0
  17. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/constants.py +0 -0
  18. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/log/__init__.py +0 -0
  19. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/log/params.py +0 -0
  20. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/neighborhoods/__init__.py +0 -0
  21. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/neighborhoods/community.py +0 -0
  22. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/network/__init__.py +0 -0
  23. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/network/geometry.py +0 -0
  24. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/network/graph.py +0 -0
  25. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/network/plot.py +0 -0
  26. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/stats/__init__.py +0 -0
  27. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/stats/hypergeom.py +0 -0
  28. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/stats/permutation/__init__.py +0 -0
  29. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/stats/permutation/permutation.py +0 -0
  30. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/stats/poisson.py +0 -0
  31. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk/stats/stats.py +0 -0
  32. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk_network.egg-info/SOURCES.txt +0 -0
  33. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk_network.egg-info/dependency_links.txt +0 -0
  34. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk_network.egg-info/requires.txt +0 -0
  35. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/risk_network.egg-info/top_level.txt +0 -0
  36. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/setup.cfg +0 -0
  37. {risk_network-0.0.7b10 → risk_network-0.0.7b11}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: risk-network
3
- Version: 0.0.7b10
3
+ Version: 0.0.7b11
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,4 +7,4 @@ RISK: RISK Infers Spatial Kinships
7
7
 
8
8
  from risk.risk import RISK
9
9
 
10
- __version__ = "0.0.7-beta.10"
10
+ __version__ = "0.0.7-beta.11"
@@ -219,6 +219,6 @@ def _log_loading(filetype: str, filepath: str = "") -> None:
219
219
  filepath (str, optional): The path to the file being loaded.
220
220
  """
221
221
  log_header("Loading annotations")
222
- logger.debug(f"Filetype: {filetype}")
222
+ logger.info(f"Filetype: {filetype}")
223
223
  if filepath:
224
- logger.debug(f"Filepath: {filepath}")
224
+ logger.info(f"Filepath: {filepath}")
@@ -5,17 +5,16 @@ risk/log/config
5
5
 
6
6
  import logging
7
7
 
8
- # Create a global logger
8
+ # Create and configure the global logger
9
9
  logger = logging.getLogger("risk_logger")
10
- logger.setLevel(logging.DEBUG) # Start with the highest level; adjust as needed
11
- # Create a console handler
10
+ logger.setLevel(logging.INFO)
11
+ # Create and configure the console handler
12
12
  console_handler = logging.StreamHandler()
13
- console_handler.setLevel(logging.DEBUG) # Set the handler level (can be controlled later)
14
- # Create a formatter and set it for the handler
13
+ console_handler.setLevel(logging.INFO)
14
+ # Set the output format for the logger
15
15
  formatter = logging.Formatter("%(message)s")
16
16
  console_handler.setFormatter(formatter)
17
-
18
- # Add the handler to the logger if it doesn't already exist
17
+ # Add the console handler to the logger if not already attached
19
18
  if not logger.hasHandlers():
20
19
  logger.addHandler(console_handler)
21
20
 
@@ -30,8 +29,8 @@ def set_global_verbosity(verbose):
30
29
  None
31
30
  """
32
31
  if verbose:
33
- logger.setLevel(logging.DEBUG) # Show all messages
34
- console_handler.setLevel(logging.DEBUG)
32
+ logger.setLevel(logging.INFO) # Show all messages
33
+ console_handler.setLevel(logging.INFO)
35
34
  else:
36
35
  logger.setLevel(logging.ERROR) # Show only error messages
37
36
  console_handler.setLevel(logging.ERROR)
@@ -46,10 +46,10 @@ def define_domains(
46
46
  )
47
47
  # Perform hierarchical clustering
48
48
  Z = linkage(m, method=best_linkage, metric=best_metric)
49
- logger.debug(
49
+ logger.info(
50
50
  f"Linkage criterion: '{linkage_criterion}'\nLinkage method: '{best_linkage}'\nLinkage metric: '{best_metric}'"
51
51
  )
52
- logger.debug(f"Optimal linkage threshold: {round(best_threshold, 3)}")
52
+ logger.info(f"Optimal linkage threshold: {round(best_threshold, 3)}")
53
53
  # Calculate the optimal threshold for clustering
54
54
  max_d_optimal = np.max(Z[:, 2]) * best_threshold
55
55
  # Assign domains to the annotations matrix
@@ -130,7 +130,7 @@ def process_neighborhoods(
130
130
  enrichment_matrix = neighborhoods["enrichment_matrix"]
131
131
  binary_enrichment_matrix = neighborhoods["binary_enrichment_matrix"]
132
132
  significant_enrichment_matrix = neighborhoods["significant_enrichment_matrix"]
133
- logger.debug(f"Imputation depth: {impute_depth}")
133
+ logger.info(f"Imputation depth: {impute_depth}")
134
134
  if impute_depth:
135
135
  (
136
136
  enrichment_matrix,
@@ -143,7 +143,7 @@ def process_neighborhoods(
143
143
  max_depth=impute_depth,
144
144
  )
145
145
 
146
- logger.debug(f"Pruning threshold: {prune_threshold}")
146
+ logger.info(f"Pruning threshold: {prune_threshold}")
147
147
  if prune_threshold:
148
148
  (
149
149
  enrichment_matrix,
@@ -451,10 +451,10 @@ class NetworkIO:
451
451
  # Log the number of nodes and edges before and after cleaning
452
452
  num_final_nodes = G.number_of_nodes()
453
453
  num_final_edges = G.number_of_edges()
454
- logger.debug(f"Initial node count: {num_initial_nodes}")
455
- logger.debug(f"Final node count: {num_final_nodes}")
456
- logger.debug(f"Initial edge count: {num_initial_edges}")
457
- logger.debug(f"Final edge count: {num_final_edges}")
454
+ logger.info(f"Initial node count: {num_initial_nodes}")
455
+ logger.info(f"Final node count: {num_final_nodes}")
456
+ logger.info(f"Initial edge count: {num_initial_edges}")
457
+ logger.info(f"Final edge count: {num_final_edges}")
458
458
 
459
459
  def _assign_edge_weights(self, G: nx.Graph) -> None:
460
460
  """Assign weights to the edges in the graph.
@@ -472,7 +472,7 @@ class NetworkIO:
472
472
  ) # Default to 1.0 if 'weight' not present
473
473
 
474
474
  if self.include_edge_weight and missing_weights:
475
- logger.debug(f"Total edges missing weights: {missing_weights}")
475
+ logger.info(f"Total edges missing weights: {missing_weights}")
476
476
 
477
477
  def _validate_nodes(self, G: nx.Graph) -> None:
478
478
  """Validate the graph structure and attributes.
@@ -511,13 +511,13 @@ class NetworkIO:
511
511
  filepath (str, optional): The path to the file being loaded. Defaults to "".
512
512
  """
513
513
  log_header("Loading network")
514
- logger.debug(f"Filetype: {filetype}")
514
+ logger.info(f"Filetype: {filetype}")
515
515
  if filepath:
516
- logger.debug(f"Filepath: {filepath}")
517
- logger.debug(f"Edge weight: {'Included' if self.include_edge_weight else 'Excluded'}")
516
+ logger.info(f"Filepath: {filepath}")
517
+ logger.info(f"Edge weight: {'Included' if self.include_edge_weight else 'Excluded'}")
518
518
  if self.include_edge_weight:
519
- logger.debug(f"Weight label: {self.weight_label}")
520
- logger.debug(f"Minimum edges per node: {self.min_edges_per_node}")
521
- logger.debug(f"Projection: {'Sphere' if self.compute_sphere else 'Plane'}")
519
+ logger.info(f"Weight label: {self.weight_label}")
520
+ logger.info(f"Minimum edges per node: {self.min_edges_per_node}")
521
+ logger.info(f"Projection: {'Sphere' if self.compute_sphere else 'Plane'}")
522
522
  if self.compute_sphere:
523
- logger.debug(f"Surface depth: {self.surface_depth}")
523
+ logger.info(f"Surface depth: {self.surface_depth}")
@@ -221,10 +221,10 @@ class RISK(NetworkIO, AnnotationsIO):
221
221
  )
222
222
 
223
223
  # Log and display permutation test settings
224
- logger.debug(f"Neighborhood scoring metric: '{score_metric}'")
225
- logger.debug(f"Null distribution: '{null_distribution}'")
226
- logger.debug(f"Number of permutations: {num_permutations}")
227
- logger.debug(f"Maximum workers: {max_workers}")
224
+ logger.info(f"Neighborhood scoring metric: '{score_metric}'")
225
+ logger.info(f"Null distribution: '{null_distribution}'")
226
+ logger.info(f"Number of permutations: {num_permutations}")
227
+ logger.info(f"Maximum workers: {max_workers}")
228
228
  # Run permutation test to compute neighborhood significance
229
229
  neighborhood_significance = compute_permutation_test(
230
230
  neighborhoods=neighborhoods,
@@ -290,9 +290,9 @@ class RISK(NetworkIO, AnnotationsIO):
290
290
  max_cluster_size=max_cluster_size,
291
291
  )
292
292
 
293
- logger.debug(f"p-value cutoff: {pval_cutoff}")
294
- logger.debug(f"FDR BH cutoff: {fdr_cutoff}")
295
- logger.debug(
293
+ logger.info(f"p-value cutoff: {pval_cutoff}")
294
+ logger.info(f"FDR BH cutoff: {fdr_cutoff}")
295
+ logger.info(
296
296
  f"Significance tail: '{tail}' ({'enrichment' if tail == 'right' else 'depletion' if tail == 'left' else 'both'})"
297
297
  )
298
298
  # Calculate significant neighborhoods based on the provided parameters
@@ -314,8 +314,8 @@ class RISK(NetworkIO, AnnotationsIO):
314
314
  )
315
315
 
316
316
  log_header("Finding top annotations")
317
- logger.debug(f"Min cluster size: {min_cluster_size}")
318
- logger.debug(f"Max cluster size: {max_cluster_size}")
317
+ logger.info(f"Min cluster size: {min_cluster_size}")
318
+ logger.info(f"Max cluster size: {max_cluster_size}")
319
319
  # Define top annotations based on processed neighborhoods
320
320
  top_annotations = self._define_top_annotations(
321
321
  network=network,
@@ -414,9 +414,9 @@ class RISK(NetworkIO, AnnotationsIO):
414
414
  else:
415
415
  for_print_distance_metric = distance_metric
416
416
  # Log and display neighborhood settings
417
- logger.debug(f"Distance metric: '{for_print_distance_metric}'")
418
- logger.debug(f"Edge length threshold: {edge_length_threshold}")
419
- logger.debug(f"Random seed: {random_seed}")
417
+ logger.info(f"Distance metric: '{for_print_distance_metric}'")
418
+ logger.info(f"Edge length threshold: {edge_length_threshold}")
419
+ logger.info(f"Random seed: {random_seed}")
420
420
 
421
421
  # Compute neighborhoods based on the network and distance metric
422
422
  neighborhoods = get_network_neighborhoods(
@@ -1,6 +1,6 @@
1
1
  """
2
- risk/stats/permutation/test_function
3
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2
+ risk/stats/permutation/test_functions
3
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
4
  """
5
5
 
6
6
  import numpy as np
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: risk-network
3
- Version: 0.0.7b10
3
+ Version: 0.0.7b11
4
4
  Summary: A Python package for biological network analysis
5
5
  Author: Ira Horecka
6
6
  Author-email: Ira Horecka <ira89@icloud.com>
File without changes