bonesistools 1.2.1__tar.gz → 1.2.2__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 (97) hide show
  1. {bonesistools-1.2.1 → bonesistools-1.2.2}/PKG-INFO +5 -7
  2. {bonesistools-1.2.1 → bonesistools-1.2.2}/README.md +3 -5
  3. {bonesistools-1.2.1 → bonesistools-1.2.2}/pyproject.toml +2 -2
  4. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/__init__.py +10 -5
  5. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/__init__.py +16 -9
  6. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/boolean_algebra/__init__.py +2 -2
  7. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/boolean_algebra/_typing.py +21 -17
  8. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/boolean_network/__init__.py +4 -3
  9. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/boolean_network/_network.py +1 -1
  10. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/boolean_network/_typing.py +8 -6
  11. {bonesistools-1.2.1/src/bonesistools/boolpy/interaction_graph → bonesistools-1.2.2/src/bonesistools/boolpy/influence_graph}/__init__.py +6 -6
  12. {bonesistools-1.2.1/src/bonesistools/boolpy/interaction_graph → bonesistools-1.2.2/src/bonesistools/boolpy/influence_graph}/_parser.py +9 -9
  13. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/plotting/__init__.py +2 -2
  14. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/databases/__init__.py +2 -2
  15. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/databases/ncbi/__init__.py +2 -4
  16. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/databases/omnipath/__init__.py +2 -2
  17. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/grntools/__init__.py +6 -6
  18. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/__init__.py +2 -2
  19. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/datasets/__init__.py +13 -11
  20. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/plotting/__init__.py +2 -2
  21. bonesistools-1.2.2/src/bonesistools/sctools/plotting/_typing.py +5 -0
  22. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/preprocessing/__init__.py +4 -3
  23. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/preprocessing/_genename.py +1 -1
  24. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/tools/__init__.py +2 -2
  25. bonesistools-1.2.1/tests/bpy/test_interaction_graph_parser.py → bonesistools-1.2.2/tests/bpy/test_influence_graph_parser.py +13 -13
  26. bonesistools-1.2.1/tests/bpy/test_interaction_graph_scoring.py → bonesistools-1.2.2/tests/bpy/test_influence_graph_scoring.py +2 -2
  27. bonesistools-1.2.1/src/bonesistools/sctools/plotting/_typing.py +0 -5
  28. {bonesistools-1.2.1 → bonesistools-1.2.2}/.gitignore +0 -0
  29. {bonesistools-1.2.1 → bonesistools-1.2.2}/LICENSE +0 -0
  30. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/_compat.py +0 -0
  31. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/boolean_algebra/_algebra.py +0 -0
  32. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/boolean_algebra/_boolean.py +0 -0
  33. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/boolean_algebra/_hypercube.py +0 -0
  34. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/boolean_algebra/_parser.py +0 -0
  35. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/boolean_algebra/_representation.py +0 -0
  36. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/boolean_algebra/_structure.py +0 -0
  37. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/boolean_network/_parser.py +0 -0
  38. {bonesistools-1.2.1/src/bonesistools/boolpy/interaction_graph → bonesistools-1.2.2/src/bonesistools/boolpy/influence_graph}/_algorithms.py +0 -0
  39. {bonesistools-1.2.1/src/bonesistools/boolpy/interaction_graph → bonesistools-1.2.2/src/bonesistools/boolpy/influence_graph}/_influence_graph.py +0 -0
  40. {bonesistools-1.2.1/src/bonesistools/boolpy/interaction_graph → bonesistools-1.2.2/src/bonesistools/boolpy/influence_graph}/_scoring.py +0 -0
  41. {bonesistools-1.2.1/src/bonesistools/boolpy/interaction_graph → bonesistools-1.2.2/src/bonesistools/boolpy/influence_graph}/_typing.py +0 -0
  42. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/plotting/_graphviz.py +0 -0
  43. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/boolpy/plotting/_styles.py +0 -0
  44. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/databases/ncbi/_genesyn.py +0 -0
  45. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/databases/ncbi/_typing.py +0 -0
  46. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/databases/ncbi/data/gi/escherichia_coli_gene_info.tsv +0 -0
  47. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/databases/ncbi/data/gi/homo_sapiens_gene_info.tsv +0 -0
  48. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/databases/ncbi/data/gi/mus_musculus_gene_info.tsv +0 -0
  49. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/databases/omnipath/_collectri.py +0 -0
  50. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/databases/omnipath/_dorothea.py +0 -0
  51. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/py.typed +0 -0
  52. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/_dependencies.py +0 -0
  53. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/_typing.py +0 -0
  54. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/datasets/nestorowa_hvg.h5ad +0 -0
  55. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/plotting/_boxplot.py +0 -0
  56. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/plotting/_colors.py +0 -0
  57. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/plotting/_density.py +0 -0
  58. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/plotting/_figure.py +0 -0
  59. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/plotting/_graphplot.py +0 -0
  60. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/plotting/_scatterplot.py +0 -0
  61. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/preprocessing/_simple.py +0 -0
  62. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/preprocessing/_transfer.py +0 -0
  63. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/tools/_classification.py +0 -0
  64. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/tools/_conversion.py +0 -0
  65. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/tools/_graph.py +0 -0
  66. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/tools/_markers.py +0 -0
  67. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/tools/_maths.py +0 -0
  68. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/tools/_neighbors.py +0 -0
  69. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/tools/_regress.py +0 -0
  70. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/tools/_utils.py +0 -0
  71. {bonesistools-1.2.1 → bonesistools-1.2.2}/src/bonesistools/sctools/tools/_write.py +0 -0
  72. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/bpy/conftest.py +0 -0
  73. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/bpy/test_boolean_algebra.py +0 -0
  74. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/bpy/test_boolean_network.py +0 -0
  75. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/bpy/test_boolean_network_ensemble.py +0 -0
  76. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/bpy/test_hypercube.py +0 -0
  77. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/bpy/test_hypercube_collection.py +0 -0
  78. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/bpy/test_influence_graph.py +0 -0
  79. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/bpy/test_partial_boolean.py +0 -0
  80. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/bpy/test_plotting_styles.py +0 -0
  81. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/dbs/test_ncbi.py +0 -0
  82. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/dbs/test_omnipath.py +0 -0
  83. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/conftest.py +0 -0
  84. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/plotting/test_boxplot.py +0 -0
  85. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/plotting/test_colors.py +0 -0
  86. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/plotting/test_density.py +0 -0
  87. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/plotting/test_figure.py +0 -0
  88. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/plotting/test_graphplot.py +0 -0
  89. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/plotting/test_scatterplot.py +0 -0
  90. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/preprocessing/test_genename.py +0 -0
  91. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/preprocessing/test_simple.py +0 -0
  92. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/preprocessing/test_transfer_obs.py +0 -0
  93. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/test_typing.py +0 -0
  94. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/tools/test_graph_neighbors_classification.py +0 -0
  95. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/tools/test_knnbs.py +0 -0
  96. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/tools/test_utils_conversion_maths.py +0 -0
  97. {bonesistools-1.2.1 → bonesistools-1.2.2}/tests/sct/tools/test_write.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bonesistools
3
- Version: 1.2.1
4
- Summary: BoNesisTools is a python package proposing bioinformatics tools for upstream and downstream analysis of BoNesis framework
3
+ Version: 1.2.2
4
+ Summary: Bioinformatics toolkit for upstream and downstream analyses around the BoNesis framework
5
5
  Project-URL: Repository, https://github.com/bnediction/bonesistools
6
6
  Author: Théo Roncalli
7
7
  Maintainer-email: Théo Roncalli <theo.roncalli@labri.fr>
@@ -586,13 +586,13 @@ Description-Content-Type: text/markdown
586
586
 
587
587
  # BoNesisTools
588
588
 
589
- `BoNesisTools` is a Python package providing utilities for Boolean modelling, regulatory interaction graphs and single-cell analyses around the [BoNesis](https://github.com/bnediction/bonesis) ecosystem.
589
+ `BoNesisTools` is a Python package providing utilities for Boolean modelling, regulatory influence graphs and single-cell analyses around the [BoNesis](https://github.com/bnediction/bonesis) ecosystem.
590
590
 
591
591
  The package provides:
592
592
 
593
593
  - Boolean algebra and partial Boolean abstractions
594
594
  - Boolean network manipulation and analysis
595
- - signed interaction and influence graph utilities
595
+ - signed influence graph utilities
596
596
  - GRN-informed Boolean predecessor inference
597
597
  - single-cell and multimodal analysis helpers
598
598
  - biological database interfaces
@@ -631,8 +631,6 @@ Submodules:
631
631
 
632
632
  Submodules:
633
633
 
634
- Submodules:
635
-
636
634
  - Boolean algebra: `bt.bpy.ba`
637
635
  - partial Boolean abstractions and hypercube representations
638
636
  - Boolean differential and predecessor inference utilities
@@ -643,7 +641,7 @@ Submodules:
643
641
  - `.bnet` import/export
644
642
 
645
643
  - influence graph: `bt.bpy.ig`
646
- - signed regulatory interaction graphs
644
+ - signed regulatory influence graphs
647
645
  - feedback circuit and SCC analysis
648
646
  - signed interaction scoring from bounded walks
649
647
  - graph compression and visualization utilities
@@ -5,13 +5,13 @@
5
5
 
6
6
  # BoNesisTools
7
7
 
8
- `BoNesisTools` is a Python package providing utilities for Boolean modelling, regulatory interaction graphs and single-cell analyses around the [BoNesis](https://github.com/bnediction/bonesis) ecosystem.
8
+ `BoNesisTools` is a Python package providing utilities for Boolean modelling, regulatory influence graphs and single-cell analyses around the [BoNesis](https://github.com/bnediction/bonesis) ecosystem.
9
9
 
10
10
  The package provides:
11
11
 
12
12
  - Boolean algebra and partial Boolean abstractions
13
13
  - Boolean network manipulation and analysis
14
- - signed interaction and influence graph utilities
14
+ - signed influence graph utilities
15
15
  - GRN-informed Boolean predecessor inference
16
16
  - single-cell and multimodal analysis helpers
17
17
  - biological database interfaces
@@ -50,8 +50,6 @@ Submodules:
50
50
 
51
51
  Submodules:
52
52
 
53
- Submodules:
54
-
55
53
  - Boolean algebra: `bt.bpy.ba`
56
54
  - partial Boolean abstractions and hypercube representations
57
55
  - Boolean differential and predecessor inference utilities
@@ -62,7 +60,7 @@ Submodules:
62
60
  - `.bnet` import/export
63
61
 
64
62
  - influence graph: `bt.bpy.ig`
65
- - signed regulatory interaction graphs
63
+ - signed regulatory influence graphs
66
64
  - feedback circuit and SCC analysis
67
65
  - signed interaction scoring from bounded walks
68
66
  - graph compression and visualization utilities
@@ -4,8 +4,8 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bonesistools"
7
- description = "BoNesisTools is a python package proposing bioinformatics tools for upstream and downstream analysis of BoNesis framework"
8
- version = "1.2.1"
7
+ description = "Bioinformatics toolkit for upstream and downstream analyses around the BoNesis framework"
8
+ version = "1.2.2"
9
9
  license = {file = "LICENSE"}
10
10
  credits = ["BNeDiction", "PEPR Santé Numérique 2030"]
11
11
  authors = [
@@ -23,16 +23,18 @@ from __future__ import annotations
23
23
  import importlib as _importlib
24
24
  import sys as _sys
25
25
  import warnings as _warnings
26
- from types import ModuleType
27
- from typing import TYPE_CHECKING
26
+ from types import ModuleType as _ModuleType
27
+ from typing import TYPE_CHECKING as _TYPE_CHECKING
28
28
 
29
29
  from . import boolpy as bpy
30
30
  from . import databases as dbs
31
31
  from . import sctools as sct
32
32
 
33
- if TYPE_CHECKING:
33
+ if _TYPE_CHECKING:
34
34
  from . import grntools as grn
35
35
 
36
+ del annotations
37
+
36
38
  __credits__ = "BNeDiction; PEPR Santé Numérique 2030"
37
39
 
38
40
  __all__ = [
@@ -54,11 +56,14 @@ _sys.modules.update(
54
56
  )
55
57
 
56
58
  _sys.modules.update(
57
- {f"{__name__}.bpy.{alias}": getattr(bpy, alias) for alias in ["ba", "bn", "ig"]}
59
+ {
60
+ f"{__name__}.bpy.{alias}": getattr(bpy, alias)
61
+ for alias in ["ba", "bn", "ig", "pl"]
62
+ }
58
63
  )
59
64
 
60
65
 
61
- def __getattr__(name: str) -> ModuleType:
66
+ def __getattr__(name: str) -> _ModuleType:
62
67
  if name == "grn":
63
68
  message = (
64
69
  "`bt.grn` is deprecated and will be removed in a future release; "
@@ -3,8 +3,8 @@
3
3
  """
4
4
  Utilities for Boolean modelling.
5
5
 
6
- The `bpy` package provides tools for Boolean algebra, Boolean networks
7
- and interaction/influence graphs.
6
+ The `bpy` package provides tools for Boolean algebra, Boolean networks,
7
+ influence graphs and plotting.
8
8
 
9
9
  Sub-packages
10
10
  ------------
@@ -13,28 +13,34 @@ ba
13
13
  bn
14
14
  Boolean networks and logical modelling utilities.
15
15
  ig
16
- Interaction and influence graph utilities.
16
+ Influence graph utilities.
17
+ pl
18
+ Plotting utilities.
17
19
  """
18
20
 
19
21
  from __future__ import annotations
20
22
 
21
23
  import sys as _sys
22
24
  import warnings as _warnings
23
- from types import ModuleType
24
- from typing import cast
25
+ from types import ModuleType as _ModuleType
26
+ from typing import cast as _cast
25
27
 
26
28
  from . import boolean_algebra as ba
27
29
  from . import boolean_network as bn
28
- from . import interaction_graph as ig
30
+ from . import influence_graph as ig
31
+ from . import plotting as pl
32
+
33
+ del annotations
29
34
 
30
35
  _sys.modules.update(
31
- {f"{__name__}.{alias}": globals()[alias] for alias in ["ba", "bn", "ig"]}
36
+ {f"{__name__}.{alias}": globals()[alias] for alias in ["ba", "bn", "ig", "pl"]}
32
37
  )
33
38
 
34
- _MODULES: dict[str, ModuleType] = {
39
+ _MODULES: dict[str, _ModuleType] = {
35
40
  "ba": ba,
36
41
  "bn": bn,
37
42
  "ig": ig,
43
+ "pl": pl,
38
44
  }
39
45
 
40
46
  _DEPRECATED: dict[str, tuple[str, str]] = {
@@ -49,6 +55,7 @@ __all__ = [
49
55
  "ba",
50
56
  "bn",
51
57
  "ig",
58
+ "pl",
52
59
  ]
53
60
 
54
61
 
@@ -61,7 +68,7 @@ def __getattr__(name: str) -> object:
61
68
  DeprecationWarning,
62
69
  stacklevel=2,
63
70
  )
64
- return cast(object, getattr(_MODULES[module_alias], attr))
71
+ return _cast(object, getattr(_MODULES[module_alias], attr))
65
72
 
66
73
  raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
67
74
 
@@ -8,7 +8,7 @@ Boolean algebra, including partial Boolean values and Boolean
8
8
  differential and predecessor inference utilities.
9
9
  """
10
10
 
11
- from typing import List
11
+ from typing import List as _List
12
12
 
13
13
  from ._algebra import BooleanPredecessorInference, PartialBooleanDifferential
14
14
  from ._boolean import PartialBoolean
@@ -53,5 +53,5 @@ __all__ = [
53
53
  ]
54
54
 
55
55
 
56
- def __dir__() -> List[str]:
56
+ def __dir__() -> _List[str]:
57
57
  return sorted(set(globals()) | set(__all__))
@@ -4,23 +4,27 @@
4
4
  Typing aliases and runtime validators for Boolean algebra objects.
5
5
  """
6
6
 
7
- from collections.abc import Mapping as MappingABC
7
+ from collections.abc import Mapping as _MappingABC
8
8
  from typing import (
9
- Any,
10
- Mapping,
11
- Union,
9
+ Any as _Any,
10
+ )
11
+ from typing import (
12
+ Mapping as _Mapping,
13
+ )
14
+ from typing import (
15
+ Union as _Union,
12
16
  )
13
17
 
14
18
  from boolean import Expression
15
- from typing_extensions import TypeGuard
19
+ from typing_extensions import TypeGuard as _TypeGuard
16
20
 
17
21
  from ._boolean import PartialBoolean
18
22
 
19
- BooleanRule = Union[Expression, bool, int, str]
23
+ BooleanRule = _Union[Expression, bool, int, str]
20
24
 
21
- PartialBooleanLike = Union[PartialBoolean, bool, int, float, str]
22
- ConfigurationLike = Mapping[str, Union[PartialBoolean, bool, int]]
23
- HypercubeLike = Mapping[str, PartialBooleanLike]
25
+ PartialBooleanLike = _Union[PartialBoolean, bool, int, float, str]
26
+ ConfigurationLike = _Mapping[str, _Union[PartialBoolean, bool, int]]
27
+ HypercubeLike = _Mapping[str, PartialBooleanLike]
24
28
 
25
29
 
26
30
  def is_boolean_expression_available() -> bool:
@@ -40,7 +44,7 @@ def is_boolean_expression_available() -> bool:
40
44
  return Expression is not type(NotImplemented)
41
45
 
42
46
 
43
- def is_boolean_expression_like(obj: Any) -> TypeGuard[Expression]:
47
+ def is_boolean_expression_like(obj: _Any) -> _TypeGuard[Expression]:
44
48
  """
45
49
  Test whether an object behaves as a Boolean expression.
46
50
 
@@ -66,7 +70,7 @@ def is_boolean_expression_like(obj: Any) -> TypeGuard[Expression]:
66
70
  return is_boolean_expression_available() and isinstance(obj, Expression)
67
71
 
68
72
 
69
- def is_boolean_rule_like(obj: Any) -> TypeGuard[BooleanRule]:
73
+ def is_boolean_rule_like(obj: _Any) -> _TypeGuard[BooleanRule]:
70
74
  """
71
75
  Test whether an object can be interpreted as a Boolean rule.
72
76
 
@@ -102,7 +106,7 @@ def is_boolean_rule_like(obj: Any) -> TypeGuard[BooleanRule]:
102
106
  )
103
107
 
104
108
 
105
- def is_partial_boolean_like(value: Any) -> TypeGuard[PartialBooleanLike]:
109
+ def is_partial_boolean_like(value: _Any) -> _TypeGuard[PartialBooleanLike]:
106
110
  """
107
111
  Test whether an object can be coerced into a PartialBoolean.
108
112
 
@@ -134,7 +138,7 @@ def is_partial_boolean_like(value: Any) -> TypeGuard[PartialBooleanLike]:
134
138
  return False
135
139
 
136
140
 
137
- def is_configuration_like(obj: Any) -> TypeGuard[ConfigurationLike]:
141
+ def is_configuration_like(obj: _Any) -> _TypeGuard[ConfigurationLike]:
138
142
  """
139
143
  Test whether an object behaves as a concrete Boolean configuration.
140
144
 
@@ -162,7 +166,7 @@ def is_configuration_like(obj: Any) -> TypeGuard[ConfigurationLike]:
162
166
  values.
163
167
  """
164
168
 
165
- if not isinstance(obj, MappingABC):
169
+ if not isinstance(obj, _MappingABC):
166
170
  return False
167
171
 
168
172
  try:
@@ -175,7 +179,7 @@ def is_configuration_like(obj: Any) -> TypeGuard[ConfigurationLike]:
175
179
  return False
176
180
 
177
181
 
178
- def is_hypercube_like(obj: Any) -> TypeGuard[HypercubeLike]:
182
+ def is_hypercube_like(obj: _Any) -> _TypeGuard[HypercubeLike]:
179
183
  """
180
184
  Test whether an object behaves as a hypercube mapping.
181
185
 
@@ -203,7 +207,7 @@ def is_hypercube_like(obj: Any) -> TypeGuard[HypercubeLike]:
203
207
  PartialBoolean-like values.
204
208
  """
205
209
 
206
- if not isinstance(obj, MappingABC):
210
+ if not isinstance(obj, _MappingABC):
207
211
  return False
208
212
 
209
213
  try:
@@ -216,7 +220,7 @@ def is_hypercube_like(obj: Any) -> TypeGuard[HypercubeLike]:
216
220
  return False
217
221
 
218
222
 
219
- def _is_configuration_value_like(value: Any) -> bool:
223
+ def _is_configuration_value_like(value: _Any) -> bool:
220
224
  if isinstance(value, PartialBoolean):
221
225
  value = value.value
222
226
 
@@ -7,7 +7,8 @@ The `bn` sub-package provides data structures, analyses and helper functions
7
7
  for BooleanNetworkLike objects used in logical modelling frameworks.
8
8
  """
9
9
 
10
- from typing import Any, List
10
+ from typing import Any as _Any
11
+ from typing import List as _List
11
12
 
12
13
  from . import _typing as typing
13
14
  from ._network import (
@@ -28,7 +29,7 @@ __all__ = [
28
29
  ]
29
30
 
30
31
 
31
- def bn_to_pydot(bn: Any, **kwargs: Any) -> Any:
32
+ def bn_to_pydot(bn: _Any, **kwargs: _Any) -> _Any:
32
33
  """
33
34
  Deprecated. Convert a BooleanNetworkLike object into a pydot graph.
34
35
 
@@ -47,5 +48,5 @@ def bn_to_pydot(bn: Any, **kwargs: Any) -> Any:
47
48
  return BooleanNetwork(bn).to_pydot(**kwargs)
48
49
 
49
50
 
50
- def __dir__() -> List[str]:
51
+ def __dir__() -> _List[str]:
51
52
  return sorted(set(globals()) | set(__all__))
@@ -41,7 +41,7 @@ from ..boolean_algebra import (
41
41
  is_configuration_like,
42
42
  rule_to_string,
43
43
  )
44
- from ..interaction_graph._influence_graph import InfluenceGraph
44
+ from ..influence_graph._influence_graph import InfluenceGraph
45
45
  from ..plotting import (
46
46
  count_node_style,
47
47
  ratio_edge_style,
@@ -4,17 +4,19 @@
4
4
  Typing aliases and runtime validators for BooleanNetworkLike objects.
5
5
  """
6
6
 
7
- from collections.abc import Mapping as MappingABC
8
- from typing import Any, Mapping
7
+ from collections.abc import Mapping as _MappingABC
8
+ from typing import Any as _Any
9
+ from typing import Mapping as _Mapping
9
10
 
10
- from typing_extensions import TypeAlias, TypeGuard
11
+ from typing_extensions import TypeAlias as _TypeAlias
12
+ from typing_extensions import TypeGuard as _TypeGuard
11
13
 
12
14
  from ..boolean_algebra import BooleanRule, is_boolean_rule_like
13
15
 
14
- BooleanNetworkLike: TypeAlias = Mapping[str, BooleanRule]
16
+ BooleanNetworkLike: _TypeAlias = _Mapping[str, BooleanRule]
15
17
 
16
18
 
17
- def is_boolean_network_like(obj: Any) -> TypeGuard[BooleanNetworkLike]:
19
+ def is_boolean_network_like(obj: _Any) -> _TypeGuard[BooleanNetworkLike]:
18
20
  """
19
21
  Test whether an object behaves as a BooleanNetworkLike mapping.
20
22
 
@@ -30,7 +32,7 @@ def is_boolean_network_like(obj: Any) -> TypeGuard[BooleanNetworkLike]:
30
32
  values.
31
33
  """
32
34
 
33
- if not isinstance(obj, MappingABC):
35
+ if not isinstance(obj, _MappingABC):
34
36
  return False
35
37
 
36
38
  try:
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env python
2
2
 
3
3
  """
4
- Utilities for biological interaction graphs and regulatory domains.
4
+ Utilities for biological influence graphs and regulatory domains.
5
5
 
6
6
  The `ig` sub-package provides parsers, analyses and graph-related
7
- utilities for interaction networks.
7
+ utilities for signed regulatory networks.
8
8
  """
9
9
 
10
- from typing import List
10
+ from typing import List as _List
11
11
 
12
12
  from ._algorithms import walks_from
13
13
  from ._influence_graph import InfluenceGraph
14
- from ._parser import read_interaction_graph
14
+ from ._parser import read_influence_graph
15
15
  from ._scoring import (
16
16
  InteractionScore,
17
17
  infer_signed_interactions,
@@ -20,7 +20,7 @@ from ._scoring import (
20
20
  )
21
21
 
22
22
  __all__ = [
23
- "read_interaction_graph",
23
+ "read_influence_graph",
24
24
  "walks_from",
25
25
  "InfluenceGraph",
26
26
  "InteractionScore",
@@ -30,5 +30,5 @@ __all__ = [
30
30
  ]
31
31
 
32
32
 
33
- def __dir__() -> List[str]:
33
+ def __dir__() -> _List[str]:
34
34
  return sorted(set(globals()) | set(__all__))
@@ -24,7 +24,7 @@ else:
24
24
  GeneSynonyms = None
25
25
 
26
26
 
27
- def read_interaction_graph(
27
+ def read_influence_graph(
28
28
  infile: Union[str, Path],
29
29
  genesyn: Optional[GeneSynonyms] = None,
30
30
  input_identifier_type: InputIdentifierType = "name",
@@ -33,7 +33,7 @@ def read_interaction_graph(
33
33
  **kwargs: Any,
34
34
  ) -> nx.MultiDiGraph[Any]:
35
35
  """
36
- Read an interaction graph from a tabular file.
36
+ Read an influence graph from a tabular file.
37
37
 
38
38
  The input file must contain at least three columns: 'source', 'target' and
39
39
  'sign'. Additional columns are kept as edge attributes.
@@ -41,7 +41,7 @@ def read_interaction_graph(
41
41
  Parameters
42
42
  ----------
43
43
  infile: str | Path
44
- Path to the tabular file containing the interaction graph.
44
+ Path to the tabular file containing the influence graph.
45
45
  genesyn: GeneSynonyms, optional
46
46
  GeneSynonyms object used to convert graph node identifiers.
47
47
  input_identifier_type: 'name' | 'gene_id' | 'ensembl_id' | <database>
@@ -60,7 +60,7 @@ def read_interaction_graph(
60
60
  Returns
61
61
  -------
62
62
  nx.MultiDiGraph
63
- Directed interaction graph.
63
+ Directed influence graph.
64
64
  Edges store all columns from the input file as attributes.
65
65
 
66
66
  Raises
@@ -86,17 +86,17 @@ def read_interaction_graph(
86
86
  if not infile.is_file():
87
87
  raise FileNotFoundError(f"file not found: {infile}")
88
88
 
89
- interaction_graph = pd.read_csv(infile, sep=sep, **kwargs)
89
+ influence_graph = pd.read_csv(infile, sep=sep, **kwargs)
90
90
 
91
91
  required_columns = {"source", "target", "sign"}
92
- missing_columns = required_columns - set(interaction_graph.columns)
92
+ missing_columns = required_columns - set(influence_graph.columns)
93
93
 
94
94
  if missing_columns:
95
95
  raise ValueError(f"invalid file: missing columns {sorted(missing_columns)}")
96
96
 
97
- interaction_graph["sign"] = interaction_graph["sign"].astype(float)
97
+ influence_graph["sign"] = influence_graph["sign"].astype(float)
98
98
 
99
- invalid_signs = set(interaction_graph["sign"].dropna().unique()) - {-1.0, 1.0}
99
+ invalid_signs = set(influence_graph["sign"].dropna().unique()) - {-1.0, 1.0}
100
100
 
101
101
  if invalid_signs:
102
102
  raise ValueError(
@@ -104,7 +104,7 @@ def read_interaction_graph(
104
104
  )
105
105
 
106
106
  grn = nx.from_pandas_edgelist(
107
- df=interaction_graph,
107
+ df=influence_graph,
108
108
  source="source",
109
109
  target="target",
110
110
  edge_attr=True,
@@ -8,7 +8,7 @@ helpers for objects related to logical modelling, including Boolean
8
8
  networks, influence graphs and ensemble representations.
9
9
  """
10
10
 
11
- from typing import List
11
+ from typing import List as _List
12
12
 
13
13
  from ._styles import (
14
14
  count_node_style,
@@ -23,5 +23,5 @@ __all__ = [
23
23
  ]
24
24
 
25
25
 
26
- def __dir__() -> List[str]:
26
+ def __dir__() -> _List[str]:
27
27
  return sorted(set(globals()) | set(__all__))
@@ -14,7 +14,7 @@ omnipath
14
14
  Access to regulatory and interaction prior knowledge databases.
15
15
  """
16
16
 
17
- from typing import List
17
+ from typing import List as _List
18
18
 
19
19
  from . import ncbi, omnipath
20
20
 
@@ -24,5 +24,5 @@ __all__ = [
24
24
  ]
25
25
 
26
26
 
27
- def __dir__() -> List[str]:
27
+ def __dir__() -> _List[str]:
28
28
  return sorted(set(globals()) | set(__all__))
@@ -8,22 +8,20 @@ standardising gene identifiers and handling ambiguous nomenclature
8
8
  across heterogeneous biological resources.
9
9
  """
10
10
 
11
- from typing import List
11
+ from typing import List as _List
12
12
 
13
13
  from ._genesyn import (
14
14
  GeneSynonyms,
15
15
  InputIdentifierType,
16
16
  OutputIdentifierType,
17
- support_legacy_gene_synonyms_args,
18
17
  )
19
18
 
20
19
  __all__ = [
21
20
  "InputIdentifierType",
22
21
  "OutputIdentifierType",
23
22
  "GeneSynonyms",
24
- "support_legacy_gene_synonyms_args",
25
23
  ]
26
24
 
27
25
 
28
- def __dir__() -> List[str]:
26
+ def __dir__() -> _List[str]:
29
27
  return sorted(set(globals()) | set(__all__))
@@ -8,7 +8,7 @@ constructing biological interaction priors and regulatory domains
8
8
  from OmniPath-related resources such as CollecTRI and DoRothEA.
9
9
  """
10
10
 
11
- from typing import List
11
+ from typing import List as _List
12
12
 
13
13
  from ._collectri import load_collectri_grn
14
14
  from ._dorothea import load_dorothea_grn
@@ -19,5 +19,5 @@ __all__ = [
19
19
  ]
20
20
 
21
21
 
22
- def __dir__() -> List[str]:
22
+ def __dir__() -> _List[str]:
23
23
  return sorted(set(globals()) | set(__all__))
@@ -3,19 +3,19 @@
3
3
  """
4
4
  Deprecated GRN namespace.
5
5
 
6
- This module re-exports interaction-graph utilities for backward
6
+ This module re-exports influence-graph utilities for backward
7
7
  compatibility. Prefer `bonesistools.bpy.ig` for new code.
8
8
  """
9
9
 
10
- from typing import List
10
+ from typing import List as _List
11
11
 
12
- from ..boolpy.interaction_graph import (
12
+ from ..boolpy.influence_graph import (
13
13
  InfluenceGraph,
14
14
  InteractionScore,
15
15
  infer_signed_interactions,
16
16
  infer_signed_interactions_from_walks,
17
17
  interaction_scores_from_walks,
18
- read_interaction_graph,
18
+ read_influence_graph,
19
19
  walks_from,
20
20
  )
21
21
 
@@ -25,10 +25,10 @@ __all__ = [
25
25
  "infer_signed_interactions",
26
26
  "infer_signed_interactions_from_walks",
27
27
  "interaction_scores_from_walks",
28
- "read_interaction_graph",
28
+ "read_influence_graph",
29
29
  "walks_from",
30
30
  ]
31
31
 
32
32
 
33
- def __dir__() -> List[str]:
33
+ def __dir__() -> _List[str]:
34
34
  return sorted(set(globals()) | set(__all__))
@@ -20,7 +20,7 @@ datasets
20
20
  """
21
21
 
22
22
  import sys as _sys
23
- from typing import List
23
+ from typing import List as _List
24
24
 
25
25
  from . import _typing as typing
26
26
  from . import datasets
@@ -44,5 +44,5 @@ _sys.modules.update(
44
44
  )
45
45
 
46
46
 
47
- def __dir__() -> List[str]:
47
+ def __dir__() -> _List[str]:
48
48
  return sorted(set(globals()) | set(__all__))
@@ -9,23 +9,25 @@ tests and tutorials.
9
9
 
10
10
  from __future__ import annotations
11
11
 
12
- import sys
13
- from typing import List
12
+ import sys as _sys
13
+ from typing import List as _List
14
14
 
15
- if sys.version_info >= (3, 9):
16
- from importlib.resources import files
15
+ if _sys.version_info >= (3, 9):
16
+ from importlib.resources import files as _files
17
17
  else:
18
- from importlib_resources import files
18
+ from importlib_resources import files as _files
19
19
 
20
- import anndata as ad
21
- from anndata import AnnData
20
+ import anndata as _ad
21
+ from anndata import AnnData as _AnnData
22
+
23
+ del annotations
22
24
 
23
25
  __all__ = [
24
26
  "nestorowa",
25
27
  ]
26
28
 
27
29
 
28
- def nestorowa() -> AnnData:
30
+ def nestorowa() -> _AnnData:
29
31
  """
30
32
  Load the Nestorowa et al. hematopoietic stem and progenitor cell dataset.
31
33
  The dataset is a lightweight version intended for examples, testing and tutorials.
@@ -45,10 +47,10 @@ def nestorowa() -> AnnData:
45
47
  Blood 128(8): e20-e31
46
48
  """
47
49
 
48
- path = files(__package__) / "nestorowa_hvg.h5ad"
50
+ path = _files(__package__) / "nestorowa_hvg.h5ad"
49
51
 
50
- return ad.read_h5ad(str(path))
52
+ return _ad.read_h5ad(str(path))
51
53
 
52
54
 
53
- def __dir__() -> List[str]:
55
+ def __dir__() -> _List[str]:
54
56
  return sorted(set(globals()) | set(__all__))
@@ -7,7 +7,7 @@ The `pl` namespace provides embedding, density, boxplot and graph plotting
7
7
  helpers, along with colour palettes and Matplotlib styling utilities.
8
8
  """
9
9
 
10
- from typing import List
10
+ from typing import List as _List
11
11
 
12
12
  from ._boxplot import boxplot
13
13
  from ._colors import (
@@ -46,5 +46,5 @@ __all__ = [
46
46
  ]
47
47
 
48
48
 
49
- def __dir__() -> List[str]:
49
+ def __dir__() -> _List[str]:
50
50
  return sorted(set(globals()) | set(__all__))
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env python
2
+
3
+ from typing import Tuple as _Tuple
4
+
5
+ RGB = _Tuple[int, int, int]
@@ -9,7 +9,8 @@ related AnnData objects.
9
9
  """
10
10
 
11
11
  import warnings as _warnings
12
- from typing import Any, List
12
+ from typing import Any as _Any
13
+ from typing import List as _List
13
14
 
14
15
  from ..tools import regress_out as _regress_out
15
16
  from ._genename import (
@@ -42,7 +43,7 @@ __all__ = [
42
43
  ]
43
44
 
44
45
 
45
- def regress_out(*args: Any, **kwargs: Any) -> Any:
46
+ def regress_out(*args: _Any, **kwargs: _Any) -> _Any:
46
47
  """
47
48
  Deprecated. Regress out unwanted sources of variation.
48
49
 
@@ -59,5 +60,5 @@ def regress_out(*args: Any, **kwargs: Any) -> Any:
59
60
  return _regress_out(*args, **kwargs)
60
61
 
61
62
 
62
- def __dir__() -> List[str]:
63
+ def __dir__() -> _List[str]:
63
64
  return sorted(set(globals()) | set(__all__))
@@ -13,8 +13,8 @@ from ...databases.ncbi import (
13
13
  GeneSynonyms,
14
14
  InputIdentifierType,
15
15
  OutputIdentifierType,
16
- support_legacy_gene_synonyms_args,
17
16
  )
17
+ from ...databases.ncbi._genesyn import support_legacy_gene_synonyms_args
18
18
  from .._typing import (
19
19
  Axis,
20
20
  ScData,
@@ -8,7 +8,7 @@ distance calculations, marker statistics, lightweight export functions and
8
8
  feature classification utilities.
9
9
  """
10
10
 
11
- from typing import List
11
+ from typing import List as _List
12
12
 
13
13
  from ._classification import mitochondrial_genes, ribosomal_genes
14
14
  from ._conversion import anndata_to_dataframe
@@ -58,5 +58,5 @@ __all__ = [
58
58
  ]
59
59
 
60
60
 
61
- def __dir__() -> List[str]:
61
+ def __dir__() -> _List[str]:
62
62
  return sorted(set(globals()) | set(__all__))
@@ -6,10 +6,10 @@ import networkx as nx
6
6
  import pytest
7
7
 
8
8
  import bonesistools as bt
9
- from bonesistools.boolpy.interaction_graph import _parser
9
+ from bonesistools.boolpy.influence_graph import _parser
10
10
 
11
11
 
12
- def test_read_interaction_graph_keeps_edge_attributes(tmp_path):
12
+ def test_read_influence_graph_keeps_edge_attributes(tmp_path):
13
13
  infile = tmp_path / "graph.csv"
14
14
  infile.write_text(
15
15
  "source,target,sign,confidence\n"
@@ -18,7 +18,7 @@ def test_read_interaction_graph_keeps_edge_attributes(tmp_path):
18
18
  "C,A,,unknown\n",
19
19
  )
20
20
 
21
- graph = bt.bpy.ig.read_interaction_graph(infile)
21
+ graph = bt.bpy.ig.read_influence_graph(infile)
22
22
 
23
23
  assert isinstance(graph, nx.MultiDiGraph)
24
24
  assert set(graph.nodes) == {"A", "B", "C"}
@@ -28,45 +28,45 @@ def test_read_interaction_graph_keeps_edge_attributes(tmp_path):
28
28
  assert math.isnan(graph["C"]["A"][0]["sign"])
29
29
 
30
30
 
31
- def test_read_interaction_graph_supports_custom_separator(tmp_path):
31
+ def test_read_influence_graph_supports_custom_separator(tmp_path):
32
32
  infile = tmp_path / "graph.tsv"
33
33
  infile.write_text(
34
34
  "source\ttarget\tsign\n" "A\tB\t1\n",
35
35
  )
36
36
 
37
- graph = bt.bpy.ig.read_interaction_graph(infile, sep="\t")
37
+ graph = bt.bpy.ig.read_influence_graph(infile, sep="\t")
38
38
 
39
39
  assert list(graph.edges(data=True)) == [("A", "B", {"sign": 1.0})]
40
40
 
41
41
 
42
- def test_read_interaction_graph_validates_file_columns_and_signs(tmp_path):
42
+ def test_read_influence_graph_validates_file_columns_and_signs(tmp_path):
43
43
  missing = tmp_path / "missing.csv"
44
44
 
45
45
  with pytest.raises(FileNotFoundError):
46
- bt.bpy.ig.read_interaction_graph(missing)
46
+ bt.bpy.ig.read_influence_graph(missing)
47
47
 
48
48
  missing_column = tmp_path / "missing_column.csv"
49
49
  missing_column.write_text("source,target\nA,B\n")
50
50
 
51
51
  with pytest.raises(ValueError, match="missing columns"):
52
- bt.bpy.ig.read_interaction_graph(missing_column)
52
+ bt.bpy.ig.read_influence_graph(missing_column)
53
53
 
54
54
  invalid_sign = tmp_path / "invalid_sign.csv"
55
55
  invalid_sign.write_text("source,target,sign\nA,B,0\n")
56
56
 
57
57
  with pytest.raises(ValueError, match="unsupported sign values"):
58
- bt.bpy.ig.read_interaction_graph(invalid_sign)
58
+ bt.bpy.ig.read_influence_graph(invalid_sign)
59
59
 
60
60
 
61
- def test_read_interaction_graph_rejects_invalid_genesyn(tmp_path):
61
+ def test_read_influence_graph_rejects_invalid_genesyn(tmp_path):
62
62
  infile = tmp_path / "graph.csv"
63
63
  infile.write_text("source,target,sign\nA,B,1\n")
64
64
 
65
65
  with pytest.raises(TypeError, match="unsupported argument type for 'genesyn'"):
66
- bt.bpy.ig.read_interaction_graph(infile, genesyn=object())
66
+ bt.bpy.ig.read_influence_graph(infile, genesyn=object())
67
67
 
68
68
 
69
- def test_read_interaction_graph_applies_genesyn(monkeypatch, tmp_path):
69
+ def test_read_influence_graph_applies_genesyn(monkeypatch, tmp_path):
70
70
  class FakeGeneSynonyms:
71
71
  def __init__(self):
72
72
  self.calls = []
@@ -80,7 +80,7 @@ def test_read_interaction_graph_applies_genesyn(monkeypatch, tmp_path):
80
80
 
81
81
  monkeypatch.setattr(_parser, "GeneSynonyms", FakeGeneSynonyms)
82
82
 
83
- graph = bt.bpy.ig.read_interaction_graph(
83
+ graph = bt.bpy.ig.read_influence_graph(
84
84
  infile,
85
85
  genesyn=genesyn,
86
86
  input_identifier_type="gene_id",
@@ -4,10 +4,10 @@ import networkx as nx
4
4
  import pytest
5
5
 
6
6
  import bonesistools as bt
7
- from bonesistools.boolpy.interaction_graph import _scoring
7
+ from bonesistools.boolpy.influence_graph import _scoring
8
8
 
9
9
 
10
- def test_interaction_graph_scoring_is_exported_from_public_namespace():
10
+ def test_influence_graph_scoring_is_exported_from_public_namespace():
11
11
  score = bt.bpy.ig.InteractionScore(score=0.0, total_weight=0.0, path_number=0)
12
12
 
13
13
  assert score.normalized_score == 0.0
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env python
2
-
3
- from typing import Tuple
4
-
5
- RGB = Tuple[int, int, int]
File without changes
File without changes