Metadata-Version: 2.4
Name: bonesistools
Version: 1.2.8
Summary: Bioinformatics toolkit for upstream and downstream analyses around the BoNesis framework
Project-URL: Repository, https://github.com/bnediction/bonesistools
Author: Théo Roncalli
Maintainer-email: Théo Roncalli <theo.roncalli@labri.fr>
License-Expression: CECILL-2.1
License-File: LICENSE
Keywords: anndata,atacseq,bioinformatics,bonesis,boolean-networks,gene-regulatory-networks,mudata,rnaseq,single-cell,systems-biology
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Framework :: IPython
Classifier: Framework :: Matplotlib
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Requires-Dist: anndata>=0.8
Requires-Dist: boolean-py>=4.0
Requires-Dist: h5py>=3.7
Requires-Dist: importlib-metadata; python_version < '3.8'
Requires-Dist: importlib-resources; python_version < '3.9'
Requires-Dist: matplotlib>=3.5
Requires-Dist: networkx>=2.1
Requires-Dist: numpy>=1.21
Requires-Dist: pandas>=1.3.5
Requires-Dist: scikit-learn>=1.0
Requires-Dist: scipy>=1.7
Requires-Dist: typing-extensions>=4.0
Provides-Extra: all
Requires-Dist: graphviz>=0.20; extra == 'all'
Requires-Dist: igraph>=0.10; extra == 'all'
Requires-Dist: leidenalg>=0.10; extra == 'all'
Requires-Dist: mpbn>=4.1; extra == 'all'
Requires-Dist: mudata>=0.3.1; extra == 'all'
Requires-Dist: multiprocess>=0.70.18; extra == 'all'
Requires-Dist: numba>=0.60; (python_version >= '3.10') and extra == 'all'
Requires-Dist: pydot>=3.0.2; extra == 'all'
Requires-Dist: scikit-misc>=0.5; (python_version >= '3.10') and extra == 'all'
Requires-Dist: seaborn>=0.11; extra == 'all'
Requires-Dist: umap-learn>=0.5; extra == 'all'
Provides-Extra: graphviz
Requires-Dist: graphviz>=0.20; extra == 'graphviz'
Provides-Extra: mpbn
Requires-Dist: mpbn>=4.1; extra == 'mpbn'
Provides-Extra: mudata
Requires-Dist: mudata>=0.3.1; extra == 'mudata'
Provides-Extra: omics
Requires-Dist: igraph>=0.10; extra == 'omics'
Requires-Dist: leidenalg>=0.10; extra == 'omics'
Requires-Dist: numba>=0.60; (python_version >= '3.10') and extra == 'omics'
Requires-Dist: scikit-misc>=0.5; (python_version >= '3.10') and extra == 'omics'
Requires-Dist: umap-learn>=0.5; extra == 'omics'
Description-Content-Type: text/markdown

[![tests](https://github.com/bnediction/bonesistools/actions/workflows/tests.yml/badge.svg)](https://github.com/bnediction/bonesistools/actions/workflows/tests.yml)
[![PyPI](https://img.shields.io/pypi/v/bonesistools.svg)](https://pypi.org/project/bonesistools)
[![python](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fbnediction%2Fbonesistools%2Frefs%2Fheads%2Fmain%2Fpyproject.toml&query=%24.project.requires-python&style=flat&label=python)](https://www.python.org/)
[![license](https://img.shields.io/pypi/l/bonesistools.svg)](https://github.com/bnediction/bonesistools/blob/main/LICENSE)

# BoNesisTools

`BoNesisTools` provides Python-implemented toolkits for upstream and downstream analyses around the [BoNesis](https://github.com/bnediction/bonesis) ecosystem.

The package provides:

- Boolean algebra and partial Boolean abstractions
- Boolean network manipulation and analysis
- signed influence graph utilities
- GRN-informed Boolean predecessor inference
- single-cell and multimodal analysis helpers
- biological database interfaces

## Usage

```python
import bonesistools as bt
```

`BoNesisTools` exposes four main namespaces:

- `bt.sct` — single-cell and multimodal annotated data tools
- `bt.bpy` — Boolean modelling and graph utilities
- `bt.dbs` — biological database interfaces

---

## Single-cell tools

`bt.sct` is inspired by [Scanpy](https://github.com/scverse/scanpy) while providing additional and complementary features for single-cell analyses.

Submodules:

- preprocessing: `bt.sct.pp`
  - expression transformations, feature selection, filtering and metadata utilities

- tools: `bt.sct.tl`
  - embeddings, neighborhood graphs, clustering, differential analysis and matrix utilities

- plotting: `bt.sct.pl`
  - visualization helpers for embeddings, trajectories, distributions and summaries

- datasets: `bt.sct.datasets`
  - registered single-cell example datasets loaded with `bt.sct.datasets.load(...)`

Example:

```python
bt.sct.datasets.available()
bt.sct.datasets.info("pbmc3k")
adata = bt.sct.datasets.load("pbmc3k")
adata = bt.sct.datasets.load("nestorowa")
bt.sct.datasets.clear("pbmc3k")
```

---

## Boolean modelling utilities

`bt.bpy` provides utilities for Boolean modelling, logical abstractions and signed regulatory graphs.

Submodules:

- Boolean algebra: `bt.bpy.ba`
  - logical objects and transformations for Boolean-state reasoning

- Boolean network: `bt.bpy.bn`
  - Boolean model representation, conversion, analysis and exchange

- influence graph: `bt.bpy.ig`
  - signed regulatory graph construction, comparison, analysis and display

Example:

```python
bn = bt.bpy.bn.BooleanNetwork(
    {
        "A": "B & ~C",
        "B": 1,
        "C": 0,
    }
)

graph = bn.to_influence_graph()

graph.show()
```

---

## Biological external resources

`bt.dbs` provides lightweight interfaces and utilities for biological
external resources.

Submodules:

- NCBI: `bt.dbs.ncbi`
  - gene identifier, synonym and annotation utilities

- OmniPath: `bt.dbs.omnipath`
  - regulatory interaction datasets

- HCOP: `bt.dbs.hcop`
  - orthology resources

Example:

```python
genesyn = bt.dbs.ncbi.genesyn()

grn = bt.dbs.omnipath.collectri(
    organism="mouse",
    genesyn=genesyn,
)
```

---

## Installation

Install the latest release:

```sh
pip install bonesistools
```

Install the omics dependencies:

```sh
pip install "bonesistools[omics]"
```

Install all optional dependencies:

```sh
pip install "bonesistools[all]"
```

Install the development version:

```sh
git clone https://github.com/bnediction/bonesistools.git
cd bonesistools
pip install -e ".[all]"
```

or directly:

```sh
pip install git+https://github.com/bnediction/bonesistools.git
```

---

## Bugs

Please report bugs or ask questions here:

https://github.com/bnediction/bonesistools/issues

---

## License

This package is distributed under the [CeCILL v2.1](http://www.cecill.info/index.en.html) free software license (GNU GPL compatible).

This package also includes third-party data resources derived from the
NCBI Gene database (`gene_info`). NCBI places no restrictions on the
use or redistribution of these data: https://www.ncbi.nlm.nih.gov/home/about/policies/
