Metadata-Version: 2.4
Name: kan-grn
Version: 1.0.2
Summary: Gene Regulatory Network inference using Kolmogorov-Arnold Networks
Home-page: https://github.com/poshraj24/GRN-KAN
Download-URL: https://github.com/poshraj24/GRN-KAN/archive/v1.0.1.tar.gz
Author: Posh Raj Dahal
Author-email: Posh Raj Dahal <dahal.poshraj24@gmail.com>
Maintainer: Posh Raj Dahal
Maintainer-email: dahal.poshraj24@gmail.com
License: GPL-3.0
Project-URL: Homepage, https://github.com/poshraj24/GRN-KAN
Project-URL: Repository, https://github.com/poshraj24/GRN-KAN.git
Project-URL: Bug Tracker, https://github.com/poshraj24/GRN-KAN/issues
Keywords: gene regulatory networks,bioinformatics,machine learning
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
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
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<3.0.0,>=1.21.0
Requires-Dist: torch>=1.9.0
Requires-Dist: pandas>=1.3.0
Requires-Dist: scipy>=1.6.0
Requires-Dist: scikit-learn>=0.24.0
Requires-Dist: scanpy>=1.9.0
Requires-Dist: tqdm>=4.50.0
Requires-Dist: psutil>=5.7.0
Requires-Dist: h5py>=3.1.0
Requires-Dist: anndata>=0.8.0
Requires-Dist: pykan
Requires-Dist: pyyaml
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov>=2.0; extra == "dev"
Requires-Dist: black>=21.0; extra == "dev"
Requires-Dist: flake8>=3.8; extra == "dev"
Requires-Dist: jupyter>=1.0.0; extra == "dev"
Provides-Extra: gpu
Requires-Dist: torch>=2.5.0; extra == "gpu"
Requires-Dist: torchvision>=0.20.0; extra == "gpu"
Provides-Extra: viz
Requires-Dist: matplotlib>=3.3.0; extra == "viz"
Requires-Dist: seaborn>=0.11.0; extra == "viz"
Requires-Dist: plotly>=5.0.0; extra == "viz"
Requires-Dist: networkx>=2.5; extra == "viz"
Dynamic: author
Dynamic: download-url
Dynamic: home-page
Dynamic: license-file
Dynamic: maintainer
Dynamic: maintainer-email
Dynamic: requires-python

# KAN-GRN

**Gene Regulatory Network Inference using Kolmogorov-Arnold Networks**

KAN-GRN infers Gene Regulatory Networks (GRNs) from single-cell RNA sequencing data using Kolmogorov-Arnold Networks (KANs).

## Installation

```bash
pip install kan-grn
```

**For GPU support:**

```bash
pip install torch --index-url https://download.pytorch.org/whl/cu124
pip install kan-grn
```

## Quick Start

### Command Line

```bash
# Basic usage
kan-grn run expression_data.h5ad network_file.tsv

# With custom parameters
kan-grn run expression_data.h5ad network_file.tsv --output-dir results --n-top-genes 3000 --epochs 100 --device cuda
```

### Python API

```python
import kan_grn

pipeline_config = kan_grn.PipelineConfig(
    expression_file="expression_data.h5ad",
    network_file="network.tsv",
    output_dir="results",
    n_top_genes=3000,
    device="cuda",
    model_config=kan_grn.ModelConfig(grid=5, k=4),
    training_config=kan_grn.TrainingConfig(
        batch_size=128,
        epochs=100,
        learning_rate=0.001,
        generate_symbolic=True,
    ),
)

pipeline = kan_grn.KANGRNPipeline(pipeline_config)
results = pipeline.train_models_only()
```

## CLI Options

| Option | Default | Description |
|--------|---------|-------------|
| `--output-dir` | `results` | Output directory |
| `--n-top-genes` | `2000` | Top highly variable genes |
| `--grid` | `5` | KAN grid parameter |
| `--k` | `4` | KAN k parameter |
| `--batch-size` | `128` | Batch size |
| `--epochs` | `100` | Max epochs |
| `--learning-rate` | `0.001` | Learning rate |
| `--device` | `auto` | `cuda`, `cpu`, or `auto` |
| `--filter-method` | `zscore` | Network filtering method |

## Input Formats

- **Expression data**: `.h5ad` (AnnData) with cells × genes matrix
- **Network file**: `.tsv` with columns: `source_gene`, `target_gene`, `weight`

## Requirements

Python ≥ 3.8, PyTorch ≥ 1.9.0, Scanpy ≥ 1.9.0, PyKAN

## Links

- [GitHub Repository](https://github.com/poshraj24/GRN-KAN)
- [Documentation](https://github.com/poshraj24/GRN-KAN#readme)
- [Issues](https://github.com/poshraj24/GRN-KAN/issues)

## License

GPL-3.0

## Author

Posh Raj Dahal (dahal.poshraj24@gmail.com)
