Metadata-Version: 2.3
Name: janusbio
Version: 0.2.0
Summary: JANUS : Joint ANalysis for augmentation of clUSter specificity
Author: tyasird
Author-email: tyasird <tyasird@hotmail.com>
License: MIT License
         
         Copyright (c) 2026 tyasird
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Requires-Dist: art>=6.4
Requires-Dist: emoji>=2.14.1
Requires-Dist: joblib>=1.4.2
Requires-Dist: loguru>=0.7.3
Requires-Dist: matplotlib>=3.10.1
Requires-Dist: numpy>=2.2.5
Requires-Dist: pandas>=2.2.3
Requires-Dist: pyarrow>=15.0.0
Requires-Dist: scikit-learn>=1.6.1
Requires-Dist: statsmodels>=0.14.4
Requires-Dist: tqdm>=4.67.1
Requires-Dist: pytest>=8.0 ; extra == 'dev'
Requires-Python: >=3.10
Provides-Extra: dev
Description-Content-Type: text/markdown

# JANUS / janusbio

JANUS is a matrix-based analysis toolkit for joint comparison of reference and target datasets.
It provides three main analysis categories:

- contributions: reference and target contribution matrices
- differential: differential correlation and direction matrices
- covariation: sample-size-normalized covariation matrices

## Installation

### Install from PyPI

```bash
pip install janusbio
```

### Install from Git

```bash
pip install "git+https://github.com/<YOUR_ORG_OR_USER>/<YOUR_REPO>.git"
```

### Development install (editable)

```bash
pip install -e .[dev]
```

## CLI Usage

The CLI accepts explicit large/reference and small/target datasets:

```bash
janusbio --large large.csv --small small.csv
```

### Run mode

- `--run all` (default): compute all three categories
- `--run contributions`: compute only contributions
- `--run differential`: compute only differential correlation
- `--run covariation`: compute only covariation

Examples:

```bash
janusbio --large large.csv --small small.csv --run all
janusbio --large large.csv --small small.csv --run contributions
```

### Save outputs

Use `--save` with one or more categories to save computed outputs as parquet files:

```bash
janusbio --large large.csv --small small.csv --run all --save contributions differential
janusbio --large large.csv --small small.csv --run covariation --save covariation --output output
```

If `--save` is omitted, JANUS computes results and prints a summary without writing files.

Validation rule: categories passed to `--save` must be part of what `--run` computes.

### Output files

- contributions:
	- `ref_contributions.parquet`
	- `target_contributions.parquet`
- differential:
	- `diff_corr.parquet`
	- `direction.parquet`
- covariation:
	- `ref_covariation.parquet`
	- `target_covariation.parquet`

## Python API

```python
from janusbio import analysis, preprocessing, utils

utils.initialize({"preprocessing": {"drop_na": False}})

inputs = {
		"Large (REFERENCE)": {"path": "large.csv", "sort": "high"},
		"Small (TARGET)": {"path": "small.csv", "sort": "high"},
}

preprocessing.load_datasets(inputs)
merged, n_ref = preprocessing.merge_datasets()

ref_contr, target_contr = analysis.get_contributions(merged, n_ref)
diff_corr, direction = analysis.get_differential_correlation(merged, n_ref)
ref_cov, target_cov = analysis.get_covariation_contributions(merged, n_ref)
```

## Tests

```bash
pytest
```

## Build and Publish

### Build distributions

```bash
uv build
```

### Publish to TestPyPI

```bash
set TWINE_USERNAME=__token__
set TWINE_PASSWORD=<TEST_PYPI_TOKEN>
uv publish --index testpypi
```

### Publish to PyPI

```bash
set TWINE_USERNAME=__token__
set TWINE_PASSWORD=<PYPI_TOKEN>
uv publish
```

After publish, verify install:

```bash
pip install janusbio
janusbio --help
```
