napistu 0.3.5__tar.gz → 0.3.6__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 (142) hide show
  1. {napistu-0.3.5 → napistu-0.3.6}/PKG-INFO +2 -2
  2. {napistu-0.3.5 → napistu-0.3.6}/setup.cfg +2 -2
  3. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/__main__.py +18 -18
  4. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/consensus.py +3 -2
  5. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/constants.py +1 -1
  6. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/context/filtering.py +2 -1
  7. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/identifiers.py +3 -6
  8. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/bigg.py +6 -6
  9. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/string.py +2 -1
  10. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/yeast.py +2 -1
  11. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/matching/interactions.py +4 -4
  12. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/modify/uncompartmentalize.py +1 -1
  13. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/network/net_create.py +1 -1
  14. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/network/paths.py +1 -1
  15. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ontologies/dogma.py +2 -1
  16. napistu-0.3.6/src/napistu/sbml_dfs_core.py +1915 -0
  17. napistu-0.3.6/src/napistu/sbml_dfs_utils.py +1279 -0
  18. {napistu-0.3.5 → napistu-0.3.6}/src/napistu.egg-info/PKG-INFO +2 -2
  19. {napistu-0.3.5 → napistu-0.3.6}/src/napistu.egg-info/requires.txt +1 -1
  20. {napistu-0.3.5 → napistu-0.3.6}/src/tests/conftest.py +43 -0
  21. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_consensus.py +88 -0
  22. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_context_filtering.py +2 -2
  23. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_ontologies_genodexito.py +3 -0
  24. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_ontologies_mygene.py +3 -0
  25. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_sbml_dfs_core.py +102 -203
  26. napistu-0.3.6/src/tests/test_sbml_dfs_utils.py +221 -0
  27. napistu-0.3.5/src/napistu/sbml_dfs_core.py +0 -2802
  28. napistu-0.3.5/src/napistu/sbml_dfs_utils.py +0 -340
  29. napistu-0.3.5/src/tests/test_sbml_dfs_utils.py +0 -63
  30. {napistu-0.3.5 → napistu-0.3.6}/LICENSE +0 -0
  31. {napistu-0.3.5 → napistu-0.3.6}/README.md +0 -0
  32. {napistu-0.3.5 → napistu-0.3.6}/pyproject.toml +0 -0
  33. {napistu-0.3.5 → napistu-0.3.6}/setup.py +0 -0
  34. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/__init__.py +0 -0
  35. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/context/__init__.py +0 -0
  36. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/context/discretize.py +0 -0
  37. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/gcs/__init__.py +0 -0
  38. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/gcs/constants.py +0 -0
  39. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/gcs/downloads.py +0 -0
  40. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/gcs/utils.py +0 -0
  41. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/indices.py +0 -0
  42. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/__init__.py +0 -0
  43. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/constants.py +0 -0
  44. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/gtex.py +0 -0
  45. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/hpa.py +0 -0
  46. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/identifiers_etl.py +0 -0
  47. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/napistu_edgelist.py +0 -0
  48. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/obo.py +0 -0
  49. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/psi_mi.py +0 -0
  50. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/reactome.py +0 -0
  51. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/sbml.py +0 -0
  52. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ingestion/trrust.py +0 -0
  53. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/matching/__init__.py +0 -0
  54. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/matching/constants.py +0 -0
  55. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/matching/mount.py +0 -0
  56. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/matching/species.py +0 -0
  57. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/__init__.py +0 -0
  58. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/__main__.py +0 -0
  59. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/client.py +0 -0
  60. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/codebase.py +0 -0
  61. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/codebase_utils.py +0 -0
  62. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/component_base.py +0 -0
  63. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/config.py +0 -0
  64. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/constants.py +0 -0
  65. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/documentation.py +0 -0
  66. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/documentation_utils.py +0 -0
  67. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/execution.py +0 -0
  68. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/health.py +0 -0
  69. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/profiles.py +0 -0
  70. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/server.py +0 -0
  71. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/tutorials.py +0 -0
  72. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/tutorials_utils.py +0 -0
  73. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/mcp/utils.py +0 -0
  74. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/modify/__init__.py +0 -0
  75. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/modify/constants.py +0 -0
  76. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/modify/curation.py +0 -0
  77. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/modify/gaps.py +0 -0
  78. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/modify/pathwayannot.py +0 -0
  79. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/network/__init__.py +0 -0
  80. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/network/constants.py +0 -0
  81. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/network/data_handling.py +0 -0
  82. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/network/ig_utils.py +0 -0
  83. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/network/napistu_graph_core.py +0 -0
  84. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/network/neighborhoods.py +0 -0
  85. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/network/net_propagation.py +0 -0
  86. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/network/ng_utils.py +0 -0
  87. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/network/precompute.py +0 -0
  88. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ontologies/__init__.py +0 -0
  89. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ontologies/constants.py +0 -0
  90. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ontologies/genodexito.py +0 -0
  91. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ontologies/mygene.py +0 -0
  92. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/ontologies/renaming.py +0 -0
  93. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/rpy2/__init__.py +0 -0
  94. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/rpy2/callr.py +0 -0
  95. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/rpy2/constants.py +0 -0
  96. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/rpy2/rids.py +0 -0
  97. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/scverse/__init__.py +0 -0
  98. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/scverse/constants.py +0 -0
  99. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/scverse/loading.py +0 -0
  100. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/source.py +0 -0
  101. {napistu-0.3.5 → napistu-0.3.6}/src/napistu/utils.py +0 -0
  102. {napistu-0.3.5 → napistu-0.3.6}/src/napistu.egg-info/SOURCES.txt +0 -0
  103. {napistu-0.3.5 → napistu-0.3.6}/src/napistu.egg-info/dependency_links.txt +0 -0
  104. {napistu-0.3.5 → napistu-0.3.6}/src/napistu.egg-info/entry_points.txt +0 -0
  105. {napistu-0.3.5 → napistu-0.3.6}/src/napistu.egg-info/top_level.txt +0 -0
  106. {napistu-0.3.5 → napistu-0.3.6}/src/tests/__init__.py +0 -0
  107. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_constants.py +0 -0
  108. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_context_discretize.py +0 -0
  109. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_curation.py +0 -0
  110. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_data/__init__.py +0 -0
  111. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_gaps.py +0 -0
  112. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_gcs.py +0 -0
  113. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_identifiers.py +0 -0
  114. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_indices.py +0 -0
  115. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_ingestion_napistu_edgelist.py +0 -0
  116. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_ingestion_obo.py +0 -0
  117. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_matching_interactions.py +0 -0
  118. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_matching_mount.py +0 -0
  119. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_matching_species.py +0 -0
  120. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_mcp_config.py +0 -0
  121. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_mcp_documentation_utils.py +0 -0
  122. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_mcp_server.py +0 -0
  123. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_network_data_handling.py +0 -0
  124. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_network_ig_utils.py +0 -0
  125. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_network_neighborhoods.py +0 -0
  126. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_network_net_create.py +0 -0
  127. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_network_net_propagation.py +0 -0
  128. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_network_ng_utils.py +0 -0
  129. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_network_paths.py +0 -0
  130. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_network_precompute.py +0 -0
  131. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_ontologies_renaming.py +0 -0
  132. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_pathwayannot.py +0 -0
  133. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_rpy2_callr.py +0 -0
  134. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_rpy2_init.py +0 -0
  135. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_sbml.py +0 -0
  136. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_sbo.py +0 -0
  137. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_scverse_loading.py +0 -0
  138. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_set_coverage.py +0 -0
  139. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_source.py +0 -0
  140. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_uncompartmentalize.py +0 -0
  141. {napistu-0.3.5 → napistu-0.3.6}/src/tests/test_utils.py +0 -0
  142. {napistu-0.3.5 → napistu-0.3.6}/src/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: napistu
3
- Version: 0.3.5
3
+ Version: 0.3.6
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
@@ -43,7 +43,7 @@ Requires-Dist: pytest-cov; extra == "dev"
43
43
  Requires-Dist: ruff; extra == "dev"
44
44
  Requires-Dist: testcontainers; extra == "dev"
45
45
  Provides-Extra: mcp
46
- Requires-Dist: fastmcp<3.0.0,>=2.0.0; extra == "mcp"
46
+ Requires-Dist: fastmcp<2.9.0,>=2.0.0; extra == "mcp"
47
47
  Requires-Dist: mcp<2.0.0,>=1.0.0; extra == "mcp"
48
48
  Requires-Dist: httpx>=0.24.0; extra == "mcp"
49
49
  Requires-Dist: beautifulsoup4<5.0.0,>=4.11.0; extra == "mcp"
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = napistu
3
- version = 0.3.5
3
+ version = 0.3.6
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
@@ -61,7 +61,7 @@ dev =
61
61
  ruff
62
62
  testcontainers
63
63
  mcp =
64
- fastmcp>=2.0.0,<3.0.0
64
+ fastmcp>=2.0.0,<2.9.0
65
65
  mcp>=1.0.0,<2.0.0
66
66
  httpx>=0.24.0
67
67
  beautifulsoup4>=4.11.0,<5.0.0
@@ -54,12 +54,12 @@ def cli():
54
54
 
55
55
 
56
56
  @click.group()
57
- def load():
57
+ def ingestion():
58
58
  """Command line tools to retrieve raw data."""
59
59
  pass
60
60
 
61
61
 
62
- @load.command(name="reactome")
62
+ @ingestion.command(name="reactome")
63
63
  @click.argument("base_folder", type=str)
64
64
  @click.option(
65
65
  "--overwrite", "-o", is_flag=True, default=False, help="Overwrite existing files?"
@@ -70,7 +70,7 @@ def load_reactome(base_folder: str, overwrite=True):
70
70
  reactome.reactome_sbml_download(f"{base_folder}/sbml", overwrite=overwrite)
71
71
 
72
72
 
73
- @load.command(name="bigg")
73
+ @ingestion.command(name="bigg")
74
74
  @click.argument("base_folder", type=str)
75
75
  @click.option(
76
76
  "--overwrite", "-o", is_flag=True, default=False, help="Overwrite existing files?"
@@ -81,7 +81,7 @@ def load_bigg(base_folder: str, overwrite: bool):
81
81
  bigg.bigg_sbml_download(base_folder, overwrite)
82
82
 
83
83
 
84
- @load.command(name="trrust")
84
+ @ingestion.command(name="trrust")
85
85
  @click.argument("target_uri", type=str)
86
86
  @click_logging.simple_verbosity_option(logger)
87
87
  def load_ttrust(target_uri: str):
@@ -89,7 +89,7 @@ def load_ttrust(target_uri: str):
89
89
  trrust.download_trrust(target_uri)
90
90
 
91
91
 
92
- @load.command(name="proteinatlas-subcell")
92
+ @ingestion.command(name="proteinatlas-subcell")
93
93
  @click.argument("target_uri", type=str)
94
94
  @click.option(
95
95
  "--url",
@@ -102,7 +102,7 @@ def load_proteinatlas_subcell(target_uri: str, url: str):
102
102
  hpa.download_hpa_data(target_uri, url)
103
103
 
104
104
 
105
- @load.command(name="gtex-rnaseq-expression")
105
+ @ingestion.command(name="gtex-rnaseq-expression")
106
106
  @click.argument("target_uri", type=str)
107
107
  @click.option(
108
108
  "--url",
@@ -115,7 +115,7 @@ def load_gtex_rnaseq(target_uri: str, url: str):
115
115
  gtex.download_gtex_rnaseq(target_uri, url)
116
116
 
117
117
 
118
- @load.command(name="string-db")
118
+ @ingestion.command(name="string-db")
119
119
  @click.argument("target_uri", type=str)
120
120
  @click.option(
121
121
  "--species",
@@ -128,7 +128,7 @@ def load_string_db(target_uri: str, species: str):
128
128
  string.download_string(target_uri, species)
129
129
 
130
130
 
131
- @load.command(name="string-aliases")
131
+ @ingestion.command(name="string-aliases")
132
132
  @click.argument("target_uri", type=str)
133
133
  @click.option(
134
134
  "--species",
@@ -343,9 +343,9 @@ def infer_uncompartmentalized_species_location(model_uri: str, output_model_uri:
343
343
  If the compartment of a subset of compartmentalized species was
344
344
  not specified, infer an appropriate compartment from other members of reactions they particpate in
345
345
  """
346
- model = utils.load_pickle(model_uri)
347
- model = sbml_dfs_core.infer_uncompartmentalized_species_location(model)
348
- utils.save_pickle(output_model_uri, model)
346
+ sbml_dfs = utils.load_pickle(model_uri)
347
+ sbml_dfs.infer_uncompartmentalized_species_location()
348
+ utils.save_pickle(output_model_uri, sbml_dfs)
349
349
 
350
350
 
351
351
  @refine.command(name="name_compartmentalized_species")
@@ -357,9 +357,9 @@ def name_compartmentalized_species(model_uri: str, output_model_uri: str):
357
357
 
358
358
  Rename compartmentalized species if they have the same name as their species
359
359
  """
360
- model = utils.load_pickle(model_uri)
361
- model = sbml_dfs_core.name_compartmentalized_species(model)
362
- utils.save_pickle(output_model_uri, model)
360
+ sbml_dfs = utils.load_pickle(model_uri)
361
+ sbml_dfs.name_compartmentalized_species()
362
+ utils.save_pickle(output_model_uri, sbml_dfs)
363
363
 
364
364
 
365
365
  @refine.command(name="merge_model_compartments")
@@ -786,9 +786,9 @@ def export_sbml_dfs_tables(
786
786
  logger.debug(f"nondogmatic = {nondogmatic}; dogmatic = {dogmatic}")
787
787
  logger.info(f"Exporting tables with dogmatic = {dogmatic}")
788
788
 
789
- model = utils.load_pickle(model_uri)
790
- sbml_dfs_core.export_sbml_dfs(
791
- model_prefix, model, output_uri, overwrite=overwrite, dogmatic=dogmatic
789
+ sbml_dfs = utils.load_pickle(model_uri)
790
+ sbml_dfs.export_sbml_dfs(
791
+ model_prefix, output_uri, overwrite=overwrite, dogmatic=dogmatic
792
792
  )
793
793
 
794
794
 
@@ -884,7 +884,7 @@ def calculate_igraph_stats(input_uri, output_uri):
884
884
  utils.save_json(output_uri, stats)
885
885
 
886
886
 
887
- cli.add_command(load)
887
+ cli.add_command(ingestion)
888
888
  cli.add_command(integrate)
889
889
  cli.add_command(consensus)
890
890
  cli.add_command(refine)
@@ -843,9 +843,10 @@ def report_consensus_merges(
843
843
  indexed_models = merges_lookup.set_index("model").sort_index()
844
844
  merges_dict = dict()
845
845
  for mod in indexed_models.index.unique():
846
- merges_dict[mod] = sbml_dfs_core.reaction_summaries(
847
- sbml_dfs_dict[mod], indexed_models.loc[mod]["r_id"]
846
+ merges_dict[mod] = sbml_dfs_dict[mod].reaction_formulas(
847
+ indexed_models.loc[mod]["r_id"]
848
848
  )
849
+
849
850
  merge_labels = pd.concat(merges_dict, names=["model", "r_id"]).rename("label")
850
851
 
851
852
  # add labels to models + r_id
@@ -135,7 +135,7 @@ REQUIRED_REACTION_FROMEDGELIST_COLUMNS = [
135
135
  "r_isreversible",
136
136
  ]
137
137
 
138
- CPR_STANDARD_OUTPUTS = SimpleNamespace(
138
+ NAPISTU_STANDARD_OUTPUTS = SimpleNamespace(
139
139
  SPECIES_IDENTIFIERS="species_identifiers.tsv",
140
140
  SPECIES="species.json",
141
141
  REACTIONS="reactions.json",
@@ -5,6 +5,7 @@ from typing import Union, List, Optional
5
5
  import pandas as pd
6
6
 
7
7
  from napistu import sbml_dfs_core
8
+ from napistu import sbml_dfs_utils
8
9
  from napistu import utils
9
10
  from napistu.constants import SBML_DFS
10
11
 
@@ -236,7 +237,7 @@ def _find_reactions_with_disconnected_cspecies(
236
237
  sbml_dfs._validate_table(SBML_DFS.REACTION_SPECIES)
237
238
  sbml_dfs._validate_table(SBML_DFS.COMPARTMENTALIZED_SPECIES)
238
239
 
239
- reaction_species = sbml_dfs_core.add_sbo_role(sbml_dfs.reaction_species)
240
+ reaction_species = sbml_dfs_utils.add_sbo_role(sbml_dfs.reaction_species)
240
241
 
241
242
  logger.info(
242
243
  "Finding disconnected pairs of cspecies based on the zero values in the coccurrence_edgelist"
@@ -12,7 +12,6 @@ import pandas as pd
12
12
  from pydantic import BaseModel
13
13
 
14
14
  from napistu import sbml_dfs_core
15
- from napistu import sbml_dfs_utils
16
15
  from napistu import utils
17
16
 
18
17
  from napistu.constants import IDENTIFIERS
@@ -883,9 +882,7 @@ def _prepare_species_identifiers(
883
882
  """Accepts and validates species_identifiers, or extracts a fresh table if None."""
884
883
 
885
884
  if species_identifiers is None:
886
- species_identifiers = sbml_dfs_utils.get_characteristic_species_ids(
887
- sbml_dfs, dogmatic=dogmatic
888
- )
885
+ species_identifiers = sbml_dfs.get_characteristic_species_ids(dogmatic=dogmatic)
889
886
  else:
890
887
  # check for compatibility
891
888
  try:
@@ -898,8 +895,8 @@ def _prepare_species_identifiers(
898
895
  logger.warning(
899
896
  f"The provided identifiers are not compatible with your `sbml_dfs` object. Extracting a fresh species identifier table. {e}"
900
897
  )
901
- species_identifiers = sbml_dfs_utils.get_characteristic_species_ids(
902
- sbml_dfs, dogmatic=dogmatic
898
+ species_identifiers = sbml_dfs.get_characteristic_species_ids(
899
+ dogmatic=dogmatic
903
900
  )
904
901
 
905
902
  return species_identifiers
@@ -122,10 +122,10 @@ def construct_bigg_consensus(
122
122
  raise NotImplementedError("Merging of models not implemented yet for BiGG")
123
123
 
124
124
  # In Bigg there should be only one model
125
- model = list(sbml_dfs_dict.values())[0]
125
+ sbml_dfs = list(sbml_dfs_dict.values())[0]
126
126
  # fix missing compartimentalization
127
- model = sbml_dfs_core.infer_uncompartmentalized_species_location(model)
128
- model = sbml_dfs_core.name_compartmentalized_species(model)
129
- rename_species_ontologies(model)
130
- model.validate()
131
- return model
127
+ sbml_dfs.infer_uncompartmentalized_species_location()
128
+ sbml_dfs.name_compartmentalized_species()
129
+ rename_species_ontologies(sbml_dfs)
130
+ sbml_dfs.validate()
131
+ return sbml_dfs
@@ -5,6 +5,7 @@ import logging
5
5
  import pandas as pd
6
6
  from napistu import identifiers
7
7
  from napistu import sbml_dfs_core
8
+ from napistu import sbml_dfs_utils
8
9
  from napistu import source
9
10
  from napistu import utils
10
11
  from napistu.constants import BQB
@@ -158,7 +159,7 @@ def convert_string_to_sbml_dfs(
158
159
  # Define compartments
159
160
  # Currently we are mapping everything to the `CELLULAR_COMPONENT`
160
161
  # which is a catch-all go: for unknown localisation
161
- compartments_df = sbml_dfs_core._stub_compartments()
162
+ compartments_df = sbml_dfs_utils.stub_compartments()
162
163
 
163
164
  # define interactions
164
165
  interaction_edgelist = _build_interactor_edgelist(uq_string_edgelist)
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import pandas as pd
4
4
  from napistu import identifiers
5
5
  from napistu import sbml_dfs_core
6
+ from napistu import sbml_dfs_utils
6
7
  from napistu import source
7
8
  from napistu import utils
8
9
  from napistu.constants import BQB
@@ -105,7 +106,7 @@ def convert_idea_kinetics_to_sbml_dfs(
105
106
  # Constant fields (for this data source)
106
107
 
107
108
  # setup compartments (just treat this as uncompartmentalized for now)
108
- compartments_df = sbml_dfs_core._stub_compartments()
109
+ compartments_df = sbml_dfs_utils.stub_compartments()
109
110
 
110
111
  # Per convention unaggregated models receive an empty source
111
112
  interaction_source = source.Source(init=True)
@@ -40,7 +40,7 @@ def edgelist_to_pathway_species(
40
40
  pd.Dataframe containing a "identifier_upstream" and "identifier_downstream" variables used to to match entries
41
41
  species_identifiers: pd.DataFrame
42
42
  A table of molecular species identifiers produced from sbml_dfs.get_identifiers("species") generally using
43
- sbml_dfs_core.export_sbml_dfs()
43
+ sbml_dfs.export_sbml_dfs()
44
44
  ontologies: set
45
45
  A set of ontologies used to match features to pathway species
46
46
  feature_id_var: str, default=FEATURE_ID_VAR_DEFAULT
@@ -138,7 +138,7 @@ def edgelist_to_scids(
138
138
  A mechanistic model
139
139
  species_identifiers: pd.DataFrame
140
140
  A table of molecular species identifiers produced from
141
- sbml_dfs.get_identifiers("species") generally using sbml_dfs_core.export_sbml_dfs()
141
+ sbml_dfs.get_identifiers("species") generally using sbml_dfs.export_sbml_dfs()
142
142
  ontologies: set
143
143
  A set of ontologies used to match features to pathway species
144
144
 
@@ -218,7 +218,7 @@ def filter_to_direct_mechanistic_interactions(
218
218
  species_identifiers: pd.DataFrame
219
219
  A table of molecular species identifiers
220
220
  produced from sbml_dfs.get_identifiers("species") generally
221
- using sbml_dfs_core.export_sbml_dfs()
221
+ using sbml_dfs.export_sbml_dfs()
222
222
  ontologies: set
223
223
  A set of ontologies used to match features to pathway species
224
224
 
@@ -342,7 +342,7 @@ def filter_to_indirect_mechanistic_interactions(
342
342
  A mechanistic model
343
343
  species_identifiers: pandas.DataFrame
344
344
  A table of molecular species identifiers produced from
345
- sbml_dfs.get_identifiers("species") generally using sbml_dfs_core.export_sbml_dfs()
345
+ sbml_dfs.get_identifiers("species") generally using sbml_dfs.export_sbml_dfs()
346
346
  napistu_graph: igraph.Graph
347
347
  A network representation of the sbml_dfs model
348
348
  ontologies: set
@@ -48,7 +48,7 @@ def uncompartmentalize_sbml_dfs(
48
48
  )
49
49
 
50
50
  # 1. update the compartments table to the stubbed default level: GO CELLULAR_COMPONENT
51
- stubbed_compartment = sbml_dfs_core._stub_compartments().assign(
51
+ stubbed_compartment = sbml_dfs_utils.stub_compartments().assign(
52
52
  c_Source=_create_stubbed_source()
53
53
  )
54
54
 
@@ -1697,7 +1697,7 @@ def _create_topology_weights(
1697
1697
  base_score (float): offset which will be added to all weights.
1698
1698
  protein_multiplier (int): multiplier for non-metabolite species (lower weight paths will tend to be selected).
1699
1699
  metabolite_multiplier (int): multiplier for metabolites [defined a species with a ChEBI ID).
1700
- unknown_multiplier (int): multiplier for species without any identifier. See sbml_dfs_core.species_type_types.
1700
+ unknown_multiplier (int): multiplier for species without any identifier. See sbml_dfs_utils.species_type_types.
1701
1701
  scale_multiplier_by_meandegree (bool): if True then multipliers will be rescaled by the average number of
1702
1702
  connections a node has (i.e., its degree) so that weights will be relatively similar regardless of network
1703
1703
  size and sparsity.
@@ -489,7 +489,7 @@ def _label_path_reactions(sbml_dfs: sbml_dfs_core.SBML_dfs, paths_df: pd.DataFra
489
489
  reaction_info = (
490
490
  pd.concat(
491
491
  [
492
- sbml_dfs_core.reaction_summaries(sbml_dfs, r_ids=x)
492
+ sbml_dfs.reaction_formulas(r_ids=x)
493
493
  for x in set(reaction_paths["node"])
494
494
  ]
495
495
  )
@@ -4,6 +4,7 @@ import logging
4
4
  import pandas as pd
5
5
 
6
6
  from napistu import sbml_dfs_core
7
+ from napistu import sbml_dfs_utils
7
8
  from napistu import source
8
9
  from napistu import identifiers
9
10
  from napistu import utils
@@ -59,7 +60,7 @@ def create_dogmatic_sbml_dfs(
59
60
  )
60
61
 
61
62
  # stub required but invariant variables
62
- compartments_df = sbml_dfs_core._stub_compartments()
63
+ compartments_df = sbml_dfs_utils.stub_compartments()
63
64
  interaction_source = source.Source(init=True)
64
65
 
65
66
  # interactions table. This is required to create the sbml_dfs but we'll drop the info later