napistu 0.4.3__tar.gz → 0.4.4__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 (149) hide show
  1. {napistu-0.4.3/src/napistu.egg-info → napistu-0.4.4}/PKG-INFO +1 -1
  2. {napistu-0.4.3 → napistu-0.4.4}/setup.cfg +1 -1
  3. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/network/neighborhoods.py +28 -7
  4. {napistu-0.4.3 → napistu-0.4.4/src/napistu.egg-info}/PKG-INFO +1 -1
  5. {napistu-0.4.3 → napistu-0.4.4}/LICENSE +0 -0
  6. {napistu-0.4.3 → napistu-0.4.4}/README.md +0 -0
  7. {napistu-0.4.3 → napistu-0.4.4}/pyproject.toml +0 -0
  8. {napistu-0.4.3 → napistu-0.4.4}/setup.py +0 -0
  9. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/__init__.py +0 -0
  10. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/__main__.py +0 -0
  11. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/consensus.py +0 -0
  12. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/constants.py +0 -0
  13. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/context/__init__.py +0 -0
  14. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/context/discretize.py +0 -0
  15. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/context/filtering.py +0 -0
  16. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/gcs/__init__.py +0 -0
  17. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/gcs/constants.py +0 -0
  18. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/gcs/downloads.py +0 -0
  19. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/gcs/utils.py +0 -0
  20. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/identifiers.py +0 -0
  21. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/indices.py +0 -0
  22. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/__init__.py +0 -0
  23. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/bigg.py +0 -0
  24. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/constants.py +0 -0
  25. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/gtex.py +0 -0
  26. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/hpa.py +0 -0
  27. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/identifiers_etl.py +0 -0
  28. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/napistu_edgelist.py +0 -0
  29. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/obo.py +0 -0
  30. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/psi_mi.py +0 -0
  31. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/reactom_fi.py +0 -0
  32. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/reactome.py +0 -0
  33. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/sbml.py +0 -0
  34. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/string.py +0 -0
  35. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/trrust.py +0 -0
  36. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ingestion/yeast.py +0 -0
  37. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/matching/__init__.py +0 -0
  38. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/matching/constants.py +0 -0
  39. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/matching/interactions.py +0 -0
  40. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/matching/mount.py +0 -0
  41. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/matching/species.py +0 -0
  42. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/__init__.py +0 -0
  43. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/__main__.py +0 -0
  44. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/client.py +0 -0
  45. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/codebase.py +0 -0
  46. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/codebase_utils.py +0 -0
  47. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/component_base.py +0 -0
  48. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/config.py +0 -0
  49. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/constants.py +0 -0
  50. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/documentation.py +0 -0
  51. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/documentation_utils.py +0 -0
  52. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/execution.py +0 -0
  53. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/health.py +0 -0
  54. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/profiles.py +0 -0
  55. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/server.py +0 -0
  56. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/tutorials.py +0 -0
  57. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/tutorials_utils.py +0 -0
  58. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/mcp/utils.py +0 -0
  59. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/modify/__init__.py +0 -0
  60. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/modify/constants.py +0 -0
  61. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/modify/curation.py +0 -0
  62. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/modify/gaps.py +0 -0
  63. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/modify/pathwayannot.py +0 -0
  64. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/modify/uncompartmentalize.py +0 -0
  65. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/network/__init__.py +0 -0
  66. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/network/constants.py +0 -0
  67. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/network/data_handling.py +0 -0
  68. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/network/ig_utils.py +0 -0
  69. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/network/net_create.py +0 -0
  70. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/network/net_create_utils.py +0 -0
  71. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/network/net_propagation.py +0 -0
  72. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/network/ng_core.py +0 -0
  73. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/network/ng_utils.py +0 -0
  74. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/network/paths.py +0 -0
  75. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/network/precompute.py +0 -0
  76. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ontologies/__init__.py +0 -0
  77. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ontologies/constants.py +0 -0
  78. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ontologies/dogma.py +0 -0
  79. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ontologies/genodexito.py +0 -0
  80. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ontologies/id_tables.py +0 -0
  81. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ontologies/mygene.py +0 -0
  82. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/ontologies/renaming.py +0 -0
  83. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/rpy2/__init__.py +0 -0
  84. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/rpy2/callr.py +0 -0
  85. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/rpy2/constants.py +0 -0
  86. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/rpy2/rids.py +0 -0
  87. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/sbml_dfs_core.py +0 -0
  88. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/sbml_dfs_utils.py +0 -0
  89. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/scverse/__init__.py +0 -0
  90. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/scverse/constants.py +0 -0
  91. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/scverse/loading.py +0 -0
  92. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/source.py +0 -0
  93. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/statistics/__init__.py +0 -0
  94. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/statistics/hypothesis_testing.py +0 -0
  95. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/statistics/quantiles.py +0 -0
  96. {napistu-0.4.3 → napistu-0.4.4}/src/napistu/utils.py +0 -0
  97. {napistu-0.4.3 → napistu-0.4.4}/src/napistu.egg-info/SOURCES.txt +0 -0
  98. {napistu-0.4.3 → napistu-0.4.4}/src/napistu.egg-info/dependency_links.txt +0 -0
  99. {napistu-0.4.3 → napistu-0.4.4}/src/napistu.egg-info/entry_points.txt +0 -0
  100. {napistu-0.4.3 → napistu-0.4.4}/src/napistu.egg-info/requires.txt +0 -0
  101. {napistu-0.4.3 → napistu-0.4.4}/src/napistu.egg-info/top_level.txt +0 -0
  102. {napistu-0.4.3 → napistu-0.4.4}/src/tests/__init__.py +0 -0
  103. {napistu-0.4.3 → napistu-0.4.4}/src/tests/conftest.py +0 -0
  104. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_consensus.py +0 -0
  105. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_constants.py +0 -0
  106. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_context_discretize.py +0 -0
  107. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_context_filtering.py +0 -0
  108. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_curation.py +0 -0
  109. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_data/__init__.py +0 -0
  110. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_gaps.py +0 -0
  111. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_gcs.py +0 -0
  112. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_identifiers.py +0 -0
  113. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_indices.py +0 -0
  114. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_ingestion_napistu_edgelist.py +0 -0
  115. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_ingestion_obo.py +0 -0
  116. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_matching_interactions.py +0 -0
  117. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_matching_mount.py +0 -0
  118. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_matching_species.py +0 -0
  119. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_mcp_config.py +0 -0
  120. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_mcp_documentation_utils.py +0 -0
  121. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_mcp_server.py +0 -0
  122. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_network_data_handling.py +0 -0
  123. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_network_ig_utils.py +0 -0
  124. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_network_neighborhoods.py +0 -0
  125. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_network_net_create.py +0 -0
  126. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_network_net_create_utils.py +0 -0
  127. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_network_net_propagation.py +0 -0
  128. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_network_ng_core.py +0 -0
  129. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_network_ng_utils.py +0 -0
  130. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_network_paths.py +0 -0
  131. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_network_precompute.py +0 -0
  132. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_ontologies_genodexito.py +0 -0
  133. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_ontologies_id_tables.py +0 -0
  134. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_ontologies_mygene.py +0 -0
  135. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_ontologies_renaming.py +0 -0
  136. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_pathwayannot.py +0 -0
  137. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_rpy2_callr.py +0 -0
  138. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_rpy2_init.py +0 -0
  139. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_sbml.py +0 -0
  140. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_sbml_dfs_core.py +0 -0
  141. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_sbml_dfs_utils.py +0 -0
  142. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_sbo.py +0 -0
  143. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_scverse_loading.py +0 -0
  144. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_source.py +0 -0
  145. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_statistics_hypothesis_testing.py +0 -0
  146. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_statistics_quantiles.py +0 -0
  147. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_uncompartmentalize.py +0 -0
  148. {napistu-0.4.3 → napistu-0.4.4}/src/tests/test_utils.py +0 -0
  149. {napistu-0.4.3 → napistu-0.4.4}/src/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: napistu
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: Connecting high-dimensional data to curated pathways
5
5
  Home-page: https://github.com/napistu/napistu-py
6
6
  Author: Sean Hackett
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = napistu
3
- version = 0.4.3
3
+ version = 0.4.4
4
4
  description = Connecting high-dimensional data to curated pathways
5
5
  long_description = file: README.md
6
6
  long_description_content_type = text/markdown
@@ -34,6 +34,7 @@ def find_and_prune_neighborhoods(
34
34
  napistu_graph: ig.Graph,
35
35
  compartmentalized_species: str | list[str],
36
36
  precomputed_distances: pd.DataFrame | None = None,
37
+ source_total_counts: pd.Series | None = None,
37
38
  network_type: str = NEIGHBORHOOD_NETWORK_TYPES.DOWNSTREAM,
38
39
  order: int = 3,
39
40
  verbose: bool = True,
@@ -44,7 +45,7 @@ def find_and_prune_neighborhoods(
44
45
 
45
46
  Wrapper which combines find_neighborhoods() and prune_neighborhoods()
46
47
 
47
- Parameters
48
+ Parameters
48
49
  ----------
49
50
  sbml_dfs: sbml_dfs_core.SBML_dfs
50
51
  A mechanistic molecular model
@@ -54,6 +55,9 @@ def find_and_prune_neighborhoods(
54
55
  Compartmentalized species IDs for neighborhood centers
55
56
  precomputed_distances : pd.DataFrame or None
56
57
  If provided, an edgelist of origin->destination path weights and lengths
58
+ source_total_counts: pd.Series | None
59
+ Optional, A series of the total counts of each source. As produced by
60
+ source.get_source_total_counts()
57
61
  network_type: str
58
62
  If the network is directed should neighbors be located "downstream",
59
63
  or "upstream" of each compartmentalized species. The "hourglass" option
@@ -109,6 +113,7 @@ def find_and_prune_neighborhoods(
109
113
  order=order,
110
114
  verbose=verbose,
111
115
  precomputed_neighbors=precomputed_neighbors,
116
+ source_total_counts=source_total_counts,
112
117
  )
113
118
 
114
119
  pruned_neighborhoods = prune_neighborhoods(neighborhoods, top_n=top_n)
@@ -132,7 +137,7 @@ def load_neighborhoods(
132
137
 
133
138
  Load existing neighborhoods if they exist
134
139
  (and overwrite = False) and otherwise construct
135
- neighborhoods using the provided settings
140
+ neighborhoods using the provided settings
136
141
 
137
142
  Parameters
138
143
  ----------
@@ -509,12 +514,13 @@ def find_neighborhoods(
509
514
  order: int = 3,
510
515
  verbose: bool = True,
511
516
  precomputed_neighbors: pd.DataFrame | None = None,
517
+ source_total_counts: pd.Series | None = None,
512
518
  ) -> dict:
513
519
  """
514
520
  Find Neighborhood
515
521
 
516
522
  Create a network composed of all species and reactions within N steps of
517
- each of a set of compartmentalized species.
523
+ each of a set of compartmentalized species.
518
524
 
519
525
  Parameters
520
526
  ----------
@@ -535,11 +541,14 @@ def find_neighborhoods(
535
541
  precomputed_neighbors: pd.DataFrame or None
536
542
  If provided, a pre-filtered table of nodes nearby the compartmentalized species
537
543
  which will be used to skip on-the-fly neighborhood generation.
544
+ source_total_counts: pd.Series | None
545
+ Optional, A series of the total counts of each source. As produced by
546
+ source.get_source_total_counts()
538
547
 
539
548
  Returns:
540
549
  ----------
541
550
  A dict containing the neighborhood of each compartmentalized species.
542
- Each entry in the dict is a dict of the subgraph, vertices, and edges.
551
+ Each entry in the dict is a dict of the subgraph, vertices, and edges.
543
552
  """
544
553
 
545
554
  if not isinstance(network_type, str):
@@ -567,7 +576,12 @@ def find_neighborhoods(
567
576
  # format the vertices and edges in each compartmentalized species' network
568
577
  neighborhood_dict = {
569
578
  sc_id: create_neighborhood_dict_entry(
570
- sc_id, neighborhood_df, sbml_dfs, napistu_graph, verbose=verbose
579
+ sc_id,
580
+ neighborhood_df=neighborhood_df,
581
+ sbml_dfs=sbml_dfs,
582
+ napistu_graph=napistu_graph,
583
+ source_total_counts=source_total_counts,
584
+ verbose=verbose,
571
585
  )
572
586
  for sc_id in compartmentalized_species
573
587
  }
@@ -580,6 +594,7 @@ def create_neighborhood_dict_entry(
580
594
  neighborhood_df: pd.DataFrame,
581
595
  sbml_dfs: sbml_dfs_core.SBML_dfs,
582
596
  napistu_graph: ig.Graph,
597
+ source_total_counts: pd.Series | None = None,
583
598
  verbose: bool = False,
584
599
  ) -> dict[str, Any]:
585
600
  """
@@ -597,6 +612,9 @@ def create_neighborhood_dict_entry(
597
612
  A mechanistic molecular model
598
613
  napistu_graph: igraph.Graph
599
614
  A network connecting molecular species and reactions
615
+ source_total_counts: pd.Series
616
+ Optional, A series of the total counts of each source. As produced by
617
+ source.get_source_total_counts()
600
618
  verbose: bool
601
619
  Extra reporting?
602
620
 
@@ -645,7 +663,10 @@ def create_neighborhood_dict_entry(
645
663
 
646
664
  try:
647
665
  edge_sources = ng_utils.get_minimal_sources_edges(
648
- vertices.rename(columns={"name": "node"}), sbml_dfs
666
+ vertices.rename(columns={"name": "node"}),
667
+ sbml_dfs,
668
+ # optional, counts of sources across the whole model
669
+ source_total_counts,
649
670
  )
650
671
  except Exception:
651
672
  edge_sources = None
@@ -1441,7 +1462,7 @@ def _prune_vertex_set(one_neighborhood: dict, top_n: int) -> pd.DataFrame:
1441
1462
  ----------
1442
1463
  one_neighborhood: dict
1443
1464
  The neighborhood around a single compartmentalized species - one of the values
1444
- in dict created by find_neighborhoods().
1465
+ in dict created by find_neighborhoods().
1445
1466
  top_n: int
1446
1467
  How many neighboring molecular species should be retained?
1447
1468
  If the neighborhood includes both upstream and downstream connections
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: napistu
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: Connecting high-dimensional data to curated pathways
5
5
  Home-page: https://github.com/napistu/napistu-py
6
6
  Author: Sean Hackett
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